Java Code Examples for androidx.appcompat.app.ActionBar#show()

The following examples show how to use androidx.appcompat.app.ActionBar#show() . 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: CameraFiltersPopup.java    From arcusandroid with Apache License 2.0 6 votes vote down vote up
protected void showFullScreen(boolean fullscreen) {
    Activity activity = getActivity();
    if (activity == null || !(activity instanceof BaseActivity)) {
        return;
    }

    ActionBar actionBar = ((BaseActivity)activity).getSupportActionBar();
    if (actionBar != null) {
        if (fullscreen) {
            actionBar.hide();
        }
        else {
            actionBar.show();
        }
    }
}
 
Example 2
Source File: VideoPlayerActivity.java    From android-player-samples with Apache License 2.0 6 votes vote down vote up
@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    EventEmitter eventEmitter = baseVideoView.getEventEmitter();
    ActionBar actionBar = getSupportActionBar();
    if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
        eventEmitter.emit(EventType.EXIT_FULL_SCREEN);
        if (actionBar != null) {
            actionBar.show();
        }
    } else if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
        eventEmitter.emit(EventType.ENTER_FULL_SCREEN);
        if (actionBar != null) {
            actionBar.hide();
        }
    }
}
 
Example 3
Source File: CommonUtil.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
@SuppressLint("RestrictedApi")
public static void showSupportActionBar(Context context, boolean actionBar, boolean statusBar) {
    if (actionBar) {
        AppCompatActivity appCompatActivity = CommonUtil.getAppCompActivity(context);
        if (appCompatActivity != null) {
            ActionBar ab = appCompatActivity.getSupportActionBar();
            if (ab != null) {
                ab.setShowHideAnimationEnabled(false);
                ab.show();
            }
        }
    }

    if (statusBar) {
        if (context instanceof FragmentActivity) {
            FragmentActivity fragmentActivity = (FragmentActivity) context;
            fragmentActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        } else if (context instanceof Activity) {
            Activity activity = (Activity) context;
            activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        } else {
            CommonUtil.getAppCompActivity(context).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
    }
}
 
Example 4
Source File: MainActivity.java    From lbry-android with MIT License 6 votes vote down vote up
public void exitFullScreenMode() {
    View appBarMainContainer = findViewById(R.id.app_bar_main_container);
    View decorView = getWindow().getDecorView();
    int flags = isDarkMode() ? (View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_VISIBLE) :
            (View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_VISIBLE);
    appBarMainContainer.setFitsSystemWindows(true);
    decorView.setSystemUiVisibility(flags);

    if (!Lbry.SDK_READY) {
        findViewById(R.id.global_sdk_initializing_status).setVisibility(View.VISIBLE);
    }
    showFloatingWalletBalance();
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.show();
    }
    unlockDrawer();
    inFullscreenMode = false;
}
 
Example 5
Source File: ArcusFloatingFragment.java    From arcusandroid with Apache License 2.0 6 votes vote down vote up
protected void showFullScreen(boolean fullscreen) {
    Activity activity = getActivity();
    if (activity == null || !(activity instanceof BaseActivity)) {
        return;
    }

    ActionBar actionBar = ((BaseActivity)activity).getSupportActionBar();
    if (actionBar != null) {
        if (fullscreen) {
            actionBar.hide();
        }
        else {
            actionBar.show();
        }
    }
}
 
Example 6
Source File: BaseFragment.java    From arcusandroid with Apache License 2.0 6 votes vote down vote up
private void toggleActionBarVisibility(boolean hide) {
    Activity activity = getActivity();
    if (activity == null || !(activity instanceof BaseActivity)) {
        return;
    }

    ActionBar actionBar = ((BaseActivity) activity).getSupportActionBar();
    if (actionBar != null) {
        if (hide) {
            actionBar.hide();
        }
        else {
            actionBar.show();
        }
    }
}
 
Example 7
Source File: FullscreenVideoView.java    From fullscreen-video-view with Apache License 2.0 5 votes vote down vote up
private void toggleSupportActionBarVisibility(boolean isVisible) {
    // AppCompatActivity support action bar
    ActionBar supportActionBar = ((AppCompatActivity) getContext())
            .getSupportActionBar();
    if (supportActionBar != null) {
        if (isVisible) {
            supportActionBar.show();
        } else {
            supportActionBar.hide();
        }
    }
}
 
Example 8
Source File: WebviewActivity.java    From WhatsappWebToGo with MIT License 5 votes vote down vote up
private void setAppbarEnabled(boolean enable) {
    ActionBar actionBar= getSupportActionBar();
    if (actionBar != null) {
        if (enable) {
            actionBar.show();
        } else {
            actionBar.hide();
        }
        mSharedPrefs.edit().putBoolean("appbarEnabled", enable).apply();
    }
}
 
Example 9
Source File: SkipFloatingFragment.java    From arcusandroid with Apache License 2.0 5 votes vote down vote up
@Override
public void onPause() {
    super.onPause();
    ActionBar actionBar = getActionBarOrNull();
    if (actionBar != null) {
        actionBar.show();
    }
}
 
Example 10
Source File: FullscreenActivity.java    From zapp with MIT License 5 votes vote down vote up
@Override
public void run() {
	// Delayed display of UI elements
	ActionBar actionBar = getSupportActionBar();
	if (actionBar != null) {
		actionBar.show();
	}
	controlsView.setVisibility(View.VISIBLE);
}
 
Example 11
Source File: FullscreenPage.java    From AndroidAnimationExercise with Apache License 2.0 5 votes vote down vote up
@Override
public void run() {
    // Delayed display of UI elements
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.show();
    }
    mControlsView.setVisibility(View.VISIBLE);
}
 
Example 12
Source File: FullscreenActivity.java    From AndroidAnimationExercise with Apache License 2.0 5 votes vote down vote up
@Override
public void run() {
    // Delayed display of UI elements
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.show();
    }
    mControlsView.setVisibility(View.VISIBLE);
}
 
Example 13
Source File: FullscreenADActivity.java    From AndroidAnimationExercise with Apache License 2.0 5 votes vote down vote up
@Override
public void run() {
    // Delayed display of UI elements
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.show();
    }
    mControlsView.setVisibility(View.VISIBLE);
}
 
Example 14
Source File: GuideVideoActivity.java    From smart-farmer-android with Apache License 2.0 5 votes vote down vote up
@Override
public void run() {
    // Delayed display of UI elements
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.show();
    }
}
 
Example 15
Source File: ConversationActivity.java    From deltachat-android with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onAttachmentDrawerStateChanged(DrawerState drawerState) {
  ActionBar supportActionBar = getSupportActionBar();
  if (supportActionBar == null) throw new AssertionError();

  if (drawerState == DrawerState.FULL_EXPANDED) {
    supportActionBar.hide();
  } else {
    supportActionBar.show();
  }

  if (drawerState == DrawerState.COLLAPSED) {
    container.hideAttachedInput(true);
  }
}
 
Example 16
Source File: MapFragment.java    From nearby-android with Apache License 2.0 5 votes vote down vote up
/**
 * Remove RouteHeader view from map view and restore action bar
 */
private void removeRouteHeaderView(){
  if(mRouteHeaderView != null){
    mMapLayout.removeView(mRouteHeaderView);
  }
  final ActionBar ab = ((AppCompatActivity)getActivity()).getSupportActionBar();
  if (ab != null){
    ab.show();
  }
}
 
Example 17
Source File: FullScreenImageActivity.java    From Applozic-Android-SDK with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void toggleActionBar() {

        ActionBar actionBar = getSupportActionBar();

        if (actionBar != null) {
            if (actionBar.isShowing()) {
                actionBar.hide();
                hideUi();
            } else {
                showUi();
                actionBar.show();
            }
        }
    }
 
Example 18
Source File: BaseFragmentActivity.java    From edx-app-android with Apache License 2.0 5 votes vote down vote up
public void setActionBarVisible(boolean visible) {
    try {
        ActionBar bar = getSupportActionBar();
        if (bar != null) {
            if (visible)
                bar.show();
            else
                bar.hide();
        }
    } catch (Exception ex) {
        logger.error(ex);
    }
}
 
Example 19
Source File: SystemUiHelperImplHC.java    From turbo-editor with GNU General Public License v3.0 5 votes vote down vote up
protected void onSystemUiShown() {
    ActionBar ab = ((AppCompatActivity) mActivity).getSupportActionBar();
    if (ab != null) {
        ab.show();
    }

    mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setIsShowing(true);
}
 
Example 20
Source File: MainActivity.java    From lbry-android with MIT License 4 votes vote down vote up
public void showActionBar() {
    ActionBar actionBar = getSupportActionBar();
    if (actionBar != null) {
        actionBar.show();
    }
}