diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/AbstractCheat.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/AbstractCheat.java index 9a86d58533..2c33ccc616 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/AbstractCheat.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/AbstractCheat.java @@ -9,6 +9,11 @@ public abstract class AbstractCheat implements Cheat { private Runnable mChangedCallback = null; + public boolean supportsCode() + { + return true; + } + public int trySet(@NonNull String name, @NonNull String creator, @NonNull String notes, @NonNull String code) { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/Cheat.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/Cheat.java index 75a3befc6f..142931b9cb 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/Cheat.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/model/Cheat.java @@ -17,6 +17,8 @@ public interface Cheat boolean supportsNotes(); + boolean supportsCode(); + @NonNull String getName(); @@ -33,7 +35,10 @@ public interface Cheat } @NonNull - String getCode(); + default String getCode() + { + return ""; + } int trySet(@NonNull String name, @NonNull String creator, @NonNull String notes, @NonNull String code); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatDetailsFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatDetailsFragment.java index e5a027f64b..9c207996bb 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatDetailsFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatDetailsFragment.java @@ -31,6 +31,7 @@ public class CheatDetailsFragment extends Fragment private EditText mEditCreator; private TextView mLabelNotes; private EditText mEditNotes; + private TextView mLabelCode; private EditText mEditCode; private Button mButtonDelete; private Button mButtonEdit; @@ -59,6 +60,7 @@ public class CheatDetailsFragment extends Fragment mEditCreator = view.findViewById(R.id.edit_creator); mLabelNotes = view.findViewById(R.id.label_notes); mEditNotes = view.findViewById(R.id.edit_notes); + mLabelCode = view.findViewById(R.id.label_code); mEditCode = view.findViewById(R.id.edit_code); mButtonDelete = view.findViewById(R.id.button_delete); mButtonEdit = view.findViewById(R.id.button_edit); @@ -158,10 +160,13 @@ public class CheatDetailsFragment extends Fragment int creatorVisibility = cheat != null && cheat.supportsCreator() ? View.VISIBLE : View.GONE; int notesVisibility = cheat != null && cheat.supportsNotes() ? View.VISIBLE : View.GONE; + int codeVisibility = cheat != null && cheat.supportsCode() ? View.VISIBLE : View.GONE; mLabelCreator.setVisibility(creatorVisibility); mEditCreator.setVisibility(creatorVisibility); mLabelNotes.setVisibility(notesVisibility); mEditNotes.setVisibility(notesVisibility); + mLabelCode.setVisibility(codeVisibility); + mEditCode.setVisibility(codeVisibility); boolean userDefined = cheat != null && cheat.getUserDefined(); mButtonDelete.setEnabled(userDefined);