Skip to content

Commit

Permalink
Make the whole notifications permission banner clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
irfano committed Apr 6, 2023
1 parent ddbac77 commit 63431aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,14 @@ class NotificationsListFragment : Fragment(R.layout.notifications_list_fragment)
viewModel.resetNotificationsPermissionWarningDismissState()
}

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU ||
hasPermission ||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU || hasPermission ||
viewModel.isNotificationsPermissionsWarningDismissed
) {
// If the user dismissed the warning, don't show it again.
notificationPermissionWarning.isVisible = false
} else {
notificationPermissionWarning.isVisible = true
permissionFixButton.setOnClickListener {
notificationPermissionWarning.setOnClickListener {
val isAlwaysDenied = WPPermissionUtils.isPermissionAlwaysDenied(
requireActivity(),
Manifest.permission.POST_NOTIFICATIONS
Expand Down
2 changes: 0 additions & 2 deletions WordPress/src/main/res/layout/notifications_list_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,8 @@
android:textColor="?attr/colorOnSurface" />

<com.google.android.material.textview.MaterialTextView
android:id="@+id/permission_fix_button"
android:layout_width="wrap_content"
android:layout_height="@dimen/min_touch_target_sz"
android:background="?selectableItemBackgroundBorderless"
android:gravity="center"
android:minWidth="@dimen/min_touch_target_sz"
android:text="@string/notifications_permission_fix"
Expand Down

0 comments on commit 63431aa

Please sign in to comment.