当前位置: 首页>>代码示例>>Java>>正文


Java Orientation.LEFT_RIGHT属性代码示例

本文整理汇总了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 });
}
 
开发者ID:hwangjr,项目名称:AndroidProjectTemplete,代码行数:7,代码来源:SlicedPanelLayout.java

示例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);
}
 
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:15,代码来源:ColorPickerAdvancedComponent.java

示例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();
}
 
开发者ID:WanderingSeed,项目名称:Common-Library,代码行数:36,代码来源:SlideMenu.java

示例4: loadBGUtils

public BGUtils loadBGUtils() {
	int[] colorsInGradient = BGUtils.createGrayGradient3();
	BGUtils bgUtils = new BGUtils(Orientation.LEFT_RIGHT, colorsInGradient,
			BGUtils.genCornerArray(2));
	return bgUtils;
}
 
开发者ID:pnosalik,项目名称:AugmentedOxford,代码行数:6,代码来源:M_SeperatorLine.java

示例5: B3

public static Theme.ThemeBackground B3() {
	Theme.ThemeBackground b = new ThemeBackground();
	b.gradientOrientation = Orientation.LEFT_RIGHT;
	b.cornerRadii = genCornerArray(10);
	return b;
}
 
开发者ID:pnosalik,项目名称:AugmentedOxford,代码行数:6,代码来源:Theme.java


注:本文中的android.graphics.drawable.GradientDrawable.Orientation.LEFT_RIGHT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。