Code example for ProgressBar

0
    	int p = AQUtility.dip2pixel(context, 30);
    	LinearLayout.LayoutParams plp = new LinearLayout.LayoutParams(p, p);
    	ll.addView(progress, plp);
    	 
    	if(message != null){
	    	TextView tv = new TextView(context);
	    	LinearLayout.LayoutParams tlp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
	    	tlp.leftMargin = AQUtility.dip2pixel(context, 5);
	    	tlp.gravity = 0x10;
	    	tv.setText(message);
	    	ll.addView(tv, tlp);
    	} 
    	 
    	RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); 
    	lp.addRule(RelativeLayout.CENTER_IN_PARENT);
    	 
        layout.addView(ll, lp);
    	 
    } 
     
Contextual code suggestions in your IDE  Get Codota for Java