本文整理汇总了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;
}