本文整理匯總了Java中android.graphics.drawable.GradientDrawable.Orientation.LEFT_RIGHT屬性的典型用法代碼示例。如果您正苦於以下問題:Java Orientation.LEFT_RIGHT屬性的具體用法?Java Orientation.LEFT_RIGHT怎麽用?Java Orientation.LEFT_RIGHT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.graphics.drawable.GradientDrawable.Orientation
的用法示例。
在下文中一共展示了Orientation.LEFT_RIGHT屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setupShadowDrawable
private void setupShadowDrawable() {
int start = Color.parseColor("#00000000");
int center = Color.parseColor("#11000000");
int end = Color.parseColor("#33000000");
mDrawableLeft = new GradientDrawable(Orientation.LEFT_RIGHT, new int[] { start, center, end });
mDrawableRight = new GradientDrawable(Orientation.LEFT_RIGHT, new int[] { end, center, start });
}
示例2: setGradientColors
/**
* Sets the colors for the gradient view to interpolate through.
*
* @param newColors The set of colors representing the interpolation points for the gradient.
*/
public void setGradientColors(int[] newColors) {
mGradientColors = newColors.clone();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
Orientation currentOrientation = Orientation.LEFT_RIGHT;
mGradientDrawable = new GradientDrawable(currentOrientation, mGradientColors);
} else {
mGradientDrawable.setColors(mGradientColors);
}
ApiCompatibilityUtils.setBackgroundForView(mGradientView, mGradientDrawable);
}
示例3: SlideMenu
public SlideMenu(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// we want to draw drop shadow of content
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
mVelocityTracker = VelocityTracker.obtain();
mScroller = new Scroller(context, mInterpolator);
mContentHitRect = new Rect();
STATUS_BAR_HEIGHT = (int) getStatusBarHeight(context);
setWillNotDraw(false);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SlideMenu, defStyle, 0);
// Set the shadow attributes
setPrimaryShadowWidth(a.getDimension(R.styleable.SlideMenu_primaryShadowWidth, 30));
setSecondaryShadowWidth(a.getDimension(R.styleable.SlideMenu_secondaryShadowWidth, 30));
Drawable primaryShadowDrawable = a.getDrawable(R.styleable.SlideMenu_primaryShadowDrawable);
if (null == primaryShadowDrawable) {
primaryShadowDrawable = new GradientDrawable(Orientation.LEFT_RIGHT, new int[] { Color.TRANSPARENT,
Color.argb(99, 0, 0, 0) });
}
setPrimaryShadowDrawable(primaryShadowDrawable);
Drawable secondaryShadowDrawable = a.getDrawable(R.styleable.SlideMenu_sencondaryShadowDrawable);
if (null == secondaryShadowDrawable) {
secondaryShadowDrawable = new GradientDrawable(Orientation.LEFT_RIGHT, new int[] { Color.argb(99, 0, 0, 0),
Color.TRANSPARENT });
}
setSecondaryShadowDrawable(secondaryShadowDrawable);
mSlideDirectionFlag = a
.getInt(R.styleable.SlideMenu_slideDirection, FLAG_DIRECTION_LEFT | FLAG_DIRECTION_RIGHT);
setFocusable(true);
setFocusableInTouchMode(true);
a.recycle();
}
示例4: loadBGUtils
public BGUtils loadBGUtils() {
int[] colorsInGradient = BGUtils.createGrayGradient3();
BGUtils bgUtils = new BGUtils(Orientation.LEFT_RIGHT, colorsInGradient,
BGUtils.genCornerArray(2));
return bgUtils;
}
示例5: B3
public static Theme.ThemeBackground B3() {
Theme.ThemeBackground b = new ThemeBackground();
b.gradientOrientation = Orientation.LEFT_RIGHT;
b.cornerRadii = genCornerArray(10);
return b;
}