Upgrade to Pro — share decks privately, control downloads, hide ads and more …

kotlin season 1 - Part 17 BottomSheet 적용하기

TaeHwan
November 20, 2016

kotlin season 1 - Part 17 BottomSheet 적용하기

2016년 유데미 Kotlin 강의를 공개합니다.

동영상 : https://www.youtube.com/watch?v=RWlyCi2wnwI

2회 분은 유데미에서 확인 가능합니다.
http://bit.ly/2UpaJUR

TaeHwan

November 20, 2016
Tweet

More Decks by TaeHwan

Other Decks in Education

Transcript

  1. ࢠ೒ ௏٘ח!!! • Sample Code GitHub ࠳۠஖ : 11-DetailPage •

    https://github.com/taehwandev/Kotlin-Udemy-Sample/tree/ 11-Add-Detail-Page ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 2
  2. য়ט ೡ ࠗ࠙ • Android BottomSheet • BottomSheet ੸ਊೞӝ ରࣁ؀

    উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 3
  3. Android BottomSheet • Android Support Library 23.2ࠗఠ ࢎਊ оמ •

    android.support.design.widget.CoordinatorLayout ղী ನೣ غযঠ ࢎਊ оמ ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 4
  4. Android BottomSheet - dependencies ୶о dependencies { compile 'com.android.support:appcompat-v7:24.2.1' compile

    'com.android.support:design:24.2.1' } ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 5
  5. BottomSheetਸ ੸ਊೞӝ ਤೠ ઱ਃ ௏٘ <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent"

    android:layout_height="match_parent" android:fitsSystemWindows="true"> <!-- ࢤۚ --> <RelativeLayout app:behavior_hideable="true" app:behavior_peekHeight="200dp" app:layout_behavior="@string/bottom_sheet_behavior"> <!-- ࢤۚ --> </RelativeLayout> </android.support.design.widget.CoordinatorLayout> ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 7
  6. ௏٘۽ ੸ਊೞӝ - peekHeight // ֫੉ ࢸ੿ bottomSheetBehavior.peekHeight = TypedValue.applyDimension(

    TypedValue.COMPLEX_UNIT_DIP, 200f, resources.displayMetrics).toInt() ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 10
  7. ௏٘۽ ੸ਊೞӝ - bottomSheet Callback bottomSheetBehavior.setBottomSheetCallback(object : BottomSheetBehavior.BottomSheetCallback() { override

    fun onSlide(bottomSheet: View, slideOffset: Float) { // Slide ... // 1੉ݶ ৮੹ ಟ୛૓ ࢚క // 0੉ݶ peekHeightੋ ࢚క // -1੉ݶ ऀӣ ࢚క Log.i("TAG", "slideOffset $slideOffset") } override fun onStateChanged(bottomSheet: View, newState: Int) { Log.d("TAG", "newState $newState") } }) ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 11
  8. ௏٘۽ ੸ਊೞӝ - State ߸҃ // ૑੿ೠ ֫੉݅ఀ ࠁৈ઱ӝ bottomSheetBehavior.state

    = BottomSheetBehavior.STATE_COLLAPSED // ऀӝӝ bottomSheetBehavior.state = BottomSheetBehavior.STATE_HIDDEN // ഛ੢ bottomSheetBehavior.state = BottomSheetBehavior.STATE_EXPANDED ରࣁ؀ উ٘۽੉٘ ѐߊ ঱য ௏ౣܽ, द੘ೞӝ thdev.tech, 2016 12