Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- firebasefunctions
- BottomSheetDialog
- FRAGMENT
- OutlinedButton
- nav_graph
- 안드로이드
- androidstudio
- Activity
- Imageview
- 랜덤ID
- 안드로이드스튜디오
- EditText
- Android
- textview
- MaterialButton
- Kotlin
- RealtimeDB
- 밑줄
- 뷰바인딩
- 팝업액티비티
- 안드로이드 스튜디오
- ArrayList
- ButtonWithButton
- 코틀린
- button
- firebase
- ViewModel
- Dialog
- lifecyclescope
- ROOM
Archives
- Today
- Total
안드로이드 앱 개발
BottomSheetDialog_Modal - Kotlin 본문
1. bottomSheetDialog xml 파일을 만든다.
2. bottomSheetFragment를 아래와 같이 만든다.
class BottomSheetFragmentCustomer : BottomSheetDialogFragment() {
private val mContext: Context? = context
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
// Inflate the layout for this fragment
val view = inflater.inflate(R.layout.custom_bottomsheet_addcus, container, false)
val manualCreateBtn: MaterialButton = view.findViewById(R.id.manuallyAdd)
val fromBookBtn: MaterialButton = view.findViewById(R.id.fromPhonebook)
manualCreateBtn.setOnClickListener(View.OnClickListener {
val intent = Intent(context, CreateCustomerActivity::class.java)
startActivity(intent)
dismiss()
})
fromBookBtn.setOnClickListener(View.OnClickListener {
val intent = Intent(context, CreateCustomerActivity::class.java)
startActivity(intent)
dismiss()
})
return view
}
}
3. activity에서 호출한다.
val frag = BottomSheetFragmentEvent()
frag.show(supportFragmentManager, frag.tag)
'코틀린(Kotlin)공부' 카테고리의 다른 글
CheckBox에 setOnCheckedChangeListner 달기 (0) | 2021.04.15 |
---|---|
Coroutine 사용 방법 (0) | 2021.04.09 |
for문 - Kotlin (0) | 2021.03.29 |
BottomNavigationView에서 transaction already commit called 오류 (0) | 2021.03.28 |
Data Class 만들기 (0) | 2021.03.28 |