Code example for View

Methods: getHeightgetLayoutParams

0
     * 
     * @param includeMargins whether or not to include margins when calculating 
     *            height. 
     */ 
    public static int getHeight(View view, boolean includeMargins) {
        ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
        return view.getHeight() + (includeMargins ? params.topMargin + params.bottomMargin : 0);
    } 
 
    /** 
     * Returns the number of lines of this text view. 
     */ 
    private static int getLineCount(TextView textView) {
        return textView.getHeight() / textView.getLineHeight();
    } 
 
    /** 
     * Returns the length (maximum of characters) of subject in this mode. 
     */ 
    public static int getSubjectLength(Context context, int mode) {