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:
parent
29ef92edd3
commit
8767d2ed3d
122 changed files with 330 additions and 724 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue