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