From 768db69b4dceb8ab01e18ef1ab0e692c9ed1257b Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Sat, 27 May 2017 13:37:52 -0700 Subject: [PATCH] Apply the Huawei spinner fix to all the spinners in `DomainSettingsFragment`. Fixes https://redmine.stoutner.com/issues/131. --- .idea/misc.xml | 2 +- .../fragments/DomainSettingsFragment.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 95f0f031..1caa1363 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java b/app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java index c6c465f0..112a4297 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java +++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/DomainSettingsFragment.java @@ -117,16 +117,16 @@ public class DomainSettingsFragment extends Fragment { ArrayAdapter fontSizeEntryValuesArrayAdapter = ArrayAdapter.createFromResource(context, R.array.default_font_size_entry_values, android.R.layout.simple_spinner_item); final ArrayAdapter displayImagesArrayAdapter = ArrayAdapter.createFromResource(context, R.array.display_website_images_array, android.R.layout.simple_spinner_item); - // Set the drop down style for the `ArrayAdapters`. - fontSizeArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - displayImagesArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - - // Some phones running Huawei's customized Android 7.0 don't display a spinner that requires scrolling correctly with the default `simple_spinner_dropdown_item`. The Huawei P9 Lite is known to be affected. + // Some phones running Huawei's customized Android 7.0 have layout problems displaying a spinner with the default `simple_spinner_dropdown_item`. The Huawei P9 Lite is known to be affected. if (Build.BRAND.equals("HUAWEI") && (Build.VERSION.SDK_INT == 24)) { // The device is manufactured by Huawei and is running Android 7.0. // Use a customized `simple_spinner_dropdown_item`. Huawei spinner code fix contributed 2017 Thomas Jensen . Copyright assigned to Soren Stoutner . userAgentArrayAdapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item_huawei_fix); + fontSizeArrayAdapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item_huawei_fix); + displayImagesArrayAdapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item_huawei_fix); } else { // Use the standard `android.R.layout.simple_spinner_dropdown_item` on all other devices. userAgentArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + fontSizeArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + displayImagesArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); } // Set the `ArrayAdapters` for the `Spinners`. -- 2.45.2