Android ViewGroup.MarginLayoutParams - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ViewGroup.MarginLayoutParams class.

This code example shows how to use the following methods: setMargins
			width = LayoutParams.FILL_PARENT;
		} 
		else{ 
			width = (Long) settings.get("width");
		} 
		LayoutParams p = new FrameLayout.LayoutParams((int)width,(int)height,0);
		p.setMargins((int)left, (int)top, (int)right, (int)bottom);
		return p;
	} 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setMarginStart
    /** 
     * @see android.view.ViewGroup.MarginLayoutParams#setMarginStart(int) 
     */ 
    public static void setMarginStart(MarginLayoutParams layoutParams, int start) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            layoutParams.setMarginStart(start);
        } else { 
            layoutParams.leftMargin = start;
        } 
    } 
 
    /** 
     * @see android.view.ViewGroup.MarginLayoutParams#getMarginStart() 
     */ 
    public static int getMarginStart(MarginLayoutParams layoutParams) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            return layoutParams.getMarginStart();
        } else { 
            return layoutParams.leftMargin;
        } 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setMargins
	private LoadTimeDate(){} 
	 
	public void getView(int choice, int integerId, int integerWidth, int integerHeight, int integerLayoutX, int integerLayoutY, String text ) {
 
		if (choice == 0) {
			params = new FrameLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
			context = Home.getHome().getLayout().getContext();
			TimePicker timePicker = new TimePicker(context);
			timePicker.setId(integerId);
			timePicker.setCurrentHour(hour);
			timePicker.setCurrentMinute(minute);
			timePicker.setBackgroundColor(Color.DKGRAY);
			timePicker.setScaleX(0.50f);
			timePicker.setScaleY(0.50f);
			params.setMargins(integerLayoutX, integerLayoutY, 0, 0);
			timePicker.setLayoutParams(params);
			Home.getHome().getLayout().addView(timePicker, params);
			timePicker.setOnTouchListener(new DragListener(timePicker));
			if (timePickerId > integerId){
				timePickerId = timePickerId;

5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setMargins
    	} 
    	 
    	View view = control.getView(inflater);
    	mRootLayout.addView(view);
    	 
    	RelativeLayout.LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
    														ViewGroup.LayoutParams.WRAP_CONTENT);
    	lp.alignWithParent = true;
    	lp.setMargins(x, y, 0, 0);
    	control.setLayoutParame(lp);
    	control.setLabel(label);
    	 
    } 
     
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setMargins
    	} 
    	 
    	View view = control.getView(inflater);
    	mRootLayout.addView(view);
    	 
    	RelativeLayout.LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
    														ViewGroup.LayoutParams.WRAP_CONTENT);
    	lp.alignWithParent = true;
    	lp.setMargins(x, y, 0, 0);
    	control.setLayoutParame(lp);
    	control.setLabel(label);
    	 
    } 
     
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android ViewGroup.MarginLayoutParams Questions & Answers:

See Code Examples for Android ViewGroup.MarginLayoutParams Methods: