Use theme colour for snackbar action

This commit is contained in:
moezbhatti
2019-08-26 02:19:24 +01:00
parent a16c48dc3b
commit 0f96209eca
4 changed files with 8 additions and 6 deletions
@@ -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()
}
}
@@ -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<View>(R.id.snackbar) }
private val syncing by lazy { findViewById<View>(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 {
@@ -184,6 +184,7 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
view?.run {
Snackbar.make(contentView, R.string.toast_qksms_plus, Snackbar.LENGTH_LONG).run {
setAction(R.string.button_more) { viewQksmsPlusSubject.onNext(Unit) }
setActionTextColor(colors.theme().theme)
show()
}
}
@@ -91,6 +91,7 @@ class ThemePickerController(val threadId: Long = 0L) : QkController<ThemePickerV
override fun showQksmsPlusSnackbar() {
Snackbar.make(contentView, R.string.toast_qksms_plus, Snackbar.LENGTH_LONG).run {
setAction(R.string.button_more) { viewQksmsPlusSubject.onNext(Unit) }
setActionTextColor(colors.theme().theme)
show()
}
}