mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-26 11:26:01 +03:00
Cleanup
This commit is contained in:
parent
edc6c3dd4f
commit
99423bacb2
5 changed files with 9 additions and 9 deletions
|
@ -16,6 +16,7 @@
|
|||
|
||||
package im.vector.riotx.core.extensions
|
||||
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.airbnb.epoxy.EpoxyController
|
||||
|
@ -25,11 +26,13 @@ import com.airbnb.epoxy.EpoxyController
|
|||
*/
|
||||
fun RecyclerView.configureWith(epoxyController: EpoxyController,
|
||||
itemAnimator: RecyclerView.ItemAnimator? = null,
|
||||
itemDecoration: RecyclerView.ItemDecoration? = null,
|
||||
showDivider: Boolean = false,
|
||||
hasFixedSize: Boolean = true) {
|
||||
layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||
itemAnimator?.let { this.itemAnimator = it }
|
||||
itemDecoration?.let { addItemDecoration(it) }
|
||||
if (showDivider) {
|
||||
addItemDecoration(DividerItemDecoration(context, DividerItemDecoration.VERTICAL))
|
||||
}
|
||||
setHasFixedSize(hasFixedSize)
|
||||
adapter = epoxyController.adapter
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ class ViewEditHistoryBottomSheet : VectorBaseBottomSheetDialogFragment() {
|
|||
super.onActivityCreated(savedInstanceState)
|
||||
recyclerView.configureWith(
|
||||
epoxyController,
|
||||
itemDecoration = DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL),
|
||||
showDivider = true,
|
||||
hasFixedSize = false)
|
||||
bottomSheetTitle.text = context?.getString(R.string.message_edits)
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ package im.vector.riotx.features.reactions
|
|||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import com.airbnb.mvrx.activityViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import im.vector.riotx.R
|
||||
|
@ -49,7 +48,7 @@ class EmojiSearchResultFragment @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
recyclerView.configureWith(epoxyController, itemDecoration = DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL))
|
||||
recyclerView.configureWith(epoxyController, showDivider = true)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
|
|
|
@ -18,7 +18,6 @@ package im.vector.riotx.features.settings.push
|
|||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import im.vector.riotx.R
|
||||
|
@ -46,7 +45,7 @@ class PushGatewaysFragment @Inject constructor(
|
|||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
recyclerView.configureWith(epoxyController, itemDecoration = DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL))
|
||||
recyclerView.configureWith(epoxyController, showDivider = true)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
|
|
|
@ -17,7 +17,6 @@ package im.vector.riotx.features.settings.push
|
|||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import com.airbnb.epoxy.TypedEpoxyController
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
|
@ -46,7 +45,7 @@ class PushRulesFragment : VectorBaseFragment() {
|
|||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
recyclerView.configureWith(epoxyController, itemDecoration = DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL))
|
||||
recyclerView.configureWith(epoxyController, showDivider = true)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
|
|
Loading…
Reference in a new issue