Search in sources :

Example 1 with LinkageRightAdapter

use of com.wsyzj.android.offer.adapter.LinkageRightAdapter in project Offer by woshiyizhijiao.

the class ListViewLinkageActivity method setRightData.

/**
 * 右边ex数据
 */
private void setRightData() {
    mRightAdapter = new LinkageRightAdapter(this, mAcupointData);
    exlv_right.setAdapter(mRightAdapter);
    for (int i = 0; i < mRightAdapter.getGroupCount(); i++) {
        exlv_right.expandGroup(i);
    }
    exlv_right.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {

        @Override
        public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
            return true;
        }
    });
    exlv_right.setOnScrollListener(new AbsListView.OnScrollListener() {

        @Override
        public void onScrollStateChanged(AbsListView view, int scrollState) {
            if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
                shouldSet = false;
            } else {
                shouldSet = true;
            }
        }

        @Override
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
            if (isScroll) {
                if (shouldSet) {
                    lv_left.setItemChecked(firstVisibleItem, true);
                    lv_left.smoothScrollToPosition(firstVisibleItem);
                }
            } else {
                isScroll = true;
            }
        }
    });
}
Also used : LinkageRightAdapter(com.wsyzj.android.offer.adapter.LinkageRightAdapter) AbsListView(android.widget.AbsListView) AbsListView(android.widget.AbsListView) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) ExpandableListView(android.widget.ExpandableListView) ExpandableListView(android.widget.ExpandableListView)

Aggregations

View (android.view.View)1 AbsListView (android.widget.AbsListView)1 AdapterView (android.widget.AdapterView)1 ExpandableListView (android.widget.ExpandableListView)1 ListView (android.widget.ListView)1 LinkageRightAdapter (com.wsyzj.android.offer.adapter.LinkageRightAdapter)1