Migrate ConversationInfo to Controller

This commit is contained in:
Moez Bhatti
2018-07-31 02:36:32 -04:00
parent e0e50c98f3
commit ae2246c43d
16 changed files with 382 additions and 355 deletions
@@ -21,6 +21,9 @@ abstract class QkController<ViewContract : QkViewContract<State>, State, Present
private val appCompatActivity: AppCompatActivity?
get() = activity as? AppCompatActivity
protected val themedActivity: QkThemedActivity?
get() = activity as? QkThemedActivity
override var containerView: View? = null
@LayoutRes
@@ -53,12 +53,12 @@ abstract class QkThemedActivity : QkActivity() {
* In case the activity should be themed for a specific conversation, the selected conversation
* can be changed by pushing the threadId to this subject
*/
protected val threadId: Subject<Long> = BehaviorSubject.createDefault(0)
val threadId: Subject<Long> = BehaviorSubject.createDefault(0)
/**
* Switch the theme if the threadId changes
*/
protected val theme = threadId
val theme = threadId
.distinctUntilChanged()
.switchMap { threadId -> colors.themeObservable(threadId) }