Java Code Examples for android.graphics.Color#DKGRAY
The following examples show how to use
android.graphics.Color#DKGRAY .
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: EventLogActivity.java From xDrip-plus with GNU General Public License v3.0 | 6 votes |
public int colorForSeverity(int severity) { switch (severity) { case 1: return Color.TRANSPARENT; case 2: return Color.DKGRAY; case 3: return Color.RED; case 4: return Color.DKGRAY; case 5: return Color.parseColor("#ff337777"); case 6: return Color.parseColor("#ff337733"); default: return Color.TRANSPARENT; } }
Example 2
Source File: CircleWatchface.java From NightWatch 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 3
Source File: CircleWatchface.java From NightWatch 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 4
Source File: OptionsAdapter.java From Musicoco with Apache License 2.0 | 6 votes |
public OptionsAdapter(Context context, @Nullable int[] iconsID, @Nullable int[] ids, @NonNull String[] texts, @Nullable String[] msgs, @Nullable OptionClickListener[] listener) { this.context = context; this.iconColor = this.titleColor = Color.DKGRAY; this.msgColor = Color.GRAY; for (int i = 0; i < texts.length; i++) { Option option = new Option( texts[i], ids == null ? 0 : (ids.length == texts.length ? ids[i] : 0), msgs == null ? null : msgs[i], iconsID == null ? -1 : iconsID[i], listener == null ? null : listener[i] ); options.add(option); } }
Example 5
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 6
Source File: CircleWatchface.java From xDrip with GNU General Public License v3.0 | 6 votes |
public void addReadingSoft(Canvas canvas, BgWatchData entry) { Log.d(TAG, "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 7
Source File: FeedAdapter.java From android-proguards with Apache License 2.0 | 5 votes |
public FeedAdapter(Activity hostActivity, DataLoadingSubject dataLoading, int columns, boolean pocketInstalled) { this.host = hostActivity; this.dataLoading = dataLoading; dataLoading.registerCallback(this); this.columns = columns; this.pocketIsInstalled = pocketInstalled; layoutInflater = LayoutInflater.from(host); comparator = new PlaidItemSorting.PlaidItemComparator(); items = new ArrayList<>(); setHasStableIds(true); // get the dribbble shot placeholder colors & badge color from the theme final TypedArray a = host.obtainStyledAttributes(R.styleable.DribbbleFeed); final int loadingColorArrayId = a.getResourceId(R.styleable.DribbbleFeed_shotLoadingPlaceholderColors, 0); if (loadingColorArrayId != 0) { int[] placeholderColors = host.getResources().getIntArray(loadingColorArrayId); shotLoadingPlaceholders = new ColorDrawable[placeholderColors.length]; for (int i = 0; i < placeholderColors.length; i++) { shotLoadingPlaceholders[i] = new ColorDrawable(placeholderColors[i]); } } else { shotLoadingPlaceholders = new ColorDrawable[] { new ColorDrawable(Color.DKGRAY) }; } final int initialGifBadgeColorId = a.getResourceId(R.styleable.DribbbleFeed_initialBadgeColor, 0); initialGifBadgeColor = initialGifBadgeColorId != 0 ? ContextCompat.getColor(host, initialGifBadgeColorId) : 0x40ffffff; a.recycle(); }
Example 8
Source File: ActivityResult.java From android-fragment-bugs with The Unlicense | 5 votes |
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ResultFragment fragmentA1 = new ResultFragment("A1", Color.DKGRAY); ResultFragment fragmentA2 = new ResultFragment("A2", Color.DKGRAY); getChildFragmentManager().beginTransaction() .add(R.id.container, fragmentA1) .add(R.id.container, fragmentA2) .commit(); }
Example 9
Source File: RichTextConfig.java From RichText with MIT License | 5 votes |
@Override public Drawable getDrawable(ImageHolder holder, RichTextConfig config, TextView textView) { ColorDrawable drawable = new ColorDrawable(Color.DKGRAY); int width = textView.getWidth(); drawable.setBounds(0, 0, width, width / 2); HANDLER.obtainMessage(SET_BOUNDS, Pair.create(drawable, textView)).sendToTarget(); return drawable; }
Example 10
Source File: ColorList.java From ui with Apache License 2.0 | 5 votes |
ColorList() { num = 0; //set to first color in list colors = new ColorData[]{ new ColorData("Red", Color.RED), new ColorData("Blue", Color.BLUE), new ColorData("Cyan", Color.CYAN), new ColorData("Orange", Color.rgb(255, 165, 0)), //Android's green is lime. //new ColorData("Green", Color.GREEN), new ColorData("Green", Color.rgb(0, 128, 0)), new ColorData("Magenta", Color.MAGENTA), new ColorData("Pink", Color.rgb(255, 192, 203)), new ColorData("Yellow", Color.YELLOW), new ColorData("Gray", Color.GRAY), new ColorData("Light Gray", Color.LTGRAY), new ColorData("Dark Gray", Color.DKGRAY), new ColorData("Lime", Color.rgb(0, 255, 0)), new ColorData("Olive", Color.rgb(128, 128, 0)), new ColorData("Purple", Color.rgb(128, 0, 128)), new ColorData("Teal", Color.rgb(0, 128, 128)), new ColorData("Navy", Color.rgb(0, 0, 128)), new ColorData("Golden Rod", Color.rgb(218, 165, 32)), new ColorData("Dark Olive Green", Color.rgb(85, 107, 47)), new ColorData("Khaki", Color.rgb(240, 230, 140)), new ColorData("Steel Blue", Color.rgb(70, 130, 180)), new ColorData("Dark Orchid", Color.rgb(153, 50, 204)), new ColorData("White", Color.WHITE), new ColorData() //black. }; }
Example 11
Source File: KeypadInputActivity.java From xDrip with GNU General Public License v3.0 | 5 votes |
private void updateTab() { final int offColor = Color.DKGRAY; final int onColor = Color.RED; insulintabbutton.setBackgroundColor(offColor); carbstabbutton.setBackgroundColor(offColor); timetabbutton.setBackgroundColor(offColor); bloodtesttabbutton.setBackgroundColor(offColor); String append = ""; String value = ""; switch (currenttab) { case "insulin": insulintabbutton.setBackgroundColor(onColor); append = " units"; break; case "carbs": carbstabbutton.setBackgroundColor(onColor); append = " carbs"; break; case "bloodtest": bloodtesttabbutton.setBackgroundColor(onColor); append = " BG"; // TODO get mgdl or mmol here break; case "time": timetabbutton.setBackgroundColor(onColor); append = " time"; break; } value = getValue(currenttab); mDialTextView.setText(value + append); // show green tick if (value.length() > 0) { mDialTextView.getBackground().setAlpha(255); } else { mDialTextView.getBackground().setAlpha(0); } }
Example 12
Source File: SuggestionDialogFragment.java From uservoice-android-sdk with MIT License | 4 votes |
private void displaySuggestion(View view, Suggestion suggestion) { TextView status = (TextView) view.findViewById(R.id.uv_status); TextView responseStatus = (TextView) view.findViewById(R.id.uv_response_status); View responseDivider = view.findViewById(R.id.uv_response_divider); TextView title = (TextView) view.findViewById(R.id.uv_title); if (suggestion.isSubscribed()) { ((CheckBox) view.findViewById(R.id.uv_subscribe_checkbox)).setChecked(true); } if (suggestion.getStatus() == null) { status.setVisibility(View.GONE); int defaultColor = Color.DKGRAY; responseStatus.setTextColor(defaultColor); responseDivider.setBackgroundColor(defaultColor); } else { int color = Color.parseColor(suggestion.getStatusColor()); status.setBackgroundColor(color); status.setText(suggestion.getStatus()); responseStatus.setTextColor(color); responseStatus.setText(String.format(getString(R.string.uv_admin_response_format), suggestion.getStatus().toUpperCase(Locale.getDefault()))); responseDivider.setBackgroundColor(color); } title.setText(suggestion.getTitle()); ((TextView) view.findViewById(R.id.uv_text)).setText(suggestion.getText()); ((TextView) view.findViewById(R.id.uv_creator)).setText(String.format(view.getContext().getString(R.string.uv_posted_by_format), suggestion.getCreatorName(), DateFormat.getDateInstance().format(suggestion.getCreatedAt()))); if (suggestion.getAdminResponseText() == null) { view.findViewById(R.id.uv_admin_response).setVisibility(View.GONE); } else { view.findViewById(R.id.uv_admin_response).setVisibility(View.VISIBLE); ((TextView) view.findViewById(R.id.uv_admin_name)).setText(suggestion.getAdminResponseUserName()); ((TextView) view.findViewById(R.id.uv_response_date)).setText(DateFormat.getDateInstance().format(suggestion.getAdminResponseCreatedAt())); ((TextView) view.findViewById(R.id.uv_response_text)).setText(suggestion.getAdminResponseText()); ImageView avatar = (ImageView) view.findViewById(R.id.uv_admin_avatar); ImageCache.getInstance().loadImage(suggestion.getAdminResponseAvatarUrl(), avatar); } ((TextView) view.findViewById(R.id.uv_comment_count)).setText(Utils.getQuantityString(view, R.plurals.uv_comments, suggestion.getNumberOfComments()).toUpperCase(Locale.getDefault())); if (Session.getInstance().getClientConfig().shouldDisplaySuggestionsByRank()) { ((TextView) view.findViewById(R.id.uv_subscriber_count)).setText(String.format(view.getContext().getResources().getString(R.string.uv_ranked), suggestion.getRankString())); } else { ((TextView) view.findViewById(R.id.uv_subscriber_count)).setText(String.format(view.getContext().getResources().getQuantityString(R.plurals.uv_number_of_subscribers_format, suggestion.getNumberOfSubscribers()), Utils.getQuantityString(view, R.plurals.uv_subscribers, suggestion.getNumberOfSubscribers()))); } }
Example 13
Source File: Style.java From Bitocle with Apache License 2.0 | 4 votes |
/** * Returns a preset style with specified animations. * * @param styleType {@link Style} * @param animations {@link com.github.johnpersano.supertoasts.SuperToast.Animations} * * @return {@link Style} */ public static Style getStyle(int styleType, SuperToast.Animations animations) { final Style style = new Style(); style.animations = animations; switch (styleType) { case BLACK: style.textColor = Color.WHITE; style.background = getBackground(BLACK); style.dividerColor = Color.WHITE; return style; case WHITE: style.textColor = Color.DKGRAY; style.background = getBackground(WHITE); style.dividerColor = Color.DKGRAY; style.buttonTextColor = Color.GRAY; return style; case GRAY: style.textColor = Color.WHITE; style.background = getBackground(GRAY); style.dividerColor = Color.WHITE; style.buttonTextColor = Color.GRAY; return style; case PURPLE: style.textColor = Color.WHITE; style.background = getBackground(PURPLE); style.dividerColor = Color.WHITE; return style; case RED: style.textColor = Color.WHITE; style.background = getBackground(RED); style.dividerColor = Color.WHITE; return style; case ORANGE: style.textColor = Color.WHITE; style.background = getBackground(ORANGE); style.dividerColor = Color.WHITE; return style; case BLUE: style.textColor = Color.WHITE; style.background = getBackground(BLUE); style.dividerColor = Color.WHITE; return style; case GREEN: style.textColor = Color.WHITE; style.background = getBackground(GREEN); style.dividerColor = Color.WHITE; return style; default: style.textColor = Color.WHITE; style.background = getBackground(GRAY); style.dividerColor = Color.WHITE; return style; } }
Example 14
Source File: ExplorerActivity.java From PowerFileExplorer with GNU General Public License v3.0 | 4 votes |
private void updateColor() { final int theme = getAppTheme().getSimpleTheme().ordinal(); Log.d(TAG, "updateColor " + theme + ", " + prevTheme + ", hourOfDay " + PreferenceUtils.hourOfDay() + ", configurationChanged " + configurationChanged); if (prevTheme != theme) { if (Build.VERSION.SDK_INT >= 21) { if (theme == 1) { mCurTheme = android.R.style.Theme_Material_Wallpaper; Constants.TEXT_COLOR = Constants.TEXT_COLOR_LIGHT; Constants.BASE_BACKGROUND = Constants.BASE_BACKGROUND_DARK; Constants.DIVIDER_COLOR = Color.DKGRAY; Constants.DIR_COLOR = Color.WHITE; Constants.FILE_COLOR = Color.WHITE; Constants.SELECTED_IN_LIST = 0xffb0b0b0; Constants.IN_DATA_SOURCE_2 = 0xff505050; Constants.IS_PARTIAL = 0xff707070; } else { mCurTheme = android.R.style.Theme_Material_Light;//AndroidUtils.getSharedPreference(this, "theme", android.R.style.Theme_Material_Light); Constants.SELECTED_IN_LIST = 0xFFFEF8BA; Constants.BASE_BACKGROUND = Constants.BASE_BACKGROUND_LIGHT; Constants.DIVIDER_COLOR = Color.LTGRAY; Constants.IN_DATA_SOURCE_2 = 0xFFFFF8D9; Constants.IS_PARTIAL = 0xFFFFF0CF; Constants.TEXT_COLOR = Constants.TEXT_COLOR_DARK; Constants.DIR_COLOR = Constants.TEXT_COLOR_DARK; Constants.FILE_COLOR = Constants.TEXT_COLOR_DARK; } } else { if (theme == 1) { mCurTheme = android.R.style.Theme_Wallpaper; Constants.TEXT_COLOR = Constants.TEXT_COLOR_LIGHT; Constants.BASE_BACKGROUND = Constants.BASE_BACKGROUND_DARK; Constants.DIVIDER_COLOR = Color.DKGRAY; Constants.DIR_COLOR = Color.WHITE; Constants.FILE_COLOR = Color.WHITE; Constants.SELECTED_IN_LIST = 0xffb0b0b0; Constants.IN_DATA_SOURCE_2 = 0xff505050; Constants.IS_PARTIAL = 0xff707070; } else { mCurTheme = android.R.style.Theme_Holo_Light; Constants.SELECTED_IN_LIST = 0xFFFEF8BA; Constants.BASE_BACKGROUND = Constants.BASE_BACKGROUND_LIGHT; Constants.DIVIDER_COLOR = Color.LTGRAY; Constants.IN_DATA_SOURCE_2 = 0xFFFFF8D9; Constants.IS_PARTIAL = 0xFFFFF0CF; Constants.TEXT_COLOR = Constants.TEXT_COLOR_DARK; Constants.DIR_COLOR = Constants.TEXT_COLOR_DARK; Constants.FILE_COLOR = Constants.TEXT_COLOR_DARK; } } if (ImageThreadLoader.compressIcon != null) { ImageThreadLoader.compressIcon.setColorFilter(Constants.TEXT_COLOR, PorterDuff.Mode.SRC_IN); } setTheme(mCurTheme); window.getDecorView().setBackgroundColor(Constants.BASE_BACKGROUND); //findViewById(R.id.buttons).setBackgroundColor(Constants.BASE_BACKGROUND); if (configurationChanged) { configurationChanged = false; } else if (slideFrag != null) { prevTheme = theme; slideFrag.getView().setBackgroundColor(Constants.BASE_BACKGROUND); if (curContentFrag != null) { slideFrag.updateLayout(true); } slideFrag.notifyTitleChange(); if (curExplorerFrag != null && curExplorerFrag.getContext() != null) { slideFrag2.getView().setBackgroundColor(Constants.BASE_BACKGROUND); slideFrag2.notifyTitleChange(); slideFrag2.updateLayout(true); curContentFrag.select(slideFrag1Selected); } } } }
Example 15
Source File: SuggestionDialogFragment.java From android-discourse with Apache License 2.0 | 4 votes |
private void displaySuggestion(View view, Suggestion suggestion) { TextView status = (TextView) view.findViewById(R.id.uv_status); TextView responseStatus = (TextView) view.findViewById(R.id.uv_response_status); View responseDivider = view.findViewById(R.id.uv_response_divider); TextView title = (TextView) view.findViewById(R.id.uv_title); if (suggestion.isSubscribed()) { ((CheckBox) view.findViewById(R.id.uv_subscribe_checkbox)).setChecked(true); } if (suggestion.getStatus() == null) { status.setVisibility(View.GONE); int defaultColor = Color.DKGRAY; responseStatus.setTextColor(defaultColor); responseDivider.setBackgroundColor(defaultColor); } else { int color = Color.parseColor(suggestion.getStatusColor()); status.setBackgroundColor(color); status.setText(suggestion.getStatus()); responseStatus.setTextColor(color); responseStatus.setText(String.format(getString(R.string.uv_admin_response_format), suggestion.getStatus().toUpperCase(Locale.getDefault()))); responseDivider.setBackgroundColor(color); } title.setText(suggestion.getTitle()); ((TextView) view.findViewById(R.id.uv_text)).setText(suggestion.getText()); ((TextView) view.findViewById(R.id.uv_creator)).setText(String.format(view.getContext().getString(R.string.uv_posted_by_format), suggestion.getCreatorName(), DateFormat.getDateInstance().format(suggestion.getCreatedAt()))); if (suggestion.getAdminResponseText() == null) { view.findViewById(R.id.uv_admin_response).setVisibility(View.GONE); } else { view.findViewById(R.id.uv_admin_response).setVisibility(View.VISIBLE); ((TextView) view.findViewById(R.id.uv_admin_name)).setText(suggestion.getAdminResponseUserName()); ((TextView) view.findViewById(R.id.uv_response_date)).setText(DateFormat.getDateInstance().format(suggestion.getAdminResponseCreatedAt())); ((TextView) view.findViewById(R.id.uv_response_text)).setText(suggestion.getAdminResponseText()); ImageView avatar = (ImageView) view.findViewById(R.id.uv_admin_avatar); ImageCache.getInstance().loadImage(suggestion.getAdminResponseAvatarUrl(), avatar); } ((TextView) view.findViewById(R.id.uv_comment_count)).setText(Utils.getQuantityString(view, R.plurals.uv_comments, suggestion.getNumberOfComments()).toUpperCase(Locale.getDefault())); ((TextView) view.findViewById(R.id.uv_subscriber_count)).setText(String.format(view.getContext().getResources().getQuantityString(R.plurals.uv_number_of_subscribers_format, suggestion.getNumberOfSubscribers()), Utils.getQuantityString(view, R.plurals.uv_subscribers, suggestion.getNumberOfSubscribers()))); }
Example 16
Source File: OptionsAdapter.java From Musicoco with Apache License 2.0 | 4 votes |
public OptionsAdapter(Context context, List<Option> options) { this.context = context; this.iconColor = this.titleColor = Color.DKGRAY; this.msgColor = Color.GRAY; this.options = options; }
Example 17
Source File: Style.java From Bitocle with Apache License 2.0 | 4 votes |
/** * Returns a preset style. * * @param styleType {@link Style} * * @return {@link Style} */ public static Style getStyle(int styleType) { final Style style = new Style(); switch (styleType) { case BLACK: style.textColor = Color.WHITE; style.background = getBackground(BLACK); style.dividerColor = Color.WHITE; return style; case WHITE: style.textColor = Color.DKGRAY; style.background = getBackground(WHITE); style.dividerColor = Color.DKGRAY; style.buttonTextColor = Color.GRAY; return style; case GRAY: style.textColor = Color.WHITE; style.background = getBackground(GRAY); style.dividerColor = Color.WHITE; style.buttonTextColor = Color.GRAY; return style; case PURPLE: style.textColor = Color.WHITE; style.background = getBackground(PURPLE); style.dividerColor = Color.WHITE; return style; case RED: style.textColor = Color.WHITE; style.background = getBackground(RED); style.dividerColor = Color.WHITE; return style; case ORANGE: style.textColor = Color.WHITE; style.background = getBackground(ORANGE); style.dividerColor = Color.WHITE; return style; case BLUE: style.textColor = Color.WHITE; style.background = getBackground(BLUE); style.dividerColor = Color.WHITE; return style; case GREEN: style.textColor = Color.WHITE; style.background = getBackground(GREEN); style.dividerColor = Color.WHITE; return style; default: style.textColor = Color.WHITE; style.background = getBackground(GRAY); style.dividerColor = Color.WHITE; return style; } }
Example 18
Source File: Style.java From Bitocle with Apache License 2.0 | 4 votes |
/** * Returns a preset style. * * @param styleType {@link Style} * * @return {@link Style} */ public static Style getStyle(int styleType) { final Style style = new Style(); switch (styleType) { case BLACK: style.textColor = Color.WHITE; style.background = getBackground(BLACK); style.dividerColor = Color.WHITE; return style; case WHITE: style.textColor = Color.DKGRAY; style.background = getBackground(WHITE); style.dividerColor = Color.DKGRAY; style.buttonTextColor = Color.GRAY; return style; case GRAY: style.textColor = Color.WHITE; style.background = getBackground(GRAY); style.dividerColor = Color.WHITE; style.buttonTextColor = Color.GRAY; return style; case PURPLE: style.textColor = Color.WHITE; style.background = getBackground(PURPLE); style.dividerColor = Color.WHITE; return style; case RED: style.textColor = Color.WHITE; style.background = getBackground(RED); style.dividerColor = Color.WHITE; return style; case ORANGE: style.textColor = Color.WHITE; style.background = getBackground(ORANGE); style.dividerColor = Color.WHITE; return style; case BLUE: style.textColor = Color.WHITE; style.background = getBackground(BLUE); style.dividerColor = Color.WHITE; return style; case GREEN: style.textColor = Color.WHITE; style.background = getBackground(GREEN); style.dividerColor = Color.WHITE; return style; default: style.textColor = Color.WHITE; style.background = getBackground(GRAY); style.dividerColor = Color.WHITE; return style; } }
Example 19
Source File: ItemData.java From FlyRefresh with MIT License | 4 votes |
public ItemData(int icon, String title) { this(Color.DKGRAY, icon, title, new Date()); }
Example 20
Source File: TestMovieSegment.java From PhotoMovie with Apache License 2.0 | 4 votes |
private int getRanColor() { int colors[] = new int[]{Color.BLUE, Color.RED, Color.DKGRAY, Color.GREEN, Color.YELLOW, Color.MAGENTA, Color.WHITE}; int i = (int) (Math.random() * colors.length); return colors[i]; }