Questions tagged bottom-sheet

Explore the latest questions and answers asked by our top developers.

Android material bottomsheet half-expanded state with dynamic height

I crateed a bottomSheet with this xml code: <?xml version="1.0" encoding="utf-8"?> <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/coordinator_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#C57C3C" tools:context=".MainActivity"> <TextView android:id="@+id/tvState" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="initial state" /> <LinearLayout android:id="@+id/linBottomSheet" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"> <include layout="@layout/dialog_bottomsheet_half" android:layout_width="match_parent" android:layout_height="wrap_content" /> </LinearLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout> on my bottom sheet ui i have three linearlayout. named linHeader , linOne and linTwo. […]

By javadroid
Published
Categorized as android, bottom-sheet, kotlin, xml

how can I build a minimized android activity that displays a button when minimized?

I’m buiding a media player, I want the app’s activity to slide down to above the bottom menu bar, when the activity has slide it must only display whatever song is selected and playing, the activity at the bottom must contain the song infor and a pause button.. something similar to a spotify’s bottom player […]

By HLULANI MARTIN
Published
Categorized as android, android-activity, bottom-sheet, java

BottomSheet : The view is not a child of CoordinatorLayout

I’ve checked other posts having this problem and they said use <merge> instead of <include> but when i use <merge> it shows red in my fragment.xml file, there is no such tag. How can i solve this error? In my fragment.xml: <androidx.coordinatorlayout.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent"> <include layout="@layout/product_variation_bottom_sheet" /> </androidx.coordinatorlayout.widget.CoordinatorLayout> In my Fragment.kt: var view = inflater.inflate(R.layout.bottom_sheet, […]

By AhChing11
Published
Categorized as android, bottom-sheet

BottomSheetDialogFragment dismiss() not working sometimes

I open a new bottomSheet from a bottomSheet. When service result is successful I call dismiss() and open new fragment. This works most of times but sometimes previous bottomSheet now dismissing. For example when an alertDialog is shown and I close bottom sheet then reopen this issue is occurring. First BottomSheet: btnSend.click { viewModel.callServiceFunction() } […]

By Mehmet G r
Published
Categorized as android, bottom-sheet, dismiss, fragmentmanager, kotlin

how to split google map when BottomSheetBehavior scroll up and down in android?

I am stuck one of small layout issue for when scroll up and down of BottomSheetBehavior. I am trying too much how to split google map. So, If you know about this knowledge then share your best answer. This is my xml code please check. <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white"> <androidx.fragment.app.FragmentContainerView android:id="@+id/google_map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" […]

Jetpack Compose collapse Bottom Sheet on outside click

I currently display a Bottom Sheet through a BottomSheetScaffold and want to collapse it when the user clicks outside the Bottom Sheet. Is there a way to detect the click outside of the Bottom Sheet? This is the screen with my BottomSheetScaffold: @ExperimentalMaterialApi @ExperimentalMaterial3Api @Composable fun HomeScreen() { val bottomSheetScaffoldState = rememberBottomSheetScaffoldState( bottomSheetState = BottomSheetState(BottomSheetValue.Collapsed) […]

Scrolling priority in the bottom sheet fragment

So I have a nested scroll view inside the bottom sheet fragment and the default behavior is to expand the bottom sheet to the top of the screen first and then scroll the long text inside the nested scroll view. how can change the default behavior to scroll the long text inside nested scroll view […]

By Amjad
Published
Categorized as android, bottom-sheet, kotlin

Android compose ModalBottomSheetLayout jumps on content size change

I basically have the same problem as this post, except I’m using Jetpack Compose, instead of the old View model. It happens with any kind of content – I tested it with a simple Text composable. Here’s how to reproduce it: Set the Text composable to display a string that ends up making it 6 […]

By user496854
Published
Categorized as android, android-jetpack-compose, bottom-sheet, jetpack

How to make BottomSheetScaffold with a snapping BottomSheet in Jetpack Compose?

Description When sheetGesturesEnabled are enabled for a BottomSheetScaffold you can drag the BottomSheet outside the collapsed/expanded position. I would like a BottomSheet which is collapsable by dragging but snaps to the Collapsed or Expanded state. Any Suggestion how to accomplish this? Here is an example of my BottomSheetScaffold: BottomSheetScaffold( scaffoldState = scaffoldState, sheetContent = { […]

By Luciano
Published
Categorized as android, android-jetpack-compose, bottom-sheet

How to append text in textview in bottom sheet from mainactivity?

my app screen shot I want to append text in textview on bottom sheet using MainActivity. I have thread in my MainActivity to append text in textview. I didn’t about how to append the text from MainActivity to bottom sheet. I want to append the text if the bottom sheet shown. how can I do […]

By justforfun
Published
Categorized as android, bottom-sheet, textview
1 2 3 24

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq