Move toolbar from controller to activity

This commit is contained in:
Moez Bhatti
2018-07-30 23:25:32 -04:00
parent 75162c8114
commit 54facab486
9 changed files with 491 additions and 606 deletions
@@ -3,7 +3,6 @@ package com.moez.QKSMS.common.base
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.CallSuper
import androidx.annotation.LayoutRes
import androidx.annotation.StringRes
import androidx.appcompat.app.AppCompatActivity
@@ -32,13 +31,6 @@ abstract class QkController<ViewContract : QkViewContract<State>, State, Present
return inflater.inflate(layoutRes, container, false)
}
@CallSuper
override fun onAttach(view: View) {
super.onAttach(view)
appCompatActivity?.setSupportActionBar(view.toolbar)
setTitle(activity?.title)
}
fun setTitle(@StringRes titleId: Int) {
setTitle(activity?.getString(titleId))
}
@@ -8,7 +8,7 @@ import com.moez.QKSMS.common.base.QkController
import com.moez.QKSMS.common.widget.PreferenceView
import com.moez.QKSMS.injection.appComponent
import io.reactivex.Observable
import kotlinx.android.synthetic.main.about_activity.*
import kotlinx.android.synthetic.main.about_controller.*
import javax.inject.Inject
class AboutController : QkController<AboutView, Unit, AboutPresenter>(), AboutView {
@@ -17,7 +17,7 @@ class AboutController : QkController<AboutView, Unit, AboutPresenter>(), AboutVi
init {
appComponent.inject(this)
layoutRes = R.layout.about_activity
layoutRes = R.layout.about_controller
}
override fun onAttach(view: View) {
@@ -32,7 +32,7 @@ import com.moez.QKSMS.injection.appComponent
import io.reactivex.Observable
import io.reactivex.subjects.PublishSubject
import io.reactivex.subjects.Subject
import kotlinx.android.synthetic.main.theme_picker_activity.*
import kotlinx.android.synthetic.main.theme_picker_controller.*
import kotlinx.android.synthetic.main.theme_picker_hsv.*
import javax.inject.Inject
@@ -53,7 +53,7 @@ class ThemePickerController(val threadId: Long = 0L) : QkController<ThemePickerV
.build()
.inject(this)
layoutRes = R.layout.theme_picker_activity
layoutRes = R.layout.theme_picker_controller
}
override fun onAttach(view: View) {