Java Code Examples for android.view.View#getPaddingEnd()

The following examples show how to use android.view.View#getPaddingEnd() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public void setSizeFromMeasure(Context aContext, View aView) {
    aView.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
                  View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
    int border =  SettingsStore.getInstance(aContext).getTransparentBorderWidth();
    int paddingH = aView.getPaddingStart() + aView.getPaddingEnd();
    int paddingV = aView.getPaddingTop() + aView.getPaddingBottom();
    width = (int)Math.ceil((aView.getMeasuredWidth() + paddingH)/density) + border * 2;
    height = (int)Math.ceil((aView.getMeasuredHeight() + paddingV)/density) + border * 2;
}
 
Example 2
Source Project: AndroidBarUtils   File: AndroidBarUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 设置BarPaddingTop
 *
 * @param context Activity
 * @param view    View[ToolBar、TitleBar、navigationView.getHeaderView(0)]
 */
public static void setBarPaddingTop(Activity context, View view) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        int paddingStart = view.getPaddingStart();
        int paddingEnd = view.getPaddingEnd();
        int paddingBottom = view.getPaddingBottom();
        int statusBarHeight = getStatusBarHeight(context);
        //改变titleBar的高度
        ViewGroup.LayoutParams lp = view.getLayoutParams();
        lp.height += statusBarHeight;
        view.setLayoutParams(lp);
        //设置paddingTop
        view.setPaddingRelative(paddingStart, statusBarHeight, paddingEnd, paddingBottom);
    }
}
 
Example 3
/**
 * @see android.view.View#getPaddingEnd()
 */
public static int getPaddingEnd(View view) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        return view.getPaddingEnd();
    } else {
        // Before JB MR1, all layouts are left-to-right, so end == right.
        return view.getPaddingRight();
    }
}
 
Example 4
public static int getPaddingEnd(View view) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
        return view.getPaddingEnd();
    } else {
        return view.getPaddingRight();
    }
}
 
Example 5
Source Project: letv   File: ViewCompatJellybeanMr1.java    License: Apache License 2.0 4 votes vote down vote up
public static int getPaddingEnd(View view) {
    return view.getPaddingEnd();
}
 
Example 6
Source Project: ProjectX   File: Compat.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public int getPaddingEnd(View view) {
    return view.getPaddingEnd();
}
 
Example 7
Source Project: ProjectX   File: Compat.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public int getPaddingEnd(View view) {
    return view.getPaddingEnd();
}
 
Example 8
Source Project: ProjectX   File: Compat.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public int getPaddingEnd(View view) {
    return view.getPaddingEnd();
}
 
Example 9
public static int getPaddingEnd(View view) {
    return view.getPaddingEnd();
}