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

@ -41,7 +41,6 @@ import androidx.annotation.ColorInt
import androidx.annotation.StringRes
import androidx.annotation.VisibleForTesting
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.content.FileProvider
@ -387,9 +386,7 @@ class ComposeActivity : BaseActivity(),
title = null
setDisplayHomeAsUpEnabled(true)
setDisplayShowHomeEnabled(true)
val closeIcon = AppCompatResources.getDrawable(this@ComposeActivity, R.drawable.ic_close_24dp)
ThemeUtils.setDrawableTint(this@ComposeActivity, closeIcon!!, R.attr.compose_close_button_tint)
setHomeAsUpIndicator(closeIcon)
setHomeAsUpIndicator(R.drawable.ic_close_24dp)
}
}
@ -505,7 +502,7 @@ class ComposeActivity : BaseActivity(),
@ColorInt val color = if (contentWarningShown) {
composeHideMediaButton.setImageResource(R.drawable.ic_hide_media_24dp)
composeHideMediaButton.isClickable = false
ContextCompat.getColor(this, R.color.compose_media_visible_button_disabled_blue)
ContextCompat.getColor(this, R.color.transparent_tusky_blue)
} else {
composeHideMediaButton.isClickable = true
@ -826,14 +823,14 @@ class ComposeActivity : BaseActivity(),
button.isEnabled = clickable
ThemeUtils.setDrawableTint(this, button.drawable,
if (colorActive) android.R.attr.textColorTertiary
else R.attr.image_button_disabled_tint)
else R.attr.textColorDisabled)
}
private fun enablePollButton(enable: Boolean) {
addPollTextActionTextView.isEnabled = enable
val textColor = ThemeUtils.getColor(this,
if (enable) android.R.attr.textColorTertiary
else R.attr.image_button_disabled_tint)
else R.attr.textColorDisabled)
addPollTextActionTextView.setTextColor(textColor)
addPollTextActionTextView.compoundDrawablesRelative[0].colorFilter = PorterDuffColorFilter(textColor, PorterDuff.Mode.SRC_IN)
}

View file

@ -66,7 +66,7 @@ public final class ProgressImageView extends AppCompatImageView {
markBgPaint.setStyle(Paint.Style.FILL);
markBgPaint.setColor(ContextCompat.getColor(getContext(),
R.color.description_marker_unselected));
R.color.tusky_grey_10));
captionDrawable = AppCompatResources.getDrawable(getContext(), R.drawable.spellcheck);
}
@ -82,7 +82,7 @@ public final class ProgressImageView extends AppCompatImageView {
public void setChecked(boolean checked) {
this.markBgPaint.setColor(ContextCompat.getColor(getContext(),
checked ? R.color.tusky_blue : R.color.description_marker_unselected));
checked ? R.color.tusky_blue : R.color.tusky_grey_10));
invalidate();
}

View file

@ -60,14 +60,11 @@ class ReportActivity : BottomSheetActivity(), HasAndroidInjector {
setSupportActionBar(toolbar)
val closeIcon = AppCompatResources.getDrawable(this, R.drawable.ic_close_24dp)
ThemeUtils.setDrawableTint(this, closeIcon!!, R.attr.compose_close_button_tint)
supportActionBar?.apply {
title = getString(R.string.report_username_format, viewModel.accountUserName)
setDisplayHomeAsUpEnabled(true)
setDisplayShowHomeEnabled(true)
setHomeAsUpIndicator(closeIcon)
setHomeAsUpIndicator(R.drawable.ic_close_24dp)
}
initViewPager()