Android makes a simple ordinary shopping cart

This example shares the production process of Android ordinary shopping cart for your reference. The specific contents are as follows

1. Similar shopping cart functions have been added in the latest project, as shown in the figure below:

When I first saw this page, my first reaction was to nest listviews with listviews. After some operations, I finally realized this function. At that time, I didn't consider the performance problem, only that I could write it out. Later, when the amount of nested data is large, the sliding listview can obviously feel stuck, which is difficult for users to bear. Therefore, I came up with the idea of finding an alternative. I see that the mainstream online is to use expandablelistview to realize this function, so I also use this scheme to write about it.

2. The demo after molding is shown in the figure below:

3. Ideas: 1) Select expandablelistview as the control 2) Add a check mark to each data source, ischecked, and control according to ischecked check@R_786_2419 @Status of the;

Expandablelistview related popularity

#1. First, take a look at the expandablelistview adapter, which is different from the ordinary listview adapter

#2. Expandablelistview expansion

3). Expandablelistview removes the default icon

sp_ date_ list. setGroupIndicator(null);

4). Expandablelistview itemclick event handling

1. setOnChildClickListener 2. setOnGroupClickListener 3. setOnGroupCollapseListener 4. setOnGroupExpandListener

We can know their respective purposes through the method names. They set listeners for clicking sub options, clicking group items, group merging and group expansion respectively.

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.

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
分享
二维码
< <上一篇
下一篇>>