Link colors in cards and list items.

This commit is contained in:
Amine Bou 2018-04-11 20:28:16 +02:00
parent eb5672901b
commit 533636f3a1
4 changed files with 12 additions and 10 deletions

View File

@ -382,13 +382,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
Scoop.getInstance()
.update(Toppings.PRIMARY.value, appColors.colorPrimary)
.update(Toppings.PRIMARY_DARK.value, appColors.colorPrimaryDark)
/*.update(Toppings.ACCENT.value, colorAccent)
.update(Toppings.ACCENT_DARK.value, colorAccentDark)
.update(Toppings.BACKGROUND.value, colorBackground)
.update(Toppings.CARD_BACKGROUND.value, cardBackgroundColor)
.update(Toppings.TEXT_PRIMARY.value, textColorPrimary)
.update(Toppings.TEXT_SECONDARY.value, textColorSecondary)
.update(Toppings.HEADER_DRAWER_TEXT.value, materialDrawerHeaderSelectionText)*/
}
private fun handleDrawer() {
@ -943,7 +936,8 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
internalBrowser,
articleViewer,
debugReadingItems,
userIdentifier
userIdentifier,
appColors
)
recyclerView.addItemDecoration(

View File

@ -42,7 +42,7 @@ class ItemCardAdapter(
private val internalBrowser: Boolean,
private val articleViewer: Boolean,
private val fullHeightCards: Boolean,
private val appColors: AppColors,
override val appColors: AppColors,
override val debugReadingItems: Boolean,
override val userIdentifier: String
) : ItemsAdapter<ItemCardAdapter.ViewHolder>() {
@ -63,6 +63,8 @@ class ItemCardAdapter(
holder.mView.favButton.isLiked = itm.starred
holder.mView.title.text = Html.fromHtml(itm.title)
holder.mView.title.setLinkTextColor(appColors.colorAccent)
holder.mView.sourceTitleAndDate.text = itm.sourceAndDateText()
if (!fullHeightCards) {

View File

@ -14,6 +14,7 @@ import apps.amine.bou.readerforselfoss.R
import apps.amine.bou.readerforselfoss.api.selfoss.Item
import apps.amine.bou.readerforselfoss.api.selfoss.SelfossApi
import apps.amine.bou.readerforselfoss.api.selfoss.SuccessResponse
import apps.amine.bou.readerforselfoss.themes.AppColors
import apps.amine.bou.readerforselfoss.utils.buildCustomTabsIntent
import apps.amine.bou.readerforselfoss.utils.customtabs.CustomTabActivityHelper
import apps.amine.bou.readerforselfoss.utils.glide.bitmapCenterCrop
@ -43,7 +44,8 @@ class ItemListAdapter(
private val internalBrowser: Boolean,
private val articleViewer: Boolean,
override val debugReadingItems: Boolean,
override val userIdentifier: String
override val userIdentifier: String,
override val appColors: AppColors
) : ItemsAdapter<ItemListAdapter.ViewHolder>() {
private val generator: ColorGenerator = ColorGenerator.MATERIAL
private val c: Context = app.baseContext
@ -64,6 +66,8 @@ class ItemListAdapter(
holder.mView.title.text = Html.fromHtml(itm.title)
holder.mView.title.setLinkTextColor(appColors.colorAccent)
holder.mView.sourceTitleAndDate.text = itm.sourceAndDateText()
if (itm.getThumbnail(c).isEmpty()) {

View File

@ -10,6 +10,7 @@ import apps.amine.bou.readerforselfoss.R
import apps.amine.bou.readerforselfoss.api.selfoss.Item
import apps.amine.bou.readerforselfoss.api.selfoss.SelfossApi
import apps.amine.bou.readerforselfoss.api.selfoss.SuccessResponse
import apps.amine.bou.readerforselfoss.themes.AppColors
import apps.amine.bou.readerforselfoss.utils.succeeded
import com.crashlytics.android.Crashlytics
import retrofit2.Call
@ -22,6 +23,7 @@ abstract class ItemsAdapter<VH : RecyclerView.ViewHolder?> : RecyclerView.Adapte
abstract val debugReadingItems: Boolean
abstract val userIdentifier: String
abstract val app: Activity
abstract val appColors: AppColors
fun updateAllItems(newItems: ArrayList<Item>) {
items = newItems