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

The following examples show how to use android.support.v7.app.ActionBar#hide() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature((Window.FEATURE_NO_TITLE));
    super.onCreate(savedInstanceState);
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }
    ;

    View decorView = getWindow().getDecorView();
    int uiOptions = View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY |
            View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
            View.SYSTEM_UI_FLAG_FULLSCREEN |
            View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
            View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
    decorView.setSystemUiVisibility(uiOptions);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    mGLView = new MyGLSurfaceView(this);
    //mGLView.setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
    setContentView(mGLView);
}
 
Example 2
private void initUi() {
    ActionBar actionBar = getSupportActionBar();
    actionBar.hide();

    printerlist_list = (ListView) findViewById(R.id.printerlist_list);
    toolbar_refresh = (Button) findViewById(R.id.toolbar_refresh);
    toolbar_left_button = (ImageButton) findViewById(R.id.toolbar_left_button);

    printerlist_active = (TextView) findViewById(R.id.printerlist_active);
    printerlist_progress = (ProgressBar) findViewById(R.id.printerlist_progress);

    printerlist_progress.setVisibility(View.GONE);

    toolbar_left_button.setOnClickListener(this);
    toolbar_refresh.setOnClickListener(this);
    printerlist_list.setOnItemClickListener(this);
}
 
Example 3
@SuppressWarnings("WeakerAccess") // Potentially useful for extensions adding custom activities
protected void styleTitleBar() {
  ActionBar actionBar = getSupportActionBar();
  Log.d(LOG_TAG, "actionBarEnabled = " + actionBarEnabled);
  Log.d(LOG_TAG, "!classicMode = " + !classicMode);
  Log.d(LOG_TAG, "actionBar = " + actionBar);
  if (actionBar != null) {
    actionBar.setBackgroundDrawable(new ColorDrawable(getPrimaryColor()));
    if (actionBarEnabled) {
      actionBar.show();
      hideTitleBar();
      return;
    } else {
      actionBar.hide();
    }
  }
  maybeShowTitleBar();
}
 
Example 4
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
    ActionBar ab = getSupportActionBar();
    if (ab == null) {
        return;
    }
    if (scrollState == ScrollState.UP) {
        if (ab.isShowing()) {
            ab.hide();
        }
    } else if (scrollState == ScrollState.DOWN) {
        if (!ab.isShowing()) {
            ab.show();
        }
    }
}
 
Example 5
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_proj_settings);

    final ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }

    WindowManager.LayoutParams params = getWindow().getAttributes();
    params.alpha = 0.8f;
    DisplayMetrics out = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(out);
    params.height = out.heightPixels / 4;
    getWindow().setAttributes(params);

    info.setID(System.currentTimeMillis());
    adapter = new SectionsPagerAdapter(getSupportFragmentManager());

    pager = (ViewPager) findViewById(R.id.pager);
    pager.setAdapter(adapter);
}
 
Example 6
Source Project: YCVideoPlayer   File: VideoPlayerUtils.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressLint("RestrictedApi")
public static void hideActionBar(Context context) {
    ActionBar ab = getAppCompActivity(context).getSupportActionBar();
    if (ab != null) {
        ab.setShowHideAnimationEnabled(false);
        ab.hide();
    }
    scanForActivity(context).getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
 
Example 7
public void onViewTap(View view, float x, float y) {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar.isShowing()) {
        actionBar.hide();
    } else {
        actionBar.show();
    }
}
 
Example 8
Source Project: GiraffePlayer   File: GiraffePlayer.java    License: Apache License 2.0 5 votes vote down vote up
private void tryFullScreen(boolean fullScreen) {
    if (activity instanceof AppCompatActivity) {
        ActionBar supportActionBar = ((AppCompatActivity) activity).getSupportActionBar();
        if (supportActionBar != null) {
            if (fullScreen) {
                supportActionBar.hide();
            } else {
                supportActionBar.show();
            }
        }
    }
    setFullScreen(fullScreen);
}
 
Example 9
Source Project: cashuwallet   File: SplashActivity.java    License: MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }
    setContentView(R.layout.activity_splash);
}
 
Example 10
Source Project: JZVideoDemo   File: JZVideoPlayer.java    License: MIT License 5 votes vote down vote up
@SuppressLint("RestrictedApi")
public static void hideSupportActionBar(Context context) {
    if (ACTION_BAR_EXIST && JZUtils.getAppCompActivity(context) != null) {
        ActionBar ab = JZUtils.getAppCompActivity(context).getSupportActionBar();
        if (ab != null) {
            ab.setShowHideAnimationEnabled(false);
            ab.hide();
        }
    }
    if (TOOL_BAR_EXIST) {
        JZUtils.getWindow(context).setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
}
 
Example 11
public void setSupportActionBar(@Nullable ActionBar actionBar)
{
    mActionBar = actionBar;
    if (isShowing())
    {
        actionBar.show();
    }
    else
    {
        actionBar.hide();
    }
}
 
Example 12
private void hide() {
    // Hide UI first
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }
    mControlsView.setVisibility(View.GONE);
    mVisible = false;

    // Schedule a runnable to remove the status and navigation bar after a delay
    mHideHandler.removeCallbacks(mShowPart2Runnable);
    mHideHandler.postDelayed(mHidePart2Runnable, UI_ANIMATION_DELAY);
}
 
Example 13
@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);

    GridLayout answerarea = findViewById(R.id.answer_area);
    LinearLayout centercol = findViewById(R.id.centercol);
    ActionBar actionBar = getSupportActionBar();
    if (isLandscape()) {

        //answerarea.setOrientation(GridLayout.VERTICAL);
        setColumnCount(answerarea,2);

        centercol.setOrientation(LinearLayout.HORIZONTAL);

        if (actionBar != null) {
            actionBar.hide();
        }
    } else {
        //answerarea.setOrientation(GridLayout.VERTICAL);


        setColumnCount(answerarea,1);

        centercol.setOrientation(LinearLayout.VERTICAL);

        if (actionBar != null) {
            actionBar.show();
        }

    }

}
 
Example 14
Source Project: Crimson   File: About.java    License: Apache License 2.0 5 votes vote down vote up
private void hide() {
    // Hide UI first
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.hide();
    }

    mVisible = false;

    // Schedule a runnable to remove the status and navigation bar after a delay
    mHideHandler.removeCallbacks(mShowPart2Runnable);
    mHideHandler.postDelayed(mHidePart2Runnable, UI_ANIMATION_DELAY);
}
 
Example 15
Source Project: JCVideoPlayer   File: JCVideoPlayer.java    License: MIT License 5 votes vote down vote up
public static void hideSupportActionBar(Context context) {
    if (ACTION_BAR_EXIST) {
        ActionBar ab = JCUtils.getAppCompActivity(context).getSupportActionBar();
        if (ab != null) {
            ab.setShowHideAnimationEnabled(false);
            ab.hide();
        }
    }
    if (TOOL_BAR_EXIST) {
        JCUtils.getAppCompActivity(context).getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
}
 
Example 16
@Override
public void onUpOrCancelMotionEvent(ScrollState scrollState) {
    ActionBar ab = getSupportActionBar();
    if (scrollState == ScrollState.UP) {
        if (ab.isShowing()) {
            ab.hide();
        }
    } else if (scrollState == ScrollState.DOWN) {
        if (!ab.isShowing()) {
            ab.show();
        }
    }
}
 
Example 17
Source Project: HomeMirror   File: MirrorActivity.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_mirror);
    mConfigSettings = new ConfigurationSettings(this);
    AlarmReceiver.startMirrorUpdates(this);

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
    } else {
        View decorView = getWindow().getDecorView();
        int uiOptions = 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_STICKY
                | View.SYSTEM_UI_FLAG_IMMERSIVE;
        decorView.setSystemUiVisibility(uiOptions);
        ActionBar actionBar = getSupportActionBar();
        actionBar.hide();
    }

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    mBirthdayText = (TextView) findViewById(R.id.birthday_text);
    mDayText = (TextView) findViewById(R.id.day_text);
    mWeatherSummary = (TextView) findViewById(R.id.weather_summary);
    mHelloText = (TextView) findViewById(R.id.hello_text);
    mWaterPlants = findViewById(R.id.water_plants);
    mGroceryList = findViewById(R.id.grocery_list);
    mBikeTodayText = (TextView) findViewById(R.id.can_bike);
    mStockText = (TextView) findViewById(R.id.stock_text);
    mMoodText = (TextView) findViewById(R.id.mood_text);
    mXKCDImage = (ImageView) findViewById(R.id.xkcd_image);
    mNewsHeadline = (TextView) findViewById(R.id.news_headline);
    mCalendarTitleText = (TextView) findViewById(R.id.calendar_title);
    mCalendarDetailsText = (TextView) findViewById(R.id.calendar_details);
    mCountdownText = (TextView) findViewById(R.id.countdown_text);

    if (mConfigSettings.invertXKCD()) {
        //Negative of XKCD image
        float[] colorMatrixNegative = {
                -1.0f, 0, 0, 0, 255, //red
                0, -1.0f, 0, 0, 255, //green
                0, 0, -1.0f, 0, 255, //blue
                0, 0, 0, 1.0f, 0 //alpha
        };
        ColorFilter colorFilterNegative = new ColorMatrixColorFilter(colorMatrixNegative);
        mXKCDImage.setColorFilter(colorFilterNegative); // not inverting for now
    }

    setViewState();
}
 
Example 18
@Override
public void hideActionBar() {
    ActionBar bar = getSupportActionBar();
    if(bar != null) bar.hide();
}
 
Example 19
protected void hideToolbar() {
    ActionBar actionBar = getSupportActionBar();
 if (actionBar != null) {
     actionBar.hide();
    }
}
 
Example 20
protected void hideToolbar() {
    ActionBar actionBar = getSupportActionBar();
 if (actionBar != null) {
     actionBar.hide();
    }
}