mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Move toolbar from controller to activity
This commit is contained in:
@@ -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) {
|
||||
|
||||
+2
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user