Implementation code of POI search function of Android Gaode map

No more nonsense. Let's see the effect first. If you feel good, please refer to the implementation code

I used the fragmentdialog to do this function, and I also encountered many holes

First, when the drawable of the background is set to pure white, causing the keyboard to pop up, the layout of the recyclerview is pushed up, resulting in a white layout, which is a little eye-catching; Finally, it is changed to set it to the same color as the background color

layout

The second problem is that when the keyboard pops up, the dialog layout will be pushed up as a whole

Finally, it is solved by setting style

Finally, the search function is realized

When you first click search, both the keyboard and the search button have the same effect

Then it is processed in the callback

In addition, it is also very simple to monitor the changes of content in EditText to search

OK, it's done. Finally, just make a callback and send back the item clicked after search. 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
分享
二维码
< <上一篇
下一篇>>