Add email support option in hamburger menu

This commit is contained in:
Moez Bhatti
2018-01-12 14:03:04 -05:00
parent 4cfe674945
commit 649596fa0f
7 changed files with 72 additions and 21 deletions
@@ -72,7 +72,8 @@ class MainActivity : QkActivity<MainViewModel>(), MainView {
archived.clicks().map { DrawerItem.ARCHIVED },
scheduled.clicks().map { DrawerItem.SCHEDULED },
blocked.clicks().map { DrawerItem.BLOCKED },
settings.clicks().map { DrawerItem.SETTINGS }))
settings.clicks().map { DrawerItem.SETTINGS },
help.clicks().map { DrawerItem.HELP }))
}
override val conversationClickIntent by lazy { conversationsAdapter.clicks }
override val conversationLongClickIntent by lazy { conversationsAdapter.longClicks }
@@ -134,14 +135,17 @@ class MainActivity : QkActivity<MainViewModel>(), MainView {
}
}
// Set the theme color tint to the progressbar and FAB
disposables += colors.theme
.doOnNext { color -> syncingProgress.indeterminateTintList = ColorStateList.valueOf(color) }
.doOnNext { color -> compose.setBackgroundTint(color) }
.subscribe()
// Set the hamburger icon color
disposables += colors.textSecondary
.subscribe { color -> toggle.drawerArrowDrawable.color = color }
// Set the color for the drawer icons
disposables += Observables
.combineLatest(colors.theme, colors.textSecondary, { theme, textSecondary ->
ColorStateList(states, intArrayOf(theme, textSecondary))
@@ -151,8 +155,10 @@ class MainActivity : QkActivity<MainViewModel>(), MainView {
.doOnNext { tintList -> scheduledIcon.imageTintList = tintList }
.doOnNext { tintList -> blockedIcon.imageTintList = tintList }
.doOnNext { tintList -> settingsIcon.imageTintList = tintList }
.doOnNext { tintList -> helpIcon.imageTintList = tintList }
.subscribe()
// Set the background highlight for the drawer options
disposables += colors.separator
.doOnNext { color -> inbox.background = rowBackground(color) }
.doOnNext { color -> archived.background = rowBackground(color) }
@@ -18,9 +18,9 @@
*/
package presentation.feature.main
import presentation.common.base.QkView
import io.reactivex.Observable
import io.reactivex.subjects.Subject
import presentation.common.base.QkView
interface MainView : QkView<MainState> {
@@ -39,4 +39,4 @@ interface MainView : QkView<MainState> {
}
enum class DrawerItem { INBOX, ARCHIVED, SCHEDULED, BLOCKED, SETTINGS }
enum class DrawerItem { INBOX, ARCHIVED, SCHEDULED, BLOCKED, SETTINGS, HELP }
@@ -125,6 +125,7 @@ class MainViewModel : QkViewModel<MainView, MainState>(MainState()) {
intents += view.drawerItemIntent
.doOnNext { newState { it.copy(drawerOpen = false) } }
.doOnNext { if (it == DrawerItem.SETTINGS) navigator.showSettings() }
.doOnNext { if (it == DrawerItem.HELP) navigator.showSupport() }
.distinctUntilChanged()
.doOnNext {
when (it) {