Improve notification permission layout
This commit is contained in:
parent
4987a70efa
commit
9d1d9a31fe
@ -6,8 +6,10 @@ import androidx.databinding.DataBindingUtil
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.ListAdapter
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import com.readrops.app.R
|
||||
import com.readrops.app.databinding.NotificationLayoutBinding
|
||||
import com.readrops.app.utils.GlideApp
|
||||
import com.readrops.readropsdb.entities.Feed
|
||||
|
||||
class NotificationPermissionAdapter(val listener: (feed: Feed) -> Unit) : ListAdapter<Feed, NotificationPermissionAdapter.NotificationPermissionViewHolder>(DIFF_CALLBACK) {
|
||||
@ -23,6 +25,12 @@ class NotificationPermissionAdapter(val listener: (feed: Feed) -> Unit) : ListAd
|
||||
|
||||
holder.binding.notificationFeedName.text = feed.name
|
||||
holder.binding.notificationSwitch.isChecked = feed.isNotificationEnabled
|
||||
|
||||
GlideApp.with(holder.itemView.context)
|
||||
.load(feed.iconUrl)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.placeholder(R.drawable.ic_rss_feed_grey)
|
||||
.into(holder.binding.notificationFeedIcon)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: NotificationPermissionViewHolder, position: Int, payloads: MutableList<Any>) {
|
||||
|
@ -7,11 +7,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginEnd="6dp">
|
||||
android:layout_marginEnd="6dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="8dp">
|
||||
|
||||
<ImageView
|
||||
@ -19,6 +22,7 @@
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="6dp"
|
||||
tools:src="@drawable/ic_rss_feed_grey" />
|
||||
|
||||
@ -27,6 +31,7 @@
|
||||
style="@style/TextAppearance.AppCompat.Subhead"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_toStartOf="@id/notification_switch"
|
||||
android:layout_toEndOf="@id/notification_feed_icon"
|
||||
|
Loading…
x
Reference in New Issue
Block a user