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.artemchep.horario.ui.fragments.details.TeacherDetailsFragment.java
@Override protected void updateAll() { super.updateAll(); Teacher model = getModel();/*from w w w . j av a 2s .co m*/ // Make color a little bit lighter on dark backgrounds // and darker on light ones. int textAccentColor = model != null ? model.color : Palette.GREY; if (ColorUtil.isColorDark(textAccentColor) == mIsDarkTheme) { int filter = mIsDarkTheme ? Color.WHITE : Color.BLACK; textAccentColor = ColorUtils.blendARGB(textAccentColor, filter, 0.5f); } mEmailButton.setTextColor(textAccentColor); mPhoneButton.setTextColor(textAccentColor); }
From source file:com.arlib.floatingsearchview.FloatingSearchView.java
private void init(AttributeSet attrs) { mHostActivity = getHostActivity();//from w w w.j av a 2s . c o m LayoutInflater layoutInflater = (LayoutInflater) getContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflate(getContext(), R.layout.floating_search_layout, this); mBackgroundDrawable = new ColorDrawable(Color.BLACK); mQuerySection = findViewById(R.id.search_query_section); mVoiceInputOrClearButton = (ImageView) findViewById(R.id.search_bar_mic_or_ex); mSearchInput = (EditText) findViewById(R.id.search_bar_text); mSearchBarTitle = (TextView) findViewById(R.id.search_bar_title); mMenuSearchOrExitButton = (ImageView) findViewById(R.id.search_bar_exit); mSearchProgress = (ProgressBar) findViewById(R.id.search_bar_search_progress); mShowMenuAction = true; mOverflowMenu = (ImageView) findViewById(R.id.search_bar_overflow_menu); mMenuBuilder = new MenuBuilder(getContext()); mMenuPopupHelper = new MenuPopupHelper(getContext(), mMenuBuilder, mOverflowMenu); initDrawables(); mVoiceInputOrClearButton.setImageDrawable(mIconMic); mOverflowMenu.setImageDrawable(mIconOverflowMenu); mDivider = findViewById(R.id.divider); mSuggestionsSection = (RelativeLayout) findViewById(R.id.search_suggestions_section); mSuggestionListContainer = findViewById(R.id.suggestions_list_container); mSuggestionsList = (RecyclerView) findViewById(R.id.suggestions_list); setupViews(attrs); }
From source file:com.davidmiguel.gobees.recording.RecordingFragment.java
/** * Configure bees chart and the data./*from w ww . java 2s . c o m*/ * * @param recordsList list of records. */ private void setupBeesChart(List<Record> recordsList) { // Setup data referenceTimestamp = recordsList.get(0).getTimestamp().getTime() / 1000; Record[] records = recordsList.toArray(new Record[recordsList.size()]); List<Entry> entries = new ArrayList<>(); int maxNumBees = 0; for (Record record : records) { // Convert timestamp to seconds and relative to first timestamp long timestamp = record.getTimestamp().getTime() / 1000 - referenceTimestamp; int numBees = record.getNumBees(); entries.add(new Entry(timestamp, numBees)); // Get max num of bees if (numBees > maxNumBees) { maxNumBees = numBees; } } lastTimestamp = (long) entries.get(entries.size() - 1).getX(); // Style char lines (type, color, etc.) LineDataSet lineDataSet = new LineDataSet(entries, getString(R.string.num_bees)); lineDataSet.setMode(LineDataSet.Mode.HORIZONTAL_BEZIER); lineDataSet.setCubicIntensity(0.2f); lineDataSet.setDrawValues(false); lineDataSet.setDrawCircles(false); lineDataSet.setLineWidth(1.8f); lineDataSet.setColor(ContextCompat.getColor(getContext(), R.color.colorAccent)); // General setup beesChart.setDrawGridBackground(false); beesChart.setDrawBorders(false); beesChart.setViewPortOffsets(80, 40, 80, 50); beesChart.getDescription().setEnabled(false); beesChart.getLegend().setEnabled(false); beesChart.setTouchEnabled(true); beesChart.setDragEnabled(false); beesChart.setScaleEnabled(false); beesChart.setPinchZoom(false); BeesMarkerView mv = new BeesMarkerView(getContext(), R.layout.recording_bees_marker_vew); mv.setChartView(beesChart); beesChart.setMarker(mv); beesChart.setNoDataText(getString(R.string.no_flight_act_data_available)); // X axis setup IAxisValueFormatter xAxisFormatter = new HourAxisValueFormatter(referenceTimestamp); XAxis xAxis = beesChart.getXAxis(); xAxis.setValueFormatter(xAxisFormatter); xAxis.setDrawGridLines(false); xAxis.setDrawAxisLine(false); xAxis.setPosition(XAxis.XAxisPosition.BOTTOM); xAxis.setTextColor(Color.BLACK); // Y axis setup YAxis leftAxis = beesChart.getAxisLeft(); leftAxis.setAxisMaximum(maxNumBees > 40 ? maxNumBees + 2 : 40); leftAxis.setAxisMinimum(0); leftAxis.setDrawGridLines(true); leftAxis.setDrawAxisLine(false); YAxis rightAxis = beesChart.getAxisRight(); rightAxis.setAxisMaximum(maxNumBees > 40 ? maxNumBees + 2 : 40); rightAxis.setAxisMinimum(0); rightAxis.setDrawGridLines(true); rightAxis.setDrawAxisLine(false); // Add data beesChart.setData(new LineData(lineDataSet)); }
From source file:com.mk4droid.IMC_Activities.Fragment_List.java
/** on Resume this fragment */ @Override// www . j a v a 2s . c om public void onResume() { resources = setResources(); //set initial state if (MyIssuesSW) { btListMyIss.setCompoundDrawablesWithIntrinsicBounds( resources.getDrawable(R.drawable.my_issues_icon_white32), null, null, null); btListMyIss.setBackgroundDrawable(resources.getDrawable(R.drawable.bt_custom_click_orange)); btListMyIss.setTextColor(Color.WHITE); btListMyIss.setClickable(false); btListAllIss.setCompoundDrawablesWithIntrinsicBounds( resources.getDrawable(R.drawable.all_issues_icon_gray32), null, null, null); btListAllIss.setBackgroundDrawable(resources.getDrawable(android.R.drawable.btn_default)); btListAllIss.setTextColor(Color.BLACK); btListAllIss.setClickable(true); } else { btListAllIss.setCompoundDrawablesWithIntrinsicBounds( resources.getDrawable(R.drawable.all_issues_icon_white32), null, null, null); btListAllIss.setBackgroundDrawable(resources.getDrawable(R.drawable.bt_custom_click_orange)); btListAllIss.setTextColor(Color.WHITE); btListAllIss.setClickable(false); btListMyIss.setCompoundDrawablesWithIntrinsicBounds( resources.getDrawable(R.drawable.my_issues_icon_gray32), null, null, null); btListMyIss.setBackgroundDrawable(resources.getDrawable(android.R.drawable.btn_default)); btListMyIss.setTextColor(Color.BLACK); btListMyIss.setClickable(true); } if (UserID_STR.length() == 0) { ll_listissues_MyIssues.setVisibility(View.GONE); } else { ll_listissues_MyIssues.setVisibility(View.VISIBLE); } if (InternetConnCheck.getInstance(ctx).isOnline(ctx)) { //-------------- Check if distance has changed ------------- int distanceData = mshPrefs.getInt("distanceData", Constants_API.initRange); int distanceDataOLD = mshPrefs.getInt("distanceDataOLD", Constants_API.initRange); //---------- Check if IssuesNo has changed --------- int IssuesNoAR = Integer.parseInt(mshPrefs.getString("IssuesNoAR", "40")); int IssuesNoAROLD = Integer.parseInt(mshPrefs.getString("IssuesNoAROLD", "40")); if (distanceData != distanceDataOLD) { Message msg = new Message(); msg.arg1 = 2; handlerBroadcastRefresh.sendMessage(msg); } else if (IssuesNoAR != IssuesNoAROLD) { Message msg = new Message(); msg.arg1 = 3; handlerBroadcastRefresh.sendMessage(msg); } } super.onResume(); }
From source file:com.hacktx.android.activities.CheckInActivity.java
private void loadQrCode(final String email) { new Thread(new Runnable() { public void run() { QRCodeWriter writer = new QRCodeWriter(); final Bitmap code; try { if (!isCodeSaved()) { BitMatrix bitMatrix = writer.encode(email, BarcodeFormat.QR_CODE, 512, 512); int width = bitMatrix.getWidth(); int height = bitMatrix.getHeight(); code = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { code.setPixel(x, y, bitMatrix.get(x, y) ? Color.BLACK : ContextCompat.getColor(CheckInActivity.this, R.color.cardview_light_background)); }/* w w w . j a v a 2 s . co m*/ } saveCodeToInternalStorage(code); } else { code = loadCodeFromInternalStorage(); } CheckInActivity.this.runOnUiThread(new Runnable() { @Override public void run() { ((ImageView) findViewById(R.id.codeCardCode)).setImageBitmap(code); findViewById(R.id.codeCardProgressBar).setVisibility(View.GONE); findViewById(R.id.codeCardCode).setVisibility(View.VISIBLE); findViewById(R.id.codeCardButtons).setVisibility(View.VISIBLE); } }); } catch (WriterException e) { e.printStackTrace(); } } }).start(); }
From source file:com.example.damerap_ver1.IntroVideoActivity.java
/** * Create the view in which the video will be rendered. *//*from w w w .j av a 2s. c o m*/ private void setupView() { LinearLayout lLinLayout = new LinearLayout(this); lLinLayout.setId(1); lLinLayout.setOrientation(LinearLayout.VERTICAL); lLinLayout.setGravity(Gravity.CENTER); lLinLayout.setBackgroundColor(Color.BLACK); LayoutParams lLinLayoutParms = new LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT); lLinLayout.setLayoutParams(lLinLayoutParms); this.setContentView(lLinLayout); RelativeLayout lRelLayout = new RelativeLayout(this); lRelLayout.setId(2); lRelLayout.setGravity(Gravity.CENTER); lRelLayout.setBackgroundColor(Color.BLACK); android.widget.RelativeLayout.LayoutParams lRelLayoutParms = new android.widget.RelativeLayout.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT); lRelLayout.setLayoutParams(lRelLayoutParms); lLinLayout.addView(lRelLayout); mVideoView = new VideoView(this); mVideoView.setId(3); android.widget.RelativeLayout.LayoutParams lVidViewLayoutParams = new android.widget.RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); lVidViewLayoutParams.addRule(RelativeLayout.CENTER_IN_PARENT); mVideoView.setLayoutParams(lVidViewLayoutParams); lRelLayout.addView(mVideoView); mProgressBar = new ProgressBar(this); mProgressBar.setId(4); android.widget.RelativeLayout.LayoutParams lProgressBarLayoutParms = new android.widget.RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); lProgressBarLayoutParms.addRule(RelativeLayout.CENTER_IN_PARENT); mProgressBar.setLayoutParams(lProgressBarLayoutParms); lRelLayout.addView(mProgressBar); mProgressMessage = new TextView(this); mProgressMessage.setId(5); android.widget.RelativeLayout.LayoutParams lProgressMsgLayoutParms = new android.widget.RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); lProgressMsgLayoutParms.addRule(RelativeLayout.CENTER_HORIZONTAL); lProgressMsgLayoutParms.addRule(RelativeLayout.BELOW, 4); mProgressMessage.setLayoutParams(lProgressMsgLayoutParms); mProgressMessage.setTextColor(Color.LTGRAY); mProgressMessage.setTextSize(TypedValue.COMPLEX_UNIT_PT, 8); mProgressMessage.setText("..."); lRelLayout.addView(mProgressMessage); }
From source file:com.forecast.weather.activities.MainActivity.java
private void aboutDialog() { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle("Forecast Weather"); final WebView webView = new WebView(this); String about = "<p>Forecast weather app.</p>" + "<p>Data provided by <a href='http://openweathermap.org/'>OpenWeatherMap</a>, under the <a href='http://creativecommons.org/licenses/by-sa/2.0/'>Creative Commons license</a>" + "<p>Icons are <a href='https://erikflowers.github.io/weather-icons/'>Weather Icons</a>, by <a href='http://www.twitter.com/artill'>Lukas Bischoff</a> under the <a href='http://scripts.sil.org/OFL'>SIL OFL 1.1</a> licence."; TypedArray ta = obtainStyledAttributes(new int[] { android.R.attr.textColorPrimary, R.attr.colorAccent }); String textColor = String.format("#%06X", (0xFFFFFF & ta.getColor(0, Color.BLACK))); String accentColor = String.format("#%06X", (0xFFFFFF & ta.getColor(1, Color.BLUE))); ta.recycle();/*from w w w .j a v a 2s . co m*/ about = "<style media=\"screen\" type=\"text/css\">" + "body {\n" + " color:" + textColor + ";\n" + "}\n" + "a:link {color:" + accentColor + "}\n" + "</style>" + about; webView.setBackgroundColor(Color.TRANSPARENT); webView.loadData(about, "text/html", "UTF-8"); alert.setView(webView, 32, 0, 32, 0); alert.setPositiveButton(R.string.dialog_ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { } }); alert.show(); }
From source file:com.dwdesign.gallery3d.app.ImageViewerGLActivity.java
protected void setContentPane(final GLView content) { mContentPane = content;//from w w w. j a v a 2 s .c om mContentPane.setBackgroundColor(GalleryUtils.intColorToFloatARGBArray(Color.BLACK)); mGLRootView.setContentPane(mContentPane); }
From source file:sjizl.com.FileUploadTest.java
@SuppressLint("NewApi") @Override// w w w. j a v a 2s . co m public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.fileuploadtest2); //ac_image_grid TextView textView2_under_title; final ImageLoader imageLoader = ImageLoader.getInstance(); imageLoader.init(ImageLoaderConfiguration.createDefault(getApplicationContext())); progressBar_hole = (ProgressBar) findViewById(R.id.progressBar_hole); progressBar_hole.setVisibility(View.INVISIBLE); right_lin = (LinearLayout) findViewById(R.id.right_lin); rand = CommonUtilities.randInt(111, 999); middle_lin = (LinearLayout) findViewById(R.id.middle_lin); //right_lin.setBackgroundColor(Color.BLUE); right_lin = (LinearLayout) findViewById(R.id.right_lin); left_lin1 = (LinearLayout) findViewById(R.id.left_lin1); left_lin3 = (LinearLayout) findViewById(R.id.left_lin3); left_lin4 = (LinearLayout) findViewById(R.id.left_lin4); middle_lin = (LinearLayout) findViewById(R.id.middle_lin); upload_photo_text = (LinearLayout) findViewById(R.id.upload_photo_text); textView2_under_title = (TextView) findViewById(R.id.textView2_under_title); ((LinearLayout) textView2_under_title.getParent()).removeView(textView2_under_title); textView2_under_title.setVisibility(View.GONE); ImageView imageView2_dashboard = (ImageView) findViewById(R.id.imageView2_dashboard); if (android.os.Build.VERSION.SDK_INT > 9) { StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); } Button upload_photo0 = (Button) findViewById(R.id.upload_photo0); Button upload_photo1 = (Button) findViewById(R.id.upload_photo1); Button upload_photo2 = (Button) findViewById(R.id.upload_photo2); upload_photo0.setVisibility(View.GONE); upload_photo1.setVisibility(View.GONE); upload_photo2.setVisibility(View.GONE); upload_photo0.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { CommonUtilities.custom_toast(getApplicationContext(), FileUploadTest.this, "UploadActivity! ", null, R.drawable.iconbd); Intent dashboard = new Intent(getApplicationContext(), UploadActivity.class); startActivity(dashboard); } }); upload_photo1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "FileChooserExampleActivity!", Toast.LENGTH_LONG).show(); Intent dashboard = new Intent(getApplicationContext(), FileChooserExampleActivity.class); startActivity(dashboard); } }); upload_photo2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "FileChooserExampleActivity!", Toast.LENGTH_LONG).show(); Intent dashboard = new Intent(getApplicationContext(), FileChooserExampleActivity.class); startActivity(dashboard); } }); final ImageView left_button; left_button = (ImageView) findViewById(R.id.imageView1_back); Button button1 = (Button) findViewById(R.id.upload_photo1); SharedPreferences sp = getApplicationContext().getSharedPreferences("loginSaved", Context.MODE_PRIVATE); naam = sp.getString("naam", null); username = sp.getString("username", null); password = sp.getString("password", null); foto = sp.getString("foto", null); foto_num = sp.getString("foto_num", null); imageLoader.displayImage("http://sjizl.com/fotos/" + foto_num + "/thumbs/" + foto, imageView2_dashboard, options); Brows(); listView.setLongClickable(true); registerForContextMenu(listView); listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { //startImagePagerActivity(position); if (position == 0) { openGallery(SELECT_FILE1); } else { listView.showContextMenuForChild(view); // registerForContextMenu(view); // openContextMenu(view); // unregisterForContextMenu(view); } } }); left_lin1.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_MOVE || event.getAction() == MotionEvent.ACTION_POINTER_DOWN) { left_lin1.setBackgroundColor(Color.DKGRAY); v.setBackgroundColor(Color.DKGRAY); onBackPressed(); } else if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL) { left_lin1.setBackgroundColor(Color.BLACK); v.setBackgroundColor(Color.BLACK); } return false; } }); CommonUtilities u = new CommonUtilities(); u.setHeaderConrols(getApplicationContext(), this, right_lin, left_lin3, left_lin4, left_lin1, left_button); ; middle_lin.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN || event.getAction() == MotionEvent.ACTION_MOVE || event.getAction() == MotionEvent.ACTION_POINTER_DOWN) { middle_lin.setBackgroundColor(Color.DKGRAY); v.setBackgroundColor(Color.DKGRAY); } else if (event.getAction() == MotionEvent.ACTION_UP || event.getAction() == MotionEvent.ACTION_CANCEL) { middle_lin.setBackgroundColor(Color.BLACK); v.setBackgroundColor(Color.BLACK); } return false; } }); }