List of usage examples for android.graphics Color WHITE
int WHITE
To view the source code for android.graphics Color WHITE.
Click Source Link
From source file:net.naonedbus.utils.InfoDialogUtils.java
/** * Afficher une dialog avec un contenu au format HTML * //from ww w . j a va 2s . co m * @param context * @param html */ public static void showHtml(final Context context, final String html) { AlertDialog.Builder moreDetailsDialog = null; final WebView webView = new WebView(context); final ScrollView scrollView = new ScrollView(context); webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); webView.setBackgroundColor(Color.WHITE); webView.loadDataWithBaseURL("fake://not/needed", html, "text/html", "UTF-8", null); // Encoding // fix // for // Android // 3.x // / // 4.x scrollView.addView(webView); moreDetailsDialog = new AlertDialog.Builder(context); moreDetailsDialog.setIcon(android.R.drawable.ic_dialog_info); moreDetailsDialog.setTitle("Informations"); moreDetailsDialog.setView(scrollView); moreDetailsDialog.setPositiveButton(android.R.string.ok, null); moreDetailsDialog.show(); }
From source file:com.bzu.yhd.pocketcampus.main.AboutActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); mUnbinder = ButterKnife.bind(this); initializeToolbar();/*www . ja v a2 s.c o m*/ BaseApplication.getInstance().addActivity(this); Glide.with(this).load(R.mipmap.flowbloom).into(mHeaderImg); try { PackageManager manager = getPackageManager(); PackageInfo info = manager.getPackageInfo(getPackageName(), 0); String s = String.format(Locale.CHINA, "%sBuild %d", info.versionName, info.versionCode); mVersionNameText.setText(s); } catch (Exception e) { e.printStackTrace(); mVersionNameText.setText(""); } if (Colorful.getThemeDelegate().isNight()) { Drawable drawable = mGitHubImg.getDrawable(); if (drawable != null) { DrawableCompat.setTint(drawable, Color.WHITE); mGitHubImg.setImageDrawable(drawable); } } mLicenseText.setText(Html.fromHtml(getString(R.string.license))); }
From source file:com.danimahardhika.android.helpers.core.ColorHelper.java
@ColorInt public static int getTitleTextColor(@ColorInt int color) { double darkness = 1 - (0.299 * Color.red(color) + 0.587 * Color.green(color) + 0.114 * Color.blue(color)) / 255; return (darkness < 0.35) ? getDarkerColor(color, 0.25f) : Color.WHITE; }
From source file:com.bytebit.classicbyte.ScreenMainMenu.java
public void draw(Canvas c) { this.parent.standard_paint.setColor(Color.WHITE); for (int i = 0; i != 9; i++) { for (int k = 0; k != 10; k++) { c.drawBitmap(TextureManager.getBitmap(3), k * (this.parent.renderer.width / 10), (i + 1) * (this.parent.renderer.width / 10), this.parent.standard_paint); }//from w w w. java2s .c o m } if (this.menu_current_tab == 1) { Rect bounds = new Rect(); String g; for (int k = 0; k != this.server_list_name.size(); k++) { if (k >= this.server_list_name.size()) { break; } if ((this.parent.renderer.width * 0.12F + this.parent.renderer.width * 0.1F * k + this.server_list_y_offset) >= 0 && (this.parent.renderer.width * 0.12F + this.parent.renderer.width * 0.1F * k + this.server_list_y_offset) <= this.parent.renderer.height) { this.parent.standard_paint.setColor(Color.WHITE); this.parent.standard_paint.setTextSize(this.parent.renderer.width * 0.04F); c.drawBitmap(TextureManager.getBitmap(10), (this.parent.renderer.width - TextureManager.getBitmap(10).getWidth()) / 2, this.parent.renderer.width * 0.02F + this.parent.renderer.width * 0.12F + this.parent.renderer.width * 0.1F * k + this.server_list_y_offset, this.parent.standard_paint); g = this.server_list_name.get(k); this.parent.standard_paint.getTextBounds(this.server_list_name.get(k), 0, this.server_list_name.get(k).length(), bounds); if (bounds.width() > TextureManager.getBitmap(10).getWidth() * 0.85F) { while (bounds.width() > TextureManager.getBitmap(10).getWidth() * 0.85F) { this.parent.standard_paint.getTextBounds(g + " ..", 0, (g + " ..").length(), bounds); g = g.substring(0, g.length() - 1); } g = g + " .."; } c.drawText(g, (this.parent.renderer.width - TextureManager.getBitmap(10).getWidth()) / 2 + this.parent.renderer.width * 0.02F, this.parent.renderer.width * 0.08F + this.parent.renderer.width * 0.12F + this.parent.renderer.width * 0.1F * k + this.server_list_y_offset, this.parent.standard_paint); this.parent.standard_paint.setColor(Color.YELLOW); this.parent.standard_paint.getTextBounds(this.server_list_online_data.get(k), 0, this.server_list_online_data.get(k).length(), bounds); c.drawText(this.server_list_online_data.get(k), this.parent.renderer.width - (this.parent.renderer.width - TextureManager.getBitmap(10).getWidth()) / 2 - this.parent.renderer.width * 0.02F - bounds.width(), this.parent.renderer.width * 0.08F + this.parent.renderer.width * 0.12F + this.parent.renderer.width * 0.1F * k + this.server_list_y_offset, this.parent.standard_paint); } } c.drawBitmap( TextureManager.getBitmap(26), 0, TextureManager.getBitmap(2).getHeight() + TextureManager.getBitmap(22).getHeight() + this.scrollbar_offset, this.parent.standard_paint); if (this.menu_button_highlighted == 3) { c.drawBitmap(TextureManager.getBitmap(25), 0, TextureManager.getBitmap(2).getHeight(), this.parent.standard_paint); } else { c.drawBitmap(TextureManager.getBitmap(24), 0, TextureManager.getBitmap(2).getHeight(), this.parent.standard_paint); } if (this.menu_button_highlighted == 4) { c.drawBitmap(TextureManager.getBitmap(23), 0, this.parent.renderer.height - TextureManager.getBitmap(22).getHeight(), this.parent.standard_paint); } else { c.drawBitmap(TextureManager.getBitmap(22), 0, this.parent.renderer.height - TextureManager.getBitmap(22).getHeight(), this.parent.standard_paint); } } if (this.menu_current_tab == 2) { Rect bounds = new Rect(); this.parent.standard_paint.setColor(Color.WHITE); this.parent.standard_paint.setTextSize(this.parent.renderer.height * 0.25F); this.parent.standard_paint.getTextBounds("Nothing here", 0, "Nothing here".length(), bounds); c.drawText("Nothing here", (this.parent.renderer.width - bounds.width()) / 2, this.parent.renderer.height * 0.5F, this.parent.standard_paint); } for (int k = 0; k != 10; k++) { c.drawBitmap(TextureManager.getBitmap(2), k * TextureManager.getBitmap(2).getWidth(), 0, this.parent.standard_paint); } c.drawBitmap(TextureManager.getBitmap(4), this.parent.renderer.width * 0.05F, 0, this.parent.standard_paint); if (this.menu_button_highlighted == 1) { c.drawBitmap(TextureManager.getBitmap(8), this.parent.renderer.width * 0.1F * 6.5F, this.parent.renderer.width * 0.01F, this.parent.standard_paint); } else { c.drawBitmap(TextureManager.getBitmap(7), this.parent.renderer.width * 0.1F * 6.5F, this.parent.renderer.width * 0.01F, this.parent.standard_paint); } if (this.menu_button_highlighted == 2) { c.drawBitmap(TextureManager.getBitmap(6), this.parent.renderer.width * 0.1F * 8.75F, this.parent.renderer.width * 0.01F, this.parent.standard_paint); } else { c.drawBitmap(TextureManager.getBitmap(5), this.parent.renderer.width * 0.1F * 8.75F, this.parent.renderer.width * 0.01F, this.parent.standard_paint); } //c.drawBitmap(TextureManager.getBitmap(9), this.parent.renderer.width-TextureManager.getBitmap(9).getWidth(), this.parent.renderer.height-TextureManager.getBitmap(9).getHeight(), this.parent.standard_paint); }
From source file:com.cls.sugutomo.map.ClusterOP.java
public ClusterOP(Resources resources) { baseBitmaps = new Bitmap[res.length]; for (int i = 0; i < res.length; i++) { baseBitmaps[i] = BitmapFactory.decodeResource(resources, res[i]); }//w w w . j av a2 s . c o m paint.setColor(Color.WHITE); paint.setTextAlign(Align.CENTER); paint.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD)); paint.setTextSize(resources.getDimension(R.dimen.text_size)); }
From source file:com.agenmate.lollipop.util.ViewUtils.java
public static RippleDrawable createRipple(@ColorInt int color, @FloatRange(from = 0f, to = 1f) float alpha, boolean bounded) { color = ColorUtils.modifyAlpha(color, alpha); return new RippleDrawable(ColorStateList.valueOf(color), null, bounded ? new ColorDrawable(Color.WHITE) : null); }
From source file:com.drextended.rvdbsample.util.Converters.java
@BindingAdapter(value = { "glidePath", "glidePlaceholder", "glideSignature", "glideCacheStrategy", "glideCrossFadeDisabled", "glideAnimation", "glideTransform" }, requireAll = false) public static void setImageUri(ImageView imageView, String path, Drawable placeholder, String glideSignature, String glideCacheStrategy, boolean crossFadeDisabled, Integer animationResId, String glideTransform) { Context context = imageView.getContext(); if (context instanceof Activity && ((Activity) context).isFinishing()) return;/* w w w . j a va 2s.c o m*/ if (context instanceof ContextWrapper) { final Context baseContext = ((ContextWrapper) context).getBaseContext(); if (baseContext instanceof Activity && ((Activity) baseContext).isFinishing()) return; } boolean isEmptyPath = TextUtils.isEmpty(path); if (isEmptyPath) { if (placeholder != null) { imageView.setImageDrawable(placeholder); } return; } try { RequestManager glide = Glide.with(context); DrawableRequestBuilder request = glide.load(path); if (placeholder != null) { if (!crossFadeDisabled && animationResId == null) request.crossFade(); request.placeholder(placeholder); } if (animationResId != null) { request.animate(animationResId); } if (!TextUtils.isEmpty(glideSignature)) { request.signature(new StringSignature(glideSignature)); } if (glideTransform != null) { switch (glideTransform) { case "CIRCLE": request.bitmapTransform( new CircleBorderedTransform(Glide.get(context).getBitmapPool(), Color.WHITE)); break; case "BLUR": break; } } if (!TextUtils.isEmpty(glideCacheStrategy)) { request.diskCacheStrategy(DiskCacheStrategy.valueOf(glideCacheStrategy)); } request.into(imageView); } catch (IllegalArgumentException e) { e.printStackTrace(); } }
From source file:com.davis.kangpinhui.views.viewpagerindicator.ScrollPageIndicator.java
public ScrollPageIndicator(Context context, AttributeSet attrs) { super(context, attrs); setHorizontalScrollBarEnabled(false); mTabLayout = new LinearLayout(context, attrs); ColorDrawable colorDrawable = new ColorDrawable(Color.WHITE); mTabLayout.setDividerDrawable(colorDrawable); addView(mTabLayout, new ViewGroup.LayoutParams(WRAP_CONTENT, MATCH_PARENT)); density = context.getResources().getDisplayMetrics().density; }
From source file:com.davidecirillo.multichoicesample.sampleToolbar.MySampleToolbarAdapter.java
/** * Override this method to implement a custom active/deactive state *//*from w w w. j ava 2s . co m*/ @Override public void setActive(View view, boolean state) { RelativeLayout relativeLayout = (RelativeLayout) view.findViewById(R.id.get_started_relative_layout); if (relativeLayout != null) { if (state) { relativeLayout.setBackgroundColor(ContextCompat.getColor(mContext, R.color.colorPrimaryDark)); } else { relativeLayout.setBackgroundColor(Color.WHITE); } } }
From source file:com.sebible.cordova.videosnapshot.VideoSnapshot.java
private void drawTimestamp(Bitmap bm, String prefix, long timeMs, int textSize) { float w = bm.getWidth(), h = bm.getHeight(); float size = (float) (textSize * bm.getWidth()) / 1280; float margin = (float) (w < h ? w : h) * 0.05f; Canvas c = new Canvas(bm); Paint p = new Paint(); p.setColor(Color.WHITE); p.setStrokeWidth((int) (size / 10)); p.setTextSize((int) size); // Text Size p.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_OVER)); // Text Overlapping Pattern long second = (timeMs / 1000) % 60; long minute = (timeMs / (1000 * 60)) % 60; long hour = (timeMs / (1000 * 60 * 60)) % 24; String text = String.format("%s %02d:%02d:%02d", prefix, hour, minute, second); Rect r = new Rect(); p.getTextBounds(text, 0, text.length(), r); //c.drawBitmap(originalBitmap, 0, 0, paint); c.drawText(text, bm.getWidth() - r.width() - margin, bm.getHeight() - r.height() - margin, p); }