Skip to content

Commit f3fdce9

Browse files
committed
Update
1 parent 4456853 commit f3fdce9

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

app/src/main/java/com/omarea/krscript/ui/DialogLogFragment.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,10 @@ class DialogLogFragment : DialogFragment() {
244244

245245
override fun updateLog(msg: SpannableString?) {
246246
val logView = logViewRef.get() ?: return
247-
val scrollView = logView.parent as? ScrollView ?: return
248247
msg?.let {
249248
logView.post {
250-
val isAtBottom = (logView.bottom - (scrollView.height + scrollView.scrollY)) <= 50
251249
logView.append(it)
252-
if (isAtBottom) {
253-
scrollView.fullScroll(ScrollView.FOCUS_DOWN)
254-
}
250+
(logView.parent as? ScrollView)?.fullScroll(ScrollView.FOCUS_DOWN)
255251
}
256252
}
257253
}

app/src/main/res/layout/kr_dialog_log.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
style="@style/dialogRoot"
4+
android:animateLayoutChanges="true"
45
android:clickable="true"
56
android:focusable="true">
67

0 commit comments

Comments
 (0)