Category : android-bottomsheetdialog

I need to handle 3 states of bottom sheet view by sliding up and down. For example, if current state is equals to STATE_EXPANDED then if I swipe down the state should be changed to STATE_HALF_EXPANDED and if swipe down again – STATE_COLLAPSED. This is the code i have (i tried to work with slideOffset, ..

Read more

I have created a BottomSheetDialogFragment. This bottom sheet displays on main activity as expected but failed to show inside a fragment. I am using navcontroller for navigation between fragments like navController.navigate(R.id.fragmentId) Here is My Code for BottomSheetDialogFragment. class FilterBottomSheet : BottomSheetDialogFragment() { companion object { const val TAG = "FILTER" } override fun onCreateView( inflater: ..

Read more

I have created bottomSheetDialog but I cannot get my inside items using scroll functionality <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/newOrderBottom" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" tools:context=".Main.NewOrderFragment"> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView android:id="@+id/closeBtn" android:layout_width="48dp" android:layout_height="48dp" android:layout_alignParentEnd="true" android:layout_margin="10dp" android:background="@color/colorPrimary" android:contentDescription="TODO" android:src="@android:drawable/ic_menu_close_clear_cancel" /> <TextView android:id="@+id/dialogTxt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/closeBtn" android:layout_centerInParent="true" android:layout_marginBottom="-162dp" android:text="Place New Order" android:textSize="32sp" android:textStyle="bold" /> <TextView android:id="@+id/textView" android:layout_width="wrap_content" android:layout_height="wrap_content" ..

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’m developing a custom graph view, displayed in a bottom sheet dialog fragment and it is not drawing, when I add data and call invalidate() before onSizeChanged() is called. This happens some times and I don’t know how to solve that. I add the Data in onViewCreated(…) of my BottomSheetDialogFragment, which is LiveData, so it ..

Read more

I’m using a BottomSheet containing an AppCompatTextView with default maxLines value 5. I use a Motionlayout to animate the view from collapsed to expanded. My start constraint in my scene is: <Constraint android:id="@+id/details_textview_description" android:layout_width="0dp" android:layout_height="wrap_content" android:paddingVertical="5dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/xxx"> <CustomAttribute app:attributeName="maxLines" app:customIntegerValue="5"/> </Constraint> And my end constraint is: <Constraint android:id="@+id/details_textview_description" android:layout_width="0dp" android:layout_height="wrap_content" android:paddingVertical="5dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" ..

Read more

I’m tryin to hide soft key on a bottom clicked in bottom sheet dialog fragment. I already tried this : try { val view: View? = requireActivity().currentFocus if (view != null) { (requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager).hideSoftInputFromWindow( view.windowToken, 0) } } catch (e: Exception) { Logger.e(TAG, "can’t hide the softKey –> ${e.message}", e) } buy its not ..

Read more

I’m trying to hide soft key on Action done it works outside the bottom sheet dialog but in the bottom sheet dialog it doesn’t hide here is my code : try { val view: View? = requireActivity().currentFocus if (view != null) { (requireActivity().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager).hideSoftInputFromWindow( view.windowToken, 0) } } catch (e: Exception) { Logger.e(TAG, "can’t ..

Read more

I needed rounded corners on my BottomSheetDialogFragment so I applied a custom drawable as its background. But after applying a custom background the button on the BottomSheet is not accepting a custom background. It just displays a white background. backgroundTint works fine and changes the color of the button. themes.xml : <style name="AppBottomSheetDialogTheme" parent="Theme.Design.Light.BottomSheetDialog"> <item ..

Read more