From 50fdb7c49ac29cd3cdb4270dfcc131601bd961c6 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Thu, 14 Feb 2019 05:30:13 +0100 Subject: [PATCH] Fix #450 Signed-off-by: Mario Danic --- .../nextcloud/talk/controllers/SettingsController.java | 9 +++++---- app/src/main/res/layout/controller_settings.xml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java b/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java index 9a217c4d6..9a1aa4d66 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/SettingsController.java @@ -31,6 +31,7 @@ import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.Checkable; import android.widget.ImageView; import android.widget.TextView; @@ -319,16 +320,16 @@ public class SettingsController extends BaseController { dispose(null); getCurrentUser(); - if (shouldVibrateSwitchPreference.getVisibility() == View.VISIBLE) { - shouldVibrateSwitchPreference.setActivated(appPreferences.getShouldVibrateSetting()); - } - if (!TextUtils.isEmpty(currentUser.getClientCertificate())) { certificateSetup.setTitle(R.string.nc_client_cert_change); } else { certificateSetup.setTitle(R.string.nc_client_cert_setup); } + if (shouldVibrateSwitchPreference.getVisibility() == View.VISIBLE) { + ((Checkable)shouldVibrateSwitchPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.getShouldVibrateSetting()); + } + String ringtoneName = ""; RingtoneSettings ringtoneSettings; if (!TextUtils.isEmpty(appPreferences.getCallRingtoneUri())) { diff --git a/app/src/main/res/layout/controller_settings.xml b/app/src/main/res/layout/controller_settings.xml index 46f7fb650..cb0fb571b 100644 --- a/app/src/main/res/layout/controller_settings.xml +++ b/app/src/main/res/layout/controller_settings.xml @@ -135,7 +135,7 @@ android:id="@+id/settings_always_vibrate" android:layout_width="match_parent" android:layout_height="wrap_content" - apc:mp_default_value="true" + apc:mp_default_value="@bool/value_true" apc:mp_key="@string/nc_settings_vibrate_key" apc:mp_summary="@string/nc_settings_vibrate_desc" apc:mp_title="@string/nc_settings_vibrate" />