Search in sources :

Example 1 with BottomSheetCallback

use of android.support.design.widget.BottomSheetBehavior.BottomSheetCallback in project Rocket by mozilla-tw.

the class TabTrayFragment method setupBottomSheetCallback.

private void setupBottomSheetCallback() {
    BottomSheetBehavior behavior = getBehavior(recyclerView);
    if (behavior == null) {
        return;
    }
    behavior.setBottomSheetCallback(new BottomSheetCallback() {

        @Override
        public void onStateChanged(@NonNull View bottomSheet, int newState) {
            if (newState == BottomSheetBehavior.STATE_HIDDEN) {
                dismiss();
            }
        }

        @Override
        public void onSlide(@NonNull View bottomSheet, float slideOffset) {
            slideCoordinator.onSlide(slideOffset);
        }
    });
}
Also used : BottomSheetBehavior(android.support.design.widget.BottomSheetBehavior) BottomSheetCallback(android.support.design.widget.BottomSheetBehavior.BottomSheetCallback) View(android.view.View) WebView(android.webkit.WebView) TabView(org.mozilla.focus.tabs.TabView) RecyclerView(android.support.v7.widget.RecyclerView)

Aggregations

BottomSheetBehavior (android.support.design.widget.BottomSheetBehavior)1 BottomSheetCallback (android.support.design.widget.BottomSheetBehavior.BottomSheetCallback)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 WebView (android.webkit.WebView)1 TabView (org.mozilla.focus.tabs.TabView)1