diff --git a/presentation/src/main/java/com/moez/QKSMS/common/util/TextViewStyler.kt b/presentation/src/main/java/com/moez/QKSMS/common/util/TextViewStyler.kt index e934d750..c45542df 100644 --- a/presentation/src/main/java/com/moez/QKSMS/common/util/TextViewStyler.kt +++ b/presentation/src/main/java/com/moez/QKSMS/common/util/TextViewStyler.kt @@ -119,13 +119,12 @@ class TextViewStyler @Inject constructor( else -> return } - setTextColor(when (colorAttr) { - COLOR_THEME -> colors.theme().theme - COLOR_PRIMARY_ON_THEME -> colors.theme().textPrimary - COLOR_SECONDARY_ON_THEME -> colors.theme().textSecondary - COLOR_TERTIARY_ON_THEME -> colors.theme().textTertiary - else -> currentTextColor - }) + when (colorAttr) { + COLOR_THEME -> setTextColor(colors.theme().theme) + COLOR_PRIMARY_ON_THEME -> setTextColor(colors.theme().textPrimary) + COLOR_SECONDARY_ON_THEME -> setTextColor(colors.theme().textSecondary) + COLOR_TERTIARY_ON_THEME -> setTextColor(colors.theme().textTertiary) + } setTextSize(textView, textSizeAttr) } diff --git a/presentation/src/main/java/com/moez/QKSMS/common/widget/PreferenceView.kt b/presentation/src/main/java/com/moez/QKSMS/common/widget/PreferenceView.kt index 45fa352e..d26a0357 100644 --- a/presentation/src/main/java/com/moez/QKSMS/common/widget/PreferenceView.kt +++ b/presentation/src/main/java/com/moez/QKSMS/common/widget/PreferenceView.kt @@ -26,8 +26,6 @@ import android.widget.TextView import androidx.appcompat.widget.LinearLayoutCompat import com.moez.QKSMS.R import com.moez.QKSMS.common.util.extensions.resolveThemeAttribute -import com.moez.QKSMS.common.util.extensions.resolveThemeColor -import com.moez.QKSMS.common.util.extensions.setTint import com.moez.QKSMS.common.util.extensions.setVisible import com.moez.QKSMS.injection.appComponent import kotlinx.android.synthetic.main.preference_view.view.* @@ -73,9 +71,6 @@ class PreferenceView @JvmOverloads constructor( orientation = HORIZONTAL gravity = Gravity.CENTER_VERTICAL - val textSecondary = context.resolveThemeColor(android.R.attr.textColorSecondary) - icon.setTint(textSecondary) - context.obtainStyledAttributes(attrs, R.styleable.PreferenceView)?.run { title = getString(R.styleable.PreferenceView_title) summary = getString(R.styleable.PreferenceView_summary) diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/blocking/BlockingController.kt b/presentation/src/main/java/com/moez/QKSMS/feature/blocking/BlockingController.kt index fb0d46ba..1289b9c4 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/blocking/BlockingController.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/blocking/BlockingController.kt @@ -19,7 +19,6 @@ package com.moez.QKSMS.feature.blocking import android.view.View -import androidx.core.view.isVisible import com.bluelinelabs.conductor.RouterTransaction import com.jakewharton.rxbinding2.view.clicks import com.moez.QKSMS.R @@ -66,7 +65,7 @@ class BlockingController : QkController= 2) name.summary = state.name - notifications.setVisible(!state.blocked) + notifications.isEnabled = !state.blocked - themePrefs.setVisible(!state.blocked) + themePrefs.isEnabled = !state.blocked - archive.setVisible(!state.blocked) + archive.isEnabled = !state.blocked archive.title = activity?.getString(when (state.archived) { true -> R.string.info_unarchive false -> R.string.info_archive diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/notificationprefs/NotificationPrefsActivity.kt b/presentation/src/main/java/com/moez/QKSMS/feature/notificationprefs/NotificationPrefsActivity.kt index 7f2d794a..b998c1d9 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/notificationprefs/NotificationPrefsActivity.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/notificationprefs/NotificationPrefsActivity.kt @@ -55,7 +55,9 @@ class NotificationPrefsActivity : QkThemedActivity(), NotificationPrefsView { override val ringtoneSelectedIntent: Subject = PublishSubject.create() override val actionsSelectedIntent by lazy { actionsDialog.adapter.menuItemClicks } - private val viewModel by lazy { ViewModelProviders.of(this, viewModelFactory)[NotificationPrefsViewModel::class.java] } + private val viewModel by lazy { + ViewModelProviders.of(this, viewModelFactory)[NotificationPrefsViewModel::class.java] + } override fun onCreate(savedInstanceState: Bundle?) { AndroidInjection.inject(this) @@ -112,7 +114,8 @@ class NotificationPrefsActivity : QkThemedActivity(), NotificationPrefsView { qkreplyTitle.isVisible = state.threadId == 0L qkreply.checkbox.isChecked = state.qkReplyEnabled qkreply.isVisible = state.threadId == 0L - qkreplyTapDismiss.setVisible(state.threadId == 0L && state.qkReplyEnabled) + qkreplyTapDismiss.isVisible = state.threadId == 0L + qkreplyTapDismiss.isEnabled = state.qkReplyEnabled qkreplyTapDismiss.checkbox.isChecked = state.qkReplyTapDismiss } diff --git a/presentation/src/main/res/color-night/text_primary.xml b/presentation/src/main/res/color-night/text_primary.xml new file mode 100644 index 00000000..c97dc9b2 --- /dev/null +++ b/presentation/src/main/res/color-night/text_primary.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/presentation/src/main/res/color-night/text_secondary.xml b/presentation/src/main/res/color-night/text_secondary.xml new file mode 100644 index 00000000..653e10ea --- /dev/null +++ b/presentation/src/main/res/color-night/text_secondary.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/presentation/src/main/res/color-night/text_tertiary.xml b/presentation/src/main/res/color-night/text_tertiary.xml new file mode 100644 index 00000000..195ffca8 --- /dev/null +++ b/presentation/src/main/res/color-night/text_tertiary.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/presentation/src/main/res/color/text_primary.xml b/presentation/src/main/res/color/text_primary.xml new file mode 100644 index 00000000..2e8e5249 --- /dev/null +++ b/presentation/src/main/res/color/text_primary.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/presentation/src/main/res/color/text_secondary.xml b/presentation/src/main/res/color/text_secondary.xml new file mode 100644 index 00000000..8e32a5ff --- /dev/null +++ b/presentation/src/main/res/color/text_secondary.xml @@ -0,0 +1,23 @@ + + + + + + diff --git a/presentation/src/main/res/color/text_tertiary.xml b/presentation/src/main/res/color/text_tertiary.xml new file mode 100644 index 00000000..89d232e2 --- /dev/null +++ b/presentation/src/main/res/color/text_tertiary.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/presentation/src/main/res/layout/preference_view.xml b/presentation/src/main/res/layout/preference_view.xml index 09bef000..3782885d 100644 --- a/presentation/src/main/res/layout/preference_view.xml +++ b/presentation/src/main/res/layout/preference_view.xml @@ -31,12 +31,15 @@ android:layout_width="24dp" android:layout_height="24dp" android:layout_marginStart="24dp" + android:duplicateParentState="true" + android:tint="?android:attr/textColorSecondary" android:visibility="invisible" /> @@ -64,6 +69,7 @@ android:id="@+id/widgetFrame" android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_marginEnd="16dp" /> + android:layout_marginEnd="16dp" + android:duplicateParentState="true" /> \ No newline at end of file diff --git a/presentation/src/main/res/layout/settings_switch_widget.xml b/presentation/src/main/res/layout/settings_switch_widget.xml index f0a3d63f..4958dcdb 100644 --- a/presentation/src/main/res/layout/settings_switch_widget.xml +++ b/presentation/src/main/res/layout/settings_switch_widget.xml @@ -22,4 +22,5 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:clickable="false" /> + android:clickable="false" + android:duplicateParentState="true" /> diff --git a/presentation/src/main/res/values-night/themes.xml b/presentation/src/main/res/values-night/themes.xml index 28232b29..ed26b3c6 100644 --- a/presentation/src/main/res/values-night/themes.xml +++ b/presentation/src/main/res/values-night/themes.xml @@ -26,9 +26,9 @@ @color/backgroundDark @color/toolbarSearchBackgroundDark @color/statusBarDark - @color/textPrimaryDark - @color/textSecondaryDark - @color/textTertiaryDark + @color/text_primary + @color/text_secondary + @color/text_tertiary @color/backgroundDark true @style/PopupTheme @@ -45,9 +45,9 @@