Search in sources :

Example 91 with LayoutParams

use of android.view.ViewGroup.LayoutParams in project AndroidChromium by JackyAndroid.

the class ChromeFullscreenManager method applyTranslationToTopChildViews.

private void applyTranslationToTopChildViews(ViewGroup contentView, float translation) {
    for (int i = 0; i < contentView.getChildCount(); i++) {
        View child = contentView.getChildAt(i);
        if (!(child.getLayoutParams() instanceof FrameLayout.LayoutParams))
            continue;
        FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) child.getLayoutParams();
        if (Gravity.TOP == (layoutParams.gravity & Gravity.FILL_VERTICAL)) {
            child.setTranslationY(translation);
            TraceEvent.instant("FullscreenManager:child.setTranslationY()");
        }
    }
}
Also used : LayoutParams(android.view.ViewGroup.LayoutParams) FrameLayout(android.widget.FrameLayout) View(android.view.View) ContentVideoView(org.chromium.content.browser.ContentVideoView)

Example 92 with LayoutParams

use of android.view.ViewGroup.LayoutParams in project AndroidChromium by JackyAndroid.

the class VrShellDelegate method addVrViews.

private void addVrViews() {
    FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView();
    LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    decor.addView(mVrShell.getContainer(), params);
    mActivity.setUIVisibilityForVR(View.GONE);
}
Also used : LayoutParams(android.view.ViewGroup.LayoutParams) FrameLayout(android.widget.FrameLayout)

Example 93 with LayoutParams

use of android.view.ViewGroup.LayoutParams in project AndroidDevelop by 7449.

the class BadgeView method applyTo.

private void applyTo(View target) {
    LayoutParams lp = target.getLayoutParams();
    ViewParent parent = target.getParent();
    FrameLayout container = new FrameLayout(context);
    if (target instanceof TabWidget) {
        target = ((TabWidget) target).getChildTabViewAt(targetTabIndex);
        this.target = target;
        ((ViewGroup) target).addView(container, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
        this.setVisibility(View.GONE);
        container.addView(this);
    } else {
        ViewGroup group = (ViewGroup) parent;
        int index = group.indexOfChild(target);
        group.removeView(target);
        group.addView(container, index, lp);
        container.addView(target);
        this.setVisibility(View.GONE);
        container.addView(this);
        group.invalidate();
    }
}
Also used : LayoutParams(android.view.ViewGroup.LayoutParams) ViewParent(android.view.ViewParent) ViewGroup(android.view.ViewGroup) FrameLayout(android.widget.FrameLayout) TabWidget(android.widget.TabWidget) SuppressLint(android.annotation.SuppressLint)

Example 94 with LayoutParams

use of android.view.ViewGroup.LayoutParams in project UltimateAndroid by cymcsg.

the class FadingActionBarHelperBase method createWebView.

private View createWebView() {
    ViewGroup webViewContainer = (ViewGroup) mInflater.inflate(R.layout.fab__webview_container, null);
    ObservableWebViewWithHeader webView = (ObservableWebViewWithHeader) mContentView;
    webView.setOnScrollChangedCallback(mOnScrollChangedListener);
    webViewContainer.addView(webView);
    mHeaderContainer = (FrameLayout) webViewContainer.findViewById(R.id.fab__header_container);
    initializeGradient(mHeaderContainer);
    mHeaderContainer.addView(mHeaderView, 0);
    mMarginView = new FrameLayout(webView.getContext());
    mMarginView.setBackgroundColor(Color.TRANSPARENT);
    mMarginView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
    webView.addView(mMarginView);
    return webViewContainer;
}
Also used : LayoutParams(android.view.ViewGroup.LayoutParams) ViewGroup(android.view.ViewGroup) FrameLayout(android.widget.FrameLayout) ObservableWebViewWithHeader(com.marshalchen.common.uimodule.fadingactionbar.view.ObservableWebViewWithHeader)

Example 95 with LayoutParams

use of android.view.ViewGroup.LayoutParams in project UltimateAndroid by cymcsg.

the class FadingActionBarHelperBase method createScrollView.

private View createScrollView() {
    ViewGroup scrollViewContainer = (ViewGroup) mInflater.inflate(R.layout.fab__scrollview_container, null);
    ObservableScrollView scrollView = (ObservableScrollView) scrollViewContainer.findViewById(R.id.fab__scroll_view);
    scrollView.setOnScrollChangedCallback(mOnScrollChangedListener);
    ViewGroup contentContainer = (ViewGroup) scrollViewContainer.findViewById(R.id.fab__container);
    LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    mContentView.setLayoutParams(layoutParams);
    contentContainer.addView(mContentView);
    mHeaderContainer = (FrameLayout) scrollViewContainer.findViewById(R.id.fab__header_container);
    initializeGradient(mHeaderContainer);
    mHeaderContainer.addView(mHeaderView, 0);
    mMarginView = (FrameLayout) contentContainer.findViewById(R.id.fab__content_top_margin);
    return scrollViewContainer;
}
Also used : LayoutParams(android.view.ViewGroup.LayoutParams) ViewGroup(android.view.ViewGroup) ObservableScrollView(com.marshalchen.common.uimodule.fadingactionbar.view.ObservableScrollView) LinearLayout(android.widget.LinearLayout)

Aggregations

LayoutParams (android.view.ViewGroup.LayoutParams)265 TextView (android.widget.TextView)56 View (android.view.View)50 ViewGroup (android.view.ViewGroup)50 FrameLayout (android.widget.FrameLayout)35 LinearLayout (android.widget.LinearLayout)33 ImageView (android.widget.ImageView)30 Test (org.junit.Test)26 Paint (android.graphics.Paint)22 ListView (android.widget.ListView)22 ScrollView (android.widget.ScrollView)22 Context (android.content.Context)19 MarginLayoutParams (android.view.ViewGroup.MarginLayoutParams)19 AdapterView (android.widget.AdapterView)17 RelativeLayout (android.widget.RelativeLayout)14 DisplayMetrics (android.util.DisplayMetrics)12 CheckedTextView (android.widget.CheckedTextView)12 Rect (android.graphics.Rect)9 ViewParent (android.view.ViewParent)9 TypedArray (android.content.res.TypedArray)8