Java Code Examples for android.support.v7.app.ActionBar.isShowing()

The following are Jave code examples for showing how to use isShowing() of the android.support.v7.app.ActionBar class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Phoenix-for-VK   File: VideoPlayerActivity.java   Source Code and License Vote up 5 votes
private void resolveControlsVisibility() {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar == null)
        return;

    if (actionBar.isShowing()) {
        //toolbar_with_elevation.animate().translationY(-toolbar_with_elevation.getBottom()).setInterpolator(new AccelerateInterpolator()).start();
        actionBar.hide();
        mControllerView.hide();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            mDecorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_IMMERSIVE);
        } else {
            mDecorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                    | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                    | View.SYSTEM_UI_FLAG_FULLSCREEN);
        }
    } else {
        //toolbar_with_elevation.animate().translationY(0).setInterpolator(new DecelerateInterpolator()).start();
        actionBar.show();
        mControllerView.show();
        mDecorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
    }
}
 
Example 2
Project: RetrofitAppArchitecture   File: BaseActivity.java   Source Code and License Vote up 5 votes
private void showActionBar(boolean show) {
    ActionBar bar = getSupportActionBar();
    if (bar != null) {
        if (!show && bar.isShowing()) {
            bar.hide();
        } else if (show && !bar.isShowing()) {
            bar.show();
        }
    }
}
 
Example 3
Project: SimpleRssReader   File: InitialSetupFragment.java   Source Code and License Vote up 5 votes
@SuppressWarnings("ConstantConditions")
@Override
public void onActivityCreated(final Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    final ActionBar actionBar = ((MainActivity) getActivity()).getSupportActionBar();

    if (actionBar.isShowing()) {
        actionBar.hide();
    }
}
 
Example 4
Project: SimpleRssReader   File: MainActivity.java   Source Code and License Vote up 5 votes
@SuppressWarnings("ConstantConditions")
private void toggleActionBarVisibility(final boolean visible) {
    final ActionBar actionBar = getSupportActionBar();

    if (visible) {
        if (!actionBar.isShowing()) {
            actionBar.show();
        }
    } else if (actionBar.isShowing()) {
        actionBar.hide();
    }
}