Fix click synchronization between the switch and the item view in notification permission layout
This commit is contained in:
parent
6600090525
commit
b359d6c3f8
@ -29,11 +29,8 @@ class NotificationPermissionListAdapter(var enableAll: Boolean, val listener: (f
|
||||
holder.binding.notificationSwitch.isChecked = feed.isNotificationEnabled
|
||||
|
||||
holder.binding.notificationSwitch.isEnabled = enableAll
|
||||
holder.binding.notificationSwitch.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked != feed.isNotificationEnabled) listener(feed)
|
||||
}
|
||||
|
||||
holder.itemView.setOnClickListener { if (enableAll) listener(feed) }
|
||||
holder.itemView.setOnClickListener { if (enableAll) listener(getItem(position)) }
|
||||
|
||||
GlideApp.with(holder.itemView.context)
|
||||
.load(feed.iconUrl)
|
||||
|
@ -24,6 +24,6 @@ class NotificationPermissionViewModel(application: Application) : AndroidViewMod
|
||||
fun setFeedNotificationState(feed: Feed): Completable = database.feedDao()
|
||||
.updateFeedNotificationState(feed.id, !feed.isNotificationEnabled)
|
||||
|
||||
fun setAllFeedsNotificationState(enabled: Boolean) = database.feedDao()
|
||||
fun setAllFeedsNotificationState(enabled: Boolean): Completable = database.feedDao()
|
||||
.updateAllFeedsNotificationState(account?.id!!, enabled)
|
||||
}
|
@ -43,7 +43,8 @@
|
||||
android:id="@+id/notification_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true" />
|
||||
android:layout_alignParentEnd="true"
|
||||
android:clickable="false" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user