From 0f96209eca81a07289cf06c16dce7be232b08de1 Mon Sep 17 00:00:00 2001 From: moezbhatti Date: Mon, 26 Aug 2019 02:19:24 +0100 Subject: [PATCH] Use theme colour for snackbar action --- .../com/moez/QKSMS/feature/compose/ComposeActivity.kt | 1 + .../java/com/moez/QKSMS/feature/main/MainActivity.kt | 11 +++++------ .../moez/QKSMS/feature/settings/SettingsController.kt | 1 + .../feature/themepicker/ThemePickerController.kt | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt index 9ef6f238..7957488e 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt @@ -313,6 +313,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView { override fun showQksmsPlusSnackbar(message: Int) { Snackbar.make(contentView, message, Snackbar.LENGTH_LONG).run { setAction(R.string.button_more) { viewQksmsPlusIntent.onNext(Unit) } + setActionTextColor(colors.theme().theme) show() } } diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/main/MainActivity.kt b/presentation/src/main/java/com/moez/QKSMS/feature/main/MainActivity.kt index e08bbbe0..d253d346 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/main/MainActivity.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/main/MainActivity.kt @@ -115,11 +115,6 @@ class MainActivity : QkThemedActivity(), MainView { private val itemTouchHelper by lazy { ItemTouchHelper(itemTouchCallback) } private val progressAnimator by lazy { ObjectAnimator.ofInt(syncingProgress, "progress", 0, 0) } private val changelog by lazy { ChangelogDialog(this) } - private val archiveSnackbar by lazy { - Snackbar.make(drawerLayout, R.string.toast_archived, Snackbar.LENGTH_LONG).apply { - setAction(R.string.button_undo) { undoArchiveIntent.onNext(Unit) } - } - } private val snackbar by lazy { findViewById(R.id.snackbar) } private val syncing by lazy { findViewById(R.id.syncing) } @@ -351,7 +346,11 @@ class MainActivity : QkThemedActivity(), MainView { } override fun showArchivedSnackbar() { - archiveSnackbar.show() + Snackbar.make(drawerLayout, R.string.toast_archived, Snackbar.LENGTH_LONG).apply { + setAction(R.string.button_undo) { undoArchiveIntent.onNext(Unit) } + setActionTextColor(colors.theme().theme) + show() + } } override fun onCreateOptionsMenu(menu: Menu?): Boolean { diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/settings/SettingsController.kt b/presentation/src/main/java/com/moez/QKSMS/feature/settings/SettingsController.kt index 8f8bd699..85327396 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/settings/SettingsController.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/settings/SettingsController.kt @@ -184,6 +184,7 @@ class SettingsController : QkController