當前位置: 首頁>>代碼示例>>Java>>正文


Java RelativeLayout.getLayoutParams方法代碼示例

本文整理匯總了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);
}
 
開發者ID:feigxj,項目名稱:VideoRecorder-master,代碼行數:31,代碼來源:FFmpegPreviewActivity.java

示例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);
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:22,代碼來源:BasicActivity.java

示例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);
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:18,代碼來源:MyPlayRecordActivity.java

示例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);
    }
}
 
開發者ID:prashantsaini1,項目名稱:titanium-android-imagepicker,代碼行數:15,代碼來源:ImageViewerActivity.java

示例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;
}
 
開發者ID:riteshakya037,項目名稱:Flashcards-Demo,代碼行數:31,代碼來源:ScreenSlidePageFragment.java

示例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();
}
 
開發者ID:liupengandroid,項目名稱:ywApplication,代碼行數:13,代碼來源:EditPage.java

示例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();

}
 
開發者ID:DuanJiaNing,項目名稱:Musicoco,代碼行數:35,代碼來源:DialogProvider.java

示例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);
    }
}
 
開發者ID:lpy19930103,項目名稱:MinimalismJotter,代碼行數:36,代碼來源:GridNoteAdapter.java

示例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();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:13,代碼來源:EditPage.java

示例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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:6,代碼來源:BaseViewHolder.java

示例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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:6,代碼來源:BaseViewHolder.java


注:本文中的android.widget.RelativeLayout.getLayoutParams方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。