ankushsachdeva / emojicon

Android library to show emojicon dialog box over soft keyboard
283 stars 149 forks source link

Get wrong size when Translucent Status Bar #15

Open rexi1r opened 9 years ago

rexi1r commented 9 years ago

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

rexi1r commented 9 years ago

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 commented 9 years ago

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);
                    }
                }
ankushsachdeva commented 9 years ago

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.

rexi1r commented 9 years ago

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

cridus commented 9 years ago

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).