Split long lines

This commit is contained in:
Benoit Marty 2019-11-05 18:47:09 +01:00
parent b6bb714264
commit d3d7f7cc61
2 changed files with 70 additions and 24 deletions

View file

@ -781,7 +781,9 @@ class RoomDetailFragment @Inject constructor(
.setTitle(R.string.content_reported_as_spam_title)
.setMessage(R.string.content_reported_as_spam_content)
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.block_user) { _, _ -> roomDetailViewModel.process(RoomDetailActions.IgnoreUser(data.senderId)) }
.setNegativeButton(R.string.block_user) { _, _ ->
roomDetailViewModel.process(RoomDetailActions.IgnoreUser(data.senderId))
}
.show()
.withColoredButton(DialogInterface.BUTTON_NEGATIVE)
}
@ -790,7 +792,9 @@ class RoomDetailFragment @Inject constructor(
.setTitle(R.string.content_reported_as_inappropriate_title)
.setMessage(R.string.content_reported_as_inappropriate_content)
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.block_user) { _, _ -> roomDetailViewModel.process(RoomDetailActions.IgnoreUser(data.senderId)) }
.setNegativeButton(R.string.block_user) { _, _ ->
roomDetailViewModel.process(RoomDetailActions.IgnoreUser(data.senderId))
}
.show()
.withColoredButton(DialogInterface.BUTTON_NEGATIVE)
}
@ -799,7 +803,9 @@ class RoomDetailFragment @Inject constructor(
.setTitle(R.string.content_reported_title)
.setMessage(R.string.content_reported_content)
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.block_user) { _, _ -> roomDetailViewModel.process(RoomDetailActions.IgnoreUser(data.senderId)) }
.setNegativeButton(R.string.block_user) { _, _ ->
roomDetailViewModel.process(RoomDetailActions.IgnoreUser(data.senderId))
}
.show()
.withColoredButton(DialogInterface.BUTTON_NEGATIVE)
}
@ -1124,10 +1130,12 @@ class RoomDetailFragment @Inject constructor(
roomDetailViewModel.process(RoomDetailActions.RemoveFailedEcho(action.eventId))
}
is SimpleAction.ReportContentSpam -> {
roomDetailViewModel.process(RoomDetailActions.ReportContent(action.eventId, action.senderId, "This message is spam", spam = true))
roomDetailViewModel.process(RoomDetailActions.ReportContent(
action.eventId, action.senderId, "This message is spam", spam = true))
}
is SimpleAction.ReportContentInappropriate -> {
roomDetailViewModel.process(RoomDetailActions.ReportContent(action.eventId, action.senderId, "This message is inappropriate", inappropriate = true))
roomDetailViewModel.process(RoomDetailActions.ReportContent(
action.eventId, action.senderId, "This message is inappropriate", inappropriate = true))
}
is SimpleAction.ReportContentCustom -> {
promptReasonToReportContent(action)

View file

@ -22,25 +22,63 @@ import im.vector.riotx.R
import im.vector.riotx.features.home.room.detail.timeline.item.MessageInformationData
sealed class SimpleAction(@StringRes val titleRes: Int, @DrawableRes val iconResId: Int) {
data class AddReaction(val eventId: String) : SimpleAction(R.string.message_add_reaction, R.drawable.ic_add_reaction)
data class Copy(val content: String) : SimpleAction(R.string.copy, R.drawable.ic_copy)
data class Edit(val eventId: String) : SimpleAction(R.string.edit, R.drawable.ic_edit)
data class Quote(val eventId: String) : SimpleAction(R.string.quote, R.drawable.ic_quote)
data class Reply(val eventId: String) : SimpleAction(R.string.reply, R.drawable.ic_reply)
data class Share(val imageUrl: String) : SimpleAction(R.string.share, R.drawable.ic_share)
data class Resend(val eventId: String) : SimpleAction(R.string.global_retry, R.drawable.ic_refresh_cw)
data class Remove(val eventId: String) : SimpleAction(R.string.remove, R.drawable.ic_trash)
data class Delete(val eventId: String) : SimpleAction(R.string.delete, R.drawable.ic_delete)
data class Cancel(val eventId: String) : SimpleAction(R.string.cancel, R.drawable.ic_close_round)
data class ViewSource(val content: String) : SimpleAction(R.string.view_source, R.drawable.ic_view_source)
data class ViewDecryptedSource(val content: String) : SimpleAction(R.string.view_decrypted_source, R.drawable.ic_view_source)
data class CopyPermalink(val eventId: String) : SimpleAction(R.string.permalink, R.drawable.ic_permalink)
data class ReportContent(val eventId: String, val senderId: String?) : SimpleAction(R.string.report_content, R.drawable.ic_flag)
data class ReportContentSpam(val eventId: String, val senderId: String?) : SimpleAction(R.string.report_content_spam, R.drawable.ic_report_spam)
data class ReportContentInappropriate(val eventId: String, val senderId: String?) : SimpleAction(R.string.report_content_inappropriate, R.drawable.ic_report_inappropriate)
data class ReportContentCustom(val eventId: String, val senderId: String?) : SimpleAction(R.string.report_content_custom, R.drawable.ic_report_custom)
data class QuickReact(val eventId: String, val clickedOn: String, val add: Boolean) : SimpleAction(0, 0)
data class ViewReactions(val messageInformationData: MessageInformationData) : SimpleAction(R.string.message_view_reaction, R.drawable.ic_view_reactions)
data class AddReaction(val eventId: String) :
SimpleAction(R.string.message_add_reaction, R.drawable.ic_add_reaction)
data class Copy(val content: String) :
SimpleAction(R.string.copy, R.drawable.ic_copy)
data class Edit(val eventId: String) :
SimpleAction(R.string.edit, R.drawable.ic_edit)
data class Quote(val eventId: String) :
SimpleAction(R.string.quote, R.drawable.ic_quote)
data class Reply(val eventId: String) :
SimpleAction(R.string.reply, R.drawable.ic_reply)
data class Share(val imageUrl: String) :
SimpleAction(R.string.share, R.drawable.ic_share)
data class Resend(val eventId: String) :
SimpleAction(R.string.global_retry, R.drawable.ic_refresh_cw)
data class Remove(val eventId: String) :
SimpleAction(R.string.remove, R.drawable.ic_trash)
data class Delete(val eventId: String) :
SimpleAction(R.string.delete, R.drawable.ic_delete)
data class Cancel(val eventId: String) :
SimpleAction(R.string.cancel, R.drawable.ic_close_round)
data class ViewSource(val content: String) :
SimpleAction(R.string.view_source, R.drawable.ic_view_source)
data class ViewDecryptedSource(val content: String) :
SimpleAction(R.string.view_decrypted_source, R.drawable.ic_view_source)
data class CopyPermalink(val eventId: String) :
SimpleAction(R.string.permalink, R.drawable.ic_permalink)
data class ReportContent(val eventId: String, val senderId: String?) :
SimpleAction(R.string.report_content, R.drawable.ic_flag)
data class ReportContentSpam(val eventId: String, val senderId: String?) :
SimpleAction(R.string.report_content_spam, R.drawable.ic_report_spam)
data class ReportContentInappropriate(val eventId: String, val senderId: String?) :
SimpleAction(R.string.report_content_inappropriate, R.drawable.ic_report_inappropriate)
data class ReportContentCustom(val eventId: String, val senderId: String?) :
SimpleAction(R.string.report_content_custom, R.drawable.ic_report_custom)
data class QuickReact(val eventId: String, val clickedOn: String, val add: Boolean) :
SimpleAction(0, 0)
data class ViewReactions(val messageInformationData: MessageInformationData) :
SimpleAction(R.string.message_view_reaction, R.drawable.ic_view_reactions)
data class ViewEditHistory(val messageInformationData: MessageInformationData) :
SimpleAction(R.string.message_view_edit_history, R.drawable.ic_view_edit_history)
}