Java Code Examples for android.support.design.widget.BottomSheetBehavior#setHideable()

The following examples show how to use android.support.design.widget.BottomSheetBehavior#setHideable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AlarmDialog.java    From SuntimesWidget with GNU General Public License v3.0 6 votes vote down vote up
private void expandSheet(DialogInterface dialog)
{
    if (dialog == null) {
        return;
    }

    BottomSheetDialog bottomSheet = (BottomSheetDialog) dialog;
    FrameLayout layout = (FrameLayout) bottomSheet.findViewById(android.support.design.R.id.design_bottom_sheet);  // for AndroidX, resource is renamed to com.google.android.material.R.id.design_bottom_sheet
    if (layout != null)
    {
        BottomSheetBehavior behavior = BottomSheetBehavior.from(layout);
        behavior.setHideable(true);
        behavior.setSkipCollapsed(true);
        behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
    }
}
 
Example 2
Source File: WorldMapDialog.java    From SuntimesWidget with GNU General Public License v3.0 6 votes vote down vote up
private void expandSheet(Dialog dialog)
{
    if (dialog == null) {
        return;
    }

    BottomSheetDialog bottomSheet = (BottomSheetDialog) dialog;
    FrameLayout layout = (FrameLayout) bottomSheet.findViewById(android.support.design.R.id.design_bottom_sheet);
    if (layout != null)
    {
        BottomSheetBehavior behavior = BottomSheetBehavior.from(layout);
        behavior.setHideable(false);
        behavior.setSkipCollapsed(true);
        behavior.setPeekHeight((int)(dialogHeader.getHeight() + getResources().getDimension(R.dimen.dialog_margin) * 2));
        behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
    }
}
 
Example 3
Source File: WorldMapDialog.java    From SuntimesWidget with GNU General Public License v3.0 6 votes vote down vote up
private void collapseSheet(Dialog dialog)
{
    if (dialog == null) {
        return;
    }

    BottomSheetDialog bottomSheet = (BottomSheetDialog) dialog;
    FrameLayout layout = (FrameLayout) bottomSheet.findViewById(android.support.design.R.id.design_bottom_sheet);
    if (layout != null)
    {
        BottomSheetBehavior behavior = BottomSheetBehavior.from(layout);
        behavior.setHideable(false);
        behavior.setSkipCollapsed(false);
        behavior.setPeekHeight((int)(dialogHeader.getHeight() + getResources().getDimension(R.dimen.dialog_margin) * 2));
        behavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
    }
}
 
Example 4
Source File: AboutDialog.java    From SuntimesWidget with GNU General Public License v3.0 6 votes vote down vote up
private void expandSheet(DialogInterface dialog)
{
    if (dialog == null) {
        return;
    }

    BottomSheetDialog bottomSheet = (BottomSheetDialog) dialog;
    FrameLayout layout = (FrameLayout) bottomSheet.findViewById(android.support.design.R.id.design_bottom_sheet);  // for AndroidX, resource is renamed to com.google.android.material.R.id.design_bottom_sheet
    if (layout != null)
    {
        BottomSheetBehavior behavior = BottomSheetBehavior.from(layout);
        behavior.setHideable(false);
        behavior.setSkipCollapsed(true);
        behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
    }
}
 
Example 5
Source File: LightMapDialog.java    From SuntimesWidget with GNU General Public License v3.0 6 votes vote down vote up
private void expandSheet(DialogInterface dialog)
{
    if (dialog != null) {
        BottomSheetDialog bottomSheet = (BottomSheetDialog) dialog;
        FrameLayout layout = (FrameLayout) bottomSheet.findViewById(android.support.design.R.id.design_bottom_sheet);  // for AndroidX, resource is renamed to com.google.android.material.R.id.design_bottom_sheet
        if (layout != null) {
            BottomSheetBehavior behavior = BottomSheetBehavior.from(layout);
            behavior.setHideable(false);
            behavior.setSkipCollapsed(true);
            behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
        }
    }
}
 
Example 6
Source File: MoonDialog.java    From SuntimesWidget with GNU General Public License v3.0 6 votes vote down vote up
private void expandSheet(DialogInterface dialog)
{
    if (dialog == null) {
        return;
    }

    BottomSheetDialog bottomSheet = (BottomSheetDialog) dialog;
    FrameLayout layout = (FrameLayout) bottomSheet.findViewById(android.support.design.R.id.design_bottom_sheet);  // for AndroidX, resource is renamed to com.google.android.material.R.id.design_bottom_sheet
    if (layout != null)
    {
        BottomSheetBehavior behavior = BottomSheetBehavior.from(layout);
        behavior.setHideable(false);
        behavior.setSkipCollapsed(true);
        behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
    }
}
 
Example 7
Source File: TimeZoneDialog.java    From SuntimesWidget with GNU General Public License v3.0 6 votes vote down vote up
private void expandSheet(DialogInterface dialog)
{
    if (dialog == null) {
        return;
    }

    BottomSheetDialog bottomSheet = (BottomSheetDialog) dialog;
    FrameLayout layout = (FrameLayout) bottomSheet.findViewById(android.support.design.R.id.design_bottom_sheet);  // for AndroidX, resource is renamed to com.google.android.material.R.id.design_bottom_sheet
    if (layout != null)
    {
        BottomSheetBehavior behavior = BottomSheetBehavior.from(layout);
        behavior.setHideable(true);
        behavior.setSkipCollapsed(true);
        behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
    }
}
 
Example 8
Source File: LocationConfigDialog.java    From SuntimesWidget with GNU General Public License v3.0 6 votes vote down vote up
private void expandSheet(DialogInterface dialog)
{
    if (dialog == null) {
        return;
    }

    BottomSheetDialog bottomSheet = (BottomSheetDialog) dialog;
    FrameLayout layout = (FrameLayout) bottomSheet.findViewById(android.support.design.R.id.design_bottom_sheet);  // for AndroidX, resource is renamed to com.google.android.material.R.id.design_bottom_sheet
    if (layout != null)
    {
        BottomSheetBehavior behavior = BottomSheetBehavior.from(layout);
        behavior.setHideable(false);
        behavior.setSkipCollapsed(true);
        behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
    }
}
 
Example 9
Source File: TimeDateDialog.java    From SuntimesWidget with GNU General Public License v3.0 6 votes vote down vote up
private void expandSheet(DialogInterface dialog)
{
    if (dialog == null) {
        return;
    }

    BottomSheetDialog bottomSheet = (BottomSheetDialog) dialog;
    FrameLayout layout = (FrameLayout) bottomSheet.findViewById(android.support.design.R.id.design_bottom_sheet);  // for AndroidX, resource is renamed to com.google.android.material.R.id.design_bottom_sheet
    if (layout != null)
    {
        BottomSheetBehavior behavior = BottomSheetBehavior.from(layout);
        behavior.setHideable(false);
        behavior.setSkipCollapsed(true);
        behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
    }
}
 
Example 10
Source File: HelpDialog.java    From SuntimesWidget with GNU General Public License v3.0 5 votes vote down vote up
private void expandSheet(DialogInterface dialog)
{
    if (dialog != null) {
        BottomSheetDialog bottomSheet = (BottomSheetDialog) dialog;
        FrameLayout layout = (FrameLayout) bottomSheet.findViewById(android.support.design.R.id.design_bottom_sheet);  // for AndroidX, resource is renamed to com.google.android.material.R.id.design_bottom_sheet
        if (layout != null) {
            BottomSheetBehavior behavior = BottomSheetBehavior.from(layout);
            behavior.setHideable(false);
            behavior.setSkipCollapsed(false);
            behavior.setPeekHeight(200);
            behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
        }
    }
}
 
Example 11
Source File: EquinoxDialog.java    From SuntimesWidget with GNU General Public License v3.0 5 votes vote down vote up
private void expandSheet(DialogInterface dialog)
{
    if (dialog != null)
    {
        BottomSheetDialog bottomSheet = (BottomSheetDialog) dialog;
        FrameLayout layout = (FrameLayout) bottomSheet.findViewById(android.support.design.R.id.design_bottom_sheet);  // for AndroidX, resource is renamed to com.google.android.material.R.id.design_bottom_sheet
        if (layout != null)
        {
            BottomSheetBehavior behavior = BottomSheetBehavior.from(layout);
            behavior.setHideable(true);
            behavior.setSkipCollapsed(true);
            behavior.setState(BottomSheetBehavior.STATE_EXPANDED);
        }
    }
}