forked from github/szkolny
[Changelog] Fix changelog dialog appearance on Android N+.
This commit is contained in:
parent
894135104b
commit
0eb8366027
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
package pl.szczodrzynski.edziennik.ui.dialogs.changelog
|
package pl.szczodrzynski.edziennik.ui.dialogs.changelog
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
import android.text.Html
|
import android.text.Html
|
||||||
import android.widget.ScrollView
|
import android.widget.ScrollView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
@ -44,8 +45,13 @@ class ChangelogDialog(
|
|||||||
|
|
||||||
val text = app.assets.open("pl-changelog.html").bufferedReader().use {
|
val text = app.assets.open("pl-changelog.html").bufferedReader().use {
|
||||||
it.readText()
|
it.readText()
|
||||||
}.replace("<li>", "<br><li> - ")
|
}
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
textView.text = Html.fromHtml(text)
|
textView.text = Html.fromHtml(text)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
textView.text = Html.fromHtml(text.replace("<li>", "<br><li> - "))
|
||||||
|
}
|
||||||
|
|
||||||
val scrollView = ScrollView(activity)
|
val scrollView = ScrollView(activity)
|
||||||
scrollView.addView(textView)
|
scrollView.addView(textView)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user