Android streaming layout realizes the function of historical search record
Recently, when developing projects, there was a requirement to display historical search records in a streaming layout (that is, automatically wrap according to the content). I saw a good class library on the Internet to share with you
First, import a project into the module class library in Android studio, and I will put the project demo method on GitHub
Let's talk about the implementation in the demo
In activity_ In main.xml
Simulation search effect diagram
Mainactivity.java code
When we click the OK button, notify the handler to update the UI interface
The renderings are as follows:
In this way, a simple stream layout history search record is realized
GitHub address: https://github.com/zhangliyong114/FlowLayoutDemo
The above is the Android streaming layout introduced by Xiaobian to realize the historical search record function. 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!