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

The following examples show how to use android.support.v7.app.ActionBar#hide() . 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 check out the related API usage on the sidebar.
Example 1
Source File: OpenGLActivity.java    From myMediaCodecPlayer-for-FPV with MIT License 6 votes vote down vote up
@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
Source File: ProjSettingsActivity.java    From PracticeCode with Apache License 2.0 6 votes vote down vote up
@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 3
Source File: PrinterListActivity.java    From thermalprinterhelper with Apache License 2.0 6 votes vote down vote up
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 4
Source File: ActionBarControlRecyclerViewActivity.java    From Android-ObservableScrollView with Apache License 2.0 6 votes vote down vote up
@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
Source File: AppInventorCompatActivity.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
@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 6
Source File: VideoPlayerUtils.java    From YCVideoPlayer with 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
Source File: ActionBarControlGridViewActivity.java    From UltimateAndroid with Apache License 2.0 5 votes vote down vote up
@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 8
Source File: JCVideoPlayer.java    From JCVideoPlayer with 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 9
Source File: About.java    From Crimson with 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 10
Source File: StdGameActivity.java    From Primary with GNU General Public License v3.0 5 votes vote down vote up
@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 11
Source File: IntroActivity.java    From WhatsAppStatusSaver with Apache License 2.0 5 votes vote down vote up
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 12
Source File: CustomMediaController.java    From AndroidTvDemo with Apache License 2.0 5 votes vote down vote up
public void setSupportActionBar(@Nullable ActionBar actionBar)
{
    mActionBar = actionBar;
    if (isShowing())
    {
        actionBar.show();
    }
    else
    {
        actionBar.hide();
    }
}
 
Example 13
Source File: JZVideoPlayer.java    From JZVideoDemo with 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 14
Source File: SplashActivity.java    From cashuwallet with 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 15
Source File: GiraffePlayer.java    From GiraffePlayer with 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 16
Source File: ImageViewerActivity.java    From android-imageviewer with Apache License 2.0 5 votes vote down vote up
public void onViewTap(View view, float x, float y) {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar.isShowing()) {
        actionBar.hide();
    } else {
        actionBar.show();
    }
}
 
Example 17
Source File: BaseActivity.java    From ETHWallet with GNU General Public License v3.0 4 votes vote down vote up
protected void hideToolbar() {
    ActionBar actionBar = getSupportActionBar();
 if (actionBar != null) {
     actionBar.hide();
    }
}
 
Example 18
Source File: WorldActivity.java    From blocktopograph with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void hideActionBar() {
    ActionBar bar = getSupportActionBar();
    if(bar != null) bar.hide();
}
 
Example 19
Source File: MirrorActivity.java    From HomeMirror with 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 20
Source File: BaseActivity.java    From trust-wallet-android-source with GNU General Public License v3.0 4 votes vote down vote up
protected void hideToolbar() {
    ActionBar actionBar = getSupportActionBar();
 if (actionBar != null) {
     actionBar.hide();
    }
}