/** * Specify the text size for the title via a dimen resource * <p> * Note: If set, this value will take precedence over the specified sp size */ public TapTarget titleTextDimen(@DimenRes int dimen) { this.titleTextDimen = dimen; return this; }
/** * Specify the text size for the description via a dimen resource * <p> * Note: If set, this value will take precedence over the specified sp size */ public TapTarget descriptionTextDimen(@DimenRes int dimen) { this.descriptionTextDimen = dimen; return this; }
/** * @param leftRes Left padding as dimension resource. * @param topRes Top padding as dimension resource. * @param rightRes Right padding as dimension resource. * @param bottomRes Bottom padding as dimension resource. * @param itemSpacingRes Space as dimension resource to add between each carousel item. Will be * implemented via an item decoration. */ public static Padding resource( @DimenRes int leftRes, @DimenRes int topRes, @DimenRes int rightRes, @DimenRes int bottomRes, @DimenRes int itemSpacingRes) { return new Padding( leftRes, topRes, rightRes, bottomRes, itemSpacingRes, PaddingType.RESOURCE); }
/** * Set the DrawerBuilder width with a dimension resource * * @param drawerWidthRes * @return */ public DrawerBuilder withDrawerWidthRes(@DimenRes int drawerWidthRes) { if (mActivity == null) { throw new RuntimeException("please pass an activity first to use this call"); } this.mDrawerWidth = mActivity.getResources().getDimensionPixelSize(drawerWidthRes); return this; }
/** * @param paddingRes Padding as dimension resource. * @param itemSpacingRes Space as dimension resource to add between each carousel item. Will be * implemented via an item decoration. */ public static Padding resource(@DimenRes int paddingRes, @DimenRes int itemSpacingRes) { return new Padding( paddingRes, paddingRes, paddingRes, paddingRes, itemSpacingRes, PaddingType.RESOURCE); }
/** * set the height for the header by resource * * @param heightRes * @return */ public AccountHeaderBuilder withHeightRes(@DimenRes int heightRes) { this.mHeight = DimenHolder.fromResource(heightRes); return this; }
public BadgeStyle withPaddingLeftRightRes(@DimenRes int paddingLeftRight) { this.mPaddingLeftRight = DimenHolder.fromResource(paddingLeftRight); return this; }
public BadgeStyle withPaddingTopBottomRes(@DimenRes int paddingTopBottom) { this.mPaddingTopBottom = DimenHolder.fromResource(paddingTopBottom); return this; }
public MiniProfileDrawerItem withCustomHeightRes(@DimenRes int customHeightRes) { this.customHeight = DimenHolder.fromResource(customHeightRes); return this; }
public MiniDrawerItem withCustomHeightRes(@DimenRes int customHeightRes) { this.mCustomHeight = DimenHolder.fromResource(customHeightRes); return this; }
/** * Set background contour width from an dimen res for the icon * * @return The current IconicsDrawable for chaining. */ @NonNull public IconicsDrawable backgroundContourWidthRes(@DimenRes int sizeResId) { return backgroundContourWidthPx(mContext.getResources().getDimensionPixelSize(sizeResId)); }
public GridItemDividerDecoration(@NonNull Context context, @DimenRes int dividerSizeResId, @ColorRes int dividerColorResId) { this(context.getResources().getDimensionPixelSize(dividerSizeResId), ContextCompat.getColor(context, dividerColorResId)); }
/** * Set the size of the drawable. * * @param sizeResId The dimension resource. * @return The current IconicsDrawable for chaining. */ @NonNull public IconicsDrawable sizeResY(@DimenRes int sizeResId) { return sizePxY(mContext.getResources().getDimensionPixelSize(sizeResId)); }
/** * set the icon offset for Y from resource * * @return The current IconicsDrawable for chaining. */ @NonNull public IconicsDrawable iconOffsetYRes(@DimenRes int sizeResId) { return iconOffsetYPx(mContext.getResources().getDimensionPixelSize(sizeResId)); }
/** * Set the padding of the drawable from res * * @return The current IconicsDrawable for chaining. */ @NonNull public IconicsDrawable paddingRes(@DimenRes int sizeResId) { return paddingPx(mContext.getResources().getDimensionPixelSize(sizeResId)); }
/** * Set rounded corner from res * * @return The current IconicsDrawable for chaining. */ @NonNull public IconicsDrawable roundedCornersRyRes(@DimenRes int sizeResId) { return roundedCornersRyPx(mContext.getResources().getDimensionPixelSize(sizeResId)); }
private int dimenOrSize(Context context, int size, @DimenRes int dimen) { if (dimen != -1) { return context.getResources().getDimensionPixelSize(dimen); } return UiUtil.sp(context, size); } }
/** * set the icon offset for X from resource * * @return The current IconicsDrawable for chaining. */ @NonNull public IconicsDrawable iconOffsetXRes(@DimenRes int sizeResId) { return iconOffsetXPx(mContext.getResources().getDimensionPixelSize(sizeResId)); }
/** * Set the size of the drawable. * * @param sizeResId The dimension resource. * @return The current IconicsDrawable for chaining. */ @NonNull public IconicsDrawable sizeRes(@DimenRes int sizeResId) { return sizePx(mContext.getResources().getDimensionPixelSize(sizeResId)); }
/** * Set the size of the drawable. * * @param sizeResId The dimension resource. * @return The current IconicsDrawable for chaining. */ @NonNull public IconicsDrawable sizeResX(@DimenRes int sizeResId) { return sizePxX(mContext.getResources().getDimensionPixelSize(sizeResId)); }