Search in sources :

Example 26 with LayoutParams

use of android.widget.FrameLayout.LayoutParams in project ImagePicker by jeasonlzy.

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)

Example 27 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 28 with LayoutParams

use of android.widget.FrameLayout.LayoutParams in project PagerSlidingTabStrip by astuetz.

the class SuperAwesomeCardFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    FrameLayout fl = new FrameLayout(getActivity());
    fl.setLayoutParams(params);
    final int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
    TextView v = new TextView(getActivity());
    params.setMargins(margin, margin, margin, margin);
    v.setLayoutParams(params);
    v.setLayoutParams(params);
    v.setGravity(Gravity.CENTER);
    v.setBackgroundResource(R.drawable.background_card);
    v.setText("CARD " + (position + 1));
    fl.addView(v);
    return fl;
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams) FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView)

Example 29 with LayoutParams

use of android.widget.FrameLayout.LayoutParams in project android-app by eoecn.

the class MainActivity method onAnimationStart.

@Override
public void onAnimationStart(Animation animation) {
    // TODO Auto-generated method stub
    title.setVisibility(View.VISIBLE);
    if (mIsTitleHide) {
        FrameLayout.LayoutParams lp = (LayoutParams) mlinear_listview.getLayoutParams();
        lp.setMargins(0, 0, 0, 0);
        mlinear_listview.setLayoutParams(lp);
    } else {
        FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) title.getLayoutParams();
        lp.setMargins(0, 0, 0, 0);
        title.setLayoutParams(lp);
        FrameLayout.LayoutParams lp1 = (LayoutParams) mlinear_listview.getLayoutParams();
        lp1.setMargins(0, getResources().getDimensionPixelSize(R.dimen.title_height), 0, 0);
        mlinear_listview.setLayoutParams(lp1);
    }
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams) LayoutParams(android.widget.FrameLayout.LayoutParams) FrameLayout(android.widget.FrameLayout)

Example 30 with LayoutParams

use of android.widget.FrameLayout.LayoutParams in project AndEngine by nicolasgramlich.

the class BaseGameActivity method createSurfaceViewLayoutParams.

protected static LayoutParams createSurfaceViewLayoutParams() {
    final LayoutParams layoutParams = new LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT);
    layoutParams.gravity = Gravity.CENTER;
    return layoutParams;
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams)

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