mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-23 06:07:16 +00:00
allow dialogs to be scrollable. Fixes #1264
This commit is contained in:
parent
975dfd7023
commit
8a1a55de39
2 changed files with 6 additions and 3 deletions
|
|
@ -57,6 +57,7 @@
|
|||
android:paddingStart="@dimen/alert_side_padding"
|
||||
android:paddingEnd="@dimen/alert_side_padding"
|
||||
android:textColor="?textColorSecondary"
|
||||
android:scrollbars = "vertical"
|
||||
style="@style/Body2"
|
||||
/>
|
||||
<androidx.core.widget.NestedScrollView
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.habitrpg.android.habitica.ui.views.dialogs
|
|||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.text.method.ScrollingMovementMethod
|
||||
import android.view.*
|
||||
import android.view.animation.AccelerateInterpolator
|
||||
import android.widget.*
|
||||
|
|
@ -61,7 +62,7 @@ open class HabiticaAlertDialog(context: Context) : AlertDialog(context, R.style.
|
|||
}
|
||||
|
||||
override fun setTitle(title: CharSequence?) {
|
||||
if (title != null) {
|
||||
if ((title?.length ?: 0) > 0) {
|
||||
titleTextView.visibility = View.VISIBLE
|
||||
} else {
|
||||
titleTextView.visibility = View.GONE
|
||||
|
|
@ -74,12 +75,13 @@ open class HabiticaAlertDialog(context: Context) : AlertDialog(context, R.style.
|
|||
}
|
||||
|
||||
override fun setMessage(message: CharSequence?) {
|
||||
if (message != null) {
|
||||
if ((message?.length ?: 0) > 0) {
|
||||
messageTextView.visibility = View.VISIBLE
|
||||
} else {
|
||||
messageTextView.visibility = View.GONE
|
||||
}
|
||||
messageTextView.text = message
|
||||
messageTextView.movementMethod = ScrollingMovementMethod()
|
||||
}
|
||||
|
||||
fun setMessage(messageId: Int) {
|
||||
|
|
@ -87,7 +89,7 @@ open class HabiticaAlertDialog(context: Context) : AlertDialog(context, R.style.
|
|||
}
|
||||
|
||||
fun setNotice(notice: CharSequence?) {
|
||||
if (notice != null) {
|
||||
if ((notice?.length ?: 0) > 0) {
|
||||
noticeTextView.visibility = View.VISIBLE
|
||||
} else {
|
||||
noticeTextView.visibility = View.GONE
|
||||
|
|
|
|||
Loading…
Reference in a new issue