blink notification channels

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2024-11-25 23:00:24 +01:00
parent fa70cffd83
commit c559c6b0b4
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B
3 changed files with 18 additions and 3 deletions

View file

@ -110,6 +110,7 @@ import com.nextcloud.talk.utils.ClosedInterfaceImpl
import com.nextcloud.talk.utils.ConversationUtils
import com.nextcloud.talk.utils.FileUtils
import com.nextcloud.talk.utils.Mimetype
import com.nextcloud.talk.utils.NotificationUtils
import com.nextcloud.talk.utils.ParticipantPermissions
import com.nextcloud.talk.utils.SpreedFeatures
import com.nextcloud.talk.utils.UserIdUtils
@ -1518,7 +1519,12 @@ class ConversationsListActivity :
!platformPermissionUtil.isPostNotificationsPermissionGranted()
val batteryOptimizationNotIgnored = !PowerManagerUtils().isIgnoringBatteryOptimizations()
val settingsOfUserAreWrong = notificationPermissionNotGranted || batteryOptimizationNotIgnored
val messagesChannelNotEnabled = !NotificationUtils.isMessagesNotificationChannelEnabled(this)
val callsChannelNotEnabled = !NotificationUtils.isCallsNotificationChannelEnabled(this)
val settingsOfUserAreWrong = notificationPermissionNotGranted || batteryOptimizationNotIgnored ||
messagesChannelNotEnabled || callsChannelNotEnabled
val userWantsToBeNotifiedAboutWrongSettings = appPreferences.getShowNotificationWarning()
return settingsOfUserAreWrong &&

View file

@ -388,6 +388,10 @@ class SettingsActivity : BaseActivity(), SetPhoneNumberDialogFragment.SetPhoneNu
ResourcesCompat.getColor(context.resources, R.color.nc_darkRed, null)
)
binding.callsRingtone.text = resources!!.getString(R.string.nc_common_disabled)
if (openedByNotificationWarning){
blinkRipple(binding.settingsCallSound.background)
}
}
if (NotificationUtils.isMessagesNotificationChannelEnabled(this)) {
@ -399,6 +403,10 @@ class SettingsActivity : BaseActivity(), SetPhoneNumberDialogFragment.SetPhoneNu
ResourcesCompat.getColor(context.resources, R.color.nc_darkRed, null)
)
binding.messagesRingtone.text = resources!!.getString(R.string.nc_common_disabled)
if (openedByNotificationWarning){
blinkRipple(binding.settingsMessageSound.background)
}
}
binding.settingsCallSound.setOnClickListener {

View file

@ -310,6 +310,7 @@
android:id="@+id/settings_call_sound"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical">
<com.google.android.material.textview.MaterialTextView
@ -333,8 +334,8 @@
android:id="@+id/settings_message_sound"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="?android:attr/selectableItemBackground">
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical">
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"