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.dwdesign.tweetings.activity.SetColorActivity.java
@Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.set_color);/*w w w .j a va 2 s . c o m*/ mColorsGrid = (GridView) findViewById(R.id.colors_grid); final Bundle bundle = savedInstanceState != null ? savedInstanceState : getIntent().getExtras(); mCustomizedColor = bundle != null ? bundle.getInt(Accounts.USER_COLOR, Color.WHITE) : Color.WHITE; final Resources res = getResources(); mColors.add(res.getColor(R.color.holo_red_dark)); mColors.add(res.getColor(R.color.holo_red_light)); mColors.add(res.getColor(R.color.holo_orange_dark)); mColors.add(res.getColor(R.color.holo_orange_light)); mColors.add(res.getColor(R.color.holo_green_light)); mColors.add(res.getColor(R.color.holo_green_dark)); mColors.add(res.getColor(R.color.holo_blue_bright)); mColors.add(res.getColor(R.color.holo_blue_light)); mColors.add(res.getColor(R.color.holo_blue_dark)); mColors.add(res.getColor(R.color.holo_purple)); mColors.add(res.getColor(android.R.color.white)); mColors.add(Color.TRANSPARENT); if (mColors.contains(mCustomizedColor)) { } mColorsGrid.setAdapter(new ColorsAdapter(this, mColors)); mColorsGrid.setOnItemClickListener(this); }
From source file:com.conferenceengineer.android.iosched.ui.ExploreFragment.java
@Override public void onViewCreated(final View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); view.setBackgroundColor(Color.WHITE); final ListView listView = getListView(); listView.setSelector(android.R.color.transparent); listView.setCacheColorHint(Color.WHITE); mAdapter = new TracksAdapter(getActivity(), false); setListAdapter(mAdapter);/*from w w w. j a v a2s . c o m*/ // Override default ListView empty-view handling listView.setEmptyView(null); mEmptyView.setVisibility(View.VISIBLE); mAdapter.registerDataSetObserver(new DataSetObserver() { @Override public void onChanged() { if (mAdapter.getCount() > 0) { mEmptyView.setVisibility(View.GONE); mAdapter.unregisterDataSetObserver(this); } } }); }
From source file:com.artemchep.horario.ui.fragments.details.DetailsHelper.java
void setAppBarBackgroundColor(@ColorInt int color) { color |= 0xFF000000; // ignore alpha bits final boolean isColorDark = ColorUtil.isColorDark(color); Drawable overflowIcon;//from w ww .j a v a 2 s. c o m if (isColorDark) { mCollapsingToolbar.setExpandedTitleColor(Color.WHITE); mCollapsingToolbar.setCollapsedTitleTextColor(Color.WHITE); overflowIcon = ContextCompat.getDrawable(mActivity, R.drawable.ic_dots_vertical_white_24dp); if (mSmartTabLayout != null) { mSmartTabLayout.setDefaultTabTextColor(Color.WHITE); mSmartTabLayout.setSelectedIndicatorColors(Color.WHITE); } } else { mCollapsingToolbar.setExpandedTitleColor(Color.BLACK); mCollapsingToolbar.setCollapsedTitleTextColor(Color.BLACK); overflowIcon = ContextCompat.getDrawable(mActivity, R.drawable.ic_dots_vertical_black_24dp); if (mSmartTabLayout != null) { mSmartTabLayout.setDefaultTabTextColor(Color.BLACK); mSmartTabLayout.setSelectedIndicatorColors(Color.BLACK); } } mCollapsingToolbar.setContentScrimColor(color); if (mBackdropToolbar != null) { mBackdropToolbar.setBackgroundColor(color); } else mAppBar.setBackgroundColor(color); mToolbar.setOverflowIcon(overflowIcon); if (mActivity.mContainers.hasSingleColumn()) { int iconRes; if (mActivity.mAppBar.hasGeneralToolbar()) { iconRes = isColorDark ? R.drawable.ic_close_white_24dp : R.drawable.ic_close_black_24dp; } else iconRes = isColorDark ? R.drawable.ic_backburger_white_24dp : R.drawable.ic_backburger_black_24dp; Drawable navIcon = ContextCompat.getDrawable(mActivity, iconRes); mToolbar.setNavigationIcon(navIcon); } MenuItem editItem = mToolbar.getMenu().findItem(R.id.action_edit); if (editItem != null) { Drawable editIcon = isColorDark ? ContextCompat.getDrawable(mActivity, R.drawable.ic_pencil_white_24dp) : ContextCompat.getDrawable(mActivity, R.drawable.ic_pencil_black_24dp); editItem.setIcon(editIcon); } MenuItem shareItem = mToolbar.getMenu().findItem(R.id.action_share); if (shareItem != null) { Drawable shareIcon = isColorDark ? ContextCompat.getDrawable(mActivity, R.drawable.ic_share_variant_white_24dp) : ContextCompat.getDrawable(mActivity, R.drawable.ic_share_variant_black_24dp); shareItem.setIcon(shareIcon); } }
From source file:com.richtodd.android.quiltdesign.block.PaperPiecedBlock.java
private PaperPiecedBlock(Parcel in) { m_dirty = in.readInt() == 0 ? false : true; m_width = in.readFloat();/* w w w . j a v a2 s . c o m*/ m_height = in.readFloat(); m_backgroundColor = in.readInt(); m_pieces = new ArrayList<PaperPiecedBlockPiece>(); in.readTypedList(m_pieces, PaperPiecedBlockPiece.CREATOR); m_backgroundPaint = new Paint(); m_backgroundPaint.setStyle(Style.FILL); m_backgroundPaint.setColor(m_backgroundColor); m_backgroundPaintWhite = new Paint(); m_backgroundPaintWhite.setStyle(Style.FILL); m_backgroundPaintWhite.setColor(Color.WHITE); }
From source file:com.androidarchitecture.widgets.RecyclerViewSwipeToDeleteImpl.java
/** * This is the standard support library way of implementing "swipe to delete" feature. You can do custom drawing in onChildDraw method * but whatever you draw will disappear once the swipe is over, and while the items are animating to their new position the recycler view * background will be visible. That is rarely an desired effect. */// w w w . j ava2 s. c om private void setUpItemTouchHelper() { ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT) { // we want to cache these and not allocate anything repeatedly in the onChildDraw method Drawable background; Drawable xMark; int xMarkMargin; boolean initiated; private void init() { background = new ColorDrawable(ContextCompat.getColor(mContext, R.color.colorPrimary)); xMark = ContextCompat.getDrawable(mContext, R.drawable.ic_cancel_black_24dp); xMark.setColorFilter(Color.WHITE, PorterDuff.Mode.SRC_ATOP); xMarkMargin = (int) mContext.getResources().getDimension(R.dimen.activity_margin); initiated = true; } // not important, we don't want drag & drop @Override public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) { return false; } @Override public int getSwipeDirs(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { return super.getSwipeDirs(recyclerView, viewHolder); } @Override public void onSwiped(RecyclerView.ViewHolder viewHolder, int swipeDir) { int swipedPosition = viewHolder.getAdapterPosition(); mListener.removeItem(swipedPosition); } @Override public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { View itemView = viewHolder.itemView; // not sure why, but this method get's called for viewHolder that are already swiped away if (viewHolder.getAdapterPosition() == -1) { // not interested in those return; } if (!initiated) { init(); } // draw red background background.setBounds(itemView.getRight() + (int) dX, itemView.getTop(), itemView.getRight(), itemView.getBottom()); background.draw(c); // draw x mark int itemHeight = itemView.getBottom() - itemView.getTop(); int intrinsicWidth = xMark.getIntrinsicWidth(); int intrinsicHeight = xMark.getIntrinsicWidth(); int xMarkLeft = itemView.getRight() - xMarkMargin - intrinsicWidth; int xMarkRight = itemView.getRight() - xMarkMargin; int xMarkTop = itemView.getTop() + (itemHeight - intrinsicHeight) / 2; int xMarkBottom = xMarkTop + intrinsicHeight; xMark.setBounds(xMarkLeft, xMarkTop, xMarkRight, xMarkBottom); xMark.draw(c); super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive); } }; ItemTouchHelper mItemTouchHelper = new ItemTouchHelper(simpleItemTouchCallback); mItemTouchHelper.attachToRecyclerView(mRecyclerView); }
From source file:com.Bhailal_Chauhan.retailapp.view.fragment.ContactUsFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.frag_about, container, false); getActivity().setTitle("Contact Us"); mToolbar = (Toolbar) rootView.findViewById(R.id.htab_toolbar); if (mToolbar != null) { ((ECartHomeActivity) getActivity()).setSupportActionBar(mToolbar); }// w ww. jav a 2s . c o m if (mToolbar != null) { ((ECartHomeActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true); mToolbar.setNavigationIcon(R.drawable.ic_drawer); } mToolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { ((ECartHomeActivity) getActivity()).getmDrawerLayout().openDrawer(GravityCompat.START); } }); mToolbar.setTitleTextColor(Color.WHITE); rootView.findViewById(R.id.locations).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { } }); rootView.findViewById(R.id.contact_num).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent callIntent = new Intent(Intent.ACTION_DIAL); callIntent.setData(Uri.parse("tel:" + "8347337366")); startActivity(callIntent); } }); rootView.setFocusableInTouchMode(true); rootView.requestFocus(); rootView.setOnKeyListener(new View.OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK) { Utils.switchContent(R.id.frag_container, Utils.HOME_FRAGMENT, ((ECartHomeActivity) (getContext())), AnimationType.SLIDE_UP); } return true; } }); rootView.findViewById(R.id.site_dev).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://bhailalchauhan.com/")); startActivity(browserIntent); } }); rootView.findViewById(R.id.email).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.setType("text/plain"); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { "hibhailal458@gmail.com" }); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Hello There"); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Add Message here"); emailIntent.setType("message/rfc822"); try { startActivity(Intent.createChooser(emailIntent, "Send email using...")); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(getActivity(), "No email clients installed.", Toast.LENGTH_SHORT).show(); } } }); return rootView; }
From source file:com.cloudkick.DashboardActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); PreferenceManager.setDefaultValues(this, R.xml.preferences, false); dashboard = new ListView(this); adapter = new NodesAdapter(this, R.layout.node_item, nodes); dashboard.setAdapter(adapter);//from w w w .ja va2 s. co m dashboard.setOnItemClickListener(this); dashboard.setBackgroundColor(Color.WHITE); setContentView(dashboard); reloadAPI(); }
From source file:com.android.datetimepicker.date.TextViewWithCircularIndicator.java
/** * Programmatically set the color state list (see mdtp_date_picker_year_selector) * @param accentColor pressed state text color * @param darkMode current theme mode/*from ww w . j av a 2s . c o m*/ * @return ColorStateList with pressed state */ private ColorStateList createTextColor(int accentColor, boolean darkMode) { int[][] states = new int[][] { new int[] { android.R.attr.state_pressed }, // pressed new int[] { android.R.attr.state_selected }, // selected new int[] {} }; int[] colors = new int[] { accentColor, Color.WHITE, darkMode ? Color.WHITE : Color.BLACK }; return new ColorStateList(states, colors); }
From source file:net.bither.util.ChartsUtil.java
public static synchronized void initMarketDepth(MarketDepthChart marketDepthChart, Depth depth, boolean isRefresh) { List<LineEntity<DateValueEntity>> lines = new ArrayList<LineEntity<DateValueEntity>>(); LineEntity<DateValueEntity> MALineData = new LineEntity<DateValueEntity>(); MALineData.setLineData(depth.getDateValueEntities()); lines.add(MALineData);/* ww w . j a va 2 s . co m*/ MarketDepthEntity marketDepthEntity = new MarketDepthEntity(lines, depth.getSplitIndex()); marketDepthChart.setMareketDepthEntity(marketDepthEntity); int lineColor = Color.argb(30, 255, 255, 255); marketDepthChart.setLongitudeFontSize(14); marketDepthChart.setLatitudeFontSize(14); marketDepthChart.setLongitudeFontColor(Color.WHITE); marketDepthChart.setLatitudeColor(lineColor); marketDepthChart.setLatitudeFontColor(Color.WHITE); marketDepthChart.setLongitudeColor(lineColor); marketDepthChart.setMaxValue((int) depth.getMaxVolume()); marketDepthChart.setMinValue(0); // marketDepthChart.setDisplayFrom(0); marketDepthChart.setDisplayNumber(depth.getDateValueEntities().size() - 1); marketDepthChart.setMinDisplayNumber(depth.getDateValueEntities().size() - 1); marketDepthChart.setZoomBaseLine(0); marketDepthChart.setDisplayLongitudeTitle(true); marketDepthChart.setDisplayLatitudeTitle(true); marketDepthChart.setDisplayLatitude(true); marketDepthChart.setDisplayLongitude(true); marketDepthChart.setDisplayBorder(false); marketDepthChart.setDataQuadrantPaddingTop(5); marketDepthChart.setDataQuadrantPaddingBottom(5); marketDepthChart.setDataQuadrantPaddingLeft(5); marketDepthChart.setDataQuadrantPaddingRight(5); marketDepthChart.setAxisYTitleQuadrantWidth(50); marketDepthChart.setAxisXTitleQuadrantHeight(20); marketDepthChart.setAxisXPosition(GridChart.AXIS_X_POSITION_BOTTOM); marketDepthChart.setAxisYPosition(GridChart.AXIS_Y_POSITION_RIGHT); if (isRefresh) { marketDepthChart.invalidate(); } }
From source file:com.example.inmarsat.hellomap.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); setUpMapIfNeeded();/* w w w . j a v a 2s .c om*/ // set the background of the text view showing the data from the API calls if (findViewById(R.id.detailsText) != null) { TextView view = (TextView) findViewById(R.id.detailsText); view.setBackgroundColor(Color.BLACK); view.setTextColor(Color.WHITE); } }