mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 18:30:20 +01:00
Update actionbar strings to allow for pluralization.
This commit is contained in:
@@ -8,6 +8,6 @@ import androidx.annotation.StringRes
|
||||
*/
|
||||
data class ActionItem(
|
||||
@DrawableRes val iconRes: Int,
|
||||
@StringRes val titleRes: Int,
|
||||
val title: CharSequence,
|
||||
val action: Runnable
|
||||
)
|
||||
|
||||
@@ -69,7 +69,7 @@ class SignalBottomActionBar(context: Context, attributeSet: AttributeSet) : Line
|
||||
view,
|
||||
ActionItem(
|
||||
iconRes = R.drawable.ic_more_horiz_24,
|
||||
titleRes = R.string.SignalBottomActionBar_more,
|
||||
title = context.getString(R.string.SignalBottomActionBar_more),
|
||||
action = {
|
||||
SignalContextMenu.Builder(view, parent as ViewGroup)
|
||||
.preferredHorizontalPosition(SignalContextMenu.HorizontalPosition.END)
|
||||
@@ -86,7 +86,7 @@ class SignalBottomActionBar(context: Context, attributeSet: AttributeSet) : Line
|
||||
val title: TextView = view.findViewById(R.id.signal_bottom_action_bar_item_title)
|
||||
|
||||
icon.setImageResource(item.iconRes)
|
||||
title.setText(item.titleRes)
|
||||
title.text = item.title
|
||||
view.setOnClickListener { item.action.run() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ class SignalContextMenu private constructor(
|
||||
|
||||
override fun bind(model: DisplayItem) {
|
||||
icon.setImageResource(model.item.iconRes)
|
||||
title.setText(model.item.titleRes)
|
||||
title.text = model.item.title
|
||||
itemView.setOnClickListener {
|
||||
model.item.action.run()
|
||||
dismiss()
|
||||
|
||||
Reference in New Issue
Block a user