• 로그인 함 해보끄나?

  • Sarangnamu.net June 17, 2003
    Home Login Profile Study Open Project Q&A Google Code
    navigation manager
    Last Modify : 23 May, 2019(05:30)
    https://github.com/googlesamples/android-architecture-components/tree/master/NavigationBasicSample 뒤적거리면서 fun 생성 중.. ViewController 만들어 둔 거 때문에 안쓰고 있다가, 이번에 함 보는데 편해보이네 val NAVI_ANIM_FROM_NONE: Int get() = 0 val NAVI_ANIM_FROM_LEFT: Int get() = 1 val NAVI_ANIM_FROM_RIGHT: Int get() = 2 val NAVI_ANIM_FROM_BOTTOM: Int get() = 3 val NAVI_ANIM_FROM_UP: Int get() = 4 inline fun View.navigate(@IdRes resid: Int, bundle: Bundle? = null, anim:Int = NAVI_ANIM_FROM_RIGHT) { Navigation.findNavController(this).navigate(resid, bundle, if (anim == NAVI_ANIM_FROM_NONE) { null } else { // 변경해야 함 NavOptions.Builder() .setEnterAnim(R.anim.slide_in_right) .setExitAnim(R.anim.slide_out_left) .build() }) }

    Comment


    입력하3 1560966488



    Locations of visitors to this page