Selaa lähdekoodia

Add checkbox top left corner

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 vuosi sitten
vanhempi
commit
76bfefb491

+ 12 - 8
app/src/main/res/layout/grid_image.xml

@@ -140,16 +140,20 @@
                 android:src="@drawable/ic_synced"
                 tools:visibility="visible" />
 
-            <ImageView
-                android:id="@+id/custom_checkbox"
-                android:layout_width="@dimen/grid_layout_item_size"
-                android:layout_height="@dimen/grid_layout_item_size"
-                android:contentDescription="@string/checkbox"
-                android:src="@android:drawable/checkbox_off_background"
-                tools:visibility="visible" />
-
         </LinearLayout>
 
+        <ImageView
+            android:id="@+id/custom_checkbox"
+            android:layout_width="@dimen/grid_checkbox_size"
+            android:layout_height="@dimen/grid_checkbox_size"
+            android:layout_marginStart="@dimen/grid_checkbox_margin"
+            android:layout_marginTop="@dimen/grid_checkbox_margin"
+            android:contentDescription="@string/checkbox"
+            android:src="@android:drawable/checkbox_off_background"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            tools:visibility="visible" />
+
         <TextView
             android:id="@+id/Filename"
             android:layout_width="@dimen/grid_filename_width"

+ 12 - 8
app/src/main/res/layout/grid_item.xml

@@ -127,16 +127,20 @@
                 android:src="@drawable/ic_synced"
                 tools:visibility="visible" />
 
-            <ImageView
-                android:id="@+id/custom_checkbox"
-                android:layout_width="@dimen/grid_layout_item_size"
-                android:layout_height="@dimen/grid_layout_item_size"
-                android:contentDescription="@string/checkbox"
-                android:src="@android:drawable/checkbox_off_background"
-                tools:visibility="visible" />
-
         </LinearLayout>
 
+        <ImageView
+            android:id="@+id/custom_checkbox"
+            android:layout_width="@dimen/grid_checkbox_size"
+            android:layout_height="@dimen/grid_checkbox_size"
+            android:layout_marginStart="@dimen/grid_checkbox_margin"
+            android:layout_marginTop="@dimen/grid_checkbox_margin"
+            android:contentDescription="@string/checkbox"
+            android:src="@android:drawable/checkbox_off_background"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            tools:visibility="visible" />
+
         <TextView
             android:id="@+id/Filename"
             android:layout_width="@dimen/grid_filename_width"

+ 2 - 0
app/src/main/res/values/dims.xml

@@ -110,6 +110,8 @@
     <dimen name="notification_icon_height">24dp</dimen>
     <dimen name="grid_container_margin">4dp</dimen>
     <dimen name="selected_grid_container_radius">4dp</dimen>
+    <dimen name="grid_checkbox_size">18dp</dimen>
+    <dimen name="grid_checkbox_margin">6dp</dimen>
     <dimen name="grid_thumbnail_margin_bottom">18dp</dimen>
     <dimen name="grid_bottom_view_margin_bottom">10dp</dimen>
     <dimen name="grid_bottom_view_margin_end">6dp</dimen>