use of android.widget.FrameLayout.LayoutParams in project Klyph by jonathangerbaud.
the class KlyphFakeHeaderListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = super.onCreateView(inflater, container, savedInstanceState);
if (hasFakeHeader) {
fakeHeaderView = getActivity().getLayoutInflater().inflate(R.layout.fake_header_item, getListView(), false);
if (fakeHeaderHeight != -1) {
android.view.ViewGroup.LayoutParams params = (android.view.ViewGroup.LayoutParams) fakeHeaderView.getLayoutParams();
params.height = fakeHeaderHeight;
fakeHeaderView.setLayoutParams(params);
}
getListView().addHeaderView(fakeHeaderView, null, false);
LayoutParams params = (LayoutParams) getListView().getEmptyView().getLayoutParams();
params.topMargin = fakeHeaderHeight;
getListView().getEmptyView().setLayoutParams(params);
View progress = view.findViewById(android.R.id.progress);
params = (LayoutParams) progress.getLayoutParams();
params.topMargin = fakeHeaderHeight;
params.gravity = Gravity.CENTER_HORIZONTAL | Gravity.TOP;
progress.setLayoutParams(params);
}
return view;
}
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 topMargin The progress bar's top margin.
*/
public void prepareForAttach(int topMargin) {
LayoutParams curParams = new LayoutParams(getLayoutParams());
mMarginTop = topMargin;
curParams.topMargin = mMarginTop;
setLayoutParams(curParams);
}
use of android.widget.FrameLayout.LayoutParams in project AndEngine by nicolasgramlich.
the class BaseGameActivity method createSurfaceViewLayoutParams.
protected LayoutParams createSurfaceViewLayoutParams() {
final LayoutParams layoutParams = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
layoutParams.gravity = Gravity.CENTER;
return layoutParams;
}
use of android.widget.FrameLayout.LayoutParams in project MVP by yuchengren.
the class SystemBarTintManager method setupNavBarView.
private void setupNavBarView(Context context, ViewGroup decorViewGroup) {
mNavBarTintView = new View(context);
LayoutParams params;
if (mConfig.isNavigationAtBottom()) {
params = new LayoutParams(LayoutParams.MATCH_PARENT, mConfig.getNavigationBarHeight());
params.gravity = Gravity.BOTTOM;
} else {
params = new LayoutParams(mConfig.getNavigationBarWidth(), LayoutParams.MATCH_PARENT);
params.gravity = Gravity.RIGHT;
}
mNavBarTintView.setLayoutParams(params);
mNavBarTintView.setBackgroundColor(DEFAULT_TINT_COLOR);
mNavBarTintView.setVisibility(View.GONE);
decorViewGroup.addView(mNavBarTintView);
}
Aggregations