From 741c09b1e4a24657e1380cb75d0498ef65ce25c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Fri, 23 Nov 2018 19:35:22 +0100 Subject: [PATCH] fixed TabLayout animation --- .../simplecloudnotifier/SCNApp.java | 2 -- .../view/SettingsFragment.java | 15 ++++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/SCNApp.java b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/SCNApp.java index 9199bf6..f327e08 100644 --- a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/SCNApp.java +++ b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/SCNApp.java @@ -98,5 +98,3 @@ public class SCNApp extends Application implements LifecycleObserver isBackground = false; } } - -//TODO TabLayout indicator does not correctly animate when directly clicking on tabs diff --git a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/SettingsFragment.java b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/SettingsFragment.java index 7437b4f..6e15076 100644 --- a/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/SettingsFragment.java +++ b/android/app/src/main/java/com/blackforestbytes/simplecloudnotifier/view/SettingsFragment.java @@ -150,9 +150,13 @@ public class SettingsFragment extends Fragment implements MusicPickerListener prefMsgHighLedColor_value = v.findViewById(R.id.prefMsgHighLedColor_value); prefMsgHighLedColor_container = v.findViewById(R.id.prefMsgHighLedColor_container); prefMsgHighEnableVibrations = v.findViewById(R.id.prefMsgHighEnableVibrations); - prefMsgHighForceVolume = v.findViewById(R.id.prefMsgHighForceVolume); - prefMsgHighVolume = v.findViewById(R.id.prefMsgHighVolume); - prefMsgHighVolumeTest = v.findViewById(R.id.btnHighVolumeTest); + prefMsgHighForceVolume = v.findViewById(R.id.prefMsgHighForceVolume); + prefMsgHighVolume = v.findViewById(R.id.prefMsgHighVolume); + prefMsgHighVolumeTest = v.findViewById(R.id.btnHighVolumeTest); + + ArrayAdapter plcsa = new ArrayAdapter<>(v.getContext(), android.R.layout.simple_spinner_item, SCNSettings.CHOOSABLE_CACHE_SIZES); + plcsa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + prefLocalCacheSize.setAdapter(plcsa); } private void updateUI() @@ -168,10 +172,7 @@ public class SettingsFragment extends Fragment implements MusicPickerListener prefUpgradeAccount_info.setVisibility(SCNSettings.inst().promode_local ? View.GONE : View.VISIBLE); prefUpgradeAccount_msg.setVisibility( SCNSettings.inst().promode_local ? View.VISIBLE : View.GONE ); - ArrayAdapter plcsa = new ArrayAdapter<>(c, android.R.layout.simple_spinner_item, SCNSettings.CHOOSABLE_CACHE_SIZES); - plcsa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - prefLocalCacheSize.setAdapter(plcsa); - prefLocalCacheSize.setSelection(getCacheSizeIndex(s.LocalCacheSize)); + if (prefLocalCacheSize.getSelectedItemPosition() != getCacheSizeIndex(s.LocalCacheSize)) prefLocalCacheSize.setSelection(getCacheSizeIndex(s.LocalCacheSize)); if (prefMsgLowEnableSound.isChecked() != s.PriorityLow.EnableSound) prefMsgLowEnableSound.setChecked(s.PriorityLow.EnableSound); if (!prefMsgLowRingtone_value.getText().equals(s.PriorityLow.SoundName)) prefMsgLowRingtone_value.setText(s.PriorityLow.SoundName);