當前位置: 首頁>>代碼示例>>Java>>正文


Java Orientation.TOP_BOTTOM屬性代碼示例

本文整理匯總了Java中android.graphics.drawable.GradientDrawable.Orientation.TOP_BOTTOM屬性的典型用法代碼示例。如果您正苦於以下問題:Java Orientation.TOP_BOTTOM屬性的具體用法?Java Orientation.TOP_BOTTOM怎麽用?Java Orientation.TOP_BOTTOM使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.graphics.drawable.GradientDrawable.Orientation的用法示例。


在下文中一共展示了Orientation.TOP_BOTTOM屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setVerValSlider

/**
 * Create a linear gradient shader to show variations in value.
 */
private void setVerValSlider() {
	float[] hsv = new float[3];
	hsv[0] = mHSV[0];
	hsv[1] = mHSV[1];
	hsv[2] = 1;
	int col = Color.HSVToColor(hsv);

	int colors[] = new int[2];
	colors[0] = col;
	colors[1] = 0xFF000000;
	GradientDrawable gradDraw = new GradientDrawable(Orientation.TOP_BOTTOM, colors);
	gradDraw.setDither(true);
	gradDraw.setLevel(10000);
	gradDraw.setBounds(0, 0, mSliderThicknessPx, mPaletteDimPx);
	gradDraw.draw(mVerSliderCv);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:19,代碼來源:UberColorPickerDialog.java

示例2: initResourcesIfNecessary

/**
 * Initializes resources
 */
private void initResourcesIfNecessary() {
	if (centerDrawable == null) {
		centerDrawable = getContext().getResources().getDrawable(wheelForeground);
	}

	if (topShadow == null) {
		topShadow = new GradientDrawable(Orientation.TOP_BOTTOM, SHADOWS_COLORS);
	}

	if (bottomShadow == null) {
		bottomShadow = new GradientDrawable(Orientation.BOTTOM_TOP, SHADOWS_COLORS);
	}

	setBackgroundResource(wheelBackground);
}
 
開發者ID:PengSen,項目名稱:work_sen,代碼行數:18,代碼來源:WheelView.java

示例3: SearchView

public SearchView(Context context, StringBuilder queryText) {
    super(context);

    mContext = context;
    mQueryText = queryText;

    mPaint = new Paint();
    mPaint.setAntiAlias(true);

    final SurfaceHolder holder = getHolder();
    holder.setFormat(PixelFormat.TRANSLUCENT);
    holder.addCallback(mSurfaceCallback);

    final Resources res = context.getResources();

    int mExtremeRadius = 128;

    // Gradient colors.
    final int gradientInnerColor = res.getColor(R.color.search_overlay);
    final int gradientOuterColor = res.getColor(R.color.search_overlay);
    final int[] colors = new int[] {gradientInnerColor, gradientOuterColor};
    mGradientBackground =
            new GradientDrawable(Orientation.TOP_BOTTOM, colors);
    mGradientBackground.setGradientType(GradientDrawable.LINEAR_GRADIENT);
}
 
開發者ID:google,項目名稱:brailleback,代碼行數:25,代碼來源:SearchView.java

示例4: initResourcesIfNecessary

/**
 * Initializes resources
 */
private void initResourcesIfNecessary() {
    if (centerDrawable == null) {
        centerDrawable = getContext().getResources().getDrawable(wheelForeground);
    }

    if (topShadow == null) {
        topShadow = new GradientDrawable(Orientation.TOP_BOTTOM, SHADOWS_COLORS);
    }

    if (bottomShadow == null) {
        bottomShadow = new GradientDrawable(Orientation.BOTTOM_TOP, SHADOWS_COLORS);
    }

    setBackgroundResource(wheelBackground);
}
 
開發者ID:absentm,項目名稱:myapplication,代碼行數:18,代碼來源:WheelView.java

示例5: initResourcesIfNecessary

/**
 * Initializes resources
 */
private void initResourcesIfNecessary() {
	if (centerDrawable == null) {
		centerDrawable = getContext().getResources().getDrawable(
				R.drawable.two_line);
	}

	if (topShadow == null) {
		topShadow = new GradientDrawable(Orientation.TOP_BOTTOM,
				SHADOWS_COLORS);
	}

	if (bottomShadow == null) {
		bottomShadow = new GradientDrawable(Orientation.BOTTOM_TOP,
				SHADOWS_COLORS);
	}

	setBackgroundResource(R.drawable.white);
}
 
開發者ID:BigAppOS,項目名稱:BigApp_Discuz_Android,代碼行數:21,代碼來源:WheelView.java

示例6: initResourcesIfNecessary

/**
 * Initializes resources
 */
private void initResourcesIfNecessary() {
	if (centerDrawable == null) {
		centerDrawable = getContext().getResources().getDrawable(
				R.drawable.wheel_val);
	}

	if (topShadow == null) {
		topShadow = new GradientDrawable(Orientation.TOP_BOTTOM,
				SHADOWS_COLORS);
	}

	if (bottomShadow == null) {
		bottomShadow = new GradientDrawable(Orientation.BOTTOM_TOP,
				SHADOWS_COLORS);
	}

	setBackgroundResource(R.drawable.wheel_bg);
}
 
開發者ID:yndongyong,項目名稱:fast-dev-library,代碼行數:21,代碼來源:WheelView.java

示例7: setVerValSlider

/**
 * Create a linear gradient shader to show variations in value.
 */
private void setVerValSlider() {
	float[] hsv = new float[3];
	hsv[0] = mHSV[0];
	hsv[1] = mHSV[1];
	hsv[2] = 1;
	int col = Color.HSVToColor(hsv);

	int colors[] = new int[2];
	colors[0] = col;
	colors[1] = 0xFF000000;
	GradientDrawable gradDraw = new GradientDrawable(Orientation.TOP_BOTTOM, colors);
	gradDraw.setDither(true);
	gradDraw.setLevel(10000);
	gradDraw.setBounds(0, 0, SLIDER_THICKNESS, PALETTE_DIM);
	gradDraw.draw(mVerSliderCv);
}
 
開發者ID:dragonlinux,項目名稱:connectbot,代碼行數:19,代碼來源:UberColorPickerDialog.java

示例8: init

protected void init(Context context, AttributeSet attrs) {
	Resources res = getResources();
	this.setCenterDrawable(res.getDrawable(R.drawable.wheel_val_light));
	this.setBackgroundResource(R.drawable.wheel_bg_light);

	GradientDrawable topShadow = new GradientDrawable(Orientation.TOP_BOTTOM, new int[] { 0x00000000, 0x00000000 });
	this.setTopShadowDrawable(topShadow);

	GradientDrawable bottomShadow = new GradientDrawable(Orientation.BOTTOM_TOP,
			new int[] { 0x00000000, 0x00000000 });
	this.setBottomShadowDrawable(bottomShadow);

	mTextColorValue = 0xFF000000;
	mTextColorItems = 0xFF888888;

	TEXT_SIZE = (int) AppUtil.sp2px(getContext(), 18);
	setFakeBoldText(false);
	setCyclic(true);
}
 
開發者ID:wavinsun,項目名稱:MUtils,代碼行數:19,代碼來源:WheelViewer.java

示例9: SearchView

public SearchView(Context context, StringBuilder queryText, SearchTextFormatter
        textFormatter) {
    super(context);

    mQueryText = queryText;
    mTextFormatter = textFormatter;

    final SurfaceHolder holder = getHolder();
    holder.setFormat(PixelFormat.TRANSLUCENT);
    holder.addCallback(mSurfaceCallback);

    // Gradient colors.
    final int[] colors = new int[] {GRADIENT_INNER_COLOR, GRADIENT_OUTER_COLOR};
    mGradientBackground = new GradientDrawable(Orientation.TOP_BOTTOM, colors);
    mGradientBackground.setGradientType(GradientDrawable.LINEAR_GRADIENT);
}
 
開發者ID:google,項目名稱:talkback,代碼行數:16,代碼來源:NodeSearch.java

示例10: initialize

/**
     * Initialize.
     * 
     * @param context
     */
    private void initialize(Context context) {
        this.setVerticalScrollBarEnabled(false);
        this.setSlotInCenter(true);
        this.setOrientation(VERTICAL);
        this.setGravity(Gravity.CENTER_HORIZONTAL);
        this.setUnselectedAlpha(1.0f);

        // This lead the onDraw() will be called.
        this.setWillNotDraw(false);

        // The selector rectangle drawable.
        this.mSelectorDrawable = getContext().getResources().getDrawable(R.drawable.wheel_val);
        this.mTopShadow = new GradientDrawable(Orientation.TOP_BOTTOM, SHADOWS_COLORS);
        this.mBottomShadow = new GradientDrawable(Orientation.BOTTOM_TOP, SHADOWS_COLORS);

        // The default background.
//        this.setBackgroundResource(R.drawable.wheel_bg);

        // Disable the sound effect default.
        this.setSoundEffectsEnabled(true);
    }
 
開發者ID:liangchenhe55,項目名稱:konkeWatch,代碼行數:26,代碼來源:WheelView.java

示例11: initialize

/**
 * Initialize.
 *
 * @param context
 */
private void initialize(Context context) {
    this.setVerticalScrollBarEnabled(false);
    this.setSlotInCenter(true);
    this.setOrientation(TosGallery.VERTICAL);
    this.setGravity(Gravity.CENTER_HORIZONTAL);
    this.setUnselectedAlpha(1.0f);

    // This lead the onDraw() will be called.
    this.setWillNotDraw(false);

    // The selector rectangle drawable.
    this.mSelectorDrawable = getContext().getResources().getDrawable(R.drawable.wheel_val);
    this.mTopShadow = new GradientDrawable(Orientation.TOP_BOTTOM, SHADOWS_COLORS);
    this.mBottomShadow = new GradientDrawable(Orientation.BOTTOM_TOP, SHADOWS_COLORS);

    // The default background.
    this.setBackgroundResource(R.drawable.wheel_bg);

    // Disable the sound effect default.
    this.setSoundEffectsEnabled(false);
}
 
開發者ID:rantianhua,項目名稱:MoneyRecord,代碼行數:26,代碼來源:WheelView.java

示例12: initResourcesIfNecessary

/**
 * Initializes resources
 */
private void initResourcesIfNecessary() {

    if (topShadow == null) {
        topShadow = new GradientDrawable(Orientation.TOP_BOTTOM,
                SHADOWS_COLORS);
    }

    if (topBlurShadow == null) {
        topBlurShadow = new GradientDrawable(Orientation.TOP_BOTTOM,
                BLUR_SHADOWS_COLORS);
    }

    if (bottomBlurShadow == null) {
        bottomBlurShadow = new GradientDrawable(Orientation.BOTTOM_TOP,
                BLUR_SHADOWS_COLORS);
    }

    if (bottomShadow == null) {
        bottomShadow = new GradientDrawable(Orientation.BOTTOM_TOP,
                SHADOWS_COLORS);
    }

}
 
開發者ID:Kuloud,項目名稱:Unity,代碼行數:26,代碼來源:WheelView.java

示例13: initResourcesIfNecessary

/**
 * Initializes resources
 */
private void initResourcesIfNecessary() {
	if (centerDrawable == null) {
		centerDrawable = getContext().getResources().getDrawable(R.drawable.wheel_val);
	}

	if (topShadow == null) {
		topShadow = new GradientDrawable(Orientation.TOP_BOTTOM, SHADOWS_COLORS);
	}

	if (bottomShadow == null) {
		bottomShadow = new GradientDrawable(Orientation.BOTTOM_TOP, SHADOWS_COLORS);
	}

	setBackgroundResource(R.drawable.wheel_bg);
}
 
開發者ID:bither,項目名稱:bither-android,代碼行數:18,代碼來源:WheelView.java

示例14: ColorButton

public ColorButton(Context context, AttributeSet attrs, int defStyle)
{
    super(context, attrs, defStyle);

    TypedArray a = context.obtainStyledAttributes(attrs,
            R.styleable.ColorButton, defStyle, 0);
    _color = a.getColor(R.styleable.ColorButton_color, Color.RED);
    a.recycle();

    _highlightDrawable = new GradientDrawable(Orientation.TOP_BOTTOM,
            new int[]
            {
                Color.WHITE, Color.TRANSPARENT, Color.TRANSPARENT
            });
    _highlightDrawable.setShape(GradientDrawable.OVAL);
    _colorDrawable = new GradientDrawable();
    _colorDrawable.setColor(_color);
    _colorDrawable.setShape(GradientDrawable.OVAL);
}
 
開發者ID:androidsoft-org,項目名稱:androidsoft-coloring,代碼行數:19,代碼來源:ColorButton.java

示例15: ColorButton

public ColorButton(Context context, AttributeSet attrs, int defStyle)
{
    super(context, attrs, defStyle);

    TypedArray a = context.obtainStyledAttributes(attrs,
            R.styleable.ColorButton, defStyle, 0);
    _color = a.getColor(R.styleable.ColorButton_color, Color.RED);

    _highlightDrawable = new GradientDrawable(Orientation.TOP_BOTTOM,
            new int[]
            {
                Color.WHITE, Color.TRANSPARENT, Color.TRANSPARENT
            });
    _highlightDrawable.setShape(GradientDrawable.OVAL);
    _colorDrawable = new GradientDrawable();
    _colorDrawable.setColor(_color);
    _colorDrawable.setShape(GradientDrawable.OVAL);
}
 
開發者ID:lohith,項目名稱:androidsoft-kids-coloring,代碼行數:18,代碼來源:ColorButton.java


注:本文中的android.graphics.drawable.GradientDrawable.Orientation.TOP_BOTTOM屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。