Android imitation Jingdong commodity attribute filtering function
Filtering and attribute selection are very common function modules at present; It will be used in almost all apps;
Click the filter button to pop up a self encapsulated popupwindow. The practical method is very simple; Two lines of code are displayed directly; (except initialization data, of course)
This is somewhat different from the previous flow layout: flow layout
Previously, a single classification was used, and it was not widely used in the project; Except for data, this filtering function is almost copied from the project;
The entire popupwindow layout is a user-defined listview, which mainly controls the height of the listview;
If there is less data, it is adaptive. If there is more data, the height is limited to half of the screen;
Custom listview:
Each item in the listview is a streaming layout:
The whole popupwindow is encapsulated in a class. When creating, you only need to pass the data source to it. When practical, you can directly show it
When you click OK, you can directly set a monitor:
Click the open link to download the source code for free
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.