From cb03fb955f66c84486dd1853468f19d09a432fc4 Mon Sep 17 00:00:00 2001 From: Abel Tesfaye Date: Wed, 6 Jan 2021 22:22:19 +0000 Subject: [PATCH] Correct Wifi Share UI margins and capitalization Test: locally with crosshatch Bug: 176926579 Change-Id: Ida59174f93ae696e4f2a91c353cf9b1649f1faac --- res/layout/wifi_dpp_qrcode_generator_fragment.xml | 2 +- .../wifi/dpp/WifiDppQrCodeGeneratorFragment.java | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/res/layout/wifi_dpp_qrcode_generator_fragment.xml b/res/layout/wifi_dpp_qrcode_generator_fragment.xml index d283bfd84f6..f9c7169ca64 100644 --- a/res/layout/wifi_dpp_qrcode_generator_fragment.xml +++ b/res/layout/wifi_dpp_qrcode_generator_fragment.xml @@ -55,7 +55,7 @@ android:id="@+id/password" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="16dp" + android:layout_marginBottom="24dp" android:textAlignment="center" android:textIsSelectable="true" android:focusable="true" diff --git a/src/com/android/settings/wifi/dpp/WifiDppQrCodeGeneratorFragment.java b/src/com/android/settings/wifi/dpp/WifiDppQrCodeGeneratorFragment.java index aa67bde3493..2ec960eac81 100644 --- a/src/com/android/settings/wifi/dpp/WifiDppQrCodeGeneratorFragment.java +++ b/src/com/android/settings/wifi/dpp/WifiDppQrCodeGeneratorFragment.java @@ -162,7 +162,8 @@ public class WifiDppQrCodeGeneratorFragment extends WifiDppQrCodeBaseFragment { setQrCode(); } - @VisibleForTesting ComponentName getNearbySharingComponent() { + @VisibleForTesting + ComponentName getNearbySharingComponent() { String nearbyComponent = Settings.Secure.getString( getContext().getContentResolver(), Settings.Secure.NEARBY_SHARING_COMPONENT); @@ -221,7 +222,7 @@ public class WifiDppQrCodeGeneratorFragment extends WifiDppQrCodeBaseFragment { } private Button createActionButton(Drawable icon, CharSequence title, View.OnClickListener r) { - Button b = (Button) LayoutInflater.from(getContext()).inflate( + final Button b = (Button) LayoutInflater.from(getContext()).inflate( com.android.internal.R.layout.chooser_action_button, null); if (icon != null) { final int size = getResources() @@ -252,8 +253,10 @@ public class WifiDppQrCodeGeneratorFragment extends WifiDppQrCodeBaseFragment { Button createNearbyButton(Intent originalIntent, View.OnClickListener r) { final TargetInfo ti = getNearbySharingTarget(originalIntent); if (ti == null) return null; - - return createActionButton(ti.getDisplayIcon(getContext()), ti.getDisplayLabel(), r); + final Button button = createActionButton(ti.getDisplayIcon(getContext()), + ti.getDisplayLabel(), r); + button.setAllCaps(false); + return button; } private void setQrCode() {