Skip to content
Snippets Groups Projects
Unverified Commit 47f78fb3 authored by Kolya Opahle's avatar Kolya Opahle Committed by GitHub
Browse files

Disallow scrolling tan entry text view (closes #546) (#588)


* Implemented a UnscrollableEditText which resets selection to text end on change

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Added import for AppCompatEditText
parent 08cd161c
No related branches found
No related tags found
No related merge requests found
package de.rki.coronawarnapp.ui.view
import android.content.Context
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatEditText
class UnscrollableEditText(context: Context, attributeSet: AttributeSet) :
AppCompatEditText(context, attributeSet) {
override fun onSelectionChanged(selStart: Int, selEnd: Int) {
super.onSelectionChanged(selStart, selEnd)
text?.length?.let { setSelection(it) }
}
}
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android">
<EditText <de.rki.coronawarnapp.ui.view.UnscrollableEditText
android:id="@+id/tan_input_edittext" android:id="@+id/tan_input_edittext"
style="@style/tanInputEdittext" /> style="@style/tanInputEdittext" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment