Эх сурвалжийг харах

revert back to frame layout for icon badges' size

AndyScherzinger 8 жил өмнө
parent
commit
d0bd2707fb

+ 3 - 2
src/main/res/layout/grid_image.xml

@@ -41,8 +41,8 @@
 
         <ImageView
             android:id="@+id/favorite_action"
-            android:layout_width="16dp"
-            android:layout_height="16dp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
             android:layout_gravity="top|right"
             android:layout_margin="@dimen/standard_quarter_margin"
             android:src="@drawable/ic_favorite"
@@ -54,6 +54,7 @@
             android:layout_height="wrap_content"
             android:layout_gravity="top|right"
             android:layout_marginTop="24dp"
+            android:layout_marginRight="4dp"
             android:src="@drawable/shared_via_link"/>
 
         <ImageView

+ 27 - 31
src/main/res/layout/grid_item.xml

@@ -25,7 +25,7 @@
     android:gravity="center"
     android:orientation="vertical">
 
-    <RelativeLayout
+    <FrameLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_gravity="center_horizontal">
@@ -34,61 +34,57 @@
             android:id="@+id/thumbnail"
             android:layout_width="@dimen/standard_list_item_size"
             android:layout_height="@dimen/standard_list_item_size"
-            android:layout_centerInParent="true"
+            android:layout_gravity="center"
             android:src="@drawable/ic_menu_archive"/>
 
         <ImageView
             android:id="@+id/favorite_action"
-            android:layout_width="16dp"
-            android:layout_height="16dp"
-            android:layout_alignTop="@id/thumbnail"
-            android:layout_marginRight="4dp"
-            android:layout_toRightOf="@id/thumbnail"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="top|right"
+            android:layout_margin="@dimen/standard_quarter_margin"
             android:src="@drawable/ic_favorite"
             />
 
         <ImageView
-            android:id="@+id/localFileIndicator"
-            android:layout_width="16dp"
-            android:layout_height="16dp"
-            android:layout_alignBottom="@id/thumbnail"
-            android:layout_margin="@dimen/standard_quarter_margin"
-            android:layout_toRightOf="@id/thumbnail"
-            android:src="@drawable/ic_synced"/>
+            android:id="@+id/sharedIcon"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="top|right"
+            android:layout_marginTop="24dp"
+            android:layout_marginRight="4dp"
+            android:src="@drawable/shared_via_link"/>
 
         <ImageView
-            android:id="@+id/sharedIcon"
+            android:id="@+id/localFileIndicator"
             android:layout_width="16dp"
             android:layout_height="16dp"
-            android:layout_below="@id/favorite_action"
-            android:layout_margin="@dimen/standard_quarter_margin"
-            android:layout_toRightOf="@id/thumbnail"
-            android:layout_above="@id/localFileIndicator"
-            android:src="@drawable/shared_via_link"/>
+            android:layout_gravity="bottom|right"
+            android:layout_marginBottom="@dimen/standard_quarter_margin"
+            android:layout_marginRight="@dimen/standard_quarter_margin"
+            android:layout_marginTop="@dimen/standard_quarter_margin"
+            android:src="@drawable/ic_synced"/>
 
         <ImageView
             android:id="@+id/keptOfflineIcon"
             android:layout_width="16dp"
             android:layout_height="16dp"
-            android:layout_above="@id/localFileIndicator"
-            android:layout_margin="@dimen/standard_quarter_margin"
-            android:layout_toLeftOf="@id/localFileIndicator"
-            android:layout_alignBottom="@id/thumbnail"
-            android:src="@drawable/ic_available_offline"/>
-
+            android:layout_gravity="bottom|right"
+            android:layout_marginBottom="@dimen/standard_quarter_margin"
+            android:layout_marginRight="24dp"
+            android:src="@drawable/ic_available_offline" />
 
         <ImageView
             android:id="@+id/custom_checkbox"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_alignParentTop="true"
-            android:layout_alignParentLeft="true"
             android:layout_marginLeft="@dimen/standard_quarter_margin"
             android:layout_marginRight="@dimen/standard_quarter_margin"
-            android:elevation="@dimen/elevation"
-            android:src="@android:drawable/checkbox_off_background"/>
+            android:layout_gravity="center_vertical|top"
+            android:src="@android:drawable/checkbox_off_background"
+            />
 
-    </RelativeLayout>
+    </FrameLayout>
 
     <TextView
         android:id="@+id/Filename"