I have searched long and hard but have not found an answer.
I have a fullscreen activity with a RelativeLayout that I use as to display certain options. When I create my activity I hide my options bar and the navigation bar and I set a setOnClickListener on my activity.
When the activity is clicked I want to show the option bar if it is hidden or hide the options bar AND the navigation bar again.
contentView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (ACTION_BAR_HIDDEN) {
actionBar.setVisibility(View.VISIBLE);
ACTION_BAR_HIDDEN = false;
} else {
actionBar.setVisibility(View.GONE);
ACTION_BAR_HIDDEN = true;
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;
contentView.setSystemUiVisibility(uiOptions);
}
}
});
Everything works well except when the navigation bar is hidden the first time I click on the activity it displays the navigation bar and only on the second click does my setOnClickListener get called.
Is it possible to intercept the click if the navigation bar is hidden?
I can post more code but I think my question is clear enough.
Thanks a lot.
0 comments:
Post a Comment