emojicon icon indicating copy to clipboard operation
emojicon copied to clipboard

Get wrong size when Translucent Status Bar

Open rexi1r opened this issue 9 years ago • 5 comments

hi. when set status bar translucent the size of popup is wrong .how can i fix this issue?

rexi1r avatar Mar 28 '15 14:03 rexi1r

Did you check it? when translucent status bar in android L the size of popup view is bigger than keyboard height. when translucent status bar in android 4.4.2, when i click on EditText, emoji_btn Do not move to the top of keyboard. screenshot_2015-03-29-10-15-25

rexi1r avatar Mar 29 '15 05:03 rexi1r

I've solved the problem with the following change:

      if (!((Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) && (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP))) {
                    if (resourceId > 0) {
                        heightDifference -= mContext.getResources()
                                .getDimensionPixelSize(resourceId);
                    }
                }

rexi1r avatar Mar 29 '15 11:03 rexi1r

Yes you are right, for translucent status bar, its height should not be subtracted from the heightDifference. I'll add a flag for people using translucent status bar in their apps or if anyone could suggest any better solution for this and similar problems.

ankushsachdeva avatar Mar 29 '15 19:03 ankushsachdeva

the above change work, in both situation( with translucent status bar or without translucent )

rexi1r avatar Mar 31 '15 11:03 rexi1r

I just tried KitKat in an emulator, with a non-translucent status bar and the popup is of the right height without the above change to the code (so, with the status bar's height being subtracted).

cridus avatar Sep 12 '15 18:09 cridus