1

I use a ViewPager and inside the first fragment of the ViewPager I have a another fragment that is parenting a sub fragment with ScrollView in it. to make it more visual:

┌------------┐
|   1        | 1 is the ViewPager fragment
| ┌---------┐|
| | 2       || 2 is the fragment inside ViewPager fragment
| |┌-------┐||
| ||3      ||| 3 is the sub fragment containing the ScrollView with EditText form
| ||form   |||
| ||here   |||
| ||       |||
| |└-------┘||
| └---------┘|
└------------┘

Issue is:

when I use adjustResize it allows me to scroll the fragment 3 ScrolView till end but when screen is too small, the ScrollView hides behind the SoftKeyboard and it does not push the parent fragments up to display fragment 3.

when I use adjustPan in small screens it pushes the the parent fragments up and allows me to see the 'fragment 3' but when I scroll, some of the ScrollView hides behind the soft keyboard.

I have done some reading in SO and android docs. they all point at using AdjustResize with ScrollView. but in my case i need to push the parent fragments up in small screens, otherwise the ScrollView in fragment3 will be covered by SoftKeyboard.

is it possible to do adjustPan in parent fragment and adjustResize for child fragment with scrollview at the same time ? if not is there any workarounds?

your helps are appreciated!

Poorya
  • 1,291
  • 6
  • 27
  • 57

1 Answers1

0

Test "stateHidden|adjustResize" for parent activity.For me, It was the only way to over come a situation like yours

Amir
  • 1,290
  • 1
  • 13
  • 20
  • as mentioned in the `OP` I have tried using adjustResize. but when the device has a small screen the `ScrollView` hides behind `softKeyboard` – Poorya Jul 26 '17 at 15:38
  • Yeah I noticed but I didn't get that you have used `"stateHidden|adjustResize"` as exactly as same and both together – Amir Jul 26 '17 at 15:51
  • yes I have. and they refer to two different states. my issue is the adjustResize is not effecting the two parent fragments. I need to use AdjustPan for parent fragments to move them up. but meanwhile i need AdjustResize for ScrollView. – Poorya Jul 26 '17 at 15:54
  • If you don't mind, please put the working alone part of your code so I can figure out how it could be fixed. – Amir Jul 27 '17 at 06:42
  • Adbi her is a link to my [Github Repo](https://github.com/pouriabagheri/ScrollViewAdjustViewPager) thanks for you kind attention – Poorya Jul 28 '17 at 13:32