List of usage examples for android.graphics Color BLACK
int BLACK
To view the source code for android.graphics Color BLACK.
Click Source Link
From source file:com.makotojava.android.debate.PolicySpeechFragment.java
private void createNegPrepTimerOnLongClickListener(TextView speechTimer) { speechTimer.setOnLongClickListener(new OnLongClickListener() { @Override//from ww w . java 2 s. c om public boolean onLongClick(View v) { getActivity().startActionMode(new ActionMode.Callback() { @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } @Override public void onDestroyActionMode(ActionMode mode) { // Nothing to do } @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { // Inflate the menu MenuInflater inflater = mode.getMenuInflater(); inflater.inflate(R.menu.negprep_timer_context_menu, menu); return true; } @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { boolean ret = false; switch (item.getItemId()) { case R.id.negprep_context_menu_reset: Log.i(TAG, "CONTEXT MENU: Neg Prep Timer **RESET**"); long originalDurationInMillis = getNegativePrepTimer().reset(); updateTimerTextView(_negativePrepTimerTextView, originalDurationInMillis); getPolicySpeechSingleton().setNegativePrepRemainingTime(originalDurationInMillis); _negativePrepTimerTextView.setTextColor(Color.BLACK); ret = true; break; case R.id.negprep_context_menu_set: Log.i(TAG, "CONTEXT MENU: Neg Prep Timer **SET**"); // Display dialog to set Timer FragmentManager fragMan = getActivity().getFragmentManager(); TimePickerFragment dialog = TimePickerFragment.newInstance( getNegativePrepTimer().getMillisUntilFinished(), PolicySpeechFactory.PREP_TIME_IN_MINUTES, RQID_NEGPREPTIMER); dialog.setTargetFragment(PolicySpeechFragment.this, 0); dialog.show(fragMan, MINUTES_SECONDS_PICKER_TITLE); _negativePrepTimerTextView.setTextColor(Color.BLACK); ret = true; break; } return ret; } }); return true; } }); }
From source file:com.example.android.littleblack.CameraFragment.java
@Override public void onClick(View view) { switch (view.getId()) { case R.id.picture: { takePicture();/*w ww .ja v a 2 s. c om*/ break; } case R.id.info: { Activity activity = getActivity(); if (null != activity) { new AlertDialog.Builder(activity).setMessage(R.string.intro_message) .setPositiveButton(android.R.string.ok, null).show(); } break; } case R.id.switchmode: { mCaptureBtn.setBackgroundColor(Color.BLACK); mSwitchModeBtn.setVisibility(View.GONE); WindowManager.LayoutParams lp = getActivity().getWindow().getAttributes(); lp.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE; getActivity().getWindow().setAttributes(lp); break; } } }
From source file:com.javielinux.tweettopics2.TweetTopicsActivity.java
public void refreshActionBarColumns() { int currentPosition = pager.getCurrentItem(); layoutBackgroundColumnsBar.removeAllViews(); int padding = (int) getResources().getDimension(R.dimen.default_padding); //int sizeButton = (int) getResources().getDimension(R.dimen.actionbar_columns_height); for (int i = 1; i < fragmentAdapter.getFragmentList().size(); i++) { ImageView view = new ImageView(this); view.setPadding(padding, padding, padding, padding); view.setImageBitmap(ColumnsUtils.getButtonWithTitle(this, fragmentAdapter.getFragmentList().get(i), true, currentPosition == i ? Color.GREEN : Color.BLACK)); view.setTag(i);/*from w w w . ja va2 s . c o m*/ view.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if (layoutMainOptionsColumns.getVisibility() != View.VISIBLE) { showActionBarIndicatorAndMovePager((Integer) view.getTag()); } } }); view.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View view) { int pos = (Integer) view.getTag(); int[] loc = new int[2]; view.getLocationOnScreen(loc); showOptionsColumns(loc[0], pos, true); return false; } }); layoutBackgroundColumnsBar.addView(view); } }
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 . j ava2 s . c o m*/ // 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.android.launcher2.Launcher.java
/** * Finds all the views we need and configure them properly. *///w w w . ja v a 2s .c o m private void setupViews() { final DragController dragController = mDragController; mLauncherView = findViewById(R.id.launcher); mDragLayer = (DragLayer) findViewById(R.id.drag_layer); mWorkspace = (Workspace) mDragLayer.findViewById(R.id.workspace); mQsbDivider = findViewById(R.id.qsb_divider); mDockDivider = findViewById(R.id.dock_divider); mLauncherView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); mWorkspaceBackgroundDrawable = getResources().getDrawable(R.drawable.workspace_bg); mBlackBackgroundDrawable = new ColorDrawable(Color.BLACK); // Setup the drag layer mDragLayer.setup(this, dragController); // Setup the hotseat mHotseat = (Hotseat) findViewById(R.id.hotseat); if (mHotseat != null) { mHotseat.setup(this); } // Setup the workspace mWorkspace.setHapticFeedbackEnabled(false); mWorkspace.setOnLongClickListener(this); mWorkspace.setup(dragController); dragController.addDragListener(mWorkspace); // Get the search/delete bar mSearchDropTargetBar = (SearchDropTargetBar) mDragLayer.findViewById(R.id.qsb_bar); // Setup AppsCustomize mAppsCustomizeTabHost = (AppsCustomizeTabHost) findViewById(R.id.apps_customize_pane); mAppsCustomizeContent = (AppsCustomizePagedView) mAppsCustomizeTabHost .findViewById(R.id.apps_customize_pane_content); mAppsCustomizeContent.setup(this, dragController); // Setup the drag controller (drop targets have to be added in reverse order in priority) dragController.setDragScoller(mWorkspace); dragController.setScrollView(mDragLayer); dragController.setMoveTarget(mWorkspace); dragController.addDropTarget(mWorkspace); if (mSearchDropTargetBar != null) { mSearchDropTargetBar.setup(this, dragController); } }
From source file:com.cypress.cysmart.BLEServiceFragments.SensorHubService.java
private void setupPressureGraph(View parent) { {/*from w ww.java2 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); } }
From source file:ab.util.AbDialogUtil.java
/** * /*w w w .j a v a2s .c om*/ */ public static MyPop showDatePopWindowDate(Context context, View contentView, View targetView) { // yearArrayString = getYEARArray(2016, 36); monthArrayString = getDayArray(12); hourArrayString = getHMArray(24); minuteArrayString = getHMArray(60); // ?? c = Calendar.getInstance(); PopupWindow popupWindow = new PopupWindow(contentView, -2, -2); popupWindow.setBackgroundDrawable(new ColorDrawable(Color.BLACK)); 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); hourWV.setVisibility(View.GONE); minuteWV.setVisibility(View.GONE); // ? 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.example.angel.parkpanda.MainActivity.java
public Bitmap drawTextToBitmap(int gResId, String gText) { Resources resources = getResources(); float scale = resources.getDisplayMetrics().density; Bitmap bitmap = BitmapFactory.decodeResource(resources, gResId); android.graphics.Bitmap.Config bitmapConfig = bitmap.getConfig(); if (bitmapConfig == null) { bitmapConfig = android.graphics.Bitmap.Config.ARGB_8888; }//from w ww . j av a 2 s. c o m bitmap = bitmap.copy(bitmapConfig, true); Canvas canvas = new Canvas(bitmap); Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setColor(Color.rgb(0, 0, 0)); paint.setTextSize((int) (15 * scale)); paint.setShadowLayer(1f, 0f, 1f, Color.BLACK); Rect bounds = new Rect(); paint.getTextBounds(gText, 0, gText.length(), bounds); int x = (bitmap.getWidth() - bounds.width()) / 2; int y = (bitmap.getHeight() + bounds.height()) / 2 - 10; canvas.drawText(gText, x, y, paint); return bitmap; }
From source file:com.devwang.logcabin.LogCabinMainActivity.java
/** * //from ww w. j a v a2 s.c o m * * @param strCmd */ private void sendBtMessageWithState(char strCmd) { sendMessage(strCmd + "");// char to string switch (strCmd) { case 'a': break; case 'b':// b blue setTempWindowRGBLedStateTextView("", "", getString(R.string.str_blue)); mRgbLedColorStateTextView.setTextColor(Color.BLUE); break; case 'c': break; case 'd':// d dieout setTempWindowRGBLedStateTextView("", "", getString(R.string.str_close)); mRgbLedColorStateTextView.setTextColor(Color.BLACK); buttonMusicPlay(R.raw.tick); break; case 'e': break; case 'f': break; case 'g':// g green setTempWindowRGBLedStateTextView("", "", getString(R.string.str_green)); mRgbLedColorStateTextView.setTextColor(Color.GREEN); break; case 'h': break; case 'i': break; case 'j': break; case 'k': break; case 'l': break; case 'm':// m motor if (D) Log.i("TEST_BT_CMD", "===>>"); setTempWindowRGBLedStateTextView("", "...", ""); new Thread(new Runnable() { public void run() { spandTimeMethod(); // handler.sendEmptyMessage(FLAG_HANDLER_MESSAGE_OPEN_WINDOW); // handler } }).start(); buttonMusicPlay(R.raw.tock); break; case 'n':// n if (D) Log.i("TEST_BT_CMD", "===>>"); setTempWindowRGBLedStateTextView("", "...", ""); new Thread(new Runnable() { public void run() { spandTimeMethod(); // handler.sendEmptyMessage(FLAG_HANDLER_MESSAGE_CLOSE_WINDOW); // handler } }).start(); buttonMusicPlay(R.raw.tick); break; case 'o':// o orange if (D) Log.i("TEST_BT_CMD", "===>>"); setTempWindowRGBLedStateTextView("", "", getString(R.string.str_orange)); mRgbLedColorStateTextView.setTextColor(Color.rgb(255, 125, 0)); break; case 'p':// p purple if (D) Log.i("TEST_BT_CMD", "===>>"); setTempWindowRGBLedStateTextView("", "", getString(R.string.str_purple)); mRgbLedColorStateTextView.setTextColor(Color.rgb(255, 0, 255)); break; case 'q': break; case 'r':// r red if (D) Log.i("TEST_BT_CMD", "===>>"); setTempWindowRGBLedStateTextView("", "", getString(R.string.str_red)); mRgbLedColorStateTextView.setTextColor(Color.RED); break; case 's': break; case 't':// t ring-time break; case 'u':// u up if (D) Log.i("TEST_BT_CMD", "===>>"); setTempWindowRGBLedStateTextView("", "", ""); break; case 'v':// v if (D) Log.i("TEST_BT_CMD", "===>>"); setTempWindowRGBLedStateTextView("", "", ""); break; case 'w':// w white if (D) Log.i("TEST_BT_CMD", "===>>"); setTempWindowRGBLedStateTextView("", "", getString(R.string.str_open)); mRgbLedColorStateTextView.setTextColor(Color.BLACK); buttonMusicPlay(R.raw.tock); break; case 'x':// x if (D) Log.i("TEST_BT_CMD", "===>>"); setTempWindowRGBLedStateTextView("", "", ""); break; case 'y':// yellow if (D) Log.i("TEST_BT_CMD", "===>>"); setTempWindowRGBLedStateTextView("", "", getString(R.string.str_yellow)); mRgbLedColorStateTextView.setTextColor(Color.YELLOW); break; case 'z':// z if (D) Log.i("TEST_BT_CMD", "===>>"); setTempWindowRGBLedStateTextView("", "", ""); break; default: break; } Log.i("TEST_BT_CMD", strCmd + ""); }
From source file:ab.util.AbDialogUtil.java
/** * // ww w .j av a 2 s. c o m */ public static MyPop showDatePopWindowHour(Context context, View contentView, View targetView) { // hourArrayString = getHMArray(24); // ?? c = Calendar.getInstance(); PopupWindow popupWindow = new PopupWindow(contentView, -2, -2); popupWindow.setBackgroundDrawable(new ColorDrawable(Color.BLACK)); popupWindow.setWidth(context.getResources().getDisplayMetrics().widthPixels); popupWindow.setOutsideTouchable(true); popupWindow.showAtLocation(targetView, Gravity.BOTTOM, 0, 0); hourWV = (WheelView) contentView.findViewById(R.id.time_hour); // ? hourWV.setVisibleItems(5); // hourWV.setLabel(":00"); hourWV.setCyclic(true); setHourData(); return new MyPop(popupWindow, yearWV, monthWV, dayWV, hourWV, minuteWV); }