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

The following examples show how to use android.support.v7.app.ActionBar#setShowHideAnimationEnabled() . 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: UIHelper.java    From GiraffePlayer2 with Apache License 2.0 6 votes vote down vote up
public UIHelper showActionBar(boolean show) {
    if (activity == null) {
        return this;
    }
    if (activity instanceof AppCompatActivity) {
        ActionBar supportActionBar = ((AppCompatActivity) activity).getSupportActionBar();
        if (supportActionBar != null) {
            try {
                supportActionBar.setShowHideAnimationEnabled(false);
            } catch (Exception e) {

            }
            if (show) {
                supportActionBar.show();
            } else {
                supportActionBar.hide();
            }
        }
    }
    return this;
}
 
Example 2
Source File: JZVideoPlayer.java    From JZVideoDemo with MIT License 5 votes vote down vote up
@SuppressLint("RestrictedApi")
public static void showSupportActionBar(Context context) {
    if (ACTION_BAR_EXIST && JZUtils.getAppCompActivity(context) != null) {
        ActionBar ab = JZUtils.getAppCompActivity(context).getSupportActionBar();
        if (ab != null) {
            ab.setShowHideAnimationEnabled(false);
            ab.show();
        }
    }
    if (TOOL_BAR_EXIST) {
        JZUtils.getWindow(context).clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
}
 
Example 3
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 4
Source File: WindowUtil.java    From youqu_master with Apache License 2.0 5 votes vote down vote up
/**
 * 隐藏ActionBar,StatusBar,NavigationBar
 */
@SuppressLint("RestrictedApi")
public static void hideSystemBar(Context context) {
    AppCompatActivity appCompatActivity = getAppCompActivity(context);
    if (appCompatActivity != null) {
        ActionBar ab = appCompatActivity.getSupportActionBar();
        if (ab != null && ab.isShowing()) {
            ab.setShowHideAnimationEnabled(false);
            ab.hide();
        }
    }
    hideNavigationBar(context);
}
 
Example 5
Source File: WindowUtil.java    From youqu_master with Apache License 2.0 5 votes vote down vote up
/**
 * 显示ActionBar,StatusBar,NavigationBar
 */
@SuppressLint("RestrictedApi")
public static void showSystemBar(final Context context) {
    showNavigationBar(context);
    AppCompatActivity appCompatActivity = getAppCompActivity(context);
    if (appCompatActivity != null) {
        ActionBar ab = appCompatActivity.getSupportActionBar();
        if (ab != null && !ab.isShowing()) {
            ab.setShowHideAnimationEnabled(false);
            ab.show();
        }
    }
}
 
Example 6
Source File: VideoPlayerUtils.java    From YCVideoPlayer with Apache License 2.0 5 votes vote down vote up
@SuppressLint("RestrictedApi")
public static void showActionBar(Context context) {
    ActionBar ab = getAppCompActivity(context).getSupportActionBar();
    if (ab != null) {
        ab.setShowHideAnimationEnabled(false);
        ab.show();
    }
    scanForActivity(context).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
 
Example 7
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 8
Source File: IceCreamSandwichThemeHelper.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
@Override
public void setActionBarAnimation(boolean enabled) {
  ActionBar actionBar = activity.getSupportActionBar();
  if (actionBar != null) {
    actionBar.setShowHideAnimationEnabled(enabled);
  }
}
 
Example 9
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 10
Source File: JCVideoPlayer.java    From JCVideoPlayer with MIT License 5 votes vote down vote up
public static void showSupportActionBar(Context context) {
    if (ACTION_BAR_EXIST) {
        ActionBar ab = JCUtils.getAppCompActivity(context).getSupportActionBar();
        if (ab != null) {
            ab.setShowHideAnimationEnabled(false);
            ab.show();
        }
    }
    if (TOOL_BAR_EXIST) {
        JCUtils.getAppCompActivity(context).getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
}
 
Example 11
Source File: MxVideoPlayer.java    From MxVideoPlayer with Apache License 2.0 5 votes vote down vote up
private static void hideSupportActionBar(Context context) {
    ActionBar actionBar = MxUtils.getAppComptActivity(context).getSupportActionBar();
    if (actionBar != null) {
        actionBar.setShowHideAnimationEnabled(false);
        actionBar.hide();
    }
    MxUtils.getAppComptActivity(context).getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
 
Example 12
Source File: MxVideoPlayer.java    From MxVideoPlayer with Apache License 2.0 5 votes vote down vote up
private static void showSupportActionBar(Context context) {
    ActionBar actionBar = MxUtils.getAppComptActivity(context).getSupportActionBar();
    if (actionBar != null) {
        actionBar.setShowHideAnimationEnabled(false);
        actionBar.show();
    }
    MxUtils.getAppComptActivity(context).getWindow().
                clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}