@Override public View getView(int position, View convertView, ViewGroup parent) { View view = null; if (convertView == null) { LayoutInflater inflator = context.getLayoutInflater(); view = inflator.inflate(R.layout.filter_color_listview_row, parent, false); final ViewHolder viewHolder = new ViewHolder(); viewHolder.checkbox = (CheckBox) view.findViewById(R.id.check_color); viewHolder.text = (TextView) view.findViewById(R.id.label_color); viewHolder.textcolor = (TextView) view.findViewById(R.id.color_display_txt); viewHolder.checkbox.setOnCheckedChangeListener( new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { Model element = (Model) viewHolder.checkbox.getTag(); element.setSelected(buttonView.isChecked()); } }); view.setOnClickListener( new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub viewHolder.checkbox.setChecked(!viewHolder.checkbox.isChecked()); } }); view.setTag(viewHolder); viewHolder.checkbox.setTag(list.get(position)); } else { view = convertView; ((ViewHolder) view.getTag()).checkbox.setTag(list.get(position)); } ViewHolder holder = (ViewHolder) view.getTag(); holder.text.setTextSize(5 * context.getResources().getDisplayMetrics().density); holder.checkbox.setChecked(list.get(position).isSelected()); JSONArray object; try { object = new JSONArray(list.get(position).getName()); final float scale = context.getResources().getDisplayMetrics().density; GradientDrawable gd = new GradientDrawable(); gd.setColor( Color.parseColor( object.getString( 1))); // Changes this drawbale to use a single color instead of a gradient gd.setCornerRadius((int) (2 * scale + 0.5f)); gd.setStroke((int) (2 * scale + 0.5f), Color.parseColor("#000000")); holder.textcolor.setBackgroundDrawable(gd); holder.text.setText(object.getString(0)); // holder.textcolor.setBackgroundColor(Color.parseColor(object.getString(1))); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } return view; }
@Override public void onPageSelected(int position) { initBtn(); // showToast(position+""); switch (position) { case 0: btnSpring.setBackgroundResource(R.drawable.wash_btn_press); btnSpring.setTextColor(Color.parseColor("#28ccfc")); break; case 1: btnSummer.setBackgroundResource(R.drawable.wash_btn_press); btnSummer.setTextColor(Color.parseColor("#28ccfc")); break; case 2: btnAutumn.setBackgroundResource(R.drawable.wash_btn_press); btnAutumn.setTextColor(Color.parseColor("#28ccfc")); break; case 3: btnWinter.setBackgroundResource(R.drawable.wash_btn_press); btnWinter.setTextColor(Color.parseColor("#28ccfc")); break; } }
/** * 组合消息文本 * * @param name * @param body * @return */ public static SpannableStringBuilder parseFriendPostpan( String name, SpannableStringBuilder body) { SpannableStringBuilder sp = null; int start = 0; int end = 0; String mName = name + ":"; sp = body.insert(0, mName); // sp = new SpannableString(name + ":" + body); end = name.length(); // 设置用户名字体加粗、高亮 sp.setSpan( new StyleSpan(android.graphics.Typeface.BOLD), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); sp.setSpan( new ForegroundColorSpan(Color.parseColor("#2f548f")), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); sp.setSpan( new ForegroundColorSpan(Color.parseColor("#ff000000")), end, sp.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); return sp; }
Bitmap drawEye() { Paint paint_eyebg = new Paint(); paint_eyebg.setColor(Color.parseColor("#EDEDED")); Paint paint_eyerim = new Paint(); paint_eyerim.setColor(Color.parseColor("#F2E16C")); Paint paint_eyeinside = new Paint(); paint_eyeinside.setColor(Color.parseColor("#FFFFFF")); Paint paint_red = new Paint(); paint_red.setColor(Color.parseColor("#FFE342")); Paint paint_black = new Paint(); paint_black.setColor(Color.parseColor("#000000")); Bitmap bg = Bitmap.createBitmap(480, 800, Bitmap.Config.ARGB_8888); Canvas canvas_eye = new Canvas(bg); Bitmap bg_eyeinside = Bitmap.createBitmap(bg.getWidth(), bg.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas_bg_inside = new Canvas(bg_eyeinside); canvas_bg_inside.drawOval(new RectF(240, 200, 300, 280), paint_red); canvas_bg_inside.drawBitmap(bg_eyeinside, 0, 0, null); canvas_eye.drawCircle(230, 200, 60, paint_eyebg); canvas_eye.drawCircle(230, 200, 50, paint_eyebg); canvas_eye.drawBitmap(bg_eyeinside, -40, -40, null); canvas_eye.drawCircle(230, 200, 35, paint_eyeinside); canvas_eye.drawCircle(220, 200, 20, paint_black); canvas_eye.drawCircle(220, 200, 2, paint_eyebg); return bg; }
public TouchableSpan() { this( Color.parseColor("#1caff6"), Color.parseColor("#8dd9fd"), Color.parseColor("#ffffff"), Color.parseColor("#999999")); }
private void initGridCell(TextView gridcell, int i) { // Get a reference to the Day gridcell final Calendar cellDate = daysMap.get(i).getDay(); float balance = daysMap.get(i).getBalance(); if (balance < 0) { gridcell.setTextColor(Color.parseColor("#B40431")); } else if (balance < 100) { gridcell.setTextColor(Color.parseColor("#868A08")); } else { gridcell.setTextColor(Color.parseColor("#088A08")); } if (cellDate != null) { if (cellDate.get(Calendar.MONTH) != currentMonth.get(Calendar.MONTH)) { gridcell.setTextColor(Color.parseColor("#A4A4A4")); } String cellString = cellDate.get(Calendar.DAY_OF_MONTH) + "\n\n" + String.format("%.0f", balance); gridcell.setText(cellString); } gridcell.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { if (cellDate != null) { Bundle b = new Bundle(); b.putLong("date", cellDate.getTimeInMillis()); FragmentManager fm = getSupportFragmentManager(); Finance_Calendar_Dialog dialog = new Finance_Calendar_Dialog(); dialog.setArguments(b); dialog.show(fm, "ShowInputs"); } } }); }
public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = vi.inflate(mResource, null); holder = new ViewHolder(convertView); convertView.setTag(holder); } else holder = (ViewHolder) convertView.getTag(); final String item = getItem(position); if (item != null) { holder.textView.setText(" " + item.toUpperCase().trim()); char letra = item.charAt(0); if (letra == 'E') { // buses expresos holder.textView.setBackgroundColor(Color.parseColor("#ECDF3E")); holder.imageView.setImageResource(R.drawable.busexpreso); } else if (letra == 'P') { // buses pretroncal holder.textView.setBackgroundColor(Color.parseColor("#2E79B9")); holder.imageView.setImageResource(R.drawable.buspretroncal); } else if (letra == 'T') { // bus trocal holder.textView.setBackgroundColor(Color.parseColor("#E30613")); holder.imageView.setImageResource(R.drawable.bustroncal); } else if (letra == 'A') { // bus alimentador holder.textView.setBackgroundColor(Color.parseColor("#5FB985")); holder.imageView.setImageResource(R.drawable.busalimentador); } else holder.imageView.setImageResource(R.drawable.busalimentador); } return convertView; }
@Override protected void onPostExecute(String result) { mWakeLock.release(); mProgressDialog.dismiss(); if (result != null) Toast.makeText(context, "Download error: " + result, Toast.LENGTH_LONG).show(); else new MaterialDialog.Builder(getActivity()) .title("File Downloaded!") .content( "Your file has been downloaded. You may need to use a file manager to view it.") .neutralText("OK") .neutralColor(Color.parseColor("#ff1963be")) .positiveText("Download Now") .positiveColor(Color.parseColor("#ff1963be")) .callback( new MaterialDialog.ButtonCallback() { @Override public void onPositive(MaterialDialog dialog) { super.onPositive(dialog); String cabinet = "market://details?id=com.afollestad.cabinet"; Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(cabinet)); startActivity(i); } @Override public void onNeutral(MaterialDialog dialog) { super.onNeutral(dialog); dialog.dismiss(); } }) .show(); }
@SuppressLint("NewApi") @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { holder = new ViewHolder(); convertView = mInflater.inflate(R.layout.order_item, null); holder.date = (TextView) convertView.findViewById(R.id.item_date); holder.location = (TextView) convertView.findViewById(R.id.item_location); holder.name = (TextView) convertView.findViewById(R.id.item_name); holder.time = (TextView) convertView.findViewById(R.id.item_time); holder.type = (TextView) convertView.findViewById(R.id.item_type); holder.company = (TextView) convertView.findViewById(R.id.item_company); holder.isDone = (TextView) convertView.findViewById(R.id.item_isDone); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } TaskInfo taskInfo = tasklist.get(position); String ServiceDate = null; String serviceBegin = taskInfo.ServiceBegin(); String serviceEnd = taskInfo.ServiceEnd(); if (serviceBegin.equals(serviceEnd)) { ServiceDate = serviceBegin; } else { ServiceDate = serviceBegin + "-" + serviceEnd; } holder.time.setText(taskInfo.OnboardTime()); holder.date.setText(ServiceDate); holder.location.setText(taskInfo.PickupAddress()); holder.name.setText(taskInfo.Customer()); holder.type.setText(taskInfo.ServiceTypeName()); holder.company.setText(taskInfo.getCustomerCompany()); String isUpdate = taskInfo.getIsUpdate(); int readmark = taskInfo.getReadmark(); if (taskInfo.getRouteNoteCount() > 0) { holder.isDone.setVisibility(View.VISIBLE); holder.isDone.setText("已完成"); holder.isDone.setBackgroundColor(Color.parseColor("#009944")); } else if (null != pauseNote && pauseNote.getTaskID().equals(taskInfo.TaskID())) { holder.isDone.setVisibility(View.VISIBLE); holder.isDone.setText("暂停中"); holder.isDone.setBackgroundColor(Color.parseColor("#eb6100")); // holder.isDone.setBackground(getResources().getColor(R.color.colorYellow)); } else if (readmark == 1) { holder.isDone.setVisibility(View.GONE); } else if (readmark == 0) { holder.isDone.setVisibility(View.VISIBLE); holder.isDone.setBackground(getResources().getDrawable(R.drawable.bg_red)); if (isUpdate.equals("0")) { holder.isDone.setText("新增"); } else { holder.isDone.setText("修改"); } } else { holder.isDone.setVisibility(View.GONE); } return convertView; }
/** 重写这个方法 */ protected void onDraw(Canvas canvas) { super.onDraw(canvas); // 获取焦点改变背景颜色. int height = getHeight(); // 获取对应高度 int width = getWidth(); // 获取对应宽度 int singleHeight = height / b.length; // 获取每一个字母的高度 for (int i = 0; i < b.length; i++) { paint.setColor(Color.parseColor("#9da0a4")); paint.setTypeface(Typeface.DEFAULT_BOLD); paint.setAntiAlias(true); // paint.setTextSize(PixelUtil.sp2px(12)); paint.setTextSize(25); // 选中的状态 if (i == choose) { paint.setColor(Color.parseColor("#3399ff")); paint.setFakeBoldText(true); } // x坐标等于中间-字符串宽度的一半. float xPos = width / 2 - paint.measureText(b[i]) / 2; float yPos = singleHeight * i + singleHeight; canvas.drawText(b[i], xPos, yPos, paint); paint.reset(); // 重置画笔 } }
private void init() { COMMON_RADIUS = dip2px(getContext(), COMMON_RADIUS_VALUE); initCircleRadius(); mInPaint.setColor(Color.parseColor(CIRCLE_COLOR_IN)); mInPaint.setAntiAlias(true); mInPaint.setStyle(Paint.Style.FILL); mInStrokePaint.setColor(Color.parseColor(CIRCLE_COLOR_OUT)); mInStrokePaint.setAntiAlias(true); mInStrokePaint.setStyle(Paint.Style.STROKE); mInStrokePaint.setStrokeWidth(dip2px(getContext(), STROKE_WIDTH)); mOutPaint.setColor(Color.parseColor(CIRCLE_COLOR_IN)); mOutPaint.setAntiAlias(true); mOutPaint.setStyle(Paint.Style.FILL); mOutStrokePaint.setColor(Color.parseColor(CIRCLE_COLOR_OUT)); mOutStrokePaint.setAntiAlias(true); mOutStrokePaint.setStyle(Paint.Style.STROKE); mOutStrokePaint.setStrokeWidth(dip2px(getContext(), STROKE_WIDTH)); mOutAlpha = mOutPaint.getAlpha(); mOutStrokeAlpha = mOutStrokePaint.getAlpha(); }
void updatePintrestView() { LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // inflate your activity layout here! sortingArray(); Layout1.removeAllViews(); Layout2.removeAllViews(); for (int i = 0; i < arrDataNote.size(); i++) { View contentView = inflater.inflate(R.layout.notefoldepintrestrow, null, false); TextView textViewSlideMenuName = (TextView) contentView.findViewById(R.id.textViewSlideMenuName); TextView textViewSlideMenuNameSubTitle = (TextView) contentView.findViewById(R.id.textViewSlideMenuNameSubTitle); View layoutsepreter = (View) contentView.findViewById(R.id.layoutsepreter); layoutsepreter.setVisibility(View.VISIBLE); SideMenuitems model = arrDataNote.get(i); textViewSlideMenuName.setText(model.getMenuName()); textViewSlideMenuNameSubTitle.setText(model.getMenuNameDetail()); if (i % 2 == 0) { Layout1.addView(contentView); contentView.setBackgroundColor(Color.parseColor(model.getColours())); } else { Layout2.addView(contentView); contentView.setBackgroundColor(Color.parseColor(model.getColours())); } } }
public int[] getColor() { int key = 9; String colorPrimary; String colorPrimaryDark; settings = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE); editor = settings.edit(); if (!settings.contains("color")) { editor.putInt("color", 0).apply(); } if (settings.getInt("color", 0) == 0) { Random randomColor = new Random(); key = randomColor.nextInt(arrayColorPrimary.length); } else { key = settings.getInt("color", 0) - 1; } colorPrimary = arrayColorPrimary[key]; colorPrimaryDark = arrayColorPrimaryDark[key]; int colorPrimaryAsInt = Color.parseColor(colorPrimary); int colorPrimaryDarkAsInt = Color.parseColor(colorPrimaryDark); return new int[] {colorPrimaryAsInt, colorPrimaryDarkAsInt}; }
@Override protected void onDraw(Canvas canvas) { Log.d("hr123", "MyEditOnDraw"); Paint paint = new Paint(); paint.setStyle(Paint.Style.STROKE); paint.setStrokeWidth(2); if (this.isFocused() == true) { Log.d("hr123", "MyEditOnDrawFocus"); paint.setColor(Color.parseColor("#F0F0F0")); } else { Log.d("hr123", "MyEditOnDrawUnFocus"); paint.setColor(Color.parseColor("#11cd6e")); } canvas.drawRoundRect( new RectF( 2 + this.getScrollX(), 2 + this.getScrollY(), this.getWidth() - 3 + this.getScrollX(), this.getHeight() + this.getScrollY() - 1), 3, 3, paint); super.onDraw(canvas); }
public void onClick(View v) { int selRBColor = ((RadioGroup) findViewById(R.id.rgColor)).getCheckedRadioButtonId(); int color = Color.RED; switch (selRBColor) { case R.id.radioRed: color = Color.parseColor("#66ff0000"); break; case R.id.radioGreen: color = Color.parseColor("#6600ff00"); break; case R.id.radioBlue: color = Color.parseColor("#660000ff"); break; } EditText etText = (EditText) findViewById(R.id.etText); // Записываем значения с экрана в Preferences SharedPreferences sp = getSharedPreferences(WIDGET_PREF, MODE_PRIVATE); Editor editor = sp.edit(); editor.putString(WIDGET_TEXT + widgetID, etText.getText().toString()); editor.putInt(WIDGET_COLOR + widgetID, color); editor.commit(); // necessary AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this); WidgetNextStart.updateWidget(this, appWidgetManager, sp, widgetID); // положительный ответ setResult(RESULT_OK, resultValue); Log.d(LOG_TAG, "finish config " + widgetID); finish(); }
@SuppressLint({"ResourceAsColor", "DefaultLocale"}) public void onGetDataFromDB() { try { txt_eventname.setText(LLDCApplication.selectedModel.getName().toString().toUpperCase()); txt_eventvenue.setText( LLDCApplication.selectedModel.getVenueTitle().toString().toUpperCase()); txt_eventdate.setText(LLDCApplication.selectedModel.getActiveDays().toString().toUpperCase()); String temp = "<p>" + LLDCApplication.selectedModel.getLongDescription() + "</p>"; txt_eventdetails.setText(Html.fromHtml(temp)); txt_eventname.setTextColor(Color.parseColor(LLDCApplication.selectedModel.getColor())); txt_eventvenue.setTextColor(Color.parseColor(LLDCApplication.selectedModel.getColor())); txt_eventdate.setTextColor(Color.parseColor(LLDCApplication.selectedModel.getColor())); try { String szImageUrl = LLDCApplication.selectedModel.getLargeImage(); Log.e("ExplorerAdapter", "szImageUrl::> " + szImageUrl); ImageLoader.getInstance().displayImage(szImageUrl, img_imagedetls); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } CalenderClickBg(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
private void init() { mFrontPointsList = new ArrayList<>(); mBackPointsList = new ArrayList<>(); mFrontPaint = new Paint(); mFrontPaint.setAntiAlias(true); mFrontPaint.setStyle(Paint.Style.FILL); mFrontPaint.setColor(Color.parseColor("#cccc669b")); mBackPaint = new Paint(); mBackPaint.setAntiAlias(true); mBackPaint.setStyle(Paint.Style.FILL); mBackPaint.setColor(Color.parseColor("#4dcc669b")); mOutBorderPaint = new Paint(); mOutBorderPaint.setAntiAlias(true); mOutBorderPaint.setStrokeWidth(OkUtils.dp2px(getContext(), 1)); mOutBorderPaint.setStyle(Paint.Style.STROKE); mOutBorderPaint.setColor(Color.parseColor("#cccc669b")); mWhitePaint = new Paint(); mWhitePaint.setAntiAlias(true); mWhitePaint.setStyle(Paint.Style.FILL); mWhitePaint.setColor(Color.parseColor("#ffffff")); // mOutBorderPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));// // 选择交集去上层图片 mFrontPath = new Path(); mBackPath = new Path(); mOutBorderPath = new Path(); }
@Override public void onClick(View arg0) { int mBtnid = arg0.getId(); switch (mBtnid) { case R.id.MyBottemDoctorBtn: // //设置我们的viewpager跳转那个界面0这个参数和我们的list相关,相当于list里面的下标 mViewPager.setCurrentItem(0); initBottemBtn(); mMyBottemDoctorTxt.setTextColor(Color.parseColor("#FF8C00")); break; case R.id.MyBottemPharmacistBtn: mViewPager.setCurrentItem(1); initBottemBtn(); mMyBottemPharmacistTxt.setTextColor(Color.parseColor("#FF8C00")); break; case R.id.MyBottemFileTransBtn: mViewPager.setCurrentItem(2); initBottemBtn(); mMyBottemFileTransTxt.setTextColor(Color.parseColor("#FF8C00")); break; case R.id.MyBottemSetBtn: mViewPager.setCurrentItem(3); initBottemBtn(); mMyBottemSetTxt.setTextColor(Color.parseColor("#FF8C00")); break; } }
public Axis yAxis() { Axis yAxis = new Axis(); yAxis.setAutoGenerated(false); List<AxisValue> axisValues = new ArrayList<AxisValue>(); // for(int j = 1; j <= 12; j += 1) { // if (doMgdl) { // axisValues.add(new AxisValue(j * 50)); // } else { // axisValues.add(new AxisValue(j*2)); // } // } axisValues.add(new AxisValue(240)); axisValues.add(new AxisValue((int) this.lowMark)); axisValues.add(new AxisValue((int) this.highMark)); yAxis.setValues(axisValues); yAxis.setHasLines(true); yAxis.setLineColor(Color.parseColor("#555555")); yAxis.setMaxLabelChars(5); yAxis.setInside(true); yAxis.setTextSize(axisTextSize); yAxis.setTextColor(Color.parseColor("#8D8D8D")); yAxis.setHasTiltedLabels(true); return yAxis; }
public void bind(Issue issue) { long tempId = issue.getIid(); if (tempId < 1) { tempId = issue.getId(); } title.setText("#" + tempId + ": " + issue.getTitle()); String state = issue.getState(); custom.setText(state); if (state != null && (state.equals("opened") || state.equals("reopened"))) { custom.setTextColor(Color.parseColor("#30C830")); } else if (state != null && (state.equals("closed"))) { custom.setTextColor(Color.parseColor("#FF0000")); } float percent = Repository.displayWidth / 720f; int size = (int) (40f * percent); String assigneeName = "Unassigned"; String assigneeAvatarUrl = "http://www.gravatar.com/avatar/00000000000000000000000000000000?s=" + size; if (issue.getAssignee() != null) { assigneeName = issue.getAssignee().getName(); if (issue.getAssignee().getEmail() != null) assigneeAvatarUrl = Gravatar.init().with(issue.getAssignee().getEmail()).size(size).build(); else if (issue.getAssignee().getAvatarUrl() != null) assigneeAvatarUrl = issue.getAssignee().getAvatarUrl() + "&s=" + size; } summary.setText(assigneeName); Picasso.with(itemView.getContext()).load(assigneeAvatarUrl).into(summary); }
private void resetSelectedDrawerItem(TableRow tr, TextView tv) { if (tr != null && tv != null) { tr.setBackgroundColor(Color.parseColor(getResources().getString(R.color.color_white))); tv.setTextColor(Color.parseColor(getResources().getString(R.color.list_text_color))); switch (tv.getId()) { case R.id.tv_apply: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.apply_icon, 0, 0, 0); break; case R.id.tv_card_services: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.card_details, 0, 0, 0); break; case R.id.tv_learn_more: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.learn_more, 0, 0, 0); break; case R.id.tv_personal_details: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.p_details, 0, 0, 0); break; case R.id.tv_account_details: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.a_details, 0, 0, 0); break; case R.id.tv_contact_us: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.contact_us, 0, 0, 0); break; case R.id.tv_store_locator: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.map_locator, 0, 0, 0); break; case R.id.tv_faq: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.faq, 0, 0, 0); break; default: break; } } }
@Override public void init(Bundle savedInstanceState) { addSlide( AppIntroFragment.newInstance( getString(R.string.appintro_security), getString(R.string.appintro_security_description), R.drawable.ic_security, Color.parseColor("#33394F"))); addSlide( AppIntroFragment.newInstance( getString(R.string.appintro_issues), getString(R.string.appintro_issues_description), R.drawable.ic_bug, Color.parseColor("#33394F"))); addSlide( AppIntroFragment.newInstance( getString(R.string.appintro_antivirus), getString(R.string.appintro_antivirus_description), R.drawable.ic_action_lock_open, Color.parseColor("#33394F"))); addSlide( AppIntroFragment.newInstance( getString(R.string.appintro_sharing), getString(R.string.appintro_sharing_description), R.drawable.ic_file_cloud_upload, Color.parseColor("#33394F"))); showSkipButton(false); showDoneButton(true); }
private void insertarTabs(ViewGroup container) { View padre = (View) container.getParent(); appBar = (AppBarLayout) padre.findViewById(R.id.appbar); pestanas = new TabLayout(getActivity()); pestanas.setTabTextColors(Color.parseColor("#FFFFFF"), Color.parseColor("#FFFFFF")); appBar.addView(pestanas); }
public void isShowOkBt() { if (Bimp.tempSelectBitmap.size() > 0) { okButton.setText( Res.getString("finish") + "(" + Bimp.tempSelectBitmap.size() + "/" + PublicWay.num_campaigner + ")"); preview.setPressed(true); okButton.setPressed(true); preview.setClickable(true); okButton.setClickable(true); okButton.setTextColor(Color.WHITE); preview.setTextColor(Color.WHITE); } else { okButton.setText( Res.getString("finish") + "(" + Bimp.tempSelectBitmap.size() + "/" + PublicWay.num_campaigner + ")"); preview.setPressed(false); preview.setClickable(false); okButton.setPressed(false); okButton.setClickable(false); okButton.setTextColor(Color.parseColor("#E1E0DE")); preview.setTextColor(Color.parseColor("#E1E0DE")); } }
protected void setupToolbar() { Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar ab = getSupportActionBar(); if (ab != null) { ab.setDisplayHomeAsUpEnabled(true); } // Status bar if (Build.VERSION.SDK_INT >= 21) { getWindow().setStatusBarColor(Color.parseColor(mColors[GridActivity.DARK_PRIMARY])); } // Entire bar layout int barColor = Color.parseColor(mColors[GridActivity.PRIMARY]); AppBarLayout barLayout = (AppBarLayout) this.findViewById(R.id.app_bar); if (barLayout != null) { barLayout.setBackgroundColor(barColor); } toolbar.setBackgroundColor(barColor); CollapsingToolbarLayout collapsingToolbarLayout = (CollapsingToolbarLayout) this.findViewById(R.id.toolbar_layout); if (collapsingToolbarLayout != null) { collapsingToolbarLayout.setBackgroundColor(barColor); collapsingToolbarLayout.setContentScrimColor(barColor); } }
public void show() { ButterKnife.inject(this, mDialog); mLevelPreviousButton.setOnClickListener( v -> { mChosenLevel = mChosenLevel - 1; updateDialog(); }); mLevelNextButton.setOnClickListener( v -> { mChosenLevel = mChosenLevel + 1; updateDialog(); }); mLevelConfirmButton.setOnClickListener( v -> { Exercise chosenExercise = mExercise.getSection().getExercises().get(mChosenLevel); RoutineStream.getInstance().setLevel(chosenExercise, mChosenLevel); mDialog.dismiss(); }); mLevelProgressBar.setWheelSize(12); mLevelProgressBar.setProgressColor(Color.parseColor("#009688")); // 00453E mLevelProgressBar.setProgressBackgroundColor(Color.parseColor("#00453E")); updateDialog(); mDialog.show(); }
/** * @param cx Coordenada del centro en el eje X, si se omite se asume 0 * @param cy Coordenada del centro el en eje Y, si se omite se asume 0 * @param rx Radio en el eje X * @param ry Radio en el eje Y * @param rgb Código de color hexadecimal de la forma #FFFFFF * @param brgb Código de color hexadecimal de la forma #FFFFFF para el borde * @param bwidth Grosor del borde del rectángulo. Debe ser 0 para omitir el borde. * @param tr Transformaciones que se aplicarán a la figura */ public BEllipse( float cx, float cy, float rx, float ry, String rgb, String brgb, float bwidth, Transformations tr) { this.tr = tr; this.rectElement = new RectF(cx - rx, cy - ry, 2 * rx, 2 * ry); this.paintBorder = new Paint(); if (bwidth > 0) { this.paintBorder.setStyle(Paint.Style.STROKE); this.paintBorder.setStrokeWidth(bwidth); this.paintBorder.setColor(Color.parseColor(brgb)); this.paintBorder.setAntiAlias(true); } this.paint = new Paint(); this.paint.setColor(Color.parseColor(rgb)); this.paint.setAntiAlias(true); }
@Override public void messageArrived(String topic, MqttMessage mqttMessage) throws Exception { if (topic.equals("Likaci/MqttMap")) { String msg = new String(mqttMessage.getPayload()); JSONObject json = new JSONObject(msg); if (!json.getString("id").equals(id)) { Point p = (Point) GeometryEngine.project( new Point(json.getDouble("x"), json.getDouble("y")), SpatialReference.create(4326), SpatialReference.create(3857)); layer.removeAll(); SimpleMarkerSymbol markerSymbol = new SimpleMarkerSymbol( Color.parseColor("#763382"), 15, SimpleMarkerSymbol.STYLE.DIAMOND); layer.addGraphic(new Graphic(p, markerSymbol)); TextSymbol textSymbol = new TextSymbol( 15, json.getString("id"), Color.parseColor("#763382"), TextSymbol.HorizontalAlignment.CENTER, TextSymbol.VerticalAlignment.MIDDLE); textSymbol.setOffsetY(-15); layer.addGraphic(new Graphic(p, textSymbol)); } } }
/** holo皮肤 */ private void initWheel2() { hourWheelView = (WheelView) findViewById(R.id.hour_wheelview); hourWheelView.setWheelAdapter(new ArrayWheelAdapter(this)); hourWheelView.setSkin(WheelView.Skin.Holo); hourWheelView.setWheelData(createHours()); WheelView.WheelViewStyle style = new WheelView.WheelViewStyle(); style.selectedTextColor = Color.parseColor("#0288ce"); style.textColor = Color.GRAY; style.selectedTextSize = 20; hourWheelView.setStyle(style); hourWheelView.setExtraText("时", Color.parseColor("#0288ce"), 40, 70); minuteWheelView = (WheelView) findViewById(R.id.minute_wheelview); minuteWheelView.setWheelAdapter(new ArrayWheelAdapter(this)); minuteWheelView.setSkin(WheelView.Skin.Holo); minuteWheelView.setWheelData(createMinutes()); minuteWheelView.setStyle(style); minuteWheelView.setExtraText("分", Color.parseColor("#0288ce"), 40, 70); secondWheelView = (WheelView) findViewById(R.id.second_wheelview); secondWheelView.setWheelAdapter(new ArrayWheelAdapter(this)); secondWheelView.setSkin(WheelView.Skin.Holo); secondWheelView.setWheelData(createMinutes()); secondWheelView.setStyle(style); secondWheelView.setExtraText("秒", Color.parseColor("#0288ce"), 40, 70); }
@Override public void onClick(View v) { switch (v.getId()) { case R.id.btn_sprint: initBtn(); viewPager.setCurrentItem(0); btnSpring.setBackgroundResource(R.drawable.wash_btn_press); btnSpring.setTextColor(Color.parseColor("#28ccfc")); break; case R.id.btn_summer: initBtn(); viewPager.setCurrentItem(1); btnSummer.setBackgroundResource(R.drawable.wash_btn_press); btnSummer.setTextColor(Color.parseColor("#28ccfc")); break; case R.id.btn_autumn: initBtn(); viewPager.setCurrentItem(2); btnAutumn.setBackgroundResource(R.drawable.wash_btn_press); btnAutumn.setTextColor(Color.parseColor("#28ccfc")); break; case R.id.btn_winter: initBtn(); viewPager.setCurrentItem(3); btnWinter.setBackgroundResource(R.drawable.wash_btn_press); btnWinter.setTextColor(Color.parseColor("#28ccfc")); break; case R.id.piece_wash_back: /*Intent intent=new Intent(PieceWashMain.this, FragmentMainActivity.class); startActivity(intent);*/ finish(); } }