From: Soren Stoutner Date: Sat, 27 May 2017 20:37:52 +0000 (-0700) Subject: Apply the Huawei spinner fix to all the spinners in `DomainSettingsFragment`. Fixes... X-Git-Tag: v2.4~21 X-Git-Url: https://gitweb.stoutner.com/?a=commitdiff_plain;h=768db69b4dceb8ab01e18ef1ab0e692c9ed1257b;p=PrivacyBrowserAndroid.git Apply the Huawei spinner fix to all the spinners in `DomainSettingsFragment`. Fixes https://redmine.stoutner.com/issues/131. --- 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`.