mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-12-15 05:01:45 +03:00
disable sound notification settings when main notification permission is is not permitted.
Otherwise user can't enable them anyway Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
b63325ae8d
commit
c2b99c591f
2 changed files with 47 additions and 38 deletions
|
@ -333,12 +333,22 @@ class SettingsActivity : BaseActivity(), SetPhoneNumberDialogFragment.SetPhoneNu
|
|||
binding.ncDiagnoseNotificationPermissionSubtitle.setTextColor(
|
||||
resources.getColor(R.color.high_emphasis_text, null)
|
||||
)
|
||||
binding.settingsCallSound.isEnabled = true
|
||||
binding.settingsCallSound.alpha = ENABLED_ALPHA
|
||||
binding.settingsMessageSound.isEnabled = true
|
||||
binding.settingsMessageSound.alpha = ENABLED_ALPHA
|
||||
} else {
|
||||
binding.ncDiagnoseNotificationPermissionSubtitle.text =
|
||||
resources.getString(R.string.nc_settings_notifications_declined)
|
||||
binding.ncDiagnoseNotificationPermissionSubtitle.setTextColor(
|
||||
resources.getColor(R.color.nc_darkRed, null)
|
||||
)
|
||||
|
||||
binding.settingsCallSound.isEnabled = false
|
||||
binding.settingsCallSound.alpha = DISABLED_ALPHA
|
||||
binding.settingsMessageSound.isEnabled = false
|
||||
binding.settingsMessageSound.alpha = DISABLED_ALPHA
|
||||
|
||||
binding.settingsNotificationsPermissionWrapper.setOnClickListener {
|
||||
requestPermissions(
|
||||
arrayOf(Manifest.permission.POST_NOTIFICATIONS),
|
||||
|
|
|
@ -247,46 +247,25 @@
|
|||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_notifications_permission_wrapper"
|
||||
android:layout_width="match_parent"
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_notifications_permission_wrapper"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/standard_padding">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/standard_padding"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
android:text="@string/nc_diagnose_notification_permission"
|
||||
android:textSize="@dimen/headline_text_size" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/headline_text_size"
|
||||
android:text="@string/nc_diagnose_notification_permission" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/nc_diagnose_notification_permission_subtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_battery_optimization_wrapper"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/standard_padding"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/headline_text_size"
|
||||
android:text="@string/nc_diagnose_battery_optimization_title" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/battery_optimization_ignored"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="@string/nc_diagnose_battery_optimization_ignored"/>
|
||||
</LinearLayout>
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/nc_diagnose_notification_permission_subtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_gplay_not_available"
|
||||
|
@ -349,7 +328,27 @@
|
|||
android:layout_marginBottom="@dimen/standard_margin"
|
||||
android:text="@string/nc_settings_default_ringtone"
|
||||
android:textSize="@dimen/supporting_text_text_size"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/settings_battery_optimization_wrapper"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:orientation="vertical"
|
||||
android:padding="@dimen/standard_padding">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/nc_diagnose_battery_optimization_title"
|
||||
android:textSize="@dimen/headline_text_size" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/battery_optimization_ignored"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="@string/nc_diagnose_battery_optimization_ignored"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
Loading…
Reference in a new issue