mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 16:33:39 +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 }
|
||||
val header = view.findViewById<ViewGroup>(R.id.header_container)
|
||||
view.findViewById<TextView>(R.id.message).text = message
|
||||
drawables.forEach {
|
||||
|
||||
fun addIcon(id: Int) {
|
||||
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)
|
||||
}.also(header::addView)
|
||||
}
|
||||
if (drawables.isNotEmpty()) {
|
||||
|
||||
fun addPlus() {
|
||||
TextView(context).apply {
|
||||
text = "+"
|
||||
setTextSize(TypedValue.COMPLEX_UNIT_SP, 40f)
|
||||
@ -45,6 +47,12 @@ object RationaleDialog {
|
||||
}.also(header::addView)
|
||||
}
|
||||
|
||||
drawables.dropLast(1).forEach {
|
||||
addIcon(it)
|
||||
addPlus()
|
||||
}
|
||||
drawables.lastOrNull()?.let(::addIcon)
|
||||
|
||||
return context.showSessionDialog {
|
||||
view(view)
|
||||
button(R.string.Permissions_continue) { onPositive.run() }
|
||||
|
Loading…
x
Reference in New Issue
Block a user