ExpandableListView setIndicatorBounds - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ExpandableListView setIndicatorBounds method.

This code example shows how to use the following methods:setIndicatorBounds
        /* Get the screen width */ 
        DisplayMetrics dm = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(dm);
        int width = dm.widthPixels;
  
        expListView.setIndicatorBounds(width - getDipsFromPixel(60), width
                - getDipsFromPixel(5)); 
    } 
  
    // Convert pixel to dip 
    public int getDipsFromPixel(float pixels) {
        // Get the screen's density scale 
        final float scale = getResources().getDisplayMetrics().density;
        // Convert the dps to pixels, based on density scale 
        return (int) (pixels * scale + 0.5f);
    } 
  
} 
4
CodeRank
This code example shows how to use the following methods:setIndicatorBounds
 
		DisplayMetrics dm = new DisplayMetrics(); // 取得窗口属性
		getWindowManager().getDefaultDisplay().getMetrics(dm);
		// 窗口的宽度 
		int screenWidth = dm.widthPixels;
		chooseTypeExpandableListView.setIndicatorBounds(screenWidth - idicateWidth, screenWidth);
	} 
 
	/** 
	 * 初使化顶部控件 
	 */ 
	private void initTop(){ 
		TextView topicTextView = (TextView)findViewById(R.id.txtTopic);
		topicTextView.setText(R.string.searcharoundtype_topic);
		ImageButton backImageButton = (ImageButton)findViewById(R.id.btnBack);
		backImageButton.setOnClickListener(new BackListener(this));
	} 
 
 
 
4
CodeRank
setIndicatorBounds Method Overview
Sets the drawing bounds for the indicators (at minimum, the group indicator is affected by this; the child indicator is affected by this if the child indicator bounds are set to inherit).
See Code Examples for other Android ExpandableListView Methods: