mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-30 05:30:47 +00:00
Fix + button in rationale dialog
This commit is contained in:
parent
b46b52ace4
commit
4ee8dc712e
@ -28,13 +28,15 @@ object RationaleDialog {
|
|||||||
.apply { clipToOutline = true }
|
.apply { clipToOutline = true }
|
||||||
val header = view.findViewById<ViewGroup>(R.id.header_container)
|
val header = view.findViewById<ViewGroup>(R.id.header_container)
|
||||||
view.findViewById<TextView>(R.id.message).text = message
|
view.findViewById<TextView>(R.id.message).text = message
|
||||||
drawables.forEach {
|
|
||||||
|
fun addIcon(id: Int) {
|
||||||
ImageView(context).apply {
|
ImageView(context).apply {
|
||||||
setImageDrawable(ResourcesCompat.getDrawable(context.resources, it, context.theme))
|
setImageDrawable(ResourcesCompat.getDrawable(context.resources, id, context.theme))
|
||||||
layoutParams = LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
|
layoutParams = LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
|
||||||
}.also(header::addView)
|
}.also(header::addView)
|
||||||
}
|
}
|
||||||
if (drawables.isNotEmpty()) {
|
|
||||||
|
fun addPlus() {
|
||||||
TextView(context).apply {
|
TextView(context).apply {
|
||||||
text = "+"
|
text = "+"
|
||||||
setTextSize(TypedValue.COMPLEX_UNIT_SP, 40f)
|
setTextSize(TypedValue.COMPLEX_UNIT_SP, 40f)
|
||||||
@ -45,6 +47,12 @@ object RationaleDialog {
|
|||||||
}.also(header::addView)
|
}.also(header::addView)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drawables.dropLast(1).forEach {
|
||||||
|
addIcon(it)
|
||||||
|
addPlus()
|
||||||
|
}
|
||||||
|
drawables.lastOrNull()?.let(::addIcon)
|
||||||
|
|
||||||
return context.showSessionDialog {
|
return context.showSessionDialog {
|
||||||
view(view)
|
view(view)
|
||||||
button(R.string.Permissions_continue) { onPositive.run() }
|
button(R.string.Permissions_continue) { onPositive.run() }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user