Fixed delete swipe action not being translated

This commit is contained in:
Sylvain Berfini 2021-04-20 13:49:23 +02:00
parent 299fa9c9b9
commit bef8884f11
3 changed files with 11 additions and 3 deletions

View file

@ -98,7 +98,11 @@ class MasterChatRoomsFragment : MasterFragment<ChatRoomMasterFragmentBinding, Ch
val swipeConfiguration = RecyclerViewSwipeConfiguration() val swipeConfiguration = RecyclerViewSwipeConfiguration()
val white = ContextCompat.getColor(requireContext(), R.color.white_color) val white = ContextCompat.getColor(requireContext(), R.color.white_color)
swipeConfiguration.rightToLeftAction = RecyclerViewSwipeConfiguration.Action("Delete", white, ContextCompat.getColor(requireContext(), R.color.red_color)) swipeConfiguration.rightToLeftAction = RecyclerViewSwipeConfiguration.Action(
requireContext().getString(R.string.dialog_delete),
white,
ContextCompat.getColor(requireContext(), R.color.red_color)
)
val swipeListener = object : RecyclerViewSwipeListener { val swipeListener = object : RecyclerViewSwipeListener {
override fun onLeftToRightSwipe(viewHolder: RecyclerView.ViewHolder) {} override fun onLeftToRightSwipe(viewHolder: RecyclerView.ViewHolder) {}

View file

@ -93,7 +93,7 @@ class MasterContactsFragment : MasterFragment<ContactMasterFragmentBinding, Cont
val white = ContextCompat.getColor(requireContext(), R.color.white_color) val white = ContextCompat.getColor(requireContext(), R.color.white_color)
swipeConfiguration.rightToLeftAction = RecyclerViewSwipeConfiguration.Action( swipeConfiguration.rightToLeftAction = RecyclerViewSwipeConfiguration.Action(
"Delete", requireContext().getString(R.string.dialog_delete),
white, white,
ContextCompat.getColor(requireContext(), R.color.red_color) ContextCompat.getColor(requireContext(), R.color.red_color)
) )

View file

@ -93,7 +93,11 @@ class MasterCallLogsFragment : MasterFragment<HistoryMasterFragmentBinding, Call
val swipeConfiguration = RecyclerViewSwipeConfiguration() val swipeConfiguration = RecyclerViewSwipeConfiguration()
val white = ContextCompat.getColor(requireContext(), R.color.white_color) val white = ContextCompat.getColor(requireContext(), R.color.white_color)
swipeConfiguration.rightToLeftAction = RecyclerViewSwipeConfiguration.Action("Delete", white, ContextCompat.getColor(requireContext(), R.color.red_color)) swipeConfiguration.rightToLeftAction = RecyclerViewSwipeConfiguration.Action(
requireContext().getString(R.string.dialog_delete),
white,
ContextCompat.getColor(requireContext(), R.color.red_color)
)
val swipeListener = object : RecyclerViewSwipeListener { val swipeListener = object : RecyclerViewSwipeListener {
override fun onLeftToRightSwipe(viewHolder: RecyclerView.ViewHolder) {} override fun onLeftToRightSwipe(viewHolder: RecyclerView.ViewHolder) {}