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

The following examples show how to use android.view.View#getPaddingEnd() . 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
Source File: WidgetPlacement.java    From FirefoxReality with Mozilla Public License 2.0 5 votes vote down vote up
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 File: AndroidBarUtils.java    From AndroidBarUtils with 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
Source File: ApiCompatibilityUtils.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * @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
Source File: ViewCompatUtils.java    From AppCompat-Extension-Library with Apache License 2.0 5 votes vote down vote up
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 File: ViewCompatJellybeanMr1.java    From letv with Apache License 2.0 4 votes vote down vote up
public static int getPaddingEnd(View view) {
    return view.getPaddingEnd();
}
 
Example 6
Source File: Compat.java    From ProjectX with Apache License 2.0 4 votes vote down vote up
@Override
public int getPaddingEnd(View view) {
    return view.getPaddingEnd();
}
 
Example 7
Source File: Compat.java    From ProjectX with Apache License 2.0 4 votes vote down vote up
@Override
public int getPaddingEnd(View view) {
    return view.getPaddingEnd();
}
 
Example 8
Source File: Compat.java    From ProjectX with Apache License 2.0 4 votes vote down vote up
@Override
public int getPaddingEnd(View view) {
    return view.getPaddingEnd();
}
 
Example 9
Source File: ViewCompatJellybeanMr1.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
public static int getPaddingEnd(View view) {
    return view.getPaddingEnd();
}