Search in sources :

Example 31 with LayoutParams

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

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

Example 34 with LayoutParams

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

Example 35 with LayoutParams

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

Aggregations

LayoutParams (android.widget.FrameLayout.LayoutParams)36 View (android.view.View)19 FrameLayout (android.widget.FrameLayout)10 Intent (android.content.Intent)5 Rect (android.graphics.Rect)5 TextView (android.widget.TextView)5 SystemServicesProxy (com.android.systemui.recents.misc.SystemServicesProxy)5 RecentsPackageMonitor (com.android.systemui.recents.model.RecentsPackageMonitor)5 TypedArray (android.content.res.TypedArray)2 ViewGroup (android.view.ViewGroup)2 AbsListView (android.widget.AbsListView)2 AdapterView (android.widget.AdapterView)2 ImageView (android.widget.ImageView)2 ScrollView (android.widget.ScrollView)2 SuppressLint (android.annotation.SuppressLint)1 TargetApi (android.annotation.TargetApi)1 Point (android.graphics.Point)1 GLSurfaceView (android.opengl.GLSurfaceView)1 MarginLayoutParams (android.view.ViewGroup.MarginLayoutParams)1 ViewTreeObserver (android.view.ViewTreeObserver)1