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:
@@ -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"));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user