I'm building an application in which I have loaded the webpage on webview. I have one layout which contains edittext in that. I want to hide the layout when user is scrolling down in the webview and show it again when user scrolls to the top. I have tried using onTouch
but it only takes the MotionEvent.ACTION_MOVE
and all that. Here what my code looks like:
@Override
public boolean onTouch(View v, MotionEvent event) {
if (v.getId() == R.id.web
&& event.getAction() == MotionEvent.ACTION_MOVE) {
handler.sendEmptyMessageDelayed(CLICK_ON_URL, 2000);
}
return false;
}
@Override
public boolean handleMessage(Message msg) {
if (msg.what == CLICK_ON_URL) {
top.setVisibility(LinearLayout.GONE);
return true;
}
return false;
}
As you can see here I'm using top.setVisibility(LinearLayout.GONE);
, but this is not solving my problem, it completely hides my layout.
Any idea how to overcome this problem.