0

I have the following problem, and I cannot figure out how to eve try solving it (or whether there is a way):

My problem

I have SrollView, containing to EditText input fields. One is a single line, below is a multiline. Everything's fine and works as expected, up until I put too much stuff into the multiline EditText. When I fast scroll the view, the scrolling skips and stutters, very obviously, the whole effect is rather disturbing. tried on a Galaxy S3 with a custom AOSP ROM, and Note 4 with official 5.1.1, no difference at all.

I would expect a very heavy EditText makes it difficult to smoothly redraw on a fling, but this starts happening with relatively short text (approx 4-5 screen-pages long).

Edit: This also seems to happen on a simple scroll, when I do as much as touch it and move it a few lines (scrolling is not near to being smooth, that is)

The setup

I have reduced the widgets to the bare minimum, even removed padding, only the problem does not improve. From the Java code I also removed anything (any styling, or typeface, anything that affects the widgets at all), still no improvement.

If this is of any significance, the ScrollView in question is inside a fragment, that is one of two pages of a ViewPager. There is nothing else on this fragment ATM.

Here's the XML (as you will see, it's as base as possible):

 <ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:singleLine="true"/>

        <EditText
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:isScrollContainer="false"
            android:inputType="textMultiLine"/>

    </LinearLayout>

</ScrollView>

What I tried

Any advice I found regards only ListViews, and some attributes like android:smoothScrollbar, which have no effect here (I tried them all).

For the record, I did try out of frustration all of the below ( I know most of these has not much to do with ScrollViews, but I'm becoming hopeless here):

android:hardwareAccelerated="true"
android:fastScrollEnabled="true" 
android:scrollingCache="true" 
android:smoothScrollbar="true"

and also tried setting from the Java code things like

.setSmoothScrollingEnabled(true);
.fling(3500);

still no luck.

Question recap

Is there any way to make a simple widget like this scroll smoothly at all?

Thanks for your time if you've read through and even more if you answer. :)

Attila Orosz
  • 275
  • 3
  • 13
  • http://stackoverflow.com/questions/23319438/android-make-multiline-edittext-scrollable-disable-in-vertical-scroll-view try this solution – mudit_sen Apr 18 '16 at 10:22
  • Thanks, I've tried making the `EditText` scrollable, but that was not much of an improvement. Plus I need to keep the `EditText` editable, *and* I need to scroll the whole lot (there are two `EditText`s, and the top one should scroll up and disappear as well, while scrolling the whole). I did in fact think about doing this like a workaround (make the top `EditText` go up, when bottom one is scrolled, and set smooth scrolling in `EditText` itself, but that feels like reinventing the wheel. This is what wrapping it all into a `ScrollView` should achieve, so I'd rather try and make that work . – Attila Orosz Apr 18 '16 at 10:30

0 Answers0