I m trying to build a twitter like slider which shows gallery images inside a grid view which can be swiped up using umano sliding panel
Initially I have disabled the grid scroll inside the Sliding panel.
mSlidingGalleryGridView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if(event.getAction() == MotionEvent.ACTION_MOVE){
return true;
}
return false;
}
});
When the slider is totally expanded I disable the sliding panel and the grid scroll becomes active and the users can scroll up and down.
mSlidingPanel.setPanelSlideListener(new SlidingUpPanelLayout.PanelSlideListener() {
@Override
public void onPanelSlide(View panel, float slideOffset) {
Log.i(TAG, "onPanelSlide, offset " + slideOffset);
}
@Override
public void onPanelExpanded(View panel) {
Log.i(TAG, "onPanelExpanded");
mSlidingPanel.setEnabled(false);
}
@Override
public void onPanelCollapsed(View panel) {
Log.i(TAG, "onPanelCollapsed");
}
@Override
public void onPanelAnchored(View panel) {
Log.i(TAG, "onPanelAnchored");
}
@Override
public void onPanelHidden(View panel) {
Log.i(TAG, "onPanelHidden");
}
});
But when the user is at the first row of the grid and tries scroll up when the grid can't scroll up any more the scroll of the sliding panel should happen and the panel should come back to its initial starting position. How can this be achieved ?
Aucun commentaire:
Enregistrer un commentaire