Skip to content

Instantly share code, notes, and snippets.

@medhdj
Forked from goodev/Manager.java
Last active August 29, 2015 14:18
Show Gist options
  • Save medhdj/19a1dc3a23af71cb18ae to your computer and use it in GitHub Desktop.
Save medhdj/19a1dc3a23af71cb18ae to your computer and use it in GitHub Desktop.
//change de.keyboardsurfer.android.widget.crouton.Manager class
// add this method below 'handleTranslucentActionBar()' method
private void handleActionBarOverlay(ViewGroup.MarginLayoutParams params, Activity activity) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
final boolean flags = activity.getWindow().hasFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
if (flags) {
final int actionBarContainerId = Resources.getSystem().getIdentifier("action_bar_container", "id", "android");
final View actionBarContainer = activity.findViewById(actionBarContainerId);
// The action bar is present: the app is using a Holo theme.
if (actionBarContainer != null) {
final ViewGroup.MarginLayoutParams marginParams = (ViewGroup.MarginLayoutParams) params;
marginParams.topMargin = actionBarContainer.getBottom();
}
}
}
}
//add call the method(below handleTranslucentActionBar call position):
handleTranslucentActionBar((ViewGroup.MarginLayoutParams) params, activity);
handleActionBarOverlay((ViewGroup.MarginLayoutParams) params, activity);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment