Java Code Examples for android.graphics.Color#LTGRAY
The following examples show how to use
android.graphics.Color#LTGRAY .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CircleWatchface.java From xDrip-Experimental with GNU General Public License v3.0 | 6 votes |
public void addReadingSoft(Canvas canvas, BgWatchData entry) { Log.d("CircleWatchface", "addReadingSoft"); double size; int color = Color.LTGRAY; if (sharedPrefs.getBoolean("dark", false)) { color = Color.DKGRAY; } float offsetMultiplier = (((displaySize.x / 2f) - PADDING) / 12f); float offset = (float) Math.max(1, Math.ceil((new Date().getTime() - entry.timestamp) / (1000 * 60 * 5))); size = bgToAngle((float) entry.sgv); addArch(canvas, offset * offsetMultiplier + 10, color, (float) size); addArch(canvas, (float) size, offset * offsetMultiplier + 10, getBackgroundColor(), (float) (360 - size)); addArch(canvas, (offset + .8f) * offsetMultiplier + 10, getBackgroundColor(), 360); }
Example 2
Source File: MainActivity.java From cashuwallet with MIT License | 6 votes |
private void updateViewHolder(ViewHolder vh, Multiwallet multiwallet) { Coin coin = multiwallet.getCoin(); int res = MainApplication.app().findDrawable(multiwallet.coin); int color = multiwallet.confirmed ? Color.TRANSPARENT : Color.parseColor("#f7b500"); if (refreshing.contains(multiwallet)) color = Color.LTGRAY; String tag = ""; if (coin instanceof Coins.ERC20Token) tag = "ERC-20"; if (coin instanceof Coins.WavesToken) tag = "Waves"; vh.image.setImageResource(res); vh.name.setText(coin.getName() + (sync.isTestnet() ? " Testnet": "")); vh.tag.setText(tag); vh.balance.setText(formatAmount(coin, multiwallet.getBalance())); vh.status.setTextColor(color); vh.itemView.setOnClickListener((View view) -> { Intent intent = new Intent(MainActivity.this, DetailActivity.class); intent.putExtra("multiwallet", multiwallet.id()); startActivity(intent); }); }
Example 3
Source File: NestedAnimations.java From android-fragment-bugs with The Unlicense | 6 votes |
private void replaceFragments() { boolean nextFragmentChildren = !((AnimatedFragment) getSupportFragmentManager().findFragmentById(R.id.container)).hasChildren(); Fragment frag = new AnimatedFragment(nextFragmentChildren ? "A" : "B", Color.LTGRAY, nextFragmentChildren); getSupportFragmentManager() .beginTransaction() .setCustomAnimations(R.anim.in_from_right, R.anim.out_to_left, R.anim.in_from_left, R.anim.out_to_right) .replace(R.id.container, frag) .addToBackStack(null) .commit(); }
Example 4
Source File: DoubleHistogramView.java From GeometricWeather with GNU Lesser General Public License v3.0 | 6 votes |
private void initialize() { lineColors = new int[] {Color.BLACK, Color.DKGRAY, Color.LTGRAY}; setTextColors(Color.BLACK); this.margins = (int) DisplayUtils.dpToPx(getContext(), MARGIN_DIP); this.marginCenter = (int) DisplayUtils.dpToPx(getContext(), MARGIN_CENTER_DIP); this.histogramWidth = (int) DisplayUtils.dpToPx(getContext(), HISTOGRAM_WIDTH_DIP); this.histogramTextSize = (int) DisplayUtils.dpToPx(getContext(), HISTOGRAM_TEXT_SIZE_DIP); this.chartLineWith = (int) DisplayUtils.dpToPx(getContext(), CHART_LINE_SIZE_DIP); this.textMargin = (int) DisplayUtils.dpToPx(getContext(), TEXT_MARGIN_DIP); this.paint = new Paint(); paint.setStrokeCap(Paint.Cap.ROUND); paint.setAntiAlias(true); histogramAlphas = new float[] {1, 1}; }
Example 5
Source File: CircleWatchface.java From xDrip-Experimental with GNU General Public License v3.0 | 6 votes |
public void addReading(Canvas canvas, BgWatchData entry) { Log.d("CircleWatchface", "addReading"); double size; int color = Color.LTGRAY; int indicatorColor = Color.DKGRAY; if (sharedPrefs.getBoolean("dark", false)) { color = Color.DKGRAY; indicatorColor = Color.LTGRAY; } int barColor = Color.GRAY; if (entry.sgv >= entry.high) { indicatorColor = getHighColor(); barColor = darken(getHighColor(), .5); } else if (entry.sgv <= entry.low) { indicatorColor = getLowColor(); barColor = darken(getLowColor(), .5); } float offsetMultiplier = (((displaySize.x / 2f) - PADDING) / 12f); float offset = (float) Math.max(1, Math.ceil((new Date().getTime() - entry.timestamp) / (1000 * 60 * 5))); size = bgToAngle((float) entry.sgv); addArch(canvas, offset * offsetMultiplier + 11, barColor, (float) size - 2); // Dark Color Bar addArch(canvas, (float) size - 2, offset * offsetMultiplier + 11, indicatorColor, 2f); // Indicator at end of bar addArch(canvas, (float) size, offset * offsetMultiplier + 11, color, (float) (360f - size)); // Dark fill addArch(canvas, (offset + .8f) * offsetMultiplier + 11, getBackgroundColor(), 360); }
Example 6
Source File: NestedAnimationsNative.java From android-fragment-bugs with The Unlicense | 6 votes |
private void replaceFragments() { boolean nextFragmentChildren = !((AnimatedFragment) getFragmentManager().findFragmentById(R.id.container)).hasChildren(); Fragment frag = new AnimatedFragment(nextFragmentChildren ? "A" : "B", Color.LTGRAY, nextFragmentChildren); getFragmentManager() .beginTransaction() .setCustomAnimations(R.animator.in_from_right, R.animator.out_to_left, R.animator.in_from_left, R.animator.out_to_right) .replace(R.id.container, frag) .addToBackStack(null) .commit(); }
Example 7
Source File: ChromeCustomTabPlugin.java From cordova-plugin-safariviewcontroller with MIT License | 5 votes |
private int getColor(String color) { if(TextUtils.isEmpty(color)) return Color.LTGRAY; try { return Color.parseColor(color); } catch (NumberFormatException ex) { Log.i(TAG, String.format("Unable to parse Color: %s", color)); return Color.LTGRAY; } }
Example 8
Source File: IDividerItemDecoration.java From AndroidUiKit with Apache License 2.0 | 5 votes |
/** * Creates a divider {@link RecyclerView.ItemDecoration} that can be used with a * {@link LinearLayoutManager}. * * @param context Current context, it will be used to access resources. * @param orientation Divider orientation. Should be {@link #HORIZONTAL} or {@link #VERTICAL}. */ public IDividerItemDecoration(Context context, int orientation) { mDivider = new GradientDrawable(); //默认divider 1dp mVerticalDividerHeight = dp2px(context, 1); mHorizontalDividerWidth = dp2px(context, 1); mDividerColor = Color.LTGRAY; setOrientation(orientation); }
Example 9
Source File: ImageUtil.java From Leisure with GNU Lesser General Public License v3.0 | 5 votes |
public static int getImageColor(Bitmap bitmap){ Palette palette = Palette.from(bitmap).generate(); if(palette == null || palette.getDarkMutedSwatch() == null){ return Color.LTGRAY; } return palette.getDarkMutedSwatch().getRgb(); }
Example 10
Source File: OC_Generic_ColourObjects.java From GLEXP-Team-onebillion with Apache License 2.0 | 5 votes |
public int getColourForString(String colourName) { if (colourName == null) { return -1; } else if (colourName.compareTo("red") == 0) { return Color.RED; } else if (colourName.compareTo("green") == 0) { return Color.GREEN; } else if (colourName.compareTo("blue") == 0) { return Color.BLUE; } else if (colourName.compareTo("yellow") == 0) { return Color.YELLOW; } else if (colourName.compareTo("pink") == 0) { return OBUtils.colorFromRGBString("255,128,255"); } else { return Color.LTGRAY; } }
Example 11
Source File: Photo.java From DelegateAdapter with Apache License 2.0 | 5 votes |
public int getBgColor () { try { return Color.parseColor(color); } catch (Exception e) { return Color.LTGRAY; } }
Example 12
Source File: ChartStyle.java From BesselChart with Apache License 2.0 | 5 votes |
public ChartStyle() { gridColor=Color.LTGRAY; horizontalTitleTextSize=34; horizontalTitleTextColor=Color.GRAY; horizontalLabelTextSize=30; horizontalLabelTextColor=Color.GRAY; verticalLabelTextSize = 34; verticalLabelTextPadding = 60; verticalLabelTextColor = Color.GRAY; verticalLabelTextPaddingRate=0.2f; axisLineWidth=2; horizontalTitlePaddingLeft = 20; horizontalTitlePaddingRight = 10; }
Example 13
Source File: FastScroller.java From HaoReader with GNU General Public License v3.0 | 4 votes |
@SuppressWarnings("ConstantConditions") private void layout(Context context, AttributeSet attrs, Size size) { inflate(context, R.layout.fast_scroller, this); setClipChildren(false); setOrientation(HORIZONTAL); bubbleView = findViewById(R.id.fastscroll_bubble); handleView = findViewById(R.id.fastscroll_handle); trackView = findViewById(R.id.fastscroll_track); scrollbar = findViewById(R.id.fastscroll_scrollbar); bubbleSize = size; @ColorInt int bubbleColor = Color.GRAY; @ColorInt int handleColor = Color.DKGRAY; @ColorInt int trackColor = Color.LTGRAY; @ColorInt int textColor = Color.WHITE; boolean hideScrollbar = true; boolean showBubble = true; boolean showTrack = false; float textSize = getResources().getDimension(size.textSizeId); if (attrs != null) { TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.FastScroller, 0, 0); if (typedArray != null) { try { bubbleColor = typedArray.getColor(R.styleable.FastScroller_bubbleColor, bubbleColor); handleColor = typedArray.getColor(R.styleable.FastScroller_handleColor, handleColor); trackColor = typedArray.getColor(R.styleable.FastScroller_trackColor, trackColor); textColor = typedArray.getColor(R.styleable.FastScroller_bubbleTextColor, textColor); hideScrollbar = typedArray.getBoolean(R.styleable.FastScroller_hideScrollbar, hideScrollbar); showBubble = typedArray.getBoolean(R.styleable.FastScroller_showBubble, showBubble); showTrack = typedArray.getBoolean(R.styleable.FastScroller_showTrack, showTrack); int sizeOrdinal = typedArray.getInt(R.styleable.FastScroller_bubbleSize, size.ordinal()); bubbleSize = Size.fromOrdinal(sizeOrdinal); textSize = typedArray.getDimension(R.styleable.FastScroller_bubbleTextSize, getResources().getDimension(bubbleSize.textSizeId)); } finally { typedArray.recycle(); } } } setTrackColor(trackColor); setHandleColor(handleColor); setBubbleColor(bubbleColor); setBubbleTextColor(textColor); setHideScrollbar(hideScrollbar); setBubbleVisible(showBubble); setTrackVisible(showTrack); bubbleView.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); }
Example 14
Source File: FastScroller.java From APlayer with GNU General Public License v3.0 | 4 votes |
private void layout(Context context, AttributeSet attrs) { inflate(context, R.layout.fastscroller, this); setClipChildren(false); setOrientation(HORIZONTAL); mBubbleView = (TextView) findViewById(R.id.fastscroll_bubble); mHandleView = (ImageView) findViewById(R.id.fastscroll_handle); mTrackView = (ImageView) findViewById(R.id.fastscroll_track); mScrollbar = findViewById(R.id.fastscroll_scrollbar); @ColorInt int bubbleColor = Color.GRAY; @ColorInt int handleColor = Color.DKGRAY; @ColorInt int trackColor = Color.LTGRAY; @ColorInt int textColor = Color.WHITE; boolean hideScrollbar = true; boolean showTrack = false; if (attrs != null) { TypedArray typedArray = context .obtainStyledAttributes(attrs, R.styleable.FastScrollRecyclerView, 0, 0); if (typedArray != null) { try { bubbleColor = typedArray .getColor(R.styleable.FastScrollRecyclerView_bubbleColor, bubbleColor); handleColor = typedArray .getColor(R.styleable.FastScrollRecyclerView_handleColor, handleColor); trackColor = typedArray .getColor(R.styleable.FastScrollRecyclerView_trackColor, trackColor); textColor = typedArray .getColor(R.styleable.FastScrollRecyclerView_bubbleTextColor, textColor); showTrack = typedArray.getBoolean(R.styleable.FastScrollRecyclerView_showTrack, false); hideScrollbar = typedArray .getBoolean(R.styleable.FastScrollRecyclerView_hideScrollbar, true); } finally { typedArray.recycle(); } } } setTrackColor(trackColor); setHandleColor(handleColor); setBubbleColor(bubbleColor); setBubbleTextColor(textColor); setHideScrollbar(hideScrollbar); setTrackVisible(showTrack); }
Example 15
Source File: MarkdownSyntaxGenerator.java From Elephant with Apache License 2.0 | 4 votes |
public static CharacterStyle styleFromSyntaxType(MarkdownSyntaxType type) { switch(type) { case MarkdownSyntaxUnknown: { return null; } case MarkdownSyntaxHeaders: { //TODO adjust text size return new AbsoluteSizeSpan(30, true); } case MarkdownSyntaxLinks: { return new ForegroundColorSpan(Color.BLUE); } case MarkdownSyntaxBold: { return new StyleSpan(Typeface.BOLD); } case MarkdownSyntaxEmphasis: { return new StyleSpan(Typeface.BOLD); } case MarkdownSyntaxDeletions: { return new StrikethroughSpan(); } case MarkdownSyntaxQuotes: { return new ForegroundColorSpan(Color.LTGRAY); } case MarkdownSyntaxCodeBlock: { return new BackgroundColorSpan(Color.parseColor("#fafafa")); } case MarkdownSyntaxInlineCode: { return new ForegroundColorSpan(Color.parseColor("#C2B17A")); } case MarkdownSyntaxBlockquotes: { return new ForegroundColorSpan(Color.LTGRAY); } case MarkdownSyntaxULLists: { return null; } case MarkdownSyntaxOLLists: { return null; } case NumberOfMarkdownSyntax: { return null; } default: { return null; } } }
Example 16
Source File: WeekColumnView.java From mCalendarView with Apache License 2.0 | 4 votes |
private void initParams() { backgroundColor = Color.WHITE; startendTextColor = Color.LTGRAY; midTextColor = Color.LTGRAY; }
Example 17
Source File: TaskItem.java From TaskQueue with Apache License 2.0 | 4 votes |
@Override public void handleData(Task<?, ?> task, int i) { final Context context = root.getContext(); taskNameText.setText(context.getString(R.string.task_name, task.getSequence())); final int color; final String priority; switch (task.getPriority()) { case IMMEDIATE: color = Color.RED; priority = "immediate"; break; case HIGH: color = Color.YELLOW; priority = "high"; break; case NORMAL: color = Color.GREEN; priority = "normal"; break; case LOW: default: color = Color.GRAY; priority = "low"; } taskPriorityIndicator.setColorFilter(color, PorterDuff.Mode.SRC_ATOP); taskPriorityText.setText(priority); String state = task.getState() + (task.isCanceled() ? ", CANCELED" : "") + (task.isTimeout() ? ", TIMEOUT" : ""); taskStateText.setText(state); final int bgColor; switch (task.getState()) { case PENDING: bgColor = Color.WHITE; break; case EXECUTING: bgColor = context.getResources().getColor(android.R.color.holo_orange_light); break; case FINISHED: default: bgColor = Color.LTGRAY; } root.setBackgroundColor(bgColor); }
Example 18
Source File: SplashActivity.java From Pioneer with Apache License 2.0 | 4 votes |
void showStyledText() { // 外部矩形弧度 float[] outerR = new float[] { 24, 24, 24, 24, 8, 8, 8, 8 }; Truss truss = new Truss(); truss.append("H"); truss.pushSpan(new BackgroundColorSpan(Color.RED)); truss.append("e"); // 绿色字 truss.pushSpan(Truss.wrap(new ForegroundColorSpan(Color.GREEN))); Spans.TextSpan lloText = new Spans.TextSpan(Paint.Align.CENTER, Paint.Style.FILL_AND_STROKE, 4); // 黄色圆角空心矩形边框,上面绘字 Spans.ShapeSpan lloStrokeShape = new Spans.ShapeSpan( new RoundRectShape(outerR, null, null), Paint.Style.STROKE, 8, Color.YELLOW, false, lloText); truss.append(new Truss() .pushSpan(lloStrokeShape) .append("l l o") .build()); truss.append(", "); truss.popSpan(); // 灰色圆角实心矩形边框,上面绘字 Spans.TextSpan woTextSpan = new Spans.TextSpan(Paint.Align.CENTER, Paint.Style.FILL_AND_STROKE, 4); Spans.ShapeSpan woFillShape = new Spans.ShapeSpan( new RoundRectShape(outerR, null, null), Paint.Style.FILL_AND_STROKE, 18, Color.LTGRAY, false, woTextSpan); truss.append(new Truss() .pushSpan(woFillShape) .append("我'") .build()); truss.append("s "); // 灰色圆角实心矩形边框,上面镂空绘字 Spans.ShapeSpan swoFillShape = new Spans.ShapeSpan( new RoundRectShape(outerR, null, null), Paint.Style.FILL_AND_STROKE, 18, Color.LTGRAY, false); Spans.TextSpan swoTextSpan = new Spans.TextSpan(Paint.Align.CENTER, Paint.Style.FILL_AND_STROKE, 4); CharacterStyle[] bg = new CharacterStyle[]{swoFillShape}; truss.append(new Truss() .pushSpan(new Spans.HollowSpan(bg, swoTextSpan)) .append("Wo") .build()); truss.append("rl"); truss.popSpan(); truss.append("d!"); styledText.setTextColor(Color.YELLOW); styledText.setText(truss.build()); }
Example 19
Source File: DividerMenuItem.java From QuickMenu with MIT License | 4 votes |
public DividerMenuItem(Context context) { mDividerColor = Color.LTGRAY; mDividerWidth = (int) context.getResources().getDisplayMetrics().density; mMarginLeft = mMarginTop = mMarginRight = mMarginBottom = 0; }
Example 20
Source File: RadiusSwitchDelegate.java From UIWidget with Apache License 2.0 | 4 votes |
@Override protected void initAttributes(Context context, AttributeSet attrs) { mColorAccent = mResourceUtil.getAttrColor(android.R.attr.colorAccent); mColorDefault = Color.LTGRAY; mThumbDrawableWidth = mTypedArray.getDimensionPixelSize(R.styleable.RadiusSwitch_rv_thumbDrawableWidth, dp2px(24)); mThumbDrawableHeight = mTypedArray.getDimensionPixelSize(R.styleable.RadiusSwitch_rv_thumbDrawableHeight, dp2px(24)); mThumbDrawable = mTypedArray.getDrawable(R.styleable.RadiusSwitch_rv_thumbDrawable); mThumbPressedDrawable = mTypedArray.getDrawable(R.styleable.RadiusSwitch_rv_thumbPressedDrawable); mThumbDisabledDrawable = mTypedArray.getDrawable(R.styleable.RadiusSwitch_rv_thumbDisabledDrawable); mThumbSelectedDrawable = mTypedArray.getDrawable(R.styleable.RadiusSwitch_rv_thumbSelectedDrawable); mThumbCheckedDrawable = mTypedArray.getDrawable(R.styleable.RadiusSwitch_rv_thumbCheckedDrawable); mThumbStrokeColor = mTypedArray.getColor(R.styleable.RadiusSwitch_rv_thumbStrokeColor, mColorDefault); mThumbStrokePressedColor = mTypedArray.getColor(R.styleable.RadiusSwitch_rv_thumbStrokePressedColor, mThumbStrokeColor); mThumbStrokeDisabledColor = mTypedArray.getColor(R.styleable.RadiusSwitch_rv_thumbStrokeDisabledColor, mThumbStrokeColor); mThumbStrokeSelectedColor = mTypedArray.getColor(R.styleable.RadiusSwitch_rv_thumbStrokeSelectedColor, mThumbStrokeColor); mThumbStrokeCheckedColor = mTypedArray.getColor(R.styleable.RadiusSwitch_rv_thumbStrokeCheckedColor, mColorAccent); mThumbStrokeWidth = mTypedArray.getDimensionPixelSize(R.styleable.RadiusSwitch_rv_thumbStrokeWidth, dp2px(2)); mThumbRadius = mTypedArray.getDimension(R.styleable.RadiusSwitch_rv_thumbRadius, 100f); //轨道属性 mTrackDrawableWidth = mTypedArray.getDimensionPixelSize(R.styleable.RadiusSwitch_rv_trackDrawableWidth, dp2px(48)); mTrackDrawableHeight = mTypedArray.getDimensionPixelSize(R.styleable.RadiusSwitch_rv_trackDrawableHeight, dp2px(24)); mTrackDrawable = mTypedArray.getDrawable(R.styleable.RadiusSwitch_rv_trackDrawable); mTrackPressedDrawable = mTypedArray.getDrawable(R.styleable.RadiusSwitch_rv_trackPressedDrawable); mTrackDisabledDrawable = mTypedArray.getDrawable(R.styleable.RadiusSwitch_rv_trackDisabledDrawable); mTrackSelectedDrawable = mTypedArray.getDrawable(R.styleable.RadiusSwitch_rv_trackSelectedDrawable); mTrackCheckedDrawable = mTypedArray.getDrawable(R.styleable.RadiusSwitch_rv_trackCheckedDrawable); mTrackStrokeColor = mTypedArray.getColor(R.styleable.RadiusSwitch_rv_trackStrokeColor, mColorDefault); mTrackStrokePressedColor = mTypedArray.getColor(R.styleable.RadiusSwitch_rv_trackStrokePressedColor, mTrackStrokeColor); mTrackStrokeDisabledColor = mTypedArray.getColor(R.styleable.RadiusSwitch_rv_trackStrokeDisabledColor, mTrackStrokeColor); mTrackStrokeSelectedColor = mTypedArray.getColor(R.styleable.RadiusSwitch_rv_trackStrokeSelectedColor, mThumbStrokeColor); mTrackStrokeCheckedColor = mTypedArray.getColor(R.styleable.RadiusSwitch_rv_trackStrokeCheckedColor, mColorAccent); mTrackStrokeWidth = mTypedArray.getDimensionPixelSize(R.styleable.RadiusSwitch_rv_trackStrokeWidth, dp2px(2)); mTrackRadius = mTypedArray.getDimension(R.styleable.RadiusSwitch_rv_trackRadius, 100f); mThumbDrawable = mThumbDrawable == null ? new ColorDrawable(Color.WHITE) : mThumbDrawable; mThumbPressedDrawable = mTrackPressedDrawable == null ? mThumbDrawable : mThumbPressedDrawable; mThumbDisabledDrawable = mThumbDisabledDrawable == null ? mThumbDrawable : mThumbDisabledDrawable; mThumbSelectedDrawable = mThumbSelectedDrawable == null ? mThumbDrawable : mThumbSelectedDrawable; mThumbCheckedDrawable = mThumbCheckedDrawable == null ? mThumbDrawable : mThumbCheckedDrawable; mTrackDrawable = mTrackDrawable == null ? new ColorDrawable(mColorDefault) : mTrackDrawable; mTrackPressedDrawable = mTrackPressedDrawable == null ? mTrackDrawable : mTrackPressedDrawable; mTrackDisabledDrawable = mTrackDisabledDrawable == null ? mTrackDrawable : mTrackDisabledDrawable; mTrackSelectedDrawable = mTrackSelectedDrawable == null ? mTrackDrawable : mTrackSelectedDrawable; mTrackCheckedDrawable = mTrackCheckedDrawable == null ? new ColorDrawable(mColorAccent) : mTrackCheckedDrawable; super.initAttributes(context, attrs); }