[Android]: Fix truncation in Add to Homescreen dlg

When fonts are enlarged 2x, the editable title field
is truncated. The solution is to stop using margins and
hard-coded heights to position the views in the dialog.

(cherry picked from commit 1387ba26ace486dc12ea0b94905d287de745c83a)

Bug: 1416733
Change-Id: I8ce56d725533827d81866381dccb4aa78572634f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4631817
Reviewed-by: Glenn Hartmann <hartmanng@chromium.org>
Commit-Queue: Finnur Thorarinsson <finnur@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1160623}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4637162
Auto-Submit: Finnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Glenn Hartmann <hartmanng@chromium.org>
Cr-Commit-Position: refs/branch-heads/5845@{#19}
Cr-Branched-From: 5a5dff63a4a4c63b9b18589819bebb2566c85443-refs/heads/main@{#1160321}
diff --git a/components/webapps/browser/android/java/res/layout/add_to_homescreen_dialog.xml b/components/webapps/browser/android/java/res/layout/add_to_homescreen_dialog.xml
index a221d4e..e738d69 100644
--- a/components/webapps/browser/android/java/res/layout/add_to_homescreen_dialog.xml
+++ b/components/webapps/browser/android/java/res/layout/add_to_homescreen_dialog.xml
@@ -15,7 +15,8 @@
         android:id="@+id/icon"
         android:layout_width="36dp"
         android:layout_height="36dp"
-        android:layout_marginTop="10dp"
+        android:layout_gravity="center_vertical"
+        android:layout_marginTop="2dp"
         tools:ignore="ContentDescription"
         android:visibility="gone" />
 
@@ -25,14 +26,15 @@
         android:id="@+id/spinny"
         android:layout_width="32dp"
         android:layout_height="32dp"
-        android:layout_marginTop="10dp" />
+        android:layout_gravity="center_vertical"
+        android:layout_marginTop="2dp" />
 
     <!-- An editable text field for the name of the home screen icon. -->
     <org.chromium.components.browser_ui.widget.text.AlertDialogEditText
         android:id="@+id/text"
         android:inputType="text"
         android:layout_width="match_parent"
-        android:layout_height="32dp"
+        android:layout_height="wrap_content"
         android:textAppearance="@style/TextAppearance.AddToHomeScreenEditText"
         android:singleLine="true"
         android:paddingTop="0dp"