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


Java Color.BLUE属性代码示例

本文整理汇总了Java中android.graphics.Color.BLUE属性的典型用法代码示例。如果您正苦于以下问题:Java Color.BLUE属性的具体用法?Java Color.BLUE怎么用?Java Color.BLUE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.graphics.Color的用法示例。


在下文中一共展示了Color.BLUE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: spanTest

private void spanTest() {
        SpannableString spannableString = new SpannableString("欢迎光临我的博客");
//        字体颜色span
        ForegroundColorSpan colorSpan = new ForegroundColorSpan(Color.BLUE);
//        背景颜色span
        BackgroundColorSpan backgroundColorSpan = new BackgroundColorSpan(Color.RED);

//        1,3其实是两个位置,末尾不包括
//        Flag 为 span如果新增了文字 的前面不包括样式,后面包括样式
        spannableString.setSpan(colorSpan, 1, 3, Spanned.SPAN_EXCLUSIVE_INCLUSIVE);
        spannableString.setSpan(backgroundColorSpan, 5, 7, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);

        SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
        spannableStringBuilder.append(spannableString);

        editText.setText(spannableString);

    }
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:18,代码来源:Main2Activity.java

示例2: initValues

private void initValues(@NonNull Context context, boolean editMode) {
  mBorderWidth = context.getResources().getDimension(R.dimen.cpb_default_stroke_width);
  mSweepSpeed = 1f;
  mRotationSpeed = 1f;
  if (editMode) {
    mColors = new int[]{Color.BLUE};
    mMinSweepAngle = 20;
    mMaxSweepAngle = 300;
  } else {
    mColors = new int[]{context.getResources().getColor(R.color.cpb_default_color)};
    mMinSweepAngle = context.getResources().getInteger(R.integer.cpb_default_min_sweep_angle);
    mMaxSweepAngle = context.getResources().getInteger(R.integer.cpb_default_max_sweep_angle);
  }
  mStyle = CircularProgressDrawable.STYLE_ROUNDED;
  mPowerManager = Utils.powerManager(context);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:CircularProgressDrawable.java

示例3: testFallbackDrawableSetOnNullModelWithErrorAndFallbackDrawables

@Test
public void testFallbackDrawableSetOnNullModelWithErrorAndFallbackDrawables() {
  Drawable placeholder = new ColorDrawable(Color.RED);
  Drawable errorPlaceholder = new ColorDrawable(Color.GREEN);
  Drawable fallback = new ColorDrawable(Color.BLUE);

  MockTarget target = new MockTarget();
  harness.placeholderDrawable = placeholder;
  harness.errorDrawable = errorPlaceholder;
  harness.fallbackDrawable = fallback;
  harness.target = target;
  harness.model = null;
  SingleRequest<List> request = harness.getRequest();
  request.begin();
  assertEquals(fallback, target.currentPlaceholder);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:SingleRequestTest.java

示例4: setUp

@Before
public void setUp() {
  mBuilder = new GenericDraweeHierarchyBuilder(null);

  mBackground = DrawableTestUtils.mockDrawable();
  mOverlay1 = DrawableTestUtils.mockDrawable();
  mOverlay2 = DrawableTestUtils.mockDrawable();
  mPlaceholderImage = DrawableTestUtils.mockBitmapDrawable();
  mFailureImage = DrawableTestUtils.mockBitmapDrawable();
  mRetryImage = DrawableTestUtils.mockBitmapDrawable();
  mProgressBarImage = DrawableTestUtils.mockBitmapDrawable();
  mActualImage1 = DrawableTestUtils.mockBitmapDrawable();
  mActualImage2 = DrawableTestUtils.mockBitmapDrawable();
  mWrappedLeaf = new ColorDrawable(Color.BLUE);
  mWrappedImage = new ForwardingDrawable(new ForwardingDrawable(mWrappedLeaf));
  mFocusPoint = new PointF(0.1f, 0.4f);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:17,代码来源:GenericDraweeHierarchyTest.java

示例5: UIProgressView

public UIProgressView(Context context, int style) {
    super(context, R.style.ProgressViewDialogStyle);
    this.mStyle = style;
    this.mContext = context;
    this.textColor = context.getResources().getColor(R.color.colorLoadingText);
    this.loadingColor = Color.BLUE;
    this.window = getWindow();
    this.lp = window.getAttributes();
    if (mStyle == STYLE_WEI_BO) {//微博样式
        mIndeterminateDrawable = mContext.getResources().getDrawable(R.drawable.dialog_loading_wei_bo);
        textColor = mContext.getResources().getColor(R.color.colorLoadingTextWeiBo);
    } else if (mStyle == STYLE_WEI_XIN) {//微信样式
        mIndeterminateDrawable = mContext.getResources().getDrawable(R.drawable.dialog_loading_wei_xin);
        textColor = Color.WHITE;
    } else if (mStyle == STYLE_MATERIAL_DESIGN) {
        textColor = loadingColor;
    }
    window.setWindowAnimations(R.style.PopWindowAnimStyle);
    setContentView(R.layout.layout_progress_view);
    initView();
}
 
开发者ID:AriesHoo,项目名称:UIWidget,代码行数:21,代码来源:UIProgressView.java

示例6: getColor

private int getColor(@NonNull Piece piece) {
    switch (piece) {
        case T:
            return Color.GREEN;
        case L:
            return Color.RED;
        case Z:
            return Color.YELLOW;
        case S:
            return Color.BLUE;
        case LL:
            return Color.MAGENTA;
        default:
            return Color.CYAN;
    }
}
 
开发者ID:GuepardoApps,项目名称:LucaHome-MediaServer,代码行数:16,代码来源:GameSurfaceView.java

示例7: getColor

public static @ColorInt int getColor(int index) {
    int color = Color.TRANSPARENT;
    switch (index) {
        case 0:
            color = R.color.color0;
            break;
        case 1:
            color = Color.BLUE;
            break;

        case 2:
            color = Color.GRAY;
            break;
    }

    return color;
}
 
开发者ID:yushiwo,项目名称:StatusBarManager,代码行数:17,代码来源:ColorUtil.java

示例8: init

private void init() {
    mTextPaint = new TextPaint();
    mTextPaint.setAntiAlias(true);
    mTextPaint.setColor(mTextColor);
    if (mTextSizePx <= 0) {
        mTextSizePx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
                DEFAULT_FONT_SIZE_SP, getResources().getDisplayMetrics());
    }
    mTextPaint.setTextSize(mTextSizePx);
    mTypeface = MongolFont.get(MongolFont.QAGAN, mContext);
    mTextPaint.setTypeface(mTypeface);
    mTextPaint.linkColor = Color.BLUE;

    // initialize the layout, but the height still needs to be set
    final CharSequence text = mTextStorage.getGlyphText();
    mLayout = new MongolLayout(text, 0, text.length(), mTextPaint, 0, Gravity.TOP, 1, 0, false, Integer.MAX_VALUE);

}
 
开发者ID:suragch,项目名称:mongol-library,代码行数:18,代码来源:MongolTextView.java

示例9: createSet

private LineDataSet createSet(String label) {
    LineDataSet set = new LineDataSet(null, label);
    set.setAxisDependency(YAxis.AxisDependency.LEFT);
    int color;
    if (label.equals(pm1Label)) {
        color = Color.BLUE;
    } else if (label.equals(pm25Label)) {
        color = Color.RED;
    } else {
        color = Color.BLACK;
    }
    set.setColor(color);
    set.setLineWidth(2f);
    set.setDrawValues(false);
    set.setDrawCircles(false);
    set.setMode(LineDataSet.Mode.LINEAR);
    return set;
}
 
开发者ID:rjaros87,项目名称:pm-home-station,代码行数:18,代码来源:ChartFragment.java

示例10: init

private void init() {
    this.mPaint = new Paint();
    this.mPaint.setAntiAlias(true);
    this.mStartedLineColor = Color.BLUE;
    this.mPreLineColor = Color.GRAY;
    this.mStartedCircleColor = mStartedLineColor;
    this.mUnderwayCircleColor = mStartedCircleColor;
    this.mPreCircleColor = mPreLineColor;
    this.mStartedStringColor = mStartedLineColor;
    this.mUnderwayStringColor = mStartedStringColor;
    this.mPreStringColor = mPreLineColor;
    this.mPointTxt = new ArrayList();
    this.mPointTxt.add("step 1");
    this.mPointTxt.add("step 2");
    this.mPointTxt.add("step 3");
    this.mBuilder = new Builder();
}
 
开发者ID:WrBug,项目名称:timelineview,代码行数:17,代码来源:TimeLineView.java

示例11: renderItemNumber

public static void renderItemNumber(SpannableStringBuilder builder) {
    String string = builder.toString();
    if (!string.contains("、")
            || !isNumeric(string.substring(0, string.indexOf("、")))) {
        return;
    }
    ForegroundColorSpan numSpan = new ForegroundColorSpan(Color.BLUE);
    builder.setSpan(numSpan, 0, string.indexOf("、"),
            Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
 
开发者ID:hh-in-zhuzhou,项目名称:ShangHanLun,代码行数:10,代码来源:Helper.java

示例12: testNullModelPrefersFallbackDrawable

@Test
public void testNullModelPrefersFallbackDrawable() {
  Drawable placeholder = new ColorDrawable(Color.GREEN);
  Drawable error = new ColorDrawable(Color.RED);
  Drawable fallback = new ColorDrawable(Color.BLUE);

  requestManager
      .load(null)
      .apply(placeholderOf(placeholder)
          .error(error)
          .fallback(fallback))
      .into(target);

  verify(target).onLoadFailed(eq(fallback));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:GlideTest.java

示例13: drawTrainingCircle

public void drawTrainingCircle(int stepX, int stepY) {
    int dx = (width - xOffset * 2) / 6;
    int dy = (height - yOffset * 2) / 5;
    int x = xOffset + stepX *dx + dx / 2;
    int y = yOffset + stepY *dy + dy / 2;

    RadialGradient gradient = new RadialGradient(x, y, 200,
            Color.TRANSPARENT, Color.BLUE, Shader.TileMode.CLAMP);
    Paint p = new Paint();
    p.setDither(true);
    p.setShader(gradient);

    canvas.drawCircle(x, y, 200, p);
}
 
开发者ID:Neschur,项目名称:KB2,代码行数:14,代码来源:Painter.java

示例14: onItemSelected

public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
        // An item was selected. You can retrieve the selected item using
        // parent.getItemAtPosition(pos)

        int viewid = parent.getId();
        if (viewid == R.id.fontcolor_spinner) {
            int color = Color.BLACK;
            String item = String.valueOf(parent.getItemAtPosition(pos));
            switch (item) {
                case "BLUE":
                    color = Color.BLUE;
                    break;
                case "RED":
                    color = Color.RED;
                    break;
                case "YELLOW":
                    color = Color.YELLOW;
                    break;
            }
            mMongolLabelMatchParent.setTextColor(color);
            mMongolLabelWrapContent.setTextColor(color);
        } else if (viewid == R.id.fontsize_spinner) {
            int size = Integer.parseInt(parent.getSelectedItem().toString());
            mMongolLabelMatchParent.setTextSize(size);
            mMongolLabelWrapContent.setTextSize(size);
//        } else if (viewid == R.id.alignment_spinner) {
//            int gravity = Gravity.TOP;
//            String item = String.valueOf(parent.getItemAtPosition(pos));
//            switch (item) {
//                case "CENTER":
//                    gravity = Gravity.CENTER;
//                    break;
//                case "BOTTOM":
//                    gravity = Gravity.BOTTOM;
//                    break;
//            }
//            mMongolLabelMatchParent.setGravity(gravity);
//            mMongolLabelWrapContent.setGravity(gravity);
        }
    }
 
开发者ID:suragch,项目名称:mongol-library,代码行数:40,代码来源:MongolLabelActivity.java

示例15: init

private void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
  if (!isInEditMode()) {

  }

  rect = new Rect();
  paint = new Paint();

  doorRect = new Rect();
  doorPaint = new Paint();
  doorPaint.setColor(Color.WHITE);

  int buildingsColor = Color.BLUE;
  if (attrs != null) {
    boolean containsBuildColor = containsBuildColor(attrs);

    if (containsBuildColor) {
      buildingsColor = loadColorAttribute(context, attrs, defStyleAttr, buildingsColor, R.styleable.BuildingView, defStyleRes,
          R.styleable.BuildingView_building_color);
    } else {
      buildingsColor = loadColorAttribute(context, attrs, defStyleAttr, buildingsColor, R.styleable.CityView, R.style.CityViewTheme,
          R.styleable.CityView_buildings_color);
    }
  }
  paint.setColor(buildingsColor);

  loadDimensions(context, attrs, defStyleAttr, defStyleRes);
}
 
开发者ID:alorma,项目名称:CityView,代码行数:28,代码来源:BuildingView.java


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