public S hasFlags(@PaintFlags int flags) { isNotNull(); int actualFlags = actual.getFlags(); //noinspection ResourceType assertThat(actualFlags) // .overridingErrorMessage("Expected flags <%s> but was <%s>.", flagsToString(flags), flagsToString(actualFlags)) // .isEqualTo(flags); return myself; }
@Test public void testCtorWithPaint() { Paint paint = new Paint(); paint.setColor(Color.RED); paint.setAlpha(72); paint.setFlags(2345); Paint other = new Paint(paint); assertThat(other.getColor()).isEqualTo(Color.RED); assertThat(other.getAlpha()).isEqualTo(72); assertThat(other.getFlags()).isEqualTo(2345); }
void initCropView(Context context, AttributeSet attrs) { config = CropViewConfig.from(context, attrs); touchManager = new TouchManager(this, config); bitmapPaint.setFilterBitmap(true); setViewportOverlayColor(config.getViewportOverlayColor()); shape = config.shape(); // We need anti-aliased Paint to smooth the curved edges viewportPaint.setFlags(viewportPaint.getFlags() | Paint.ANTI_ALIAS_FLAG); }
Paint p = new Paint(); p.setColor(ContextCompat.getColor(this,android.R.color.holo_red_dark)); p.setflags(Paint.UNDERLINE_TEXT_FLAG); textView.setPaintFlags(p.getFlags());
private PrintDrawable(Context context, CharSequence iconText, ColorStateList iconColor, Typeface iconFont, int iconSize, boolean inEditMode) { mContext = context; mPaint = new Paint(); mPaint.setFlags(mPaint.getFlags() | Paint.ANTI_ALIAS_FLAG | Paint.SUBPIXEL_TEXT_FLAG); mPath = new Path(); mPathBounds = new RectF(); mIconText = iconText; mIconColor = iconColor; mIconFont = iconFont; mIconSize = iconSize; mInEditMode = inEditMode; mPaint.setTextSize(mIconSize); mPaint.setTypeface(mIconFont); if (mIconColor != null) { updateIconColors(); } }
final Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG); paint.setFlags(paint.getFlags() | Paint.FILTER_BITMAP_FLAG); paint.setFilterBitmap(true);
public S hasFlags(@PaintFlags int flags) { isNotNull(); int actualFlags = actual.getFlags(); //noinspection ResourceType assertThat(actualFlags) // .overridingErrorMessage("Expected flags <%s> but was <%s>.", flagsToString(flags), flagsToString(actualFlags)) // .isEqualTo(flags); return myself; }
public ZLAndroidPaintContext(SystemInfo systemInfo, Canvas canvas, Geometry geometry, int scrollbarWidth) { super(systemInfo); myCanvas = canvas; myGeometry = geometry; myScrollbarWidth = scrollbarWidth; myTextPaint.setLinearText(false); myTextPaint.setAntiAlias(AntiAliasOption.getValue()); if (DeviceKerningOption.getValue()) { myTextPaint.setFlags(myTextPaint.getFlags() | Paint.DEV_KERN_TEXT_FLAG); } else { myTextPaint.setFlags(myTextPaint.getFlags() & ~Paint.DEV_KERN_TEXT_FLAG); } myTextPaint.setDither(DitheringOption.getValue()); myTextPaint.setSubpixelText(SubpixelOption.getValue()); myLinePaint.setStyle(Paint.Style.STROKE); myFillPaint.setAntiAlias(AntiAliasOption.getValue()); myOutlinePaint.setAntiAlias(true); myOutlinePaint.setDither(true); myOutlinePaint.setStrokeWidth(4); myOutlinePaint.setStyle(Paint.Style.STROKE); myOutlinePaint.setPathEffect(new CornerPathEffect(5)); myOutlinePaint.setMaskFilter(new EmbossMaskFilter(new float[] {1, 1, 1}, .4f, 6f, 3.5f)); }
data.put("Descent", paint.descent()); data.put("Alpha", paint.getAlpha()); data.put("Flags", getBinaryString(paint.getFlags())); data.put("FontMetricsInt", paint.getFontMetricsInt().toString()); data.put("FontSpacing", paint.getFontSpacing());
@Override protected void initUI() { DisplayUtil.expandLayoutToStatusBarAboveLollipop(this); DisplayUtil.expandStatusBarViewAboveKitkat(mStatusBar); DisplayUtil.darkStatusBar(this); if (DeviceUtil.hasKitKatApi()) { if (DisplayUtil.hasNavigationBar(this)) { int navHeight = DisplayUtil.getNavigationBarHeight(this); FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mFab.getLayoutParams(); params.bottomMargin += navHeight; mFab.requestLayout(); mFlBottom.setPadding(0, 0, 0, navHeight); } } Typeface tf = FontCache.get(Def.Meta.ROBOTO_MONO, this); mTvYwwynm.setTypeface(tf); mTvEverythingDone.setTypeface(tf); mTvVersion.append(" " + BuildConfig.VERSION_NAME); TextView tvLicense = f(R.id.tv_license_as_bt); Paint paint = tvLicense.getPaint(); paint.setFlags(paint.getFlags() | Paint.UNDERLINE_TEXT_FLAG); }