From 3bd86dc17c532d5bdac8368df30b387a842c13e1 Mon Sep 17 00:00:00 2001 From: usg-ishimura Date: Sun, 16 Apr 2023 23:02:38 +0200 Subject: [PATCH] add scroll fix --- .../main/java/com/usgishimura/ssh/views/AliasActivity.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/usgishimura/ssh/views/AliasActivity.kt b/app/src/main/java/com/usgishimura/ssh/views/AliasActivity.kt index 8569741..f5d3890 100644 --- a/app/src/main/java/com/usgishimura/ssh/views/AliasActivity.kt +++ b/app/src/main/java/com/usgishimura/ssh/views/AliasActivity.kt @@ -5,6 +5,7 @@ import android.os.Bundle import android.os.Environment import android.util.Log import android.view.ContextThemeWrapper +import android.view.View import android.widget.ImageView import android.widget.LinearLayout import android.widget.ScrollView @@ -59,6 +60,10 @@ class AliasActivity : AppCompatActivity() { plus.setOnClickListener { addJustOneElemProgrammatically(lunghezzaLista) + var aliasScrollView: ScrollView = findViewById(R.id.aliasscrollview) + aliasScrollView.post { + aliasScrollView.fullScroll(View.FOCUS_DOWN) + } lunghezzaLista += 2 } } @@ -146,9 +151,6 @@ class AliasActivity : AppCompatActivity() { ll.addView(tilVoicealias) ll.addView(imgv) ll.addView(tilShellcommand) - var aliasScrollView: ScrollView = findViewById(R.id.aliasscrollview) - aliasScrollView.post(java.lang.Runnable { aliasScrollView.fullScroll(ScrollView.FOCUS_DOWN) }) - } fun setMultipleElemsText(lunghezzaLista: Int, fromJSON: ArrayList){ for (i in 1 until lunghezzaLista + 1) {