mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 14:27:24 +00:00
remove vibrate setting
Resolves #1630 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
8fd4f3e5d8
commit
eb3c742f65
@ -358,9 +358,7 @@ public class CallNotificationController extends BaseController {
|
|||||||
playRingtoneSound();
|
playRingtoneSound();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DoNotDisturbUtils.INSTANCE.shouldVibrate(appPreferences.getShouldVibrateSetting())) {
|
vibrate();
|
||||||
vibrate();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||||
|
@ -170,8 +170,6 @@ public class SettingsController extends BaseController {
|
|||||||
MaterialPreferenceCategory messageView;
|
MaterialPreferenceCategory messageView;
|
||||||
@BindView(R.id.settings_client_cert)
|
@BindView(R.id.settings_client_cert)
|
||||||
MaterialStandardPreference certificateSetup;
|
MaterialStandardPreference certificateSetup;
|
||||||
@BindView(R.id.settings_always_vibrate)
|
|
||||||
MaterialSwitchPreference shouldVibrateSwitchPreference;
|
|
||||||
@BindView(R.id.settings_incognito_keyboard)
|
@BindView(R.id.settings_incognito_keyboard)
|
||||||
MaterialSwitchPreference incognitoKeyboardSwitchPreference;
|
MaterialSwitchPreference incognitoKeyboardSwitchPreference;
|
||||||
@BindView(R.id.settings_screen_security)
|
@BindView(R.id.settings_screen_security)
|
||||||
@ -263,10 +261,6 @@ public class SettingsController extends BaseController {
|
|||||||
licenceButton.setVisibility(View.GONE);
|
licenceButton.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DoNotDisturbUtils.INSTANCE.hasVibrator()) {
|
|
||||||
shouldVibrateSwitchPreference.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||||
incognitoKeyboardSwitchPreference.setVisibility(View.GONE);
|
incognitoKeyboardSwitchPreference.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
@ -280,7 +274,6 @@ public class SettingsController extends BaseController {
|
|||||||
getResources().getString(R.string.nc_app_product_name)));
|
getResources().getString(R.string.nc_app_product_name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(getResources().getString(R.string.nc_privacy_url))) {
|
if (!TextUtils.isEmpty(getResources().getString(R.string.nc_privacy_url))) {
|
||||||
privacyButton.addPreferenceClickListener(view12 -> {
|
privacyButton.addPreferenceClickListener(view12 -> {
|
||||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getResources().
|
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getResources().
|
||||||
@ -353,7 +346,6 @@ public class SettingsController extends BaseController {
|
|||||||
alias = "";
|
alias = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
userUtils.createOrUpdateUser(null, null, null, null, null, null, null, currentUser.getId(),
|
userUtils.createOrUpdateUser(null, null, null, null, null, null, null, currentUser.getId(),
|
||||||
null, alias, null);
|
null, alias, null);
|
||||||
}, new String[]{"RSA", "EC"}, null, finalHost, finalPort, currentUser.getClientCertificate
|
}, new String[]{"RSA", "EC"}, null, finalHost, finalPort, currentUser.getClientCertificate
|
||||||
@ -445,10 +437,6 @@ public class SettingsController extends BaseController {
|
|||||||
certificateSetup.setTitle(R.string.nc_client_cert_setup);
|
certificateSetup.setTitle(R.string.nc_client_cert_setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldVibrateSwitchPreference.getVisibility() == View.VISIBLE) {
|
|
||||||
((Checkable) shouldVibrateSwitchPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.getShouldVibrateSetting());
|
|
||||||
}
|
|
||||||
|
|
||||||
((Checkable) screenSecuritySwitchPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.getIsScreenSecured());
|
((Checkable) screenSecuritySwitchPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.getIsScreenSecured());
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
((Checkable) incognitoKeyboardSwitchPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.getIsKeyboardIncognito());
|
((Checkable) incognitoKeyboardSwitchPreference.findViewById(R.id.mp_checkable)).setChecked(appPreferences.getIsKeyboardIncognito());
|
||||||
|
@ -537,18 +537,15 @@ public class NotificationWorker extends Worker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
if (DoNotDisturbUtils.INSTANCE.shouldVibrate(appPreferences.getShouldVibrateSetting()) || importantConversation) {
|
if (vibrator != null) {
|
||||||
Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
//vibrator.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE));
|
||||||
if (vibrator != null) {
|
} else {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
//vibrator.vibrate(500);
|
||||||
//vibrator.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE));
|
|
||||||
} else {
|
|
||||||
//vibrator.vibrate(500);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,17 +187,6 @@ public interface AppPreferences {
|
|||||||
@RemoveMethod
|
@RemoveMethod
|
||||||
void removeNotificationChannelUpgradeToV3();
|
void removeNotificationChannelUpgradeToV3();
|
||||||
|
|
||||||
@KeyByString("notifications_vibrate")
|
|
||||||
@DefaultValue(R.bool.value_true)
|
|
||||||
boolean getShouldVibrateSetting();
|
|
||||||
|
|
||||||
@KeyByString("notifications_vibrate")
|
|
||||||
void setVibrateSetting(boolean value);
|
|
||||||
|
|
||||||
@KeyByString("notifications_vibrate")
|
|
||||||
@RemoveMethod
|
|
||||||
void removeVibrateSetting();
|
|
||||||
|
|
||||||
@KeyByString("screen_security")
|
@KeyByString("screen_security")
|
||||||
@DefaultValue(R.bool.value_false)
|
@DefaultValue(R.bool.value_false)
|
||||||
boolean getIsScreenSecured();
|
boolean getIsScreenSecured();
|
||||||
|
Loading…
Reference in New Issue
Block a user