Closed GeniusRUS closed 3 years ago
First of all, this will look a LOT better once I release the new update (which should be later this week):
toolbar.applyInsetter {
type(statusBars = true) {
padding(top = true)
}
}
nestedScroll.applyInsetter {
type(ime = true, systemBars = true) {
padding(bottom = true)
}
}
You can try the snapshots now.
As to the issue, does the EditText
need to be in the ScrollView
? If so, I'd add the ime + systemBars
padding to the LinearLayout
instead.
@chrisbanes thanks for the answer. I tried to set paddings for LinearLayout
, unfortunately, this did not lead to anything, I got absolutely the same behavior
I think that if NestedScrollView
does not change its external dimensions in the layout, then the content in it will always ignore any padding and focused view will be also ignored
I can also provide a minimal project in order to reproduce the problem
If you have a sample, I’ll try and take a look.
I don’t think this is anything to do with the library though, so I’ll close this.
Thanks for the help Here is a MVP to reproduce
Had a quick look at this. The issue is that the EditText
is in the ScrollView
. There's not a whole lot you can do here really as you need to also scroll the ScrollView
.
Thanks for your help! And last question: Is there any plans for some tools to make this case work?
No, not that I'm aware of.
@chrisbanes hi! A strange situation occurred while working with keyboard insets If you install paddings from the keyboard for
NestedScrollView
, the view in focus does not remain visible, hiding behind the keyboard How can you handle this scenario so that theEditText
respects the keyboard that appears? Only by setting margins forNestedScrollView
?Activity and layout code is below
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/root_view" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity">
https://user-images.githubusercontent.com/24453308/107341477-1a2f9580-6ad0-11eb-82ab-50a80642f30d.mp4