use of android.widget.FrameLayout.LayoutParams in project 9GAG by Mixiaoxiao.
the class SystemBarTintManager method setupStatusBarView.
private void setupStatusBarView(Context context, ViewGroup decorViewGroup) {
mStatusBarTintView = new View(context);
LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, mConfig.getStatusBarHeight());
params.gravity = Gravity.TOP;
if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) {
params.rightMargin = mConfig.getNavigationBarWidth();
}
mStatusBarTintView.setLayoutParams(params);
mStatusBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR);
mStatusBarTintView.setVisibility(View.GONE);
decorViewGroup.addView(mStatusBarTintView);
}
use of android.widget.FrameLayout.LayoutParams in project AndroidChromium by JackyAndroid.
the class ToolbarProgressBar method initializeAnimation.
/**
* Initializes animation based on command line configuration. This must be called when native
* library is ready.
*/
public void initializeAnimation() {
if (mAnimationInitialized)
return;
mAnimationInitialized = true;
assert mAnimationLogic == null;
String animation = CommandLine.getInstance().getSwitchValue(ChromeSwitches.PROGRESS_BAR_ANIMATION);
if (TextUtils.isEmpty(animation)) {
animation = VariationsAssociatedData.getVariationParamValue(ANIMATION_FIELD_TRIAL_NAME, ChromeSwitches.PROGRESS_BAR_ANIMATION);
}
if (TextUtils.equals(animation, "smooth")) {
mAnimationLogic = new ProgressAnimationSmooth();
} else if (TextUtils.equals(animation, "smooth-indeterminate") && Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN_MR2) {
mAnimationLogic = new ProgressAnimationSmooth();
// The smooth-indeterminate will start running only after 5 seconds has passed with no
// progress update. Until then, the default behavior will be used.
mIsUsingSmoothIndeterminate = true;
LayoutParams animationParams = new LayoutParams(getLayoutParams());
animationParams.width = 1;
animationParams.topMargin = mMarginTop;
mAnimatingView = new ToolbarProgressBarAnimatingView(getContext(), animationParams);
// The primary theme color may not have been set.
if (mThemeColor != 0) {
setThemeColor(mThemeColor, false);
} else {
setForegroundColor(getForegroundColor());
}
UiUtils.insertAfter(mControlContainer, mAnimatingView, this);
} else if (TextUtils.equals(animation, "fast-start")) {
mAnimationLogic = new ProgressAnimationFastStart();
} else if (TextUtils.equals(animation, "linear")) {
mAnimationLogic = new ProgressAnimationLinear();
} else {
assert TextUtils.isEmpty(animation) || TextUtils.equals(animation, "disabled");
}
}
use of android.widget.FrameLayout.LayoutParams in project AndroidChromium by JackyAndroid.
the class ToolbarProgressBar method prepareForAttach.
/**
* Prepare the progress bar for being attached to the window.
* @param toolbarHeight The height of the toolbar.
*/
public void prepareForAttach(int toolbarHeight) {
LayoutParams curParams = new LayoutParams(getLayoutParams());
mMarginTop = toolbarHeight - curParams.height;
curParams.topMargin = mMarginTop;
setLayoutParams(curParams);
}
use of android.widget.FrameLayout.LayoutParams in project Shuttle by timusus.
the class SystemBarTintManager method setupStatusBarView.
private void setupStatusBarView(Context context, ViewGroup decorViewGroup) {
mStatusBarTintView = new View(context);
LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, mConfig.getStatusBarHeight());
params.gravity = Gravity.TOP;
if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) {
params.rightMargin = mConfig.getNavigationBarWidth();
}
mStatusBarTintView.setLayoutParams(params);
mStatusBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR);
mStatusBarTintView.setVisibility(View.GONE);
decorViewGroup.addView(mStatusBarTintView);
}
use of android.widget.FrameLayout.LayoutParams in project QLibrary by DragonsQC.
the class SystemBarTintManager method setupStatusBarView.
private void setupStatusBarView(Context context, ViewGroup decorViewGroup) {
mStatusBarTintView = new View(context);
LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, mConfig.getStatusBarHeight());
params.gravity = Gravity.TOP;
if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) {
params.rightMargin = mConfig.getNavigationBarWidth();
}
mStatusBarTintView.setLayoutParams(params);
mStatusBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR);
mStatusBarTintView.setVisibility(View.GONE);
decorViewGroup.addView(mStatusBarTintView);
}
Aggregations