Search in sources :

Example 41 with LayoutParams

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;
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams) ViewGroup(android.view.ViewGroup) View(android.view.View)

Example 42 with LayoutParams

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");
    }
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams)

Example 43 with LayoutParams

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);
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams)

Example 44 with LayoutParams

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;
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams)

Example 45 with 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);
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams) View(android.view.View)

Aggregations

LayoutParams (android.widget.FrameLayout.LayoutParams)53 View (android.view.View)28 FrameLayout (android.widget.FrameLayout)17 TextView (android.widget.TextView)6 Intent (android.content.Intent)5 Rect (android.graphics.Rect)5 ViewGroup (android.view.ViewGroup)5 SystemServicesProxy (com.android.systemui.recents.misc.SystemServicesProxy)5 RecentsPackageMonitor (com.android.systemui.recents.model.RecentsPackageMonitor)5 Point (android.graphics.Point)4 ImageView (android.widget.ImageView)4 SuppressLint (android.annotation.SuppressLint)2 TargetApi (android.annotation.TargetApi)2 Activity (android.app.Activity)2 Application (android.app.Application)2 TypedArray (android.content.res.TypedArray)2 ViewTreeObserver (android.view.ViewTreeObserver)2 AbsListView (android.widget.AbsListView)2 AdapterView (android.widget.AdapterView)2 ScrollView (android.widget.ScrollView)2