mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 00:31:51 +01:00
Remove card backgrounds from browse lists
This commit is contained in:
parent
9ce8c5c160
commit
a3c598a3e1
@ -234,7 +234,6 @@ dependencies {
|
|||||||
implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
|
implementation 'eu.davidea:flexible-adapter-ui:1.0.0'
|
||||||
implementation 'com.nononsenseapps:filepicker:2.5.2'
|
implementation 'com.nononsenseapps:filepicker:2.5.2'
|
||||||
implementation 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.1.0'
|
implementation 'com.nightlynexus.viewstatepageradapter:viewstatepageradapter:1.1.0'
|
||||||
implementation 'com.github.mthli:Slice:v1.3'
|
|
||||||
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
||||||
implementation 'com.github.carlosesco:DirectionalViewPager:a844dbca0a'
|
implementation 'com.github.carlosesco:DirectionalViewPager:a844dbca0a'
|
||||||
|
|
||||||
|
@ -1,70 +0,0 @@
|
|||||||
package eu.kanade.tachiyomi.ui.base.holder
|
|
||||||
|
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
|
||||||
import eu.davidea.flexibleadapter.items.IFlexible
|
|
||||||
import eu.davidea.flexibleadapter.items.ISectionable
|
|
||||||
import eu.kanade.tachiyomi.util.system.dpToPx
|
|
||||||
import io.github.mthli.slice.Slice
|
|
||||||
|
|
||||||
interface SlicedHolder {
|
|
||||||
|
|
||||||
val slice: Slice
|
|
||||||
|
|
||||||
val adapter: FlexibleAdapter<IFlexible<*>>
|
|
||||||
|
|
||||||
val viewToSlice: View
|
|
||||||
|
|
||||||
fun setCardEdges(item: ISectionable<*, *>) {
|
|
||||||
// Position of this item in its header. Defaults to 0 when header is null.
|
|
||||||
var position = 0
|
|
||||||
|
|
||||||
// Number of items in the header of this item. Defaults to 1 when header is null.
|
|
||||||
var count = 1
|
|
||||||
|
|
||||||
if (item.header != null) {
|
|
||||||
val sectionItems = adapter.getSectionItems(item.header)
|
|
||||||
position = sectionItems.indexOf(item)
|
|
||||||
count = sectionItems.size
|
|
||||||
}
|
|
||||||
|
|
||||||
when {
|
|
||||||
// Only one item in the card
|
|
||||||
count == 1 -> applySlice(2f, topRect = false, bottomRect = false, topShadow = true, bottomShadow = true)
|
|
||||||
// First item of the card
|
|
||||||
position == 0 -> applySlice(2f, topRect = false, bottomRect = true, topShadow = true, bottomShadow = false)
|
|
||||||
// Last item of the card
|
|
||||||
position == count - 1 -> applySlice(2f, topRect = true, bottomRect = false, topShadow = false, bottomShadow = true)
|
|
||||||
// Middle item
|
|
||||||
else -> applySlice(0f, topRect = false, bottomRect = false, topShadow = false, bottomShadow = false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun applySlice(
|
|
||||||
radius: Float,
|
|
||||||
topRect: Boolean,
|
|
||||||
bottomRect: Boolean,
|
|
||||||
topShadow: Boolean,
|
|
||||||
bottomShadow: Boolean
|
|
||||||
) {
|
|
||||||
val margin = margin
|
|
||||||
|
|
||||||
slice.setRadius(radius)
|
|
||||||
slice.showLeftTopRect(topRect)
|
|
||||||
slice.showRightTopRect(topRect)
|
|
||||||
slice.showLeftBottomRect(bottomRect)
|
|
||||||
slice.showRightBottomRect(bottomRect)
|
|
||||||
setMargins(margin, if (topShadow) margin else 0, margin, if (bottomShadow) margin else 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun setMargins(left: Int, top: Int, right: Int, bottom: Int) {
|
|
||||||
if (viewToSlice.layoutParams is ViewGroup.MarginLayoutParams) {
|
|
||||||
val p = viewToSlice.layoutParams as ViewGroup.MarginLayoutParams
|
|
||||||
p.setMargins(left, top, right, bottom)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val margin
|
|
||||||
get() = 8.dpToPx
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
package eu.kanade.tachiyomi.ui.browse
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.graphics.Canvas
|
|
||||||
import android.graphics.Rect
|
|
||||||
import android.graphics.drawable.Drawable
|
|
||||||
import android.view.View
|
|
||||||
import androidx.core.view.marginBottom
|
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
|
||||||
|
|
||||||
class SourceDividerItemDecoration(context: Context) : RecyclerView.ItemDecoration() {
|
|
||||||
|
|
||||||
private val divider: Drawable
|
|
||||||
|
|
||||||
init {
|
|
||||||
val a = context.obtainStyledAttributes(intArrayOf(android.R.attr.listDivider))
|
|
||||||
divider = a.getDrawable(0)!!
|
|
||||||
a.recycle()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) {
|
|
||||||
val childCount = parent.childCount
|
|
||||||
for (i in 0 until childCount - 1) {
|
|
||||||
val child = parent.getChildAt(i)
|
|
||||||
val holder = parent.getChildViewHolder(child)
|
|
||||||
if (holder is SourceListItem &&
|
|
||||||
parent.getChildViewHolder(parent.getChildAt(i + 1)) is SourceListItem
|
|
||||||
) {
|
|
||||||
val top = child.bottom + child.marginBottom
|
|
||||||
val bottom = top + divider.intrinsicHeight
|
|
||||||
val left = parent.paddingStart + holder.margin
|
|
||||||
val right = parent.width - parent.paddingEnd - holder.margin
|
|
||||||
|
|
||||||
divider.setBounds(left, top, right, bottom)
|
|
||||||
divider.draw(c)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getItemOffsets(
|
|
||||||
outRect: Rect,
|
|
||||||
view: View,
|
|
||||||
parent: RecyclerView,
|
|
||||||
state: RecyclerView.State
|
|
||||||
) {
|
|
||||||
outRect.set(0, 0, 0, divider.intrinsicHeight)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
package eu.kanade.tachiyomi.ui.browse
|
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder
|
|
||||||
|
|
||||||
interface SourceListItem : SlicedHolder
|
|
@ -18,7 +18,6 @@ import eu.kanade.tachiyomi.extension.model.Extension
|
|||||||
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||||
import eu.kanade.tachiyomi.ui.browse.BrowseController
|
import eu.kanade.tachiyomi.ui.browse.BrowseController
|
||||||
import eu.kanade.tachiyomi.ui.browse.SourceDividerItemDecoration
|
|
||||||
import eu.kanade.tachiyomi.ui.browse.extension.details.ExtensionDetailsController
|
import eu.kanade.tachiyomi.ui.browse.extension.details.ExtensionDetailsController
|
||||||
import kotlinx.coroutines.flow.filter
|
import kotlinx.coroutines.flow.filter
|
||||||
import kotlinx.coroutines.flow.launchIn
|
import kotlinx.coroutines.flow.launchIn
|
||||||
@ -76,7 +75,6 @@ open class ExtensionController :
|
|||||||
// Create recycler and set adapter.
|
// Create recycler and set adapter.
|
||||||
binding.recycler.layoutManager = LinearLayoutManager(view.context)
|
binding.recycler.layoutManager = LinearLayoutManager(view.context)
|
||||||
binding.recycler.adapter = adapter
|
binding.recycler.adapter = adapter
|
||||||
binding.recycler.addItemDecoration(SourceDividerItemDecoration(view.context))
|
|
||||||
adapter?.fastScroller = binding.fastScroller
|
adapter?.fastScroller = binding.fastScroller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,11 +6,7 @@ import eu.kanade.tachiyomi.data.glide.GlideApp
|
|||||||
import eu.kanade.tachiyomi.extension.model.Extension
|
import eu.kanade.tachiyomi.extension.model.Extension
|
||||||
import eu.kanade.tachiyomi.extension.model.InstallStep
|
import eu.kanade.tachiyomi.extension.model.InstallStep
|
||||||
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
||||||
import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder
|
|
||||||
import eu.kanade.tachiyomi.ui.browse.SourceListItem
|
|
||||||
import eu.kanade.tachiyomi.util.system.LocaleHelper
|
import eu.kanade.tachiyomi.util.system.LocaleHelper
|
||||||
import io.github.mthli.slice.Slice
|
|
||||||
import kotlinx.android.synthetic.main.extension_card_item.card
|
|
||||||
import kotlinx.android.synthetic.main.extension_card_item.ext_button
|
import kotlinx.android.synthetic.main.extension_card_item.ext_button
|
||||||
import kotlinx.android.synthetic.main.extension_card_item.ext_title
|
import kotlinx.android.synthetic.main.extension_card_item.ext_title
|
||||||
import kotlinx.android.synthetic.main.extension_card_item.image
|
import kotlinx.android.synthetic.main.extension_card_item.image
|
||||||
@ -18,17 +14,8 @@ import kotlinx.android.synthetic.main.extension_card_item.lang
|
|||||||
import kotlinx.android.synthetic.main.extension_card_item.version
|
import kotlinx.android.synthetic.main.extension_card_item.version
|
||||||
import kotlinx.android.synthetic.main.extension_card_item.warning
|
import kotlinx.android.synthetic.main.extension_card_item.warning
|
||||||
|
|
||||||
class ExtensionHolder(view: View, override val adapter: ExtensionAdapter) :
|
class ExtensionHolder(view: View, val adapter: ExtensionAdapter) :
|
||||||
BaseFlexibleViewHolder(view, adapter),
|
BaseFlexibleViewHolder(view, adapter) {
|
||||||
SourceListItem,
|
|
||||||
SlicedHolder {
|
|
||||||
|
|
||||||
override val slice = Slice(card).apply {
|
|
||||||
setColor(adapter.cardBackground)
|
|
||||||
}
|
|
||||||
|
|
||||||
override val viewToSlice: View
|
|
||||||
get() = card
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
ext_button.setOnClickListener {
|
ext_button.setOnClickListener {
|
||||||
@ -38,7 +25,6 @@ class ExtensionHolder(view: View, override val adapter: ExtensionAdapter) :
|
|||||||
|
|
||||||
fun bind(item: ExtensionItem) {
|
fun bind(item: ExtensionItem) {
|
||||||
val extension = item.extension
|
val extension = item.extension
|
||||||
setCardEdges(item)
|
|
||||||
|
|
||||||
ext_title.text = extension.name
|
ext_title.text = extension.name
|
||||||
version.text = extension.versionName
|
version.text = extension.versionName
|
||||||
|
@ -10,7 +10,6 @@ import eu.davidea.flexibleadapter.items.IFlexible
|
|||||||
import eu.kanade.tachiyomi.databinding.MigrationMangaControllerBinding
|
import eu.kanade.tachiyomi.databinding.MigrationMangaControllerBinding
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||||
import eu.kanade.tachiyomi.ui.browse.SourceDividerItemDecoration
|
|
||||||
import eu.kanade.tachiyomi.ui.browse.migration.search.SearchController
|
import eu.kanade.tachiyomi.ui.browse.migration.search.SearchController
|
||||||
|
|
||||||
class MigrationMangaController :
|
class MigrationMangaController :
|
||||||
@ -54,7 +53,6 @@ class MigrationMangaController :
|
|||||||
adapter = FlexibleAdapter<IFlexible<*>>(null, this)
|
adapter = FlexibleAdapter<IFlexible<*>>(null, this)
|
||||||
binding.recycler.layoutManager = LinearLayoutManager(view.context)
|
binding.recycler.layoutManager = LinearLayoutManager(view.context)
|
||||||
binding.recycler.adapter = adapter
|
binding.recycler.adapter = adapter
|
||||||
binding.recycler.addItemDecoration(SourceDividerItemDecoration(view.context))
|
|
||||||
adapter?.fastScroller = binding.fastScroller
|
adapter?.fastScroller = binding.fastScroller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ import eu.davidea.flexibleadapter.FlexibleAdapter
|
|||||||
import eu.kanade.tachiyomi.databinding.MigrationSourcesControllerBinding
|
import eu.kanade.tachiyomi.databinding.MigrationSourcesControllerBinding
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||||
import eu.kanade.tachiyomi.ui.browse.SourceDividerItemDecoration
|
|
||||||
import eu.kanade.tachiyomi.ui.browse.migration.manga.MigrationMangaController
|
import eu.kanade.tachiyomi.ui.browse.migration.manga.MigrationMangaController
|
||||||
|
|
||||||
class MigrationSourcesController :
|
class MigrationSourcesController :
|
||||||
@ -32,7 +31,6 @@ class MigrationSourcesController :
|
|||||||
adapter = SourceAdapter(this)
|
adapter = SourceAdapter(this)
|
||||||
binding.recycler.layoutManager = LinearLayoutManager(view.context)
|
binding.recycler.layoutManager = LinearLayoutManager(view.context)
|
||||||
binding.recycler.adapter = adapter
|
binding.recycler.adapter = adapter
|
||||||
binding.recycler.addItemDecoration(SourceDividerItemDecoration(view.context))
|
|
||||||
adapter?.fastScroller = binding.fastScroller
|
adapter?.fastScroller = binding.fastScroller
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,28 +3,14 @@ package eu.kanade.tachiyomi.ui.browse.migration.sources
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import eu.kanade.tachiyomi.source.icon
|
import eu.kanade.tachiyomi.source.icon
|
||||||
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
||||||
import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder
|
|
||||||
import eu.kanade.tachiyomi.ui.browse.SourceListItem
|
|
||||||
import io.github.mthli.slice.Slice
|
|
||||||
import kotlinx.android.synthetic.main.source_main_controller_card_item.card
|
|
||||||
import kotlinx.android.synthetic.main.source_main_controller_card_item.image
|
import kotlinx.android.synthetic.main.source_main_controller_card_item.image
|
||||||
import kotlinx.android.synthetic.main.source_main_controller_card_item.title
|
import kotlinx.android.synthetic.main.source_main_controller_card_item.title
|
||||||
|
|
||||||
class SourceHolder(view: View, override val adapter: SourceAdapter) :
|
class SourceHolder(view: View, val adapter: SourceAdapter) :
|
||||||
BaseFlexibleViewHolder(view, adapter),
|
BaseFlexibleViewHolder(view, adapter) {
|
||||||
SourceListItem,
|
|
||||||
SlicedHolder {
|
|
||||||
|
|
||||||
override val slice = Slice(card).apply {
|
|
||||||
setColor(adapter.cardBackground)
|
|
||||||
}
|
|
||||||
|
|
||||||
override val viewToSlice: View
|
|
||||||
get() = card
|
|
||||||
|
|
||||||
fun bind(item: SourceItem) {
|
fun bind(item: SourceItem) {
|
||||||
val source = item.source
|
val source = item.source
|
||||||
setCardEdges(item)
|
|
||||||
|
|
||||||
// Set source name
|
// Set source name
|
||||||
title.text = source.name
|
title.text = source.name
|
||||||
|
@ -30,7 +30,6 @@ import eu.kanade.tachiyomi.ui.base.controller.NucleusController
|
|||||||
import eu.kanade.tachiyomi.ui.base.controller.requestPermissionsSafe
|
import eu.kanade.tachiyomi.ui.base.controller.requestPermissionsSafe
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||||
import eu.kanade.tachiyomi.ui.browse.BrowseController
|
import eu.kanade.tachiyomi.ui.browse.BrowseController
|
||||||
import eu.kanade.tachiyomi.ui.browse.SourceDividerItemDecoration
|
|
||||||
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceController
|
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceController
|
||||||
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchController
|
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchController
|
||||||
import eu.kanade.tachiyomi.ui.browse.source.latest.LatestUpdatesController
|
import eu.kanade.tachiyomi.ui.browse.source.latest.LatestUpdatesController
|
||||||
@ -93,7 +92,6 @@ class SourceController :
|
|||||||
// Create recycler and set adapter.
|
// Create recycler and set adapter.
|
||||||
binding.recycler.layoutManager = LinearLayoutManager(view.context)
|
binding.recycler.layoutManager = LinearLayoutManager(view.context)
|
||||||
binding.recycler.adapter = adapter
|
binding.recycler.adapter = adapter
|
||||||
binding.recycler.addItemDecoration(SourceDividerItemDecoration(view.context))
|
|
||||||
adapter?.fastScroller = binding.fastScroller
|
adapter?.fastScroller = binding.fastScroller
|
||||||
|
|
||||||
requestPermissionsSafe(arrayOf(WRITE_EXTERNAL_STORAGE), 301)
|
requestPermissionsSafe(arrayOf(WRITE_EXTERNAL_STORAGE), 301)
|
||||||
|
@ -6,28 +6,15 @@ import eu.kanade.tachiyomi.R
|
|||||||
import eu.kanade.tachiyomi.source.LocalSource
|
import eu.kanade.tachiyomi.source.LocalSource
|
||||||
import eu.kanade.tachiyomi.source.icon
|
import eu.kanade.tachiyomi.source.icon
|
||||||
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
import eu.kanade.tachiyomi.ui.base.holder.BaseFlexibleViewHolder
|
||||||
import eu.kanade.tachiyomi.ui.base.holder.SlicedHolder
|
|
||||||
import eu.kanade.tachiyomi.ui.browse.SourceListItem
|
|
||||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||||
import eu.kanade.tachiyomi.util.view.setVectorCompat
|
import eu.kanade.tachiyomi.util.view.setVectorCompat
|
||||||
import io.github.mthli.slice.Slice
|
|
||||||
import kotlinx.android.synthetic.main.source_main_controller_card_item.card
|
|
||||||
import kotlinx.android.synthetic.main.source_main_controller_card_item.image
|
import kotlinx.android.synthetic.main.source_main_controller_card_item.image
|
||||||
import kotlinx.android.synthetic.main.source_main_controller_card_item.pin
|
import kotlinx.android.synthetic.main.source_main_controller_card_item.pin
|
||||||
import kotlinx.android.synthetic.main.source_main_controller_card_item.source_latest
|
import kotlinx.android.synthetic.main.source_main_controller_card_item.source_latest
|
||||||
import kotlinx.android.synthetic.main.source_main_controller_card_item.title
|
import kotlinx.android.synthetic.main.source_main_controller_card_item.title
|
||||||
|
|
||||||
class SourceHolder(private val view: View, override val adapter: SourceAdapter) :
|
class SourceHolder(private val view: View, val adapter: SourceAdapter) :
|
||||||
BaseFlexibleViewHolder(view, adapter),
|
BaseFlexibleViewHolder(view, adapter) {
|
||||||
SourceListItem,
|
|
||||||
SlicedHolder {
|
|
||||||
|
|
||||||
override val slice = Slice(card).apply {
|
|
||||||
setColor(adapter.cardBackground)
|
|
||||||
}
|
|
||||||
|
|
||||||
override val viewToSlice: View
|
|
||||||
get() = card
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
source_latest.setOnClickListener {
|
source_latest.setOnClickListener {
|
||||||
@ -41,7 +28,6 @@ class SourceHolder(private val view: View, override val adapter: SourceAdapter)
|
|||||||
|
|
||||||
fun bind(item: SourceItem) {
|
fun bind(item: SourceItem) {
|
||||||
val source = item.source
|
val source = item.source
|
||||||
setCardEdges(item)
|
|
||||||
|
|
||||||
// Set source name
|
// Set source name
|
||||||
title.text = source.name
|
title.text = source.name
|
||||||
|
@ -1,94 +1,86 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="64dp"
|
||||||
|
android:background="@drawable/list_item_selector_background">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<ImageView
|
||||||
android:id="@+id/card"
|
android:id="@+id/image"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="64dp"
|
android:layout_height="0dp"
|
||||||
android:background="@drawable/list_item_selector">
|
android:padding="12dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="h,1:1"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:src="@mipmap/ic_launcher_round" />
|
||||||
|
|
||||||
<ImageView
|
<TextView
|
||||||
android:id="@+id/image"
|
android:id="@+id/ext_title"
|
||||||
android:layout_width="0dp"
|
style="@style/TextAppearance.Regular"
|
||||||
android:layout_height="0dp"
|
android:layout_width="0dp"
|
||||||
android:padding="12dp"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:layout_marginEnd="4dp"
|
||||||
app:layout_constraintDimensionRatio="h,1:1"
|
android:ellipsize="end"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:maxLines="1"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
android:textAppearance="@style/TextAppearance.Regular.SubHeading"
|
||||||
tools:src="@mipmap/ic_launcher_round" />
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/lang"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/ext_button"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/image"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed"
|
||||||
|
tools:text="Batoto" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ext_title"
|
android:id="@+id/lang"
|
||||||
style="@style/TextAppearance.Regular"
|
style="@style/TextAppearance.Regular.Body1.Secondary"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="4dp"
|
android:maxLines="1"
|
||||||
android:ellipsize="end"
|
android:textSize="12sp"
|
||||||
android:maxLines="1"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:textAppearance="@style/TextAppearance.Regular.SubHeading"
|
app:layout_constraintStart_toEndOf="@id/image"
|
||||||
android:textSize="14sp"
|
app:layout_constraintTop_toBottomOf="@+id/ext_title"
|
||||||
app:layout_constraintBottom_toTopOf="@id/lang"
|
tools:text="English"
|
||||||
app:layout_constraintEnd_toStartOf="@id/ext_button"
|
tools:visibility="visible" />
|
||||||
app:layout_constraintStart_toEndOf="@id/image"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintVertical_chainStyle="packed"
|
|
||||||
tools:text="Batoto" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/lang"
|
android:id="@+id/version"
|
||||||
style="@style/TextAppearance.Regular.Body1.Secondary"
|
style="@style/TextAppearance.Regular.Body1.Secondary"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxLines="1"
|
android:layout_marginStart="4dp"
|
||||||
android:textSize="12sp"
|
android:maxLines="1"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:textSize="12sp"
|
||||||
app:layout_constraintStart_toEndOf="@id/image"
|
app:layout_constraintStart_toEndOf="@id/lang"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/ext_title"
|
app:layout_constraintTop_toBottomOf="@+id/ext_title"
|
||||||
tools:text="English"
|
tools:text="Version" />
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/version"
|
android:id="@+id/warning"
|
||||||
style="@style/TextAppearance.Regular.Body1.Secondary"
|
style="@style/TextAppearance.Regular.Body1.Secondary"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="4dp"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:textSize="12sp"
|
android:textColor="?attr/colorError"
|
||||||
app:layout_constraintStart_toEndOf="@id/lang"
|
android:textSize="12sp"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/ext_title"
|
app:layout_constraintStart_toEndOf="@id/version"
|
||||||
tools:text="Version" />
|
app:layout_constraintTop_toBottomOf="@+id/ext_title"
|
||||||
|
tools:text="Warning" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:id="@+id/warning"
|
android:id="@+id/ext_button"
|
||||||
style="@style/TextAppearance.Regular.Body1.Secondary"
|
style="@style/Theme.Widget.Button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:maxLines="1"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:textColor="?attr/colorError"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:textSize="12sp"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/version"
|
tools:text="Details" />
|
||||||
app:layout_constraintTop_toBottomOf="@+id/ext_title"
|
|
||||||
tools:text="Warning" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/ext_button"
|
|
||||||
style="@style/Theme.Widget.Button"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:text="Details" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
@ -6,13 +6,15 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
style="@style/TextAppearance.Regular.SubHeading"
|
style="@style/TextAppearance.Regular.SubHeading.Secondary"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:fontFamily="sans-serif-medium"
|
||||||
android:paddingStart="@dimen/material_component_text_fields_padding_above_and_below_label"
|
android:paddingStart="@dimen/material_component_text_fields_padding_above_and_below_label"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:paddingEnd="@dimen/material_component_text_fields_padding_above_and_below_label"
|
android:paddingEnd="@dimen/material_component_text_fields_padding_above_and_below_label"
|
||||||
android:paddingBottom="8dp"
|
android:paddingBottom="8dp"
|
||||||
|
android:textAllCaps="true"
|
||||||
tools:text="Title" />
|
tools:text="Title" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
@ -1,74 +1,68 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="64dp"
|
||||||
|
android:background="@drawable/list_item_selector_background">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<ImageView
|
||||||
android:id="@+id/card"
|
android:id="@+id/image"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/material_component_lists_two_line_height"
|
android:layout_height="0dp"
|
||||||
android:background="@drawable/list_item_selector">
|
android:paddingStart="16dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="1:1"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:ignore="ContentDescription"
|
||||||
|
tools:src="@mipmap/ic_launcher_round" />
|
||||||
|
|
||||||
<ImageView
|
<TextView
|
||||||
android:id="@+id/image"
|
android:id="@+id/title"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:padding="8dp"
|
android:ellipsize="end"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:maxLines="1"
|
||||||
app:layout_constraintDimensionRatio="1:1"
|
android:paddingStart="0dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:paddingEnd="8dp"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
android:textAppearance="@style/TextAppearance.Regular.SubHeading"
|
||||||
tools:ignore="ContentDescription"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
tools:src="@mipmap/ic_launcher_round" />
|
app:layout_constraintEnd_toStartOf="@+id/source_latest"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/image"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:text="Source title" />
|
||||||
|
|
||||||
<TextView
|
<Button
|
||||||
android:id="@+id/title"
|
android:id="@+id/source_latest"
|
||||||
android:layout_width="0dp"
|
style="@style/Theme.Widget.Button"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:ellipsize="end"
|
android:layout_height="wrap_content"
|
||||||
android:maxLines="1"
|
android:maxHeight="48dp"
|
||||||
android:paddingStart="0dp"
|
android:minWidth="0dp"
|
||||||
android:paddingEnd="8dp"
|
android:minHeight="48dp"
|
||||||
android:textAppearance="@style/TextAppearance.Regular.SubHeading"
|
android:paddingStart="16dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:paddingEnd="16dp"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/source_latest"
|
android:text="@string/latest"
|
||||||
app:layout_constraintStart_toEndOf="@+id/image"
|
android:visibility="gone"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
tools:text="Source title" />
|
app:layout_constraintEnd_toStartOf="@+id/pin"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<Button
|
<ImageButton
|
||||||
android:id="@+id/source_latest"
|
android:id="@+id/pin"
|
||||||
style="@style/Theme.Widget.Button"
|
android:layout_width="40dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginEnd="8dp"
|
||||||
android:maxHeight="48dp"
|
android:background="?selectableItemBackgroundBorderless"
|
||||||
android:minWidth="0dp"
|
android:contentDescription="@string/action_pin"
|
||||||
android:minHeight="48dp"
|
android:visibility="gone"
|
||||||
android:paddingStart="16dp"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:paddingEnd="16dp"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:text="@string/latest"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:visibility="gone"
|
app:srcCompat="@drawable/ic_push_pin_24dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
tools:visibility="visible" />
|
||||||
app:layout_constraintEnd_toStartOf="@+id/pin"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<ImageButton
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
android:id="@+id/pin"
|
|
||||||
android:layout_width="40dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:background="?selectableItemBackgroundBorderless"
|
|
||||||
android:contentDescription="@string/action_pin"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:srcCompat="@drawable/ic_push_pin_24dp"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
@ -80,11 +80,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TextAppearance.Regular.SubHeading">
|
<style name="TextAppearance.Regular.SubHeading">
|
||||||
<item name="android:textSize">16sp</item>
|
<item name="android:textSize">14sp</item>
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="TextAppearance.Regular.SubHeading.Upper">
|
|
||||||
<item name="android:textAllCaps">true</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TextAppearance.Regular.SubHeading.Secondary">
|
<style name="TextAppearance.Regular.SubHeading.Secondary">
|
||||||
|
Loading…
Reference in New Issue
Block a user