Przeglądaj źródła

Use M3 for bottom sheet

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 rok temu
rodzic
commit
3f25a71cc1

+ 2 - 0
app/src/main/java/com/nextcloud/ui/fileactions/FileActionsBottomSheet.kt

@@ -112,6 +112,8 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable {
         return binding.root
     }
 
+    override fun getTheme() = R.style.ThemeOverlay_Material3_BottomSheetDialog
+
     private fun handleState(
         state: FileActionsViewModel.UiState
     ) {

+ 41 - 42
app/src/main/res/layout/file_actions_bottom_sheet.xml

@@ -19,14 +19,14 @@
   ~ License along with this program.  If not, see <http://www.gnu.org/licenses/>.
   ~
   -->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+
+<FrameLayout
+    android:id="@+id/bottom_sheet"
+    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/bottom_sheet"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical"
-    android:minHeight="@dimen/bottom_sheet_min_height"
+    android:layout_height="wrap_content"
     app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
 
     <com.google.android.material.bottomsheet.BottomSheetDragHandleView
@@ -41,51 +41,50 @@
         android:layout_gravity="center"
         tools:visibility="gone" />
 
-    <androidx.constraintlayout.widget.ConstraintLayout
-        android:id="@+id/bottom_sheet_content"
+    <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
         android:orientation="vertical"
-        android:visibility="gone"
-        tools:visibility="visible">
+        android:layout_height="wrap_content">
 
-        <FrameLayout
-            android:id="@+id/thumbnail_container"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+        <LinearLayout
+            android:id="@+id/bottom_sheet_content"
+            android:visibility="visible"
+            android:layout_width="match_parent"
+            android:orientation="horizontal"
+            android:layout_marginTop="@dimen/standard_double_margin"
             android:layout_marginStart="@dimen/standard_padding"
-            app:layout_constraintBottom_toBottomOf="@+id/title"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="@+id/title">
+            android:layout_height="wrap_content">
 
             <include
                 android:id="@+id/thumbnail_layout"
-                layout="@layout/file_thumbnail" />
-        </FrameLayout>
+                layout="@layout/file_thumbnail"
+                android:layout_height="wrap_content"
+                android:layout_width="wrap_content" />
 
-        <TextView
-            android:id="@+id/title"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:ellipsize="middle"
-            android:lines="1"
-            android:padding="@dimen/standard_padding"
-            android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toEndOf="@id/thumbnail_container"
-            app:layout_constraintTop_toTopOf="parent"
-            tools:text="Test file name which is very very very very very long.pdf" />
+            <TextView
+                android:id="@+id/title"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="@dimen/standard_padding"
+                android:ellipsize="middle"
+                android:lines="1"
+                android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall"
+                tools:text="Test file name which is very very very very very long.pdf" />
 
-    </androidx.constraintlayout.widget.ConstraintLayout>
+        </LinearLayout>
 
-    <androidx.core.widget.NestedScrollView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-
-        <LinearLayout
-            android:id="@+id/file_actions_list"
+        <androidx.core.widget.NestedScrollView
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="vertical" />
-    </androidx.core.widget.NestedScrollView>
-</LinearLayout>
+            android:layout_height="wrap_content">
+
+            <LinearLayout
+                android:id="@+id/file_actions_list"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical" />
+
+        </androidx.core.widget.NestedScrollView>
+
+    </LinearLayout>
+
+</FrameLayout>