In Chrome, the address bar will be hidden/shown when user swipes up/down the content.
Can I implement the similar logic to my app?
try the following code, hope it works for you:
private void init(){
WebView web = new WebView(this);
final Context context = this;
web.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View arg0, MotionEvent event) {
// TODO Auto-generated method stub
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// show action bar
((Activity) context).getActionBar().show();
break;
case MotionEvent.ACTION_UP:
// hide action bar
((Activity) context).getActionBar().hide();
break;
default:
break;
}
return false;
}
});
}