Java Code Examples for android.support.design.widget.BottomSheetBehavior#setSkipCollapsed()
The following examples show how to use
android.support.design.widget.BottomSheetBehavior#setSkipCollapsed() .
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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: MainActivity.java From CircularReveal with MIT License | 6 votes |
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); final ViewRevealManager revealManager = new ViewRevealManager(); final SpringViewAnimatorManager springManager = new SpringViewAnimatorManager(); springManager.setDampingRatio(SpringForce.DAMPING_RATIO_NO_BOUNCY); springManager.setStiffness(SpringForce.STIFFNESS_LOW); parent.setViewRevealManager(revealManager); settingsView.addSwitch("Enable Spring", false, new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { parent.setViewRevealManager(isChecked ? springManager : revealManager); } }); settingsView.setAnimatorManager(springManager); final BottomSheetBehavior behavior = BottomSheetBehavior.from(settingsView); behavior.setPeekHeight(getResources().getDimensionPixelSize(R.dimen.bottom_peek_height)); behavior.setSkipCollapsed(false); behavior.setState(BottomSheetBehavior.STATE_COLLAPSED); }
Example 11
Source File: HelpDialog.java From SuntimesWidget with GNU General Public License v3.0 | 5 votes |
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 12
Source File: EquinoxDialog.java From SuntimesWidget with GNU General Public License v3.0 | 5 votes |
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); } } }
Example 13
Source File: RadialTransformationActivity.java From CircularReveal with MIT License | 4 votes |
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample_2); ButterKnife.bind(this); Picasso.with(this) .load("http://camp-campbell.com/wp-content/uploads/2014/09/847187872-san-francisco.jpg") .resizeDimen(R.dimen.radial_card_width, R.dimen.radial_card_height) .centerCrop() .into(sanFranciscoView); videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { mp.setLooping(true); } }); videoView.setVideoURI(Uri.parse(VIDEO_URL)); videoView.start(); final GestureDetector detector = new GestureDetector(this, tapDetector); for (int i = 0; i < stack.getChildCount(); i++) { View view = stack.getChildAt(i); view.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { return detector.onTouchEvent(event); } }); } final ViewRevealManager revealManager = new ViewRevealManager(); final SpringViewAnimatorManager springManager = new SpringViewAnimatorManager(); springManager.setDampingRatio(SpringForce.DAMPING_RATIO_NO_BOUNCY); springManager.setStiffness(SpringForce.STIFFNESS_LOW); stack.setViewRevealManager(revealManager); settingsView.addSwitch("Enable Spring", false, new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { stack.setViewRevealManager(isChecked ? springManager : revealManager); } }); settingsView.setAnimatorManager(springManager); final BottomSheetBehavior behavior = BottomSheetBehavior.from(settingsView); behavior.setPeekHeight(getResources().getDimensionPixelSize(R.dimen.bottom_peek_height)); behavior.setSkipCollapsed(false); behavior.setState(BottomSheetBehavior.STATE_COLLAPSED); }