Search in sources :

Example 1 with BottomSheetLayout

use of com.flipboard.bottomsheet.BottomSheetLayout in project bottomsheet by Flipboard.

the class BottomSheetFragmentDelegate method findBottomSheetLayout.

@Nullable
private BottomSheetLayout findBottomSheetLayout() {
    Fragment parentFragment = fragment.getParentFragment();
    if (parentFragment != null) {
        View view = parentFragment.getView();
        if (view != null) {
            return (BottomSheetLayout) view.findViewById(bottomSheetLayoutId);
        } else {
            return null;
        }
    }
    Activity parentActivity = fragment.getActivity();
    if (parentActivity != null) {
        return (BottomSheetLayout) parentActivity.findViewById(bottomSheetLayoutId);
    }
    return null;
}
Also used : BottomSheetLayout(com.flipboard.bottomsheet.BottomSheetLayout) Activity(android.app.Activity) Fragment(android.support.v4.app.Fragment) View(android.view.View) Nullable(android.support.annotation.Nullable)

Aggregations

Activity (android.app.Activity)1 Nullable (android.support.annotation.Nullable)1 Fragment (android.support.v4.app.Fragment)1 View (android.view.View)1 BottomSheetLayout (com.flipboard.bottomsheet.BottomSheetLayout)1