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:com.ezac.gliderlogs.FlightOverviewActivity.java
private void makeToast(String msg, int mode) { LayoutInflater inflater = getLayoutInflater(); View layout = inflater.inflate(R.layout.toast_layout, (ViewGroup) findViewById(R.id.toast_layout_root)); ImageView image = (ImageView) layout.findViewById(R.id.image); image.setImageResource(R.drawable.ic_launcher); TextView text = (TextView) layout.findViewById(R.id.text); text.setText(msg);//ww w . j ava 2 s .co m Toast toast = new Toast(getApplicationContext()); toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0); toast.setDuration(Toast.LENGTH_LONG); toast.setView(layout); if (mode == 1) { text.setTextColor(Color.WHITE); toast.getView().setBackgroundColor(Color.RED); toast.setDuration(Toast.LENGTH_LONG); } if (mode == 2) { text.setTextColor(Color.WHITE); toast.getView().setBackgroundColor(Color.GREEN); } toast.show(); }
From source file:ab.util.AbDialogUtil.java
/** * popupwindow/*from w w w . j av a 2s . co m*/ */ public static PopupWindow showPopWindow3(Context context, View targetView, View contentView, Integer width) { PopupWindow popupWindow = null; popupWindow = new PopupWindow(contentView, -2, -2); popupWindow.setBackgroundDrawable(new ColorDrawable(Color.WHITE)); if (width != null) { popupWindow.setWidth(width); } popupWindow.setOutsideTouchable(true); popupWindow.showAtLocation(targetView, Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL, 0, 0); return popupWindow; }
From source file:com.hichinaschool.flashcards.anki.Reviewer.java
@Override protected void onCreate(Bundle savedInstanceState) { Themes.applyTheme(this); super.onCreate(savedInstanceState); // Log.i(AnkiDroidApp.TAG, "Reviewer - onCreate"); // Remove the status bar and title bar if (mPrefFullscreenReview) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); // Do not hide the title bar in Honeycomb, since it contains the action bar. if (AnkiDroidApp.SDK_VERSION <= 11) { requestWindowFeature(Window.FEATURE_NO_TITLE); }//from ww w . ja va 2s . c om } mChangeBorderStyle = Themes.getTheme() == Themes.THEME_ANDROID_LIGHT || Themes.getTheme() == Themes.THEME_ANDROID_DARK; // The hardware buttons should control the music volume while reviewing. setVolumeControlStream(AudioManager.STREAM_MUSIC); Collection col = AnkiDroidApp.getCol(); if (col == null) { reloadCollection(savedInstanceState); return; } else { mSched = col.getSched(); mCollectionFilename = col.getPath(); mBaseUrl = Utils.getBaseUrl(col.getMedia().getDir()); restorePreferences(); setFullScreen(mPrefFullscreenReview); registerExternalStorageListener(); if (mNightMode) { mCurrentBackgroundColor = Themes.getNightModeCardBackground(this); } else { mCurrentBackgroundColor = Color.WHITE; } mUseQuickUpdate = shouldUseQuickUpdate(); initLayout(R.layout.flashcard); try { String[] title = mSched.getCol().getDecks().current().getString("name").split("::"); AnkiDroidApp.getCompat().setTitle(this, title[title.length - 1], mInvertedColors); } catch (JSONException e) { throw new RuntimeException(e); } AnkiDroidApp.getCompat().setSubtitle(this, "", mInvertedColors); if (mPrefTextSelection) { clipboardSetText(""); } // Load the template for the card try { mCardTemplate = Utils.convertStreamToString(getAssets().open("card_template.html")); } catch (IOException e) { e.printStackTrace(); } // Initialize text-to-speech. This is an asynchronous operation. if (mSpeakText) { ReadText.initializeTts(this); } // Get last whiteboard state if (mPrefWhiteboard && mCurrentCard != null && MetaDB.getWhiteboardState(this, mCurrentCard.getDid()) == 1) { mShowWhiteboard = true; mWhiteboard.setVisibility(View.VISIBLE); } // Load the first card and start reviewing. Uses the answer card // task to load a card, but since we send null // as the card to answer, no card will be answered. DeckTask.launchDeckTask(DeckTask.TASK_TYPE_ANSWER_CARD, mAnswerCardHandler, new DeckTask.TaskData(mSched, null, 0)); // Since we aren't actually answering a card, decrement the rep count mSched.setReps(mSched.getReps() - 1); } }
From source file:org.lol.reddit.reddit.prepared.RedditPreparedPost.java
public VerticalToolbar generateToolbar(final Activity activity, boolean isComments, final SideToolbarOverlay overlay) { final VerticalToolbar toolbar = new VerticalToolbar(activity); final EnumSet<Action> itemsPref = PrefsUtility.pref_menus_post_toolbar_items(activity, PreferenceManager.getDefaultSharedPreferences(activity)); final Action[] possibleItems = { Action.ACTION_MENU, isComments ? Action.LINK_SWITCH : Action.COMMENTS_SWITCH, Action.UPVOTE, Action.DOWNVOTE, Action.SAVE, Action.HIDE, Action.REPLY, Action.EXTERNAL, Action.SAVE_IMAGE, Action.SHARE, Action.COPY, Action.USER_PROFILE, Action.PROPERTIES }; // TODO make static final EnumMap<Action, Integer> iconsDark = new EnumMap<Action, Integer>(Action.class); iconsDark.put(Action.ACTION_MENU, R.drawable.ic_action_overflow); iconsDark.put(Action.COMMENTS_SWITCH, R.drawable.ic_action_comments_dark); iconsDark.put(Action.LINK_SWITCH, imageUrl != null ? R.drawable.ic_action_image_dark : R.drawable.ic_action_page_dark); iconsDark.put(Action.UPVOTE, R.drawable.action_upvote_dark); iconsDark.put(Action.DOWNVOTE, R.drawable.action_downvote_dark); iconsDark.put(Action.SAVE, R.drawable.ic_action_star_filled_dark); iconsDark.put(Action.HIDE, R.drawable.ic_action_cross_dark); iconsDark.put(Action.REPLY, R.drawable.ic_action_reply_dark); iconsDark.put(Action.EXTERNAL, R.drawable.ic_action_globe_dark); iconsDark.put(Action.SAVE_IMAGE, R.drawable.ic_action_save_dark); iconsDark.put(Action.SHARE, R.drawable.ic_action_share_dark); iconsDark.put(Action.COPY, R.drawable.ic_action_copy_dark); iconsDark.put(Action.USER_PROFILE, R.drawable.ic_action_person_dark); iconsDark.put(Action.PROPERTIES, R.drawable.ic_action_info_dark); final EnumMap<Action, Integer> iconsLight = new EnumMap<Action, Integer>(Action.class); iconsLight.put(Action.ACTION_MENU, R.drawable.ic_action_overflow); iconsLight.put(Action.COMMENTS_SWITCH, R.drawable.ic_action_comments_light); iconsLight.put(Action.LINK_SWITCH, imageUrl != null ? R.drawable.ic_action_image_light : R.drawable.ic_action_page_light); iconsLight.put(Action.UPVOTE, R.drawable.action_upvote_light); iconsLight.put(Action.DOWNVOTE, R.drawable.action_downvote_light); iconsLight.put(Action.SAVE, R.drawable.ic_action_star_filled_light); iconsLight.put(Action.HIDE, R.drawable.ic_action_cross_light); iconsLight.put(Action.REPLY, R.drawable.ic_action_reply_light); iconsLight.put(Action.EXTERNAL, R.drawable.ic_action_globe_light); iconsLight.put(Action.SAVE_IMAGE, R.drawable.ic_action_save_light); iconsLight.put(Action.SHARE, R.drawable.ic_action_share_light); iconsLight.put(Action.COPY, R.drawable.ic_action_copy_light); iconsLight.put(Action.USER_PROFILE, R.drawable.ic_action_person_light); iconsLight.put(Action.PROPERTIES, R.drawable.ic_action_info_light); for (final Action action : possibleItems) { if (action == Action.SAVE_IMAGE && imageUrl == null) continue; if (itemsPref.contains(action)) { final FlatImageButton ib = new FlatImageButton(activity); final int buttonPadding = General.dpToPixels(activity, 10); ib.setPadding(buttonPadding, buttonPadding, buttonPadding, buttonPadding); if (action == Action.UPVOTE && isUpvoted() || action == Action.DOWNVOTE && isDownvoted() || action == Action.SAVE && isSaved() || action == Action.HIDE && isHidden()) { ib.setBackgroundColor(Color.WHITE); ib.setImageResource(iconsLight.get(action)); } else { ib.setImageResource(iconsDark.get(action)); // TODO highlight on click }/*from www .j a v a2 s . co m*/ ib.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { final Action actionToTake; switch (action) { case UPVOTE: actionToTake = isUpvoted() ? Action.UNVOTE : Action.UPVOTE; break; case DOWNVOTE: actionToTake = isDownvoted() ? Action.UNVOTE : Action.DOWNVOTE; break; case SAVE: actionToTake = isSaved() ? Action.UNSAVE : Action.SAVE; break; case HIDE: actionToTake = isHidden() ? Action.UNHIDE : Action.HIDE; break; default: actionToTake = action; break; } onActionMenuItemSelected(RedditPreparedPost.this, activity, actionToTake); overlay.hide(); } }); toolbar.addItem(ib); } } return toolbar; }
From source file:ab.util.AbDialogUtil.java
public static MyPop showDatePopWindow(Context context, View contentView, View targetView) { // // w w w .j av a 2 s .co m yearArrayString = getYEARArray(2016, 30); monthArrayString = getDayArray(12); hourArrayString = getHMArray(24); minuteArrayString = getHMArray(60); // ?? c = Calendar.getInstance(); PopupWindow popupWindow = new PopupWindow(contentView, -2, -2); popupWindow.setBackgroundDrawable(new ColorDrawable(Color.WHITE)); popupWindow.setWidth(context.getResources().getDisplayMetrics().widthPixels); popupWindow.setOutsideTouchable(true); popupWindow.showAtLocation(targetView, Gravity.BOTTOM, 0, 0); yearWV = (WheelView) contentView.findViewById(R.id.time_year); monthWV = (WheelView) contentView.findViewById(R.id.time_month); dayWV = (WheelView) contentView.findViewById(R.id.time_day); hourWV = (WheelView) contentView.findViewById(R.id.time_hour); minuteWV = (WheelView) contentView.findViewById(R.id.time_minute); // ? yearWV.setVisibleItems(5); monthWV.setVisibleItems(5); dayWV.setVisibleItems(5); hourWV.setVisibleItems(5); minuteWV.setVisibleItems(5); // yearWV.setLabel(""); monthWV.setLabel(""); dayWV.setLabel(""); hourWV.setLabel(""); minuteWV.setLabel(""); yearWV.setCyclic(true); monthWV.setCyclic(true); dayWV.setCyclic(true); hourWV.setCyclic(true); minuteWV.setCyclic(true); setData(); return new MyPop(popupWindow, yearWV, monthWV, dayWV, hourWV, minuteWV); }
From source file:com.skytree.epubtest.BookViewActivity.java
public void makeSeekBox() { RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); // width,height seekBox = new SkyBox(this); seekBox.setBoxColor(Color.DKGRAY); seekBox.setArrowDirection(true); // to Down Arrow seekBox.setArrowHeight(ps(25));//from w w w . j a va2 s . co m param.leftMargin = ps(0); param.topMargin = ps(0); param.width = ps(300); param.height = ps(65); seekBox.setLayoutParams(param); // public TextView makeLabel(int id, String text, int gravity,float textSize,int textColor, int width, int height) { seekLabel = this.makeLabel(2000, "", Gravity.CENTER_HORIZONTAL, 13, Color.WHITE); this.setLocation(seekLabel, ps(10), ps(6)); seekBox.addView(seekLabel); // rv.customView.addView(seekBox); ePubView.addView(seekBox); this.hideSeekBox(); }
From source file:com.mdlive.sav.MDLiveProviderDetails.java
private void VideoOrPhoneNotAvailable() { tapSeetheDoctorTxtLayout.setVisibility(View.GONE); tapSeetheDoctorTxt.setVisibility(View.GONE); reqfutureapptBtnLayout.setVisibility(View.GONE); byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_green_rounded_corner); ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_white); byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_green_rounded_corner); ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon_white); byvideoBtn.setTextColor(Color.WHITE); byphoneBtn.setTextColor(Color.WHITE); byvideoBtnLayout.setOnClickListener(new View.OnClickListener() { @Override/*from w w w. j a va2 s . c o m*/ public void onClick(View v) { byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_green_rounded_corner); ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_white); byvideoBtn.setTextColor(Color.WHITE); byphoneBtn.setTextColor(Color.WHITE); byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_green_rounded_corner); ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon_white); Intent Reasonintent = new Intent(MDLiveProviderDetails.this, MDLiveReasonForVisit.class); startActivity(Reasonintent); MdliveUtils.startActivityAnimation(MDLiveProviderDetails.this); accessModeCall("video"); saveConsultationType("Video", MDLiveProviderDetails.this); saveTimeSlotToNowMode(); } }); byphoneBtnLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { byphoneBtnLayout.setBackgroundResource(R.drawable.searchpvr_green_rounded_corner); ((ImageView) findViewById(R.id.phoneicon)).setImageResource(R.drawable.phone_icon_white); byvideoBtn.setTextColor(Color.WHITE); byphoneBtn.setTextColor(Color.WHITE); byvideoBtnLayout.setBackgroundResource(R.drawable.searchpvr_green_rounded_corner); ((ImageView) findViewById(R.id.videoicon)).setImageResource(R.drawable.video_icon_white); Intent Reasonintent = new Intent(MDLiveProviderDetails.this, MDLiveReasonForVisit.class); startActivity(Reasonintent); MdliveUtils.startActivityAnimation(MDLiveProviderDetails.this); accessModeCall("phone"); saveConsultationType("Phone", MDLiveProviderDetails.this); } }); }
From source file:de.vanita5.twittnuker.util.ThemeUtils.java
public static void notifyStatusBarColorChanged(final Context context, final int themeResource, final int actionBarColor, final int backgroundAlpha) { final Intent intent = new Intent("com.mohammadag.colouredstatusbar.ChangeStatusBarColor"); // if (isColoredActionBar(themeResource)) { // intent.putExtra("status_bar_color", backgroundAlpha << 24 | accentColor); // } else { // if (isLightActionBar(themeResource)) { // intent.putExtra("status_bar_color", backgroundAlpha << 24 | 0xFFDDDDDD); // } else { // intent.putExtra("status_bar_color", backgroundAlpha << 24 | 0xFF222222); // } // }/*from w w w .ja v a 2s . com*/ // if (isLightActionBar(themeResource)) { // intent.putExtra("status_bar_icons_color", Color.DKGRAY); // } else { // intent.putExtra("status_bar_icons_color", Color.WHITE); // } // Please note that these are not yet implemented!!! // You're free to include them in your code so that when they // are implemented, your app will work out of the box. intent.putExtra("navigation_bar_color", Color.BLACK); intent.putExtra("navigation_bar_icon_color", Color.WHITE); context.sendOrderedBroadcast(intent, null); }
From source file:com.amaze.filemanager.fragments.Main.java
void initNoFileLayout() { nofilesview = rootView.findViewById(R.id.nofilelayout); if (theme1 == 0) ((ImageView) nofilesview.findViewById(R.id.image)).setColorFilter(Color.parseColor("#666666")); else {//from w w w . j a v a 2 s . c om nofilesview.setBackgroundColor(getResources().getColor(R.color.holo_dark_background)); ((TextView) nofilesview.findViewById(R.id.nofiletext)).setTextColor(Color.WHITE); } }
From source file:com.cypress.cysmart.BLEServiceFragments.SensorHubService.java
private void setupPressureGraph(View parent) { {/* w w w. j a va2 s.co m*/ /** * Setting graph titles */ String graphTitle = getResources().getString(R.string.sen_hub_pressure); String graphXAxis = getResources().getString(R.string.health_temperature_time); String graphYAxis = getResources().getString(R.string.sen_hub_pressure); // Creating an XYSeries for temperature mPressureDataSeries = new XYSeries(graphTitle); // Creating a dataset to hold each series XYMultipleSeriesDataset mDataset = new XYMultipleSeriesDataset(); // Adding temperature Series to the dataset mDataset.addSeries(mPressureDataSeries); // Creating XYSeriesRenderer to customize XYSeriesRenderer mRenderer = new XYSeriesRenderer(); mRenderer.setColor(getResources().getColor(R.color.main_bg_color)); mRenderer.setPointStyle(PointStyle.CIRCLE); mRenderer.setFillPoints(true); mRenderer.setLineWidth(5); // Creating a XYMultipleSeriesRenderer to customize the whole chart XYMultipleSeriesRenderer mMultiRenderer = new XYMultipleSeriesRenderer(); switch (getResources().getDisplayMetrics().densityDpi) { case DisplayMetrics.DENSITY_XHIGH: mMultiRenderer.setMargins(new int[] { 40, 90, 25, 10 }); mMultiRenderer.setAxisTitleTextSize(Constants.TEXT_SIZE_XHDPI); mMultiRenderer.setChartTitleTextSize(Constants.TEXT_SIZE_XHDPI); mMultiRenderer.setLabelsTextSize(Constants.TEXT_SIZE_XHDPI); mMultiRenderer.setLegendTextSize(Constants.TEXT_SIZE_XHDPI); break; case DisplayMetrics.DENSITY_HIGH: mMultiRenderer.setMargins(new int[] { 30, 50, 25, 10 }); mMultiRenderer.setAxisTitleTextSize(Constants.TEXT_SIZE_HDPI); mMultiRenderer.setChartTitleTextSize(Constants.TEXT_SIZE_HDPI); mMultiRenderer.setLabelsTextSize(Constants.TEXT_SIZE_HDPI); mMultiRenderer.setLegendTextSize(Constants.TEXT_SIZE_HDPI); break; case DisplayMetrics.DENSITY_XXHIGH: mMultiRenderer.setMargins(new int[] { 50, 100, 35, 20 }); mMultiRenderer.setAxisTitleTextSize(Constants.TEXT_SIZE_XXHDPI); mMultiRenderer.setChartTitleTextSize(Constants.TEXT_SIZE_XXHDPI); mMultiRenderer.setLabelsTextSize(Constants.TEXT_SIZE_XXHDPI); mMultiRenderer.setLegendTextSize(Constants.TEXT_SIZE_XXHDPI); break; default: mMultiRenderer.setMargins(new int[] { 30, 50, 25, 10 }); mMultiRenderer.setAxisTitleTextSize(Constants.TEXT_SIZE_LDPI); mMultiRenderer.setChartTitleTextSize(Constants.TEXT_SIZE_LDPI); mMultiRenderer.setLabelsTextSize(Constants.TEXT_SIZE_LDPI); mMultiRenderer.setLegendTextSize(Constants.TEXT_SIZE_LDPI); break; } mMultiRenderer.setXTitle(graphXAxis); mMultiRenderer.setLabelsColor(Color.BLACK); mMultiRenderer.setYTitle(graphYAxis); mMultiRenderer.setMarginsColor(Color.argb(0x00, 0xff, 0x00, 0x00)); mMultiRenderer.setPanEnabled(true, true); mMultiRenderer.setYLabelsColor(0, Color.BLACK); mMultiRenderer.setXLabelsColor(Color.BLACK); mMultiRenderer.setApplyBackgroundColor(true); mMultiRenderer.setBackgroundColor(Color.WHITE); mMultiRenderer.setGridColor(Color.BLACK); mMultiRenderer.setShowGrid(true); mMultiRenderer.setShowLegend(false); // Adding mRenderer to multipleRenderer mMultiRenderer.addSeriesRenderer(mRenderer); // Getting a reference to LinearLayout of the MainActivity Layout mPressureGraphLayoutParent = (LinearLayout) parent.findViewById(R.id.pressure_chart_container); mPressureChart = ChartFactory.getLineChartView(getActivity(), mDataset, mMultiRenderer); // Adding the Line Chart to the LinearLayout mPressureGraphLayoutParent.addView(mPressureChart); } }