List of usage examples for android.graphics Color GRAY
int GRAY
To view the source code for android.graphics Color GRAY.
Click Source Link
From source file:fr.cph.stock.android.activity.AccountActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { Log.v(TAG, "Account Activity onCreate"); super.onCreate(savedInstanceState); setContentView(R.layout.account_activity); Bundle b = getIntent().getExtras();/*w w w .j av a2s . c o m*/ portfolio = b.getParcelable("portfolio"); errorView = (TextView) findViewById(R.id.errorMessage); totalValueView = (TextView) findViewById(R.id.totalValue); totalGainView = (TextView) findViewById(R.id.totalGain); totalPlusMinusValueView = (TextView) findViewById(R.id.totalPlusMinusValue); lastUpateView = (TextView) findViewById(R.id.lastUpdate); liquidityView = (TextView) findViewById(R.id.liquidity); yieldYearView = (TextView) findViewById(R.id.yieldYear); shareValueView = (TextView) findViewById(R.id.shareValue); gainView = (TextView) findViewById(R.id.gain2); perfView = (TextView) findViewById(R.id.perf); yieldView = (TextView) findViewById(R.id.yieldPerf); taxesView = (TextView) findViewById(R.id.taxes); RelativeLayout accLayout = (RelativeLayout) findViewById(R.id.accountsLayout); TextView recent = new TextView(getApplicationContext()); textViews = new ArrayList<TextView>(); int id = 1; int nameID = 100; int viewId1 = 500; int currencyId = 1000; for (int i = 0; i < portfolio.getAccounts().size(); i++) { Account account = portfolio.getAccounts().get(i); TextView currentAccountNameTextView = new TextView(getApplicationContext()); currentAccountNameTextView.setText(account.getName()); currentAccountNameTextView.setTextColor(Color.GRAY); currentAccountNameTextView.setId(nameID); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams((int) LayoutParams.WRAP_CONTENT, (int) LayoutParams.WRAP_CONTENT); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } params.addRule(RelativeLayout.ALIGN_PARENT_LEFT); currentAccountNameTextView.setLayoutParams(params); accLayout.addView(currentAccountNameTextView, params); textViews.add(currentAccountNameTextView); View viewPoint1 = new View(getApplicationContext()); viewPoint1.setId(viewId1); viewPoint1.setBackgroundColor(getResources().getColor(R.color.grey_light)); params = new RelativeLayout.LayoutParams((int) LayoutParams.MATCH_PARENT, 2); params.addRule(RelativeLayout.RIGHT_OF, nameID); params.addRule(RelativeLayout.LEFT_OF, currencyId); params.setMargins(0, Util.convertDpToPxl(15, getApplicationContext()), 0, 0); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } viewPoint1.setLayoutParams(params); accLayout.addView(viewPoint1, params); TextView currentCurrencyTextView = new TextView(getApplicationContext()); currentCurrencyTextView.setText(account.getCurrency()); currentCurrencyTextView.setTextColor(Color.GRAY); currentCurrencyTextView.setId(currencyId); params = new RelativeLayout.LayoutParams((int) LayoutParams.WRAP_CONTENT, (int) LayoutParams.WRAP_CONTENT); params.addRule(RelativeLayout.CENTER_HORIZONTAL); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } currentCurrencyTextView.setLayoutParams(params); accLayout.addView(currentCurrencyTextView, params); textViews.add(currentCurrencyTextView); View viewPoint2 = new View(getApplicationContext()); viewPoint2.setBackgroundColor(getResources().getColor(R.color.grey_light)); params = new RelativeLayout.LayoutParams((int) LayoutParams.MATCH_PARENT, 2); params.addRule(RelativeLayout.RIGHT_OF, currencyId); params.addRule(RelativeLayout.LEFT_OF, id); params.setMargins(0, Util.convertDpToPxl(15, getApplicationContext()), 0, 0); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } viewPoint2.setLayoutParams(params); accLayout.addView(viewPoint2, params); TextView currentTextView = new TextView(getApplicationContext()); currentTextView.setText(account.getLiquidity()); currentTextView.setTextColor(Color.GRAY); currentTextView.setId(id); params = new RelativeLayout.LayoutParams((int) LayoutParams.WRAP_CONTENT, (int) LayoutParams.WRAP_CONTENT); if (i != 0) { params.addRule(RelativeLayout.BELOW, recent.getId()); } params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); currentTextView.setLayoutParams(params); recent = currentTextView; accLayout.addView(currentTextView, params); textViews.add(currentTextView); id++; nameID++; viewId1++; currencyId++; } buildUi(false); // Set context EasyTracker.getInstance().setContext(getApplicationContext()); // Instantiate the Tracker tracker = EasyTracker.getTracker(); }
From source file:st.brothas.mtgoxwidget.MtGoxWidgetProvider.java
private static void updateViews(RemoteViews views, MtGoxTickerData prevData, MtGoxTickerData newData, WidgetPreferences preferences) { String updated = "@ " + dateFormat.format(newData.getTimestamp()); String lastRounded = round(newData.getLast()); String lowRounded = round(newData.getLow()); String highRounded = round(newData.getHigh()); views.setTextViewText(R.id.appwidget_last, preferences.getCurrencyConversion().symbol + lastRounded); views.setTextColor(R.id.appwidget_updated, getColor(preferences.getColorMode(), WidgetColor.Normal)); if (newData.getTimestamp().before(getDateMinutesAgo(DATA_IS_CONSIDERED_OLD_AFTER_MINUTES))) { // Data is old, show it by "old" and "warning" colors views.setTextColor(R.id.appwidget_last, Color.GRAY); views.setTextColor(R.id.appwidget_updated, getColor(preferences.getColorMode(), WidgetColor.Warning)); } else if (prevData != null) { // We have previous data, compare to get the color views.setTextColor(R.id.appwidget_last, getColorFromValueChange(prevData.getLast(), newData.getLast(), preferences.getColorMode())); } else {/*from w w w. jav a 2s . c o m*/ // No previous data, set standard color views.setTextColor(R.id.appwidget_last, getColor(preferences.getColorMode(), WidgetColor.StartValue)); } views.setTextViewText(R.id.appwidget_high, highRounded); views.setTextViewText(R.id.appwidget_low, lowRounded); views.setTextViewText(R.id.appwidget_updated, updated); //aws if (preferences.getCurrencyConversion().toString().contains("LTC_")) { views.setImageViewResource(R.id.appwidget_logo, R.drawable.lc_logo_32); } //else default which is bitcoin logo }
From source file:com.sinelead.car.club.map.AMapEx.java
private void setUpMap() { mAmap = ((SupportMapFragment) ((FragmentActivity) context).getSupportFragmentManager() .findFragmentById(R.id.map)).getMap(); myLocationStyle = new MyLocationStyle(); myLocationStyle.myLocationIcon(BitmapDescriptorFactory.fromResource(R.drawable.location_marker)); myLocationStyle.strokeColor(Color.GRAY); myLocationStyle.radiusFillColor(R.color.AlphaDodgerBlue); // myLocationStyle.strokeWidth(1);/*w ww. j a v a2s . c om*/ mAmap.setMyLocationStyle(myLocationStyle); mAmap.getUiSettings().setScaleControlsEnabled(true); mAmap.getUiSettings().setCompassEnabled(false); // mAmap.setLocationSource(this); mAmap.setMyLocationEnabled(true); mAmap.getUiSettings().setMyLocationButtonEnabled(false); mAmap.setMyLocationType(currentLocationType); rotateCur = true; // CameraUpdate cameraUpdate = CameraUpdateFactory.zoomTo(defalutZoom); mAmap.moveCamera(cameraUpdate); }
From source file:com.lvfq.rabbit.fragment.SlidingTabsColorsFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d(TAG, "onCreate"); // BEGIN_INCLUDE (populate_tabs) /**//from w w w.j a v a2 s .c o m * Populate our tab list with tabs. Each item contains a title, indicator color and divider * color, which are used by {@link SlidingTabLayout}. */ mTabs.add(new RabbitPagerItem(getString(R.string.video), // Title Color.BLUE, // Indicator color Color.GRAY, // Divider color 0)); mTabs.add(new RabbitPagerItem(getString(R.string.info), // Title Color.RED, // Indicator color Color.GRAY, // Divider color 1)); mTabs.add(new RabbitPagerItem(getString(R.string.extra), // Title Color.YELLOW, // Indicator color Color.GRAY, // Divider color 2)); // END_INCLUDE (populate_tabs) }
From source file:com.example.android.imaginarium.SlidingTabsColorsFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // BEGIN_INCLUDE (populate_tabs) /**/*from w ww .j a v a 2 s .co m*/ * Populate our tab list with tabs. Each item contains a title, indicator color and divider * color, which are used by {@link SlidingTabLayout}. */ mTabs.add(new SamplePagerItem(getString(R.string.tab_newsfeed), // Title Color.BLUE, // Indicator color Color.GRAY // Divider color )); mTabs.add(new SamplePagerItem(getString(R.string.tab_new_story), // Title Color.RED, // Indicator color Color.GRAY // Divider color )); mTabs.add(new SamplePagerItem(getString(R.string.tab_my_stories), // Title Color.YELLOW, // Indicator color Color.GRAY // Divider color )); mTabs.add(new SamplePagerItem(getString(R.string.tab_notifications), // Title Color.GREEN, // Indicator color Color.GRAY // Divider color )); // END_INCLUDE (populate_tabs) }
From source file:pl.wasat.smarthma.ui.frags.base.BaseCollectionDetailsFragment.java
@NonNull private EditText buildEditTextView(Parameter param) { EditText editText = new EditText(getActivity()); TableLayout.LayoutParams layoutParams = new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT, 1f); layoutParams.setMargins(40, 10, 40, 10); editText.setLayoutParams(layoutParams); editText.setHint(String.format(getActivity().getString(R.string.set_), param.getName())); editText.setHintTextColor(Color.GRAY); editText.setBackgroundColor(Color.WHITE); editText.addTextChangedListener(new EditTextViewInputWatcher(param)); editText.setOnTouchListener(new EditTextViewInputWatcher(param)); editText.setOnFocusChangeListener(new EditTextViewInputWatcher(param)); editText.setTextSize(14);//from w w w . j a va 2 s . com return editText; }
From source file:com.example.fansonlib.widget.calendar.CalendarView.java
public CalendarView(@NonNull Context context, @Nullable AttributeSet attrs) { super(context, attrs); TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CalendarView); mCurDayTextColor = array.getColor(R.styleable.CalendarView_current_day_text_color, Color.RED); mSchemeStyle = array.getInt(R.styleable.CalendarView_scheme_theme_style, CalendarCardView.STYLE_STROKE); mSelectThemeStyle = array.getInt(R.styleable.CalendarView_selected_theme_style, CalendarCardView.STYLE_STROKE); mSchemeTextColor = array.getColor(R.styleable.CalendarView_scheme_text_color, Color.RED); mSchemeThemeColor = array.getColor(R.styleable.CalendarView_scheme_theme_color, 0x50CFCFCF); isShowLunar = array.getBoolean(R.styleable.CalendarView_show_lunar, true); mCalendarCardViewClass = array.getString(R.styleable.CalendarView_calendar_card_view); mWeekBackground = array.getColor(R.styleable.CalendarView_week_background, Color.WHITE); mWeekTextColor = array.getColor(R.styleable.CalendarView_week_text_color, Color.BLACK); mSelectedThemeColor = array.getColor(R.styleable.CalendarView_selected_theme_color, 0x50CFCFCF); mSelectedTextColor = array.getColor(R.styleable.CalendarView_selected_text_color, 0xFF111111); mCurrentMonthTextColor = array.getColor(R.styleable.CalendarView_current_month_text_color, 0xFF111111); mOtherMonthTextColor = array.getColor(R.styleable.CalendarView_other_month_text_color, 0xFFe1e1e1); mLunarTextColor = array.getColor(R.styleable.CalendarView_lunar_text_color, Color.GRAY); mMinYear = array.getInt(R.styleable.CalendarView_min_year, 2010); mMaxYear = array.getInt(R.styleable.CalendarView_max_year, 2050); if (mMinYear <= 1900) mMaxYear = 1900;//from www.j av a2 s . com if (mMaxYear >= 2099) mMaxYear = 2099; array.recycle(); init(context); }
From source file:com.example.weixin.ActivityMain.java
/** * /* ww w . j a va 2 s . co m*/ * @param index */ protected void setDescColor(int index) { for (int i = 0; i < tvList.length; i++) { TextView textView = tvList[i]; if (textView == null) { break; } if (i == index) { textView.setTextColor(Color.GREEN); } else { textView.setTextColor(Color.GRAY); } } }
From source file:com.wytiger.common.widget.SlideSwitch.java
@Override protected void onDraw(Canvas canvas) { if (mShape == SHAPE_RECT) { paint.setColor(Color.GRAY); canvas.drawRect(backRect, paint); paint.setColor(color_theme);// w w w.j a va 2 s . c o m paint.setAlpha(alpha); canvas.drawRect(backRect, paint); frontRect.set(frontRect_left, RIM_SIZE, frontRect_left + getMeasuredWidth() / 2 - RIM_SIZE, getMeasuredHeight() - RIM_SIZE); paint.setColor(Color.WHITE); canvas.drawRect(frontRect, paint); } else { // draw circle int radius; radius = backRect.height() / 2 - RIM_SIZE; paint.setColor(Color.GRAY); backCircleRect.set(backRect); canvas.drawRoundRect(backCircleRect, radius, radius, paint); paint.setColor(color_theme); paint.setAlpha(alpha); canvas.drawRoundRect(backCircleRect, radius, radius, paint); frontRect.set(frontRect_left, RIM_SIZE, frontRect_left + backRect.height() - 2 * RIM_SIZE, backRect.height() - RIM_SIZE); frontCircleRect.set(frontRect); paint.setColor(Color.WHITE); canvas.drawRoundRect(frontCircleRect, radius, radius, paint); } }
From source file:odoo.controls.OViewPager.java
/** * Inits the pagger.//w w w. j a va 2s.c o m */ private void initPagger() { Log.v(TAG, "initPagger()"); mObjects = mModel.select(); setBackgroundColor(Color.GRAY); mPaggerAdapter = new PaggerAdapter(this, mOnPaggerGetView.getPaggerFragmentManager(), mOnPaggerGetView, this); mZoomOutPageTransformer = new ZoomOutPageTransformer(); setPageTransformer(true, mZoomOutPageTransformer); setAdapter(mPaggerAdapter); }