Category : bottomsheetdialogfragment

@Override public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_WRITE_EXTERNAL && resultCode == RESULT_OK) { if (data.getClipData() != null) { int count = data.getClipData().getItemCount(); for (int i = 0; i < count; i++) { Uri uri = data.getClipData().getItemAt(i).getUri(); fileArrayList.add(uri); } //replaceFragment(fileArrayList); } else { if (data.getData()!=null){ Uri ..

Read more

I tried below mentioned code to set peekheight for the bottom sheet, but I need to set the content height to the bottom sheet not parent height or fixed height. View view = getView(); view.post(() -> { View parent = (View) view.getParent(); CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) (parent).getLayoutParams(); CoordinatorLayout.Behavior behavior = params.getBehavior(); bottomSheetBehavior = (BottomSheetBehavior) behavior; ..

Read more

I put a layout on the BottomSheetDialogFragment. In the layout, 3 widgets visible apper alternately. So one widget setVisibilty(View.VISIBLE), others setVisibility(View.GONE). But when widgets setVisibility(View.GONE), BottomSheetDialogFragment will pop to the TOP. After slided BottomSheetDialogFragment, it would move to bottom instant immediately. I don’t know the reason of this situation. Someone told me that setVisibility(View.GONE) wouldn’t ..

Read more

I’m using approach with themes to add cornered edges, but bottom sheet crashes app on show. Here’s BottomSheet itself class MyBottomSheet : BottomSheetDialogFragment() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setStyle(DialogFragment.STYLE_NORMAL, R.style.ThemeOverlay_App_BottomSheetDialog) } Here it’s style <style name="ThemeOverlay.App.BottomSheetDialog" parent="ThemeOverlay.MaterialComponents.Dialog"> <item name="bottomSheetStyle">@style/CustomBottomSheet</item> </style> <style name="CustomBottomSheet" parent="Widget.MaterialComponents.BottomSheet"> <item name="shapeAppearanceOverlay">@style/CustomShapeAppearanceOverlay.MaterialComponents.BottomSheet</item> </style> <style name="CustomShapeAppearanceOverlay.MaterialComponents.BottomSheet" parent=""> <item name="cornerSizeTopRight">16dp</item> <item name="cornerSizeTopLeft">16dp</item> ..

Read more

I am getting the below exception. Couldn’t understand why. Tried to reproduce the issue too.But couldn’t succeed. Can someone help me understand why am I getting the issue and how to resolve it. Its not occuring all the time too. Fatal Exception: java.lang.IllegalStateException: view not added at com.android.internal.policy.PhoneWindow.getViewRootImpl(PhoneWindow.java:1851) at com.android.internal.policy.PhoneWindow.setLocalFocus(PhoneWindow.java:1835) at com.qikwork.worker.views.fragment.MyBottomSheetFragment$onCreateView$1.onShow(MyBottomSheetFragment.java:53) at android.app.Dialog$ListenersHandler.handleMessage(Dialog.java:1465) at ..

Read more

I want to implement something like snapchat preview of the stories . while user sliding from bottom to top the fragment start to open and loading some content . I am using navigation component and BottomSheetDialogFragment . for now in my main fragment I am detecting touch listener for sliding from bottom to top : ..

Read more

I want to be able to add more states to my current BottomSheet with multiple custom heights. Right now, the AndroidX bottom sheet only has the following states: STATE_HIDDEN, STATE_HALF_EXPANDED, STATE_EXPANDED, STATE_COLLAPSED, STATE_DRAGGING, STATE_SETTLING. Is there any way to add states/heights to the "BottomSheetBehavior" class? Solutions I’ve considered: There is a lot of material on ..

Read more

I am working on a project in which I used bottom sheet dialog but when I take multiline input in as well as a single line input it shows me the error that android.widget.Edittext returns null but I don’t know why it Is showing like that.I checked every thing is working absolutely fine and I ..

Read more