本文整理汇总了Java中android.widget.RelativeLayout.getLayoutParams方法的典型用法代码示例。如果您正苦于以下问题:Java RelativeLayout.getLayoutParams方法的具体用法?Java RelativeLayout.getLayoutParams怎么用?Java RelativeLayout.getLayoutParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.RelativeLayout
的用法示例。
在下文中一共展示了RelativeLayout.getLayoutParams方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ffmpeg_preview);
cancelBtn = (Button) findViewById(R.id.play_cancel);
cancelBtn.setOnClickListener(this);
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
surfaceView = (TextureView) findViewById(R.id.preview_video);
RelativeLayout previewVideoParent = (RelativeLayout)findViewById(R.id.preview_video_parent);
LayoutParams layoutParams = (LayoutParams) previewVideoParent
.getLayoutParams();
layoutParams.width = displaymetrics.widthPixels;
layoutParams.height = displaymetrics.widthPixels;
previewVideoParent.setLayoutParams(layoutParams);
surfaceView.setSurfaceTextureListener(this);
surfaceView.setOnClickListener(this);
path = getIntent().getStringExtra("path");
imagePlay = (ImageView) findViewById(R.id.previre_play);
imagePlay.setOnClickListener(this);
mediaPlayer = new MediaPlayer();
mediaPlayer.setOnCompletionListener(this);
}
示例2: setStatusBarTransparent
import android.widget.RelativeLayout; //导入方法依赖的package包/类
@SuppressLint({"NewApi"})
private void setStatusBarTransparent(String titleResId) {
ViewGroup title = (ViewGroup) this.mRootView.findViewWithTag(titleResId);
if (VERSION.SDK_INT >= 19) {
getWindow().getDecorView().setSystemUiVisibility(1280);
getWindow().addFlags(67108864);
if (title != null) {
LayoutParams lp = title.getLayoutParams();
lp.height = dip2px(72.0f);
title.setLayoutParams(lp);
RelativeLayout back = (RelativeLayout) this.mRootView.findViewWithTag("umgr_title_back_layout");
RelativeLayout.LayoutParams rlp = (RelativeLayout.LayoutParams) back.getLayoutParams();
rlp.topMargin = dip2px(24.0f);
back.setLayoutParams(rlp);
RelativeLayout t = (RelativeLayout) this.mRootView.findViewWithTag("umgr_title_tv_layout");
RelativeLayout.LayoutParams rrlp = (RelativeLayout.LayoutParams) t.getLayoutParams();
rrlp.topMargin = dip2px(24.0f);
t.setLayoutParams(rrlp);
}
}
}
示例3: initNavigationBar
import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void initNavigationBar() {
RelativeLayout my_playrecrod_content = (RelativeLayout) findViewById(R.id.my_collect_content);
LayoutParams params = (LayoutParams) my_playrecrod_content.getLayoutParams();
params.bottomMargin = 0;
my_playrecrod_content.setLayoutParams(params);
this.mBackImageView = (ImageView) findViewById(2131362351);
this.mEditView = (TextView) findViewById(2131362354);
this.mEditView.setText(2131099788);
this.mEditView.setTextColor(this.mContext.getResources().getColor(2131493261));
this.mTitleView = (TextView) findViewById(2131362352);
this.mLoginTip = (RelativeLayout) findViewById(R.id.my_collect_bottom_login_btn);
this.mLoginTip.setVisibility(8);
this.mTitleView.setText(getResources().getString(2131100479));
this.mBackImageView.setOnClickListener(this.onClickEvent);
this.mTitleView.setOnClickListener(this.onClickEvent);
this.mEditView.setOnClickListener(this.onClickEvent);
}
示例4: PhotoHolder
import android.widget.RelativeLayout; //导入方法依赖的package包/类
PhotoHolder(View v) {
super(v);
layout = (RelativeLayout) v.findViewById(image_view_container);
imView = (ImageView) v.findViewById(image_id);
title = (TextView) v.findViewById(title_id);
layout.getLayoutParams().height = Defaults.IMAGE_HEIGHT;
if (isShapeCircle) {
int pad = Defaults.CIRCLE_PADDING;
imView.setPadding(pad, pad, pad, pad);
}
}
示例5: onCreateView
import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, final ViewGroup container,
Bundle savedInstanceState) {
final Utils utils = new Utils(getActivity());
View rootView = inflater.inflate(R.layout.cards_fragment, container, false);
RelativeLayout relativeLayout = (RelativeLayout) rootView.findViewById(R.id.vg_cover);
// Set the width of cards according to width of screen
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) relativeLayout.getLayoutParams();
layoutParams.width = (int) (utils.getScreenWidth() * .8f);
relativeLayout.setOnClickListener(this);
frontText = (TextView) rootView.findViewById(R.id.frontText);
backText = (TextView) rootView.findViewById(R.id.backText);
pronunciationBtn = (MaterialRippleLayout) rootView.findViewById(R.id.pronunciationBtn);
pronunciationBtn.setEnabled(false);
// Instantiate the various views of the card.
updateCheckedStatus(cardModel);
pronunciationBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mp.start();
}
});
return rootView;
}
示例6: initView
import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void initView() {
if(!dialogMode) {
RelativeLayout mainRelLayout = (RelativeLayout)findViewByResName("mainRelLayout");
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) mainRelLayout.getLayoutParams();
lp.setMargins(0,0,0,0);
lp.height = RelativeLayout.LayoutParams.MATCH_PARENT;
mainRelLayout.setLayoutParams(lp);
}
initTitleView();
initBodyView();
initImageListView();
}
示例7: DialogProvider
import android.widget.RelativeLayout; //导入方法依赖的package包/类
public DialogProvider(Context context) {
this.context = context;
buttonTextSize = context.getResources().getDimensionPixelSize(R.dimen.text_dialog_button);
buttonPadding = context.getResources().getDimensionPixelSize(R.dimen.dialog_padding);
rootView = LayoutInflater.from(context).inflate(R.layout.dialog, null);
mFirstOuter = (LinearLayout) rootView.findViewById(R.id.dialog_layout_outermost);
mSecondOuter = (LinearLayout) rootView.findViewById(R.id.dialog_layout_outside);
mInsider = (LinearLayout) rootView.findViewById(R.id.dialog_layout_inside);
mCustomContainer = (RelativeLayout) rootView.findViewById(R.id.dialog_button_layout);
mTitle = (TextView) rootView.findViewById(R.id.dialog_title);
mMessage = (TextView) rootView.findViewById(R.id.dialog_message);
ViewGroup.LayoutParams p = mCustomContainer.getLayoutParams();
p.height = 0;
mCustomContainer.setLayoutParams(p);
mNeuterButton = (TextView) rootView.findViewById(R.id.dialog_Neuter);
mNeuterButton.setVisibility(View.GONE);
mPositiveButton = (TextView) rootView.findViewById(R.id.dialog_positive);
mPositiveButton.setVisibility(View.GONE);
mNegativeButton = (TextView) rootView.findViewById(R.id.dialog_Negative);
mNegativeButton.setVisibility(View.GONE);
mTopLine = rootView.findViewById(R.id.dialog_line1);
mMiddleLine = rootView.findViewById(R.id.dialog_line2);
themeEnum = new AppPreference(context).getTheme();
updateTheme();
}
示例8: convert
import android.widget.RelativeLayout; //导入方法依赖的package包/类
@Override
protected void convert(BaseViewHolder holder, Note note) {
RelativeLayout gridItem = holder.getView(R.id.grid_item);
ViewGroup.LayoutParams layoutParams = gridItem.getLayoutParams();
layoutParams.width = ScreenUtil.getScreenDispaly(mContext)[0] / 2;
layoutParams.height = ScreenUtil.getScreenDispaly(mContext)[0] / 2;
gridItem.setLayoutParams(layoutParams);
holder.addOnClickListener(R.id.cardview).addOnLongClickListener(R.id.cardview);
TextView content = holder.getView(R.id.content);
TextView time = holder.getView(R.id.time);
ImageView thumbnail = holder.getView(R.id.thumbnail_iv);
content.setText(note.getContent());
if (StringUtils.isNotEmpty(note.getContent())) {
if (note.getContent().length() > 20) {
//TODO 字数多了换成两行显示,字体缩小。
//this.content.setText(note.getContent());
}
}
time.setText(mContext.getString(R.string.note_log_text, mContext.getString(R.string.create),
TimeUtils.getTime(note.getCreateTime())));
Logger.INSTANCE.e("" + note.getImagePath());
if (StringUtils.isEmpty(note.getImagePath()) || "[]".equals(note.getImagePath())) {
thumbnail.setVisibility(View.INVISIBLE);
content.setTextColor(mContext.getResources().getColor(R.color.gray));
time.setTextColor(mContext.getResources().getColor(R.color.gray));
} else {
thumbnail.setVisibility(View.VISIBLE);
content.setTextColor(mContext.getResources().getColor(R.color.white));
time.setTextColor(mContext.getResources().getColor(R.color.white));
ImageUtils.INSTANCE.showThumbnail(mContext, note.getImagePath(), thumbnail);
}
}
示例9: initView
import android.widget.RelativeLayout; //导入方法依赖的package包/类
private void initView() {
if (!this.dialogMode) {
RelativeLayout mainRelLayout = (RelativeLayout) findViewByResName("mainRelLayout");
LayoutParams lp = (LayoutParams) mainRelLayout.getLayoutParams();
lp.setMargins(0, 0, 0, 0);
lp.height = -1;
mainRelLayout.setLayoutParams(lp);
}
initTitleView();
initBodyView();
initImageListView();
}
示例10: getParamsLayoutOffset
import android.widget.RelativeLayout; //导入方法依赖的package包/类
protected RelativeLayout.LayoutParams getParamsLayoutOffset(RelativeLayout layout, ExpandableItemData itemData) {
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) layout.getLayoutParams();
params.leftMargin = itemMargin * itemData.getTreeDepth() + offsetMargin;
return params;
}
示例11: getParamsLayout
import android.widget.RelativeLayout; //导入方法依赖的package包/类
protected RelativeLayout.LayoutParams getParamsLayout(RelativeLayout layout, T itemData) {
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) layout.getLayoutParams();
params.leftMargin = itemMargin * itemData.getTreeDepth();
return params;
}