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;
}
}
});
}
Aggregations