1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-23 08:43:15 +02:00

Compare id instead of item string

This commit is contained in:
Erik Johansson
2018-02-10 07:04:23 +01:00
parent 601dd7e75b
commit 2496667250

View File

@@ -191,15 +191,13 @@ public class DataEntryActivity extends AppCompatActivity {
final Drawable wrapped = DrawableCompat.wrap(drawable.mutate());
String menuTitle = item.getTitle().toString();
if (menuTitle == getResources().getString(R.string.save)) {
if (item.getItemId() == R.id.saveButton) {
DrawableCompat.setTint(wrapped, Color.parseColor("#FFFFFF"));
} else if (menuTitle == getResources().getString(R.string.edit)) {
} else if (item.getItemId() == R.id.editButton) {
DrawableCompat.setTint(wrapped, Color.parseColor("#99CC00"));
} else if (menuTitle == getResources().getString(R.string.toggle_expand)) {
} else if (item.getItemId() == R.id.expandButton) {
DrawableCompat.setTint(wrapped, Color.parseColor("#FFBB33"));
} else if (menuTitle == getResources().getString(R.string.label_delete)) {
} else if (item.getItemId() == R.id.deleteButton) {
DrawableCompat.setTint(wrapped, Color.parseColor("#FF4444"));
}