Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with translucent status bar Activities. #12

Open
iamBedant opened this issue Oct 15, 2019 · 9 comments
Open

Does not work with translucent status bar Activities. #12

iamBedant opened this issue Oct 15, 2019 · 9 comments
Labels
help wanted Extra attention is needed

Comments

@iamBedant
Copy link

If you add <item name="android:windowTranslucentStatus">true</item> to your activity theme, the animation does not work. Reason is FrameLayout(android.R.id.content) does not get resized in case of such activities.
Screenshot 2019-10-15 at 12 35 29 PM

@saket
Copy link
Owner

saket commented Oct 16, 2019

Were you able to check if any other ViewGroup gets resized? Afaik fullscreen activities aren't resized, but this sounds different

@iamBedant
Copy link
Author

Nope. none of the viewgroup gets resized.

@saket
Copy link
Owner

saket commented Oct 17, 2019

Does setting android:fitsSystemWindows="true" on the root ViewGroup in the layout change anything?

@iamBedant
Copy link
Author

Nope. The above screenshot is with android:fitsSystemWindows="true" only. Without it, the EditText will not even move up. It will be covered by the soft keyboard.

@saket
Copy link
Owner

saket commented Oct 18, 2019

Ah okay. I'm afraid I don't have any answers for this ¯\(ツ)

@saket saket added the help wanted Extra attention is needed label Oct 18, 2019
@fic212
Copy link

fic212 commented Apr 14, 2020

Hi. It seems that, when using "android:windowTranslucentStatus" in theme, android does not resize any views, but adds bottom padding to a root view of your activity (not content view, but root view). Don't know why, it doesn't seems like right thing to do, but they did it that way.

I still manage to detect keyboard change and animate it by animating bottom margin to the opposite direction of bottom padding, but it seams to hacky so I would not recommend it.

EDIT: Actually, bottom padding not necessary applied on root view, but on a view that has fitsSystemWindows properties set on true.

@saket
Copy link
Owner

saket commented Apr 14, 2020

Yea this whole implementation was a giant hack anyway. Hopefully we won't have to do any of this once WindowInsetsController gets backported as part of androidx.

@kkgosu
Copy link

kkgosu commented Apr 25, 2021

I've faced problem when resizing don't work with decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN. So this article helped me to solve the problem https://medium.com/@sandeeptengale/problem-solved-3-android-full-screen-view-translucent-scrollview-adjustresize-keyboard-b0547c7ced32

My commit with fix

@po1xiao
Copy link

po1xiao commented Jan 8, 2022

I got an idea form drakeet, you can see if it helps.

set the target activity's windowSoftInputMode as adjustNothing, then add an invisible window on the top of the activty, and set the window's windowSoftInputMode as adjustResize, when the keyboard visibility changes the window size will change too, so we can know the keyboard show or hide according to the window's size change, then wo can tell activity to do the size changing animation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants