Solution to skip flash problem when Android expression panel and soft keyboard are switched

At present, many applications will provide an expression panel when allowing users to input various text information, so there will be a problem, that is, the flicker of the expression panel. To input text information, it is necessary to pop up the soft keyboard. When the soft keyboard is displayed, if you want to switch to display the expression panel, Because the height of the expression panel cannot be exactly the same as that of the user's soft keyboard, in addition, the jumping and flashing of the expression panel will occur due to the up and down displacement of the control

When clicking the switch button, the expression panel will jump up first and then move down, which will bring a poor user experience. The effect is shown in the figure below:

A solution is provided here to enable the soft keyboard and expression panel to switch naturally. The effect is shown in the following figure:

The main solution is as follows: when the soft keyboard pops up, the system will top the content input box view and the view above it. When switching to the expression panel, it can be switched naturally only by keeping the height of the expression panel consistent with the height of the soft keyboard. In addition, you also need to fix the position of the content input box view and the view above it, so that there will be no flash problem

The main operation logic is in the emojikeyboard class

Code download is also provided here: Android solves the problem of jumping and flashing when switching between expression panel and soft keyboard

summary

The above is the solution to the flash problem during Android expression panel and soft keyboard switching introduced by Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>