mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 01:15:54 +03:00
Set empty toolbar by default
This commit is contained in:
parent
fb44562824
commit
2ce15a1923
1 changed files with 13 additions and 5 deletions
|
@ -26,11 +26,10 @@ import com.airbnb.mvrx.fragmentViewModel
|
|||
import com.airbnb.mvrx.withState
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.extensions.cleanup
|
||||
import im.vector.app.core.extensions.configureWith
|
||||
import im.vector.app.core.platform.VectorBaseFragment
|
||||
import im.vector.app.databinding.FragmentRoomPollDetailBinding
|
||||
import im.vector.app.features.roomprofile.polls.RoomPollsType
|
||||
import im.vector.app.features.roomprofile.polls.RoomPollsViewModel
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import javax.inject.Inject
|
||||
|
||||
|
@ -53,6 +52,7 @@ class RoomPollDetailFragment : VectorBaseFragment<FragmentRoomPollDetailBinding>
|
|||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
setupToolbar()
|
||||
|
||||
views.pollDetailRecyclerView.configureWith(
|
||||
roomPollDetailController,
|
||||
|
@ -60,9 +60,17 @@ class RoomPollDetailFragment : VectorBaseFragment<FragmentRoomPollDetailBinding>
|
|||
)
|
||||
}
|
||||
|
||||
private fun setupToolbar(isEnded: Boolean) {
|
||||
val title = if (isEnded) getString(R.string.room_polls_ended)
|
||||
else getString(R.string.room_polls_active)
|
||||
override fun onDestroyView() {
|
||||
views.pollDetailRecyclerView.cleanup()
|
||||
super.onDestroyView()
|
||||
}
|
||||
|
||||
private fun setupToolbar(isEnded: Boolean? = null) {
|
||||
val title = when (isEnded) {
|
||||
true -> getString(R.string.room_polls_ended)
|
||||
false -> getString(R.string.room_polls_active)
|
||||
else -> ""
|
||||
}
|
||||
|
||||
setupToolbar(views.roomPollDetailToolbar)
|
||||
.setTitle(title)
|
||||
|
|
Loading…
Reference in a new issue