안드로이드36 Android] Kotlin fragment에서 상태표시줄 보여지게 https://developer.android.com/reference/android/view/WindowInsetsController WindowInsetsController | Android 개발자 | Android Developers developer.android.com 상태표시줄 보이게 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R){ controller = activity!!.window.insetsController if(controller != null){ controller!!.show(WindowInsets.Type.statusBars()) } }else{ activity!!.window.clearFlags(WindowManager.Layou.. 2021. 6. 8. Kotlin] 안드로이드 국가별 시간, 날짜 표시 // getBestDateTimePattern Format DateTime in Android - AndroidWave In this tutorials, We explain How to Format DateTime in Android using SimpleDateFormat. Example Include - Format Date to Text and Parse Text to Date androidwave.com Codota Codota search - find any Java class or method www.codota.com val skeleton: String = DateFormat.getBestDateTimePattern(Locale.getDefault(), "MMMM d") val formatter = SimpleDateFormat(ske.. 2021. 5. 20. Kotlin] 안드로이드 채팅방 날짜 표시 How do I display the calendar date on the top of chat messages? I am working on a chat application but I am struggling to figure out how to display the calendar date on the top of chat messages; for example, something like this: Another image with timestamps: ... stackoverflow.com 각 채팅 메세지에 대한 Adapter에 해당 코드를 넣어준다. override fun onBindViewHolder(holder: ViewHolder, position: Int) { holder.bind(ch.. 2021. 5. 1. Android] 다른 액티비티에서 프라그먼트 교체 / 뷰페이저 A프라그먼트에서 a액티비티로 화면 전환 후, a액티비티 화면에서 back 버튼으로 갔을 때 이전과 다른 B프라그먼트가 나오도록 하는 코드. #뷰페이저 두 프라그먼트는 같은 액티비티 안에 있어야 합니다. A 액티비티내 프라그먼트에서 B 액티비티로 이동 val intent = Intent(activity, B::class.java) activity?.startActivityForResult(intent, 12345) B 액티비티에서 setResult 설정 setResult(Activity.RESULT_OK) 프라그먼트를 가진 액티비티의 뷰페이저 currentItem 변경. #onActivityResult if (requestCode == 12345) { if (RESULT_OK == resultCode) {.. 2021. 4. 29. 이전 1 ··· 3 4 5 6 7 8 9 다음