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);
}
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);
}
}
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);
}
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);
}
}
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);
}
Aggregations