gridView=(GridView)findViewById(R.id.gridview_practioner);
gridView.setOnScrollListener(new OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView arg0, int arg1) {
// TODO Auto-generated method stub
}
@Override
public void onScroll(AbsListView arg0, int arg1, int arg2, int arg3) {
for(int i=0;i<gridView.getChildCount();i++){
FrameLayout temp_layout = (FrameLayout) gridView
.getChildAt(i);
ImageView imageView = (ImageView) temp_layout.getChildAt(0);
LinearLayout linearLayout = (LinearLayout) temp_layout.getChildAt(1);
int id = imageView.getId();
if (id == id_){
linearLayout.setVisibility(View.VISIBLE);
}else{
linearLayout.setVisibility(View.GONE);
}
}
}
});
gridView.setOnScrollListener(new OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView arg0, int arg1) {
// TODO Auto-generated method stub
}
@Override
public void onScroll(AbsListView arg0, int arg1, int arg2, int arg3) {
for(int i=0;i<gridView.getChildCount();i++){
FrameLayout temp_layout = (FrameLayout) gridView
.getChildAt(i);
ImageView imageView = (ImageView) temp_layout.getChildAt(0);
LinearLayout linearLayout = (LinearLayout) temp_layout.getChildAt(1);
int id = imageView.getId();
if (id == id_){
linearLayout.setVisibility(View.VISIBLE);
}else{
linearLayout.setVisibility(View.GONE);
}
}
}
});
No comments:
Post a Comment