My EditText can have sometimes very large text (>1000 lines) and I want to be able to quickly reach the start or the end so I thought fast scroll was the solution, however it is not available for EditText, nor ScrollView, only for ListView. I found some editing apps that do have the fast scroll bar in their EditText. How did they do it? Setting smoothScrollEnabled on parent ScrollView doesn't work
Fast scroll in an EditText
1.1k views Asked by Nicolas At
2
There are 2 answers
0
On
<ScrollView
android:id="@+id/scrollViewEditText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginTop="60dp"
android:layout_marginBottom="60dp"
android:fillViewport="true"
android:scrollbarThumbHorizontal="@null"
android:scrollbarThumbVertical="@null"
android:visibility="visible">
<EditText
android:id="@+id/etBook"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp"
android:background="@null"
android:fastScrollEnabled="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:fontFamily="@font/futurabook"
android:gravity="top"
android:hint="Tap to start writing ...."
android:importantForAutofill="no"
android:inputType="textMultiLine"
android:lineSpacingExtra="0sp"
android:minHeight="48dp"
android:textColor="@color/colorSecondaryVariant"
android:textSize="17sp"
tools:ignore="SpeakableTextPresentCheck" />
</ScrollView>
By quoting this,
You can use a
ScrollViewand place yourEditTextinside it and mention the position of it that you need fast/smooth scrolling.