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

The following examples show how to use android.support.v7.app.ActionBar#setShowHideAnimationEnabled() . 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
Source Project: GiraffePlayer2   File: UIHelper.java    License: 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 Project: JZVideoDemo   File: JZVideoPlayer.java    License: 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 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 4
Source Project: youqu_master   File: WindowUtil.java    License: 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 Project: youqu_master   File: WindowUtil.java    License: 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 Project: YCVideoPlayer   File: VideoPlayerUtils.java    License: 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 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 8
@Override
public void setActionBarAnimation(boolean enabled) {
  ActionBar actionBar = activity.getSupportActionBar();
  if (actionBar != null) {
    actionBar.setShowHideAnimationEnabled(enabled);
  }
}
 
Example 9
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 10
Source Project: JCVideoPlayer   File: JCVideoPlayer.java    License: 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 Project: MxVideoPlayer   File: MxVideoPlayer.java    License: 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 Project: MxVideoPlayer   File: MxVideoPlayer.java    License: 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);
}