@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Pin other = (Pin) obj; if (configuredAction != other.configuredAction) return false; if (view == null) { if (other.view != null) return false; } else if (!view.equals(other.view)) return false; return true; }
private boolean setCurrentBtn(TextView btn) { if (currentBtn == null) { currentBtn = btn; } else if (currentBtn.equals(btn)) { return false; } else { currentBtn.setTextColor(Color.rgb(208, 190, 185)); currentBtn.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); } Drawable myImage = getResources().getDrawable(R.drawable.select_icon); btn.setTextColor(Color.rgb(255, 255, 255)); btn.setCompoundDrawablesWithIntrinsicBounds(null, null, null, myImage); currentBtn = btn; return true; }
private void setSelectedDrawerItem(TableRow tr, TextView tv) { tr.setBackgroundColor( Color.parseColor(getResources().getString(R.color.list_background_pressed))); tv.setTextColor(Color.parseColor(getResources().getString(R.color.color_action_bar))); switch (tv.getId()) { case R.id.tv_apply: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.apply_icon_highlighted, 0, 0, 0); break; case R.id.tv_card_services: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.card_details_highlighted, 0, 0, 0); break; case R.id.tv_learn_more: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.learn_more_higlighted, 0, 0, 0); break; case R.id.tv_personal_details: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.p_details_highlighted, 0, 0, 0); break; case R.id.tv_account_details: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.a_details_highlighted, 0, 0, 0); break; case R.id.tv_contact_us: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.contact_us_highlighted, 0, 0, 0); break; case R.id.tv_store_locator: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.map_locator_highlighted, 0, 0, 0); break; case R.id.tv_faq: tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.faq_highlighted, 0, 0, 0); break; default: break; } if (tr != null && !tr.equals(highlightedTableRow) && tv != null && !tv.equals(highlightedTextView)) { resetSelectedDrawerItem(highlightedTableRow, highlightedTextView); highlightedTableRow = tr; highlightedTextView = tv; } }