From 4b70d81e5c2f39c0a733dd54f4847dd5311dba11 Mon Sep 17 00:00:00 2001
From: Peter Serwylo <peter@serwylo.com>
Date: Tue, 25 Apr 2017 14:48:59 +1000
Subject: [PATCH] Make install/uninstall/run/upgrade buttons not overlap last
 updated text

Instead of showing them below the icon, it now puts the icon + name +
author + last updated into a single layout which can grow if the app
name or author wraps to a second line. The buttons are now below this
additional layout.
---
 .../main/res/layout/app_details2_header.xml   | 98 +++++++++++--------
 1 file changed, 55 insertions(+), 43 deletions(-)

diff --git a/app/src/main/res/layout/app_details2_header.xml b/app/src/main/res/layout/app_details2_header.xml
index d0e9cf401..a6205c616 100755
--- a/app/src/main/res/layout/app_details2_header.xml
+++ b/app/src/main/res/layout/app_details2_header.xml
@@ -26,53 +26,63 @@
             android:layout_marginRight="8dp"
             >
 
-            <ImageView
-                android:id="@+id/icon"
-                android:layout_width="72dp"
-                android:layout_height="72dp"
-                android:layout_alignParentLeft="true"
-                android:layout_alignParentStart="true"
-                android:layout_alignParentTop="true"
-                android:paddingBottom="8dp"
-                android:paddingRight="8dp"
-                android:paddingEnd="8dp"
-                android:src="@drawable/ic_repo_app_default" />
-
-            <LinearLayout
-                android:layout_width="0dp"
+            <!-- Icon, Name, Author (optional), Updated date -->
+            <RelativeLayout
+                android:id="@+id/icon_and_name"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_alignParentEnd="true"
-                android:layout_alignParentRight="true"
-                android:layout_alignParentTop="true"
-                android:layout_marginTop="8dp"
-                android:layout_toEndOf="@id/icon"
-                android:layout_toRightOf="@id/icon"
-                android:orientation="vertical">
+                android:paddingBottom="8dp">
 
-                <TextView
-                    android:id="@+id/title"
-                    android:layout_width="match_parent"
+                <ImageView
+                    android:id="@+id/icon"
+                    android:layout_width="72dp"
+                    android:layout_height="72dp"
+                    android:layout_alignParentLeft="true"
+                    android:layout_alignParentStart="true"
+                    android:layout_alignParentTop="true"
+                    android:paddingRight="8dp"
+                    android:paddingEnd="8dp"
+                    android:src="@drawable/ic_repo_app_default" />
+
+                <!-- Name, Author (optional), Updated date -->
+                <LinearLayout
+                    android:layout_width="0dp"
                     android:layout_height="wrap_content"
-                    android:textAppearance="@style/DetailsAppTitleStyle"
-                    tools:text="App Title" />
+                    android:layout_alignParentEnd="true"
+                    android:layout_alignParentRight="true"
+                    android:layout_alignParentTop="true"
+                    android:layout_marginTop="8dp"
+                    android:layout_toEndOf="@id/icon"
+                    android:layout_toRightOf="@id/icon"
+                    android:orientation="vertical">
 
-                <TextView
-                    android:id="@+id/author"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:textAppearance="@style/TextAppearance.AppCompat.Body1"
-                    tools:text="Author" />
+                    <TextView
+                        android:id="@+id/title"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:textAppearance="@style/DetailsAppTitleStyle"
+                        tools:text="Really Long App Title Which Wraps Around Onto the Second Line" />
 
-                <TextView
-                    android:id="@+id/text_last_update"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:textAppearance="@style/DetailsLastUpdatedStyle"
-                    android:textColor="@android:color/darker_gray"
-                    tools:text="Update released 12 days ago" />
+                    <TextView
+                        android:id="@+id/author"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:textAppearance="@style/TextAppearance.AppCompat.Body1"
+                        tools:text="Author" />
 
-            </LinearLayout>
+                    <TextView
+                        android:id="@+id/text_last_update"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:textAppearance="@style/DetailsLastUpdatedStyle"
+                        android:textColor="@android:color/darker_gray"
+                        tools:text="Update released 12 days ago" />
 
+                </LinearLayout>
+
+            </RelativeLayout>
+
+            <!-- Progress info -->
             <RelativeLayout
                 android:id="@+id/progress_layout"
                 android:layout_width="match_parent"
@@ -81,7 +91,8 @@
                 android:layout_alignParentLeft="true"
                 android:layout_alignParentRight="true"
                 android:layout_alignParentStart="true"
-                android:layout_below="@id/icon">
+                android:layout_below="@id/icon_and_name"
+                tools:visibility="gone">
 
                 <ImageView
                     android:id="@+id/progress_cancel"
@@ -125,18 +136,19 @@
                     android:layout_toStartOf="@id/progress_cancel" />
             </RelativeLayout>
 
+            <!-- Install, Uninstall, Upgrade, Run buttons -->
             <LinearLayout
                 android:id="@+id/button_layout"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_below="@id/icon"
+                android:layout_below="@id/icon_and_name"
                 android:layout_alignParentStart="true"
                 android:layout_alignParentLeft="true"
                 android:layout_alignParentEnd="true"
                 android:layout_alignParentRight="true"
                 android:paddingBottom="2dp"
                 android:clipToPadding="false"
-                android:visibility="gone"
+                android:visibility="visible"
                 >
 
                 <Button