Search in sources :

Example 46 with LayoutParams

use of android.widget.FrameLayout.LayoutParams in project MVP by yuchengren.

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 47 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 48 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 49 with LayoutParams

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

the class PlayerFragment method setClosedCaptionData.

/**
 * This function sets the closed caption data on the TextView
 */
private void setClosedCaptionData(Caption text) {
    try {
        RelativeLayout subTitlesLayout = (RelativeLayout) getActivity().findViewById(R.id.txtSubtitles);
        TextView subTitlesTv = (TextView) getActivity().findViewById(R.id.txtSubtitles_tv);
        if (subTitlesTv != null) {
            if (text != null) {
                int margin_twenty_dp = (int) UiUtil.getParamsInDP(getResources(), 20);
                int margin_ten_dp = (int) UiUtil.getParamsInDP(getResources(), 10);
                if (player != null) {
                    LayoutParams lp = (LayoutParams) subTitlesLayout.getLayoutParams();
                    if (player.getController() != null && player.getController().isShown()) {
                        if (player.isFullScreen()) {
                            lp.setMargins(margin_twenty_dp, 0, margin_twenty_dp, (int) UiUtil.getParamsInDP(getResources(), 50));
                        } else {
                            lp.setMargins(margin_twenty_dp, 0, margin_twenty_dp, (int) UiUtil.getParamsInDP(getResources(), 42));
                        }
                        subTitlesLayout.setLayoutParams(lp);
                    } else {
                        if (player.isFullScreen()) {
                            lp.setMargins(margin_twenty_dp, 0, margin_twenty_dp, margin_ten_dp);
                        } else {
                            lp.setMargins(margin_twenty_dp, 0, margin_twenty_dp, (int) UiUtil.getParamsInDP(getResources(), 5));
                        }
                        subTitlesLayout.setLayoutParams(lp);
                    }
                }
                subTitlesTv.setPadding(margin_ten_dp, (int) UiUtil.getParamsInDP(getResources(), 2), margin_ten_dp, (int) UiUtil.getParamsInDP(getResources(), 2));
                subTitlesTv.setText("");
                // This has been done because text.content contains <br />
                // in the end of each message
                String temp = text.content;
                if (temp.endsWith("<br />")) {
                    temp = temp.substring(0, temp.length() - 6);
                }
                if (temp.length() == 0) {
                    subTitlesTv.setVisibility(View.GONE);
                } else {
                    subTitlesTv.setText(temp);
                    subTitlesTv.setVisibility(View.VISIBLE);
                }
            } else {
                subTitlesTv.setVisibility(View.GONE);
            }
        }
    } catch (Exception e) {
        logger.error(e);
    }
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams) RelativeLayout(android.widget.RelativeLayout) TextView(android.widget.TextView) SuppressLint(android.annotation.SuppressLint) Point(android.graphics.Point) ParseException(java.text.ParseException)

Example 50 with LayoutParams

use of android.widget.FrameLayout.LayoutParams in project superCleanMaster by joyoyao.

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