I am developing an Android application which uses a framelayout
, in which there are two views inflated:
- Upper view holds the main functions of the applications;
- Lower view holds a refreshable list implemented with "pull down to refresh" function.
The upper view is moved to the right so that you can see the lower view containing the list, but when I start to do the pull down to refresh action, the upper view returns itself back to left covering the lower view containing the list. The list gets refreshed, but I don't want the upper view to behave this way, covering the lower one.
I would like to know if there is a way to freeze the upper view until the user does some other action (button clicking) to return it back over the lower view.
LayoutInflater inflater = LayoutInflater.from(this);
final FrameLayout main = new FrameLayout(this);
menu = inflater.inflate(R.layout.offerlist, null);
app = inflater.inflate(R.layout.main, null);
main.addView(menu);
main.addView(app);
setContentView(main);
Display display = (Display) ((WindowManager) getSystemService(Context.WINDOW_SERVICE))
.getDefaultDisplay();
final int width = display.getWidth();
final float wDip = TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 70, this.getResources()
.getDisplayMetrics());
...
app.startAnimation(hide);
menuw = (int) (width - wDip);
app.offsetLeftAndRight(-menuw);
Thank you in advance.