Skip to content

Commit

Permalink
disable focus move
Browse files Browse the repository at this point in the history
  • Loading branch information
usg-ishimura committed Apr 17, 2023
1 parent 3bd86dc commit c80e4ad
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "com.usgishimura.ssh"
minSdkVersion 21
targetSdkVersion 31
versionCode 12
versionName "1.2.7"
versionCode 13
versionName "1.2.8"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.usgishimura.ssh.utils
import android.content.Context
import android.graphics.Rect
import android.util.AttributeSet
import android.view.View
import android.widget.ScrollView


class NonFocusingScrollView : ScrollView {
constructor(context: Context?) : super(context) {}
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {}
constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(
context,
attrs,
defStyle
) {
}

override fun getFocusables(direction: Int): ArrayList<View?>? {
return ArrayList<View?>()
}
override fun onRequestFocusInDescendants(
direction: Int,
previouslyFocusedRect: Rect?
): Boolean {
return true
}
}
7 changes: 7 additions & 0 deletions app/src/main/java/com/usgishimura/ssh/views/AliasActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ class AliasActivity : AppCompatActivity() {
aliasScrollView.post {
aliasScrollView.fullScroll(View.FOCUS_DOWN)
}
/*val lastvoicealias = lunghezzaLista + 1
val resIDLVA = resources.getIdentifier(
"$lastvoicealias",
"id", packageName
)
val tietLVA: TextInputEditText = findViewById(resIDLVA)
tietLVA.requestFocus()*/
lunghezzaLista += 2
}
}
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/res/layout/activity_alias.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingTop="16dp">
<ScrollView
android:paddingTop="16dp"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".views.AliasActivity">
<com.usgishimura.ssh.utils.NonFocusingScrollView
android:id="@+id/aliasscrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content">
Expand Down Expand Up @@ -117,8 +119,7 @@
android:layout_height="1dp"
android:background="?attr/colorControlNormal"/>-->
</LinearLayout>
</ScrollView>

</com.usgishimura.ssh.utils.NonFocusingScrollView>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/addalias"
android:layout_width="wrap_content"
Expand Down

0 comments on commit c80e4ad

Please sign in to comment.