How to remove autoscroll, when I typing text in TextInputLayout and TextInputEditText

42 Views Asked by At

I tried to remove and request focus when only if I dont typing text - all don't work. How can I fix that?

TextInputLayout and TextInputEditText inserted in recyclerview

enter image description here

1

There are 1 best solutions below

0
Top4o On

I would suggest for example to do something like this:

...
// at the top of the class
boolean canScrowVertically = true;
...
...
// init recycler
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
... 
...
// Init linerLayout and override canScrollVertically method
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context) {
    @Override
    public boolean canScrollVertically() {
        return canScrowVertically;
    }
};
...
...
// Set the manager
recyclerView.setLayoutManager(layoutManager)
...

Then you can manipulate canScrowVertically to disable/enable the scrow.