List of usage examples for android.graphics Color LTGRAY
int LTGRAY
To view the source code for android.graphics Color LTGRAY.
Click Source Link
From source file:com.ezio.multiwii.Main.PadMainMultiWiiActivity.java
void updateDashboard1() { if (PRVp == null) { PRVp = (PitchRollView) findViewById(R.id.PRVp); PRVp.SetColor(Color.GREEN); PRVr = (PitchRollView) findViewById(R.id.PRVr); PRVr.SetColor(Color.GREEN); pitchRollCircle = (PitchRollCircleView) findViewById(R.id.PitchRollCircle); pitchRollCircle.SetColor(Color.GREEN); compass = (CompassView) findViewById(R.id.Mag); compass.SetColor(Color.GREEN, Color.YELLOW); myCompass = (CompassView) findViewById(R.id.CompassView02); myCompass.SetColor(Color.GRAY, Color.LTGRAY); myCompass.SetText("N"); baro = (TextView) findViewById(R.id.textViewBaro); BattVoltageTV = (TextView) findViewById(R.id.TextViewBattVoltage); PowerSumTV = (TextView) findViewById(R.id.TextViewPowerSum); }/*from w w w . j a v a2s. c om*/ myAzimuth = (float) (app.sensors.Heading); if (app.D) { app.mw.angy = app.sensors.Pitch; app.mw.angx = app.sensors.Roll; } PRVp.SetAngle(app.mw.angy); PRVr.SetAngle(app.mw.angx); pitchRollCircle.SetRollPitch(app.mw.angx, app.mw.angy); if (app.MagMode == 1) { compass.SetHeading(-app.mw.head); compass.SetText(""); } else { compass.SetHeading(myAzimuth - app.mw.head); compass.SetText("FRONT"); } myCompass.SetHeading(myAzimuth); baro.setText(String.format("%.2f", app.mw.alt)); BattVoltageTV.setText(String.valueOf((float) (app.mw.bytevbat / 10.0))); PowerSumTV.setText(String.valueOf(app.mw.pMeterSum)); }
From source file:com.numenta.taurus.instance.InstanceListActivity.java
private void configureSearchView(@NonNull final SearchView searchView) { SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); // Assumes current activity is the searchable activity searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName())); // Handle query events searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override/*from www .jav a 2 s . c om*/ public boolean onQueryTextSubmit(String query) { // Hide Keyboard on submit InputMethodManager imm = (InputMethodManager) searchView.getContext() .getSystemService(Context.INPUT_METHOD_SERVICE); if (imm != null) { imm.hideSoftInputFromWindow(searchView.getWindowToken(), 0); } return true; } @Override public boolean onQueryTextChange(String newText) { // Filter list as the user types _listFragment.applyFilter(newText); return true; } }); // FIXME: Android does not support styling the search view across all versions. // For now, "peek" into internal API to make the appropriate changes to the SearchView. // In the future we should use the official android API to customize the SearchView widget. // See android.R.layout.search_view for the layout we are "peeking". It is no guarantee it // will work on all public android versions and/or OEM customizations. // This HACK is only valid for the POC phase. We should find a better solution before releasing Resources resources = searchView.getResources(); // Style search box and text int searchPlateId = resources.getIdentifier("android:id/search_plate", null, null); View searchPlate = searchView.findViewById(searchPlateId); if (searchPlate != null) { int searchTextId = resources.getIdentifier("android:id/search_src_text", null, null); TextView searchText = (TextView) searchPlate.findViewById(searchTextId); if (searchText != null) { searchPlate.setBackgroundResource(android.R.drawable.editbox_background); searchText.setPadding(5, 0, 0, 0); searchText.setTextColor(Color.BLACK); searchText.setHintTextColor(Color.LTGRAY); } } }
From source file:org.gnucash.android.ui.chart.PieChartActivity.java
/** * Returns {@code PieData} instance with data entries and labels * @param forCurrentMonth sets data only for current month if {@code true}, otherwise for all time * @return {@code PieData} instance// ww w . ja v a 2 s .c om */ private PieData getData(boolean forCurrentMonth) { List<Account> accountList = mAccountsDbAdapter.getSimpleAccountList( AccountEntry.COLUMN_TYPE + " = ? AND " + AccountEntry.COLUMN_PLACEHOLDER + " = ?", new String[] { mAccountType.name(), "0" }, null); List<String> uidList = new ArrayList<>(); for (Account account : accountList) { uidList.add(account.getUID()); } double sum; if (forCurrentMonth) { long start = mChartDate.dayOfMonth().withMinimumValue().millisOfDay().withMinimumValue().toDate() .getTime(); long end = mChartDate.dayOfMonth().withMaximumValue().millisOfDay().withMaximumValue().toDate() .getTime(); sum = mAccountsDbAdapter.getAccountsBalance(uidList, start, end).absolute().asDouble(); } else { sum = mAccountsDbAdapter.getAccountsBalance(uidList, -1, -1).absolute().asDouble(); } double otherSlice = 0; PieDataSet dataSet = new PieDataSet(null, ""); List<String> names = new ArrayList<>(); List<String> skipUUID = new ArrayList<>(); for (Account account : getCurrencyCodeToAccountMap(accountList).get(mCurrencyCode)) { if (mAccountsDbAdapter.getSubAccountCount(account.getUID()) > 0) { skipUUID.addAll(mAccountsDbAdapter.getDescendantAccountUIDs(account.getUID(), null, null)); } if (!skipUUID.contains(account.getUID())) { double balance; if (forCurrentMonth) { long start = mChartDate.dayOfMonth().withMinimumValue().millisOfDay().withMinimumValue() .toDate().getTime(); long end = mChartDate.dayOfMonth().withMaximumValue().millisOfDay().withMaximumValue().toDate() .getTime(); balance = mAccountsDbAdapter.getAccountBalance(account.getUID(), start, end).absolute() .asDouble(); } else { balance = mAccountsDbAdapter.getAccountBalance(account.getUID()).absolute().asDouble(); } if (balance / sum * 100 > mSlicePercentThreshold) { dataSet.addEntry(new Entry((float) balance, dataSet.getEntryCount())); if (mUseAccountColor) { dataSet.getColors().set(dataSet.getColors().size() - 1, (account.getColorHexCode() != null) ? Color.parseColor(account.getColorHexCode()) : COLORS[(dataSet.getEntryCount() - 1) % COLORS.length]); } dataSet.addColor(COLORS[(dataSet.getEntryCount() - 1) % COLORS.length]); names.add(account.getName()); } else { otherSlice += balance; } } } if (otherSlice > 0) { dataSet.addEntry(new Entry((float) otherSlice, dataSet.getEntryCount())); dataSet.getColors().set(dataSet.getColors().size() - 1, Color.LTGRAY); names.add(getResources().getString(R.string.label_other_slice)); } if (dataSet.getEntryCount() == 0) { mChartDataPresent = false; dataSet.addEntry(new Entry(1, 0)); dataSet.setColor(Color.LTGRAY); dataSet.setDrawValues(false); names.add(""); mChart.setCenterText(getResources().getString(R.string.label_chart_no_data)); mChart.setTouchEnabled(false); } else { mChartDataPresent = true; dataSet.setSliceSpace(2); mChart.setCenterText(String.format(TOTAL_VALUE_LABEL_PATTERN, getResources().getString(R.string.label_chart_total), dataSet.getYValueSum(), Currency.getInstance(mCurrencyCode).getSymbol(Locale.getDefault()))); mChart.setTouchEnabled(true); } return new PieData(names, dataSet); }
From source file:com.digi.android.wva.fragments.ChartFragment.java
/** * Create the components that go into the chart. * * <p>This method is protected, rather than private, due to a bug between JaCoCo and * the Android build tools which causes the instrumented bytecode to be invalid when this * method is private:/* w ww . j a va 2 s. co m*/ * http://stackoverflow.com/questions/17603192/dalvik-transformation-using-wrong-invoke-opcode * </p> */ protected void buildGraphPieces() { if (mRenderer != null || mDataset != null || mRpmRenderer != null || mSpeedRenderer != null) { // Don't want to leak any memory or whatnot. return; } mRenderer = new XYMultipleSeriesRenderer(2); mDataset = new XYMultipleSeriesDataset(); mSpeedRenderer = new XYSeriesRenderer(); mRpmRenderer = new XYSeriesRenderer(); // Initialize renderer settings mRenderer.setShowGrid(true); mRenderer.setFitLegend(true); // Number of grid lines in either direction by default mRenderer.setXLabels(0); mRenderer.setYLabels(10); mRenderer.setXLabelsAlign(Align.RIGHT); mRenderer.setYLabelsAlign(Align.RIGHT); mRenderer.setPointSize(5f); // AChartEngine output defaults to a black background. // This doesn't fit with the general WVA color scheme. mRenderer.setApplyBackgroundColor(true); mRenderer.setBackgroundColor(Color.WHITE); mRenderer.setMarginsColor(Color.WHITE); mRenderer.setAxesColor(Color.DKGRAY); mRenderer.setLabelsColor(Color.BLACK); mRenderer.setXLabelsColor(Color.DKGRAY); mRenderer.setYLabelsColor(0, Color.DKGRAY); mRenderer.setYLabelsColor(1, Color.DKGRAY); mRenderer.setGridColor(Color.LTGRAY); mRenderer.setPanEnabled(false, false); mRenderer.setZoomEnabled(false, false); mRenderer.setXAxisMin(startTime); mRenderer.setXAxisMax(endTime); mRenderer.setXAxisMin(startTime, 1); mRenderer.setXAxisMax(endTime, 1); mRenderer.setYAxisMin(0, 0); mRenderer.setYAxisMax(100, 0); mSpeedRenderer.setColor(Color.RED); mSpeedRenderer.setPointStyle(PointStyle.CIRCLE); mSpeedRenderer.setFillPoints(true); mRpmRenderer.setColor(Color.BLUE); mRpmRenderer.setPointStyle(PointStyle.SQUARE); mRpmRenderer.setFillPoints(true); XYSeries speedSeries = new XYSeries("Vehicle Speed"); XYSeries rpmSeries = new XYSeries("Engine RPM", 1); mDataset.addSeries(0, speedSeries); mDataset.addSeries(1, rpmSeries); mRenderer.addSeriesRenderer(0, mSpeedRenderer); mRenderer.addSeriesRenderer(1, mRpmRenderer); mRenderer.setYAxisMin(0, 1); mRenderer.setYAxisMax(10000, 1); mRenderer.setYTitle("VehicleSpeed"); mRenderer.setYTitle("EngineSpeed", 1); mRenderer.setYAxisAlign(Align.RIGHT, 1); mRenderer.setYLabelsAlign(Align.RIGHT, 1); // Add X-axis labels with time. Log.d(TAG, "Time range: " + startTime + " to " + endTime); SimpleDateFormat fmt = new SimpleDateFormat("HH:mm:ss", Locale.US); for (double t = startTime; t <= endTime; t += 60 * 1000) { String time = fmt.format(new Date((long) t)); Log.d(TAG, "Adding label " + t + ", " + time); mRenderer.addXTextLabel(t, time); } }
From source file:org.gnucash.android.ui.account.AccountFormFragment.java
/** * Initialize views with defaults for new account *//*from ww w. j av a 2s .co m*/ private void initializeViews() { setSelectedCurrency(Money.DEFAULT_CURRENCY_CODE); mColorSquare.setBackgroundColor(Color.LTGRAY); mParentAccountId = getArguments().getLong(UxArgument.PARENT_ACCOUNT_ID); if (mParentAccountId > 0) { Account.AccountType parentAccountType = mAccountsDbAdapter.getAccountType(mParentAccountId); setAccountTypeSelection(parentAccountType); loadParentAccountList(parentAccountType); setParentAccountSelection(mParentAccountId); // String colorHex = mAccountsDbAdapter.getAccountColorCode(parentAccountId); // initializeColorSquarePreview(colorHex); // mSelectedColor = colorHex; } //this must be called after changing account type //because changing account type reloads list of eligible parent accounts }
From source file:org.gnucash.android.ui.report.PieChartFragment.java
/** * Groups smaller slices. All smaller slices will be combined and displayed as a single "Other". * @param data the pie data which smaller slices will be grouped * @param context Context for retrieving resources * @return a {@code PieData} instance with combined smaller slices *//*from w ww.j av a 2 s. co m*/ public static PieData groupSmallerSlices(PieData data, Context context) { float otherSlice = 0f; List<Entry> newEntries = new ArrayList<>(); List<String> newLabels = new ArrayList<>(); List<Integer> newColors = new ArrayList<>(); List<Entry> entries = data.getDataSet().getYVals(); for (int i = 0; i < entries.size(); i++) { float val = entries.get(i).getVal(); if (val / data.getYValueSum() * 100 > GROUPING_SMALLER_SLICES_THRESHOLD) { newEntries.add(new Entry(val, newEntries.size())); newLabels.add(data.getXVals().get(i)); newColors.add(data.getDataSet().getColors().get(i)); } else { otherSlice += val; } } if (otherSlice > 0) { newEntries.add(new Entry(otherSlice, newEntries.size())); newLabels.add(context.getResources().getString(R.string.label_other_slice)); newColors.add(Color.LTGRAY); } PieDataSet dataSet = new PieDataSet(newEntries, ""); dataSet.setSliceSpace(SPACE_BETWEEN_SLICES); dataSet.setColors(newColors); return new PieData(newLabels, dataSet); }
From source file:devlight.io.library.ArcProgressStackView.java
public ArcProgressStackView(final Context context, final AttributeSet attrs, final int defStyleAttr) { super(context, attrs, defStyleAttr); // Init CPSV/*from w ww. ja va 2 s .c om*/ // Always draw setWillNotDraw(false); setLayerType(LAYER_TYPE_SOFTWARE, null); ViewCompat.setLayerType(this, ViewCompat.LAYER_TYPE_SOFTWARE, null); // Detect if features available mIsFeaturesAvailable = Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB; // Retrieve attributes from xml final TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.ArcProgressStackView); try { setIsAnimated(typedArray.getBoolean(R.styleable.ArcProgressStackView_apsv_animated, true)); setIsShadowed(typedArray.getBoolean(R.styleable.ArcProgressStackView_apsv_shadowed, true)); setIsRounded(typedArray.getBoolean(R.styleable.ArcProgressStackView_apsv_rounded, false)); setIsDragged(typedArray.getBoolean(R.styleable.ArcProgressStackView_apsv_dragged, false)); setIsLeveled(typedArray.getBoolean(R.styleable.ArcProgressStackView_apsv_leveled, false)); setTypeface(typedArray.getString(R.styleable.ArcProgressStackView_apsv_typeface)); setTextColor(typedArray.getColor(R.styleable.ArcProgressStackView_apsv_text_color, Color.WHITE)); setShadowRadius(typedArray.getDimension(R.styleable.ArcProgressStackView_apsv_shadow_radius, DEFAULT_SHADOW_RADIUS)); setShadowDistance(typedArray.getDimension(R.styleable.ArcProgressStackView_apsv_shadow_distance, DEFAULT_SHADOW_DISTANCE)); setShadowAngle(typedArray.getInteger(R.styleable.ArcProgressStackView_apsv_shadow_angle, (int) DEFAULT_SHADOW_ANGLE)); setShadowColor( typedArray.getColor(R.styleable.ArcProgressStackView_apsv_shadow_color, DEFAULT_SHADOW_COLOR)); setAnimationDuration(typedArray.getInteger(R.styleable.ArcProgressStackView_apsv_animation_duration, DEFAULT_ANIMATION_DURATION)); setStartAngle(typedArray.getInteger(R.styleable.ArcProgressStackView_apsv_start_angle, (int) DEFAULT_START_ANGLE)); setSweepAngle(typedArray.getInteger(R.styleable.ArcProgressStackView_apsv_sweep_angle, (int) DEFAULT_SWEEP_ANGLE)); setProgressModelOffset(typedArray.getDimension(R.styleable.ArcProgressStackView_apsv_model_offset, DEFAULT_MODEL_OFFSET)); setModelBgEnabled(typedArray.getBoolean(R.styleable.ArcProgressStackView_apsv_model_bg_enabled, false)); // Set orientation final int orientationOrdinal = typedArray .getInt(R.styleable.ArcProgressStackView_apsv_indicator_orientation, 0); setIndicatorOrientation( orientationOrdinal == 0 ? IndicatorOrientation.VERTICAL : IndicatorOrientation.HORIZONTAL); // Retrieve interpolator Interpolator interpolator = null; try { final int interpolatorId = typedArray .getResourceId(R.styleable.ArcProgressStackView_apsv_interpolator, 0); interpolator = interpolatorId == 0 ? null : AnimationUtils.loadInterpolator(context, interpolatorId); } catch (Resources.NotFoundException exception) { interpolator = null; exception.printStackTrace(); } finally { setInterpolator(interpolator); } // Set animation info if is available if (mIsFeaturesAvailable) { mProgressAnimator.setFloatValues(MIN_FRACTION, MAX_FRACTION); mProgressAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(final ValueAnimator animation) { mAnimatedFraction = (float) animation.getAnimatedValue(); if (mAnimatorUpdateListener != null) mAnimatorUpdateListener.onAnimationUpdate(animation); postInvalidate(); } }); } // Check whether draw width dimension or fraction if (typedArray.hasValue(R.styleable.ArcProgressStackView_apsv_draw_width)) { final TypedValue drawWidth = new TypedValue(); typedArray.getValue(R.styleable.ArcProgressStackView_apsv_draw_width, drawWidth); if (drawWidth.type == TypedValue.TYPE_DIMENSION) setDrawWidthDimension(drawWidth.getDimension(context.getResources().getDisplayMetrics())); else setDrawWidthFraction(drawWidth.getFraction(MAX_FRACTION, MAX_FRACTION)); } else setDrawWidthFraction(DEFAULT_DRAW_WIDTH_FRACTION); // Set preview models if (isInEditMode()) { String[] preview = null; try { final int previewId = typedArray .getResourceId(R.styleable.ArcProgressStackView_apsv_preview_colors, 0); preview = previewId == 0 ? null : typedArray.getResources().getStringArray(previewId); } catch (Exception exception) { preview = null; exception.printStackTrace(); } finally { if (preview == null) preview = typedArray.getResources().getStringArray(R.array.default_preview); final Random random = new Random(); for (String previewColor : preview) mModels.add( new Model("", random.nextInt((int) MAX_PROGRESS), Color.parseColor(previewColor))); measure(mSize, mSize); } // Set preview model bg color mPreviewModelBgColor = typedArray.getColor(R.styleable.ArcProgressStackView_apsv_preview_bg, Color.LTGRAY); } } finally { typedArray.recycle(); } }
From source file:co.carlosandresjimenez.android.gotit.BaseActivity.java
public void setDrawerHeaderInfo(View navigationView) { TextView tvHeaderName = (TextView) navigationView.findViewById(R.id.header_name); TextView tvHeaderEmail = (TextView) navigationView.findViewById(R.id.header_email); ImageView ivHeaderCover = (ImageView) navigationView.findViewById(R.id.header_cover); CircleImageView ivHeaderAvatar = (CircleImageView) navigationView.findViewById(R.id.header_avatar); if (mUserName != null && !mUserName.isEmpty() && tvHeaderName != null) tvHeaderName.setText(mUserName); if (mUserEmail != null && !mUserEmail.isEmpty() && tvHeaderEmail != null) tvHeaderEmail.setText(mUserEmail); if (mUserCover != null && !mUserCover.isEmpty() && ivHeaderCover != null) Glide.with(this).load(mUserCover).crossFade().centerCrop().into(ivHeaderCover); if (mUserAvatar != null && !mUserAvatar.isEmpty()) { int sizeParamIndex; // Remove the avatar size limitation if (mUserAvatar.contains("?sz=")) { sizeParamIndex = mUserAvatar.lastIndexOf("?sz="); mUserAvatar = mUserAvatar.substring(0, sizeParamIndex); }/*from www . j a va 2s . c o m*/ } if (ivHeaderAvatar != null) Glide.with(this).load(mUserAvatar) .error(Utility.getDrawable(this, R.drawable.ic_account_circle_white_24dp, Color.LTGRAY)) .crossFade().fitCenter().into(ivHeaderAvatar); }
From source file:com.arcgis.android.samples.localdata.localrasterdata.FileBrowserFragment.java
private void createFileListAdapter() { adapter = new ArrayAdapter<Item>(getActivity(), android.R.layout.select_dialog_item, android.R.id.text1, fileList) {//from w w w . j a v a2 s .c om @Override public View getView(int position, View convertView, ViewGroup parent) { // creates view View view = super.getView(position, convertView, parent); TextView textView = (TextView) view.findViewById(android.R.id.text1); // put the image on the text view int drawableID = 0; if (fileList.get(position).icon != -1) { // If icon == -1, then directory is empty drawableID = fileList.get(position).icon; } textView.setCompoundDrawablesWithIntrinsicBounds(drawableID, 0, 0, 0); textView.setEllipsize(null); int dp3 = (int) (3 * getResources().getDisplayMetrics().density + 0.5f); textView.setCompoundDrawablePadding(dp3); textView.setBackgroundColor(Color.LTGRAY); return view; } }; }
From source file:com.lovely3x.eavlibrary.EasyAdapterView.java
public EasyAdapterView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); this.mDebugPaint = new Paint(Paint.ANTI_ALIAS_FLAG); this.mDebugPaint.setColor(Color.RED); this.mDebugPaint.setStrokeWidth(5); this.mDebugPaint.setTextSize( TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 20, getResources().getDisplayMetrics())); ViewConfiguration config = ViewConfiguration.get(context); mTouchSlop = config.getScaledTouchSlop() / 2; this.mVelocity = VelocityTracker.obtain(); mMinimumVelocity = config.getScaledMinimumFlingVelocity(); mMaximumVelocity = config.getScaledMaximumFlingVelocity(); this.mTopEdgeEffect = new EdgeEffect(getContext()); this.mBottomEdgeEffect = new EdgeEffect(getContext()); this.mLeftEdgeEffect = new EdgeEffect(getContext()); this.mRightEdgeEffect = new EdgeEffect(getContext()); mDividerHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1f, getResources().getDisplayMetrics()); mDivider = new ColorDrawable(Color.LTGRAY); if (attrs != null) initAttrs(attrs);/*from ww w . j a v a 2 s. c om*/ setWillNotDraw(false); previewInEditMode(); }