Android RelativeLayout.LayoutParams - 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 RelativeLayout.LayoutParams class.

This code example shows how to use the following methods: addRule
			} 
			else { 
				updatedOriginalParams = newLayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
			} 
			 
			updatedOriginalParams.addRule(RelativeLayout.ABOVE, socializeActionBar.getId());
			 
			original.setLayoutParams(updatedOriginalParams);
			 
			contentView = original;
		}		 
 
		parentRelLyout.addView(contentView);
		parentRelLyout.addView(socializeActionBar);
		 
		return parentRelLyout;
	} 
	 
	protected LayoutParams newLayoutParams(int width, int height) {
		return new LayoutParams(width, height);

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: addRule
		 
		if(active && childIndex == -1)
		{ 
			_hostProgressBar = new ProgressBar(getContext());
			_hostProgressBar.setIndeterminate(true);
			LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, 
					LayoutParams.WRAP_CONTENT);
			params.alignWithParent = true;
			params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
			params.addRule(RelativeLayout.CENTER_VERTICAL);
			container.addView(_hostProgressBar, params);
		} 
		else if(!active && childIndex > -1)
		{ 
			container.removeView(_hostProgressBar);
		} 
	} 
	 
	public void toggleError(View view, boolean active)
	{ 
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: addRule
        item_img_param.setMargins(0,0,5,0);
        RelativeLayout.LayoutParams item_title_param = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
        item_title_param.addRule(RelativeLayout.RIGHT_OF, image.getId());
        item_title_param.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
        item_title_param.setMargins(0,10,0,15); //left top right bottom
        RelativeLayout.LayoutParams item_text_param = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
        item_text_param.addRule(RelativeLayout.RIGHT_OF, image.getId());
        item_text_param.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
        item_text_param.addRule(RelativeLayout.BELOW, title.getId());
        image.setLayoutParams(item_img_param);
        title.setLayoutParams(item_title_param);
        text.setLayoutParams(item_text_param);
        text.setTextSize(10);
		return item;
	} 
	 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        intent1 = new Intent(this, SettingProfileActivity.class);
        intent2 = new Intent(this, SettingProfileActivity.class);
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: addRule
         * Each layout manager has its own layout parameters that allow to 
         * express rules how a widgets should be positioned. The WRAP_CONTENT 
         * parameters specify that the widget should be sized to its natural 
         * size (for both width and height). 
         */ 
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
                LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        /* 
         * Add a rule that specifies that the widget should be centered relative 
         * to the enclosing container. It is instructional to pass different 
         * layout parameters as defined in RelativeLayout (such as 
         * RelativeLayout.ALIGN_PARENT_BOTTOM). 
         */ 
        params.addRule(RelativeLayout.CENTER_IN_PARENT);
 
        /* 
         * Add the label as a child to the RelativeLayout using the specific 
         * layout parameters. 
         */ 
        layout.addView(label, params);
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: addRule
    } 
    if (touchRunnable == null) {
      throw new NullPointerException("Runnable cannot be null");
    } 
 
    LayoutParams prevParams = new LayoutParams(
        LayoutParams.WRAP_CONTENT,
        LayoutParams.WRAP_CONTENT);
    LayoutParams nextParams = new LayoutParams(
        LayoutParams.WRAP_CONTENT,
        LayoutParams.WRAP_CONTENT);
 
    prevParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
    nextParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
    prevParams.addRule(RelativeLayout.CENTER_VERTICAL);
    nextParams.addRule(RelativeLayout.CENTER_VERTICAL);
 
    nextImage = new TouchLayout(context, false);
    prevImage = new TouchLayout(context, true);
    nextImage.setLayoutParams(nextParams);

5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android RelativeLayout.LayoutParams Questions & Answers:

See Code Examples for Android RelativeLayout.LayoutParams Methods: