Search in sources :

Example 11 with LayoutParams

use of android.widget.FrameLayout.LayoutParams in project CircleDemo by Naoki2015.

the class SystemBarUtil method setupNavBarView.

@SuppressLint("RtlHardcoded")
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) SuppressLint(android.annotation.SuppressLint)

Example 12 with LayoutParams

use of android.widget.FrameLayout.LayoutParams in project HoloEverywhere by Prototik.

the class AlertController method setupView.

private void setupView() {
    LinearLayout contentPanel = (LinearLayout) mWindow.findViewById(R.id.contentPanel);
    setupContent(contentPanel);
    boolean hasButtons = setupButtons();
    LinearLayout topPanel = (LinearLayout) mWindow.findViewById(R.id.topPanel);
    TypedArray a = mContext.obtainStyledAttributes(null, R.styleable.AlertDialog, R.attr.alertDialogStyle, R.style.Holo_AlertDialog);
    boolean hasTitle = setupTitle(topPanel);
    View buttonPanel = mWindow.findViewById(R.id.buttonPanel);
    if (!hasButtons) {
        buttonPanel.setVisibility(View.GONE);
    // mWindow.setCloseOnTouchOutsideIfNotSet(true);
    }
    FrameLayout customPanel = null;
    if (mView != null) {
        customPanel = (FrameLayout) mWindow.findViewById(R.id.customPanel);
        FrameLayout custom = (FrameLayout) mWindow.findViewById(R.id.custom);
        custom.addView(mView, new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        if (mViewSpacingSpecified) {
            custom.setPadding(mViewSpacingLeft, mViewSpacingTop, mViewSpacingRight, mViewSpacingBottom);
        }
        if (mListView != null) {
            ((LinearLayout.LayoutParams) customPanel.getLayoutParams()).weight = 0;
        }
    } else {
        mWindow.findViewById(R.id.customPanel).setVisibility(View.GONE);
    }
    if (hasTitle) {
        View divider = null;
        if (mMessage != null || mView != null || mListView != null) {
            divider = mWindow.findViewById(R.id.titleDivider);
        } else {
            divider = mWindow.findViewById(R.id.titleDividerTop);
        }
        if (divider != null) {
            divider.setVisibility(View.VISIBLE);
        }
    }
    setBackground(topPanel, contentPanel, customPanel, hasButtons, a, hasTitle, buttonPanel);
    a.recycle();
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams) TypedArray(android.content.res.TypedArray) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) AbsListView(android.widget.AbsListView) ScrollView(android.widget.ScrollView)

Example 13 with LayoutParams

use of android.widget.FrameLayout.LayoutParams in project SherlockNavigationDrawer by nicolasjafelle.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FrameLayout frame = new FrameLayout(this);
    frame.setId(CONTENT_VIEW_ID);
    setContentView(frame, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    if (savedInstanceState == null) {
        setInitialFragment();
    }
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams) FrameLayout(android.widget.FrameLayout)

Example 14 with LayoutParams

use of android.widget.FrameLayout.LayoutParams in project SherlockNavigationDrawer by nicolasjafelle.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FrameLayout frame = new FrameLayout(this);
    frame.setId(CONTENT_VIEW_ID);
    setContentView(frame, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
    if (savedInstanceState == null) {
        setInitialFragment();
    }
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams) FrameLayout(android.widget.FrameLayout)

Example 15 with LayoutParams

use of android.widget.FrameLayout.LayoutParams in project SystemBarTint by jgilfelt.

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)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