工作笔记 pcLIST(product category list) ,pListTab(products list)

在CUSTOMER MAIN ACTIVITY里,
pListTab记录着单独一个CATEGORY里放的所有PRODUCT,比如BBQ,SALAD,这些都在TOP TAB里可以选
public static List<P> pListTab = new ArrayList<P>();
当TOP BAR里的一个ITEM被选中后,会调用MENUFRAGMENT里的REFRESH PRODUCT方法,该方法会从CUSTOMER ACTIVITY里先获取一个PCLIST(PRODUCT CATEGORY LIST)。这个表是个树状数组,主KEY是PRODUCT CATEGORY,每个PRODUCT CATEGORY对应着一个PRODUCT LIST。所以再获取PCLIST后,先读取你选中的那个PRODUCT CATEGORY的PRODUCT LIST。然后再把CUSTOMER MAIN ACTIVITY里的PLISTTAB换成新选出的这个,最后调用GRID ADAPTER去刷新。

public void refreshProductTab(String tabId) {
this.pListTab = CustomerMainActivity.pcList.get(Integer.parseInt(tabId)).pList;
CustomerMainActivity.pListTab = this.pListTab;
adapter.notifyDataSetChanged();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s