Theme refactoring (#1656)

* Theme refactoring

* disable the automatic tinting of surfaces with elevation in dark mode

* make the media warning visible again with the dark theme

* fix nav bar on api 27+

* use correct color for all media warnings
This commit is contained in:
Konrad Pozniak 2020-01-30 21:37:28 +01:00 committed by GitHub
commit 8767d2ed3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
122 changed files with 330 additions and 724 deletions

View file

@ -20,15 +20,14 @@ import android.graphics.Canvas
import android.graphics.drawable.Drawable
import androidx.recyclerview.widget.RecyclerView
import android.view.View
import androidx.core.content.ContextCompat
import com.keylesspalace.tusky.R
import com.keylesspalace.tusky.adapter.ThreadAdapter
import com.keylesspalace.tusky.util.ThemeUtils
class ConversationLineItemDecoration(private val context: Context) : RecyclerView.ItemDecoration() {
private val divider: Drawable = ThemeUtils.getDrawable(context, R.attr.conversation_thread_line_drawable,
R.drawable.conversation_thread_line_dark)
private val divider: Drawable = ContextCompat.getDrawable(context, R.drawable.conversation_thread_line)!!
override fun onDraw(canvas: Canvas, parent: RecyclerView, state: RecyclerView.State) {
val dividerStart = parent.paddingStart + context.resources.getDimensionPixelSize(R.dimen.status_line_margin_start)

View file

@ -34,7 +34,7 @@ class LicenseCard
init {
inflate(context, R.layout.card_license, this)
setCardBackgroundColor(ThemeUtils.getColor(context, android.R.attr.colorBackground))
setCardBackgroundColor(ThemeUtils.getColor(context, R.attr.colorSurface))
val a = context.theme.obtainStyledAttributes(attrs, R.styleable.LicenseCard, 0, 0)