목록전체 글 (132)
Foggy day
6. QuestionFragment Here, i used ViewPager2, RecyclerView, and EventBus. - fragment_survey_question.xml - SurveyQuestionFragment The thing to note here is EventBus. To use EnvetBus, you should add register, unregister, and @Subscribe. Register EventBus in onCreate, unregister onDestroy, and make a method with @Subscribe annotation, parameter. class SurveyQuestionFragment : Fragment(), View.OnCli..
This article is question example using assets file. The purpose of creation is to make a survey Form requires a variety of questions and answers The used things are Assets File(Json), Viewpager2, RecyclerView, Fragment navigation graph, Gson, ViewBinding, Parcelize, EventBus and so on. Video 1. package structure - survey_nav_graph.xml 2. Navigation graph container activity - ViewPagerQuestionBas..
video 1. activity_event_bus_sample_kotlin.xml 2. EventBusSampleActivityKotlin class EventBusSampleActivityKotlin : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_event_bus_sample_kotlin) GlobalBus.bus!!.register(this) val eventBusNickname = EventsNickname("jinhan") btnEventPost.setOnClickListener { Gl..
1. exo_player_activity 2. custom_exoplayer_controller 3. ExoPlayerActivity public class ExoPlayerActivity extends AppCompatActivity { private ExoPlayerActivityBinding b; private ExoPlayer exoPlayer; private Context mContext; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); b = ExoPlayerActivityBinding.inflate(getLayoutInflater()); setCo..
sample video 1. popup_activity_layout.xml 2. ShowPopup.java public class ShowPopup extends AppCompatActivity { private PopupActivityLayoutBinding b; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); b = PopupActivityLayoutBinding.inflate(getLayoutInflater()); setContentView(b.getRoot()); //If you want to fix orientation, input this code ..
sample video 1. activity_change_view_size_by_seek_bar.xml 2. change_vertical_size_layout.xml 3. ChangeViewHeightBottomSheet.java public class ChangeViewHeightBottomSheet { private BottomSheetBehavior behavior; private Activity activity; private int screenHeight = 0; private LinearLayout llDefaultView; private LinearLayout llChangeView; private SeekBar seekBar; private TextView tvProgressNum; pub..
Collections.sort(dayArrayList, new Comparator() { @Override public int compare(ChartDayData chartDayData, ChartDayData t1) { return chartDayData.getDay().compareTo(t1.getDay()); } });
This article is an simple example of mediaplayer using surfaceview. The reason that i make this sample, it is to play video without audiofocus. If you use VideoView, it catch audiofocus. But MediaPlayer doesn't catch audiofocus. Video 1. add video file Add video file in res -> raw. In my case, video file is mp4 type. 2. draw xml. All you need is a SurfaceView 3. wirte code Somethings you need ar..
If an error occurs when you rotate screen, add this code in manifest activity that you want to apply rotation
Sha key is needed when we use api like google and kakao and so on. So, this article is about how to get debug/release SHA-1. First, get debug sha-1. It is very easy. double click "signingReport" If you find Tasks tab, follow below. 1. Android Studio -> Preference -> Experimental -> disable "Do not build Gradle task list during Gradle Sync" 2. File -> Sync Project with Gradle files Second. get re..