當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。