From 252af9c1bdba7c74acb688aa9aa3b308ec85bead Mon Sep 17 00:00:00 2001 From: Mike Harris Date: Mon, 25 Sep 2017 22:20:52 -0700 Subject: [PATCH 1/4] Remove the debug strings.xml definition of application_id. This is handled by gradle, we don't need a separate strings.xml for debug. --- Source/Android/app/src/debug/res/values/strings.xml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 Source/Android/app/src/debug/res/values/strings.xml diff --git a/Source/Android/app/src/debug/res/values/strings.xml b/Source/Android/app/src/debug/res/values/strings.xml deleted file mode 100644 index 8048c21d75..0000000000 --- a/Source/Android/app/src/debug/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - org.dolphinemu.dolphinemu.debug - \ No newline at end of file From 96525cbaaa8bf33b1cb3913492d6ca830d0183e8 Mon Sep 17 00:00:00 2001 From: Mike Harris Date: Mon, 25 Sep 2017 22:47:52 -0700 Subject: [PATCH 2/4] Remove unused FRAGMENT_TAG, and move the fragment's layout ID inline. FRAGMENT_ID wasn't actually the fragment's ID (that's misleading, and sounds like the tag). It's actually the layout resource ID. There's no point in making that a static constant. --- .../org/dolphinemu/dolphinemu/fragments/MenuFragment.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java index 236ed89228..2ab3e0ba6a 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/MenuFragment.java @@ -11,14 +11,11 @@ import android.widget.Button; import android.widget.LinearLayout; import android.widget.TextView; -import org.dolphinemu.dolphinemu.BuildConfig; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.activities.EmulationActivity; public final class MenuFragment extends Fragment implements View.OnClickListener { - public static final String FRAGMENT_TAG = BuildConfig.APPLICATION_ID + ".ingame_menu"; - public static final int FRAGMENT_ID = R.layout.fragment_ingame_menu; private TextView mTitleText; private static SparseIntArray buttonsActionsMap = new SparseIntArray(); static { @@ -35,7 +32,7 @@ public final class MenuFragment extends Fragment implements View.OnClickListener @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View rootView = inflater.inflate(FRAGMENT_ID, container, false); + View rootView = inflater.inflate(R.layout.fragment_ingame_menu, container, false); LinearLayout options = (LinearLayout) rootView.findViewById(R.id.layout_options); for (int childIndex = 0; childIndex < options.getChildCount(); childIndex++) From ab90a3029d09116da068bfb3c67276807397fbf8 Mon Sep 17 00:00:00 2001 From: Mike Harris Date: Mon, 25 Sep 2017 23:02:54 -0700 Subject: [PATCH 3/4] Move Save/LoadFragment's layout ID inline and private. Fix the hack of using the layout resource ID as a save/load ID, and instead use a proper enum. --- .../dolphinemu/activities/EmulationActivity.java | 15 ++++++++++----- .../dolphinemu/fragments/LoadStateFragment.java | 3 +-- .../dolphinemu/fragments/SaveStateFragment.java | 3 +-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java index 10e803bc19..74c0eab9cb 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/EmulationActivity.java @@ -72,6 +72,11 @@ public final class EmulationActivity extends AppCompatActivity private static boolean mIsGameCubeGame; + private enum MenuType + { + SAVE, LOAD + } + /** * Handlers are a way to pass a message to an Activity telling it to do something * on the UI thread. This Handler responds to any message, even blank ones, by @@ -522,14 +527,14 @@ public final class EmulationActivity extends AppCompatActivity case MENU_ACTION_SAVE_ROOT: if (!mDeviceHasTouchScreen) { - showMenu(SaveStateFragment.FRAGMENT_ID); + showMenu(MenuType.SAVE); } return; case MENU_ACTION_LOAD_ROOT: if (!mDeviceHasTouchScreen) { - showMenu(LoadStateFragment.FRAGMENT_ID); + showMenu(MenuType.LOAD); } return; @@ -862,18 +867,18 @@ public final class EmulationActivity extends AppCompatActivity }); } - private void showMenu(int menuId) + private void showMenu(MenuType menuId) { Fragment fragment; switch (menuId) { - case SaveStateFragment.FRAGMENT_ID: + case SAVE: fragment = SaveStateFragment.newInstance(); mSubmenuFragmentTag = SaveStateFragment.FRAGMENT_TAG; break; - case LoadStateFragment.FRAGMENT_ID: + case LOAD: fragment = LoadStateFragment.newInstance(); mSubmenuFragmentTag = LoadStateFragment.FRAGMENT_TAG; break; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/LoadStateFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/LoadStateFragment.java index 95d5df94f5..894a4f76d3 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/LoadStateFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/LoadStateFragment.java @@ -17,7 +17,6 @@ import org.dolphinemu.dolphinemu.activities.EmulationActivity; public final class LoadStateFragment extends Fragment implements View.OnClickListener { public static final String FRAGMENT_TAG = BuildConfig.APPLICATION_ID + ".load_state"; - public static final int FRAGMENT_ID = R.layout.fragment_state_load; private static SparseIntArray buttonsActionsMap = new SparseIntArray(); static { @@ -42,7 +41,7 @@ public final class LoadStateFragment extends Fragment implements View.OnClickLis @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View rootView = inflater.inflate(FRAGMENT_ID, container, false); + View rootView = inflater.inflate(R.layout.fragment_state_load, container, false); GridLayout grid = (GridLayout) rootView.findViewById(R.id.grid_state_slots); for (int childIndex = 0; childIndex < grid.getChildCount(); childIndex++) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveStateFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveStateFragment.java index f6d9482ebf..1d04b03a59 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveStateFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveStateFragment.java @@ -17,7 +17,6 @@ import org.dolphinemu.dolphinemu.activities.EmulationActivity; public final class SaveStateFragment extends Fragment implements View.OnClickListener { public static final String FRAGMENT_TAG = BuildConfig.APPLICATION_ID + ".save_state"; - public static final int FRAGMENT_ID = R.layout.fragment_state_save; private static SparseIntArray buttonsActionsMap = new SparseIntArray(); static { @@ -42,7 +41,7 @@ public final class SaveStateFragment extends Fragment implements View.OnClickLis @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View rootView = inflater.inflate(FRAGMENT_ID, container, false); + View rootView = inflater.inflate(R.layout.fragment_state_save, container, false); GridLayout grid = (GridLayout) rootView.findViewById(R.id.grid_state_slots); for (int childIndex = 0; childIndex < grid.getChildCount(); childIndex++) From 7db88e831eb1394dd3215ea2a4e518d596b90c96 Mon Sep 17 00:00:00 2001 From: Mike Harris Date: Mon, 25 Sep 2017 23:13:37 -0700 Subject: [PATCH 4/4] Remove prefix of tag, args and keys with packagename. Prefixing everything with a constant packagename is not needed for internal keys, and just adds complexity. Rename ARGUMENT_ prefix to ARG_ to match (most) of the rest of the codebase. Restrict visiblity of above as much as possible. --- .../activities/AddDirectoryActivity.java | 3 +- .../dolphinemu/dialogs/GameDetailsDialog.java | 41 +++++++++---------- .../fragments/EmulationFragment.java | 9 ++-- .../fragments/LoadStateFragment.java | 3 +- .../fragments/SaveStateFragment.java | 3 +- .../ui/platform/PlatformGamesFragment.java | 3 +- .../ui/settings/SettingsActivity.java | 13 +++--- .../settings/SettingsActivityPresenter.java | 9 ++-- .../ui/settings/SettingsFragment.java | 7 +--- 9 files changed, 39 insertions(+), 52 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/AddDirectoryActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/AddDirectoryActivity.java index 7751844bbb..45e1f87ca9 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/AddDirectoryActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/activities/AddDirectoryActivity.java @@ -15,7 +15,6 @@ import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; -import org.dolphinemu.dolphinemu.BuildConfig; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.adapters.FileAdapter; import org.dolphinemu.dolphinemu.model.GameDatabase; @@ -28,7 +27,7 @@ import org.dolphinemu.dolphinemu.ui.main.MainPresenter; */ public class AddDirectoryActivity extends AppCompatActivity implements FileAdapter.FileClickListener { - public static final String KEY_CURRENT_PATH = BuildConfig.APPLICATION_ID + ".path"; + private static final String KEY_CURRENT_PATH = "path"; private FileAdapter mAdapter; private Toolbar mToolbar; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java index 5b351478d2..f67ac0c442 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/dialogs/GameDetailsDialog.java @@ -12,7 +12,6 @@ import android.widget.TextView; import com.squareup.picasso.Picasso; -import org.dolphinemu.dolphinemu.BuildConfig; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.activities.EmulationActivity; @@ -20,12 +19,12 @@ import de.hdodenhof.circleimageview.CircleImageView; public final class GameDetailsDialog extends DialogFragment { - public static final String ARGUMENT_GAME_TITLE = BuildConfig.APPLICATION_ID + ".game_title"; - public static final String ARGUMENT_GAME_DESCRIPTION = BuildConfig.APPLICATION_ID + ".game_description"; - public static final String ARGUMENT_GAME_COUNTRY = BuildConfig.APPLICATION_ID + ".game_country"; - public static final String ARGUMENT_GAME_DATE = BuildConfig.APPLICATION_ID + ".game_date"; - public static final String ARGUMENT_GAME_PATH = BuildConfig.APPLICATION_ID + ".game_path"; - public static final String ARGUMENT_GAME_SCREENSHOT_PATH = BuildConfig.APPLICATION_ID + ".game_screenshot_path"; + private static final String ARG_GAME_TITLE = "game_title"; + private static final String ARG_GAME_DESCRIPTION = "game_description"; + private static final String ARG_GAME_COUNTRY = "game_country"; + private static final String ARG_GAME_DATE = "game_date"; + private static final String ARG_GAME_PATH = "game_path"; + private static final String ARG_GAME_SCREENSHOT_PATH = "game_screenshot_path"; // TODO Add all of this to the Loader in GameActivity.java public static GameDetailsDialog newInstance(String title, String description, int country, String company, String path, String screenshotPath) @@ -33,12 +32,12 @@ public final class GameDetailsDialog extends DialogFragment GameDetailsDialog fragment = new GameDetailsDialog(); Bundle arguments = new Bundle(); - arguments.putString(ARGUMENT_GAME_TITLE, title); - arguments.putString(ARGUMENT_GAME_DESCRIPTION, description); - arguments.putInt(ARGUMENT_GAME_COUNTRY, country); - arguments.putString(ARGUMENT_GAME_DATE, company); - arguments.putString(ARGUMENT_GAME_PATH, path); - arguments.putString(ARGUMENT_GAME_SCREENSHOT_PATH, screenshotPath); + arguments.putString(ARG_GAME_TITLE, title); + arguments.putString(ARG_GAME_DESCRIPTION, description); + arguments.putInt(ARG_GAME_COUNTRY, country); + arguments.putString(ARG_GAME_DATE, company); + arguments.putString(ARG_GAME_PATH, path); + arguments.putString(ARG_GAME_SCREENSHOT_PATH, screenshotPath); fragment.setArguments(arguments); return fragment; @@ -61,13 +60,13 @@ public final class GameDetailsDialog extends DialogFragment FloatingActionButton buttonLaunch = (FloatingActionButton) contents.findViewById(R.id.button_launch); - int countryIndex = getArguments().getInt(ARGUMENT_GAME_COUNTRY); + int countryIndex = getArguments().getInt(ARG_GAME_COUNTRY); String country = getResources().getStringArray(R.array.countryNames)[countryIndex]; - textTitle.setText(getArguments().getString(ARGUMENT_GAME_TITLE)); - textDescription.setText(getArguments().getString(ARGUMENT_GAME_DESCRIPTION)); + textTitle.setText(getArguments().getString(ARG_GAME_TITLE)); + textDescription.setText(getArguments().getString(ARG_GAME_DESCRIPTION)); textCountry.setText(country); - textDate.setText(getArguments().getString(ARGUMENT_GAME_DATE)); + textDate.setText(getArguments().getString(ARG_GAME_DATE)); buttonLaunch.setOnClickListener(new View.OnClickListener() { @@ -76,9 +75,9 @@ public final class GameDetailsDialog extends DialogFragment { // Start the emulation activity and send the path of the clicked ROM to it. EmulationActivity.launch(getActivity(), - getArguments().getString(ARGUMENT_GAME_PATH), - getArguments().getString(ARGUMENT_GAME_TITLE), - getArguments().getString(ARGUMENT_GAME_SCREENSHOT_PATH), + getArguments().getString(ARG_GAME_PATH), + getArguments().getString(ARG_GAME_TITLE), + getArguments().getString(ARG_GAME_SCREENSHOT_PATH), -1, imageGameScreen); } @@ -86,7 +85,7 @@ public final class GameDetailsDialog extends DialogFragment // Fill in the view contents. Picasso.with(imageGameScreen.getContext()) - .load(getArguments().getString(ARGUMENT_GAME_SCREENSHOT_PATH)) + .load(getArguments().getString(ARG_GAME_SCREENSHOT_PATH)) .fit() .centerCrop() .noFade() diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java index 5bf1a7d677..94d411a78d 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/EmulationFragment.java @@ -12,7 +12,6 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; -import org.dolphinemu.dolphinemu.BuildConfig; import org.dolphinemu.dolphinemu.NativeLibrary; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.overlay.InputOverlay; @@ -20,9 +19,9 @@ import org.dolphinemu.dolphinemu.utils.Log; public final class EmulationFragment extends Fragment implements SurfaceHolder.Callback { - public static final String FRAGMENT_TAG = BuildConfig.APPLICATION_ID + ".emulation_fragment"; + public static final String FRAGMENT_TAG = "emulation_fragment"; - private static final String ARGUMENT_GAME_PATH = BuildConfig.APPLICATION_ID + ".game_path"; + private static final String ARG_GAME_PATH = "game_path"; private SharedPreferences mPreferences; @@ -40,7 +39,7 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C EmulationFragment fragment = new EmulationFragment(); Bundle arguments = new Bundle(); - arguments.putString(ARGUMENT_GAME_PATH, path); + arguments.putString(ARG_GAME_PATH, path); fragment.setArguments(arguments); return fragment; @@ -238,7 +237,7 @@ public final class EmulationFragment extends Fragment implements SurfaceHolder.C Log.info("[EmulationFragment] Starting emulation: " + mSurface); // Start emulation using the provided Surface. - String path = getArguments().getString(ARGUMENT_GAME_PATH); + String path = getArguments().getString(ARG_GAME_PATH); NativeLibrary.Run(path); } }; diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/LoadStateFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/LoadStateFragment.java index 894a4f76d3..41b24f929a 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/LoadStateFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/LoadStateFragment.java @@ -10,13 +10,12 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.GridLayout; -import org.dolphinemu.dolphinemu.BuildConfig; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.activities.EmulationActivity; public final class LoadStateFragment extends Fragment implements View.OnClickListener { - public static final String FRAGMENT_TAG = BuildConfig.APPLICATION_ID + ".load_state"; + public static final String FRAGMENT_TAG = "load_state"; private static SparseIntArray buttonsActionsMap = new SparseIntArray(); static { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveStateFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveStateFragment.java index 1d04b03a59..b0ae7d9818 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveStateFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/fragments/SaveStateFragment.java @@ -10,13 +10,12 @@ import android.view.ViewGroup; import android.widget.Button; import android.widget.GridLayout; -import org.dolphinemu.dolphinemu.BuildConfig; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.activities.EmulationActivity; public final class SaveStateFragment extends Fragment implements View.OnClickListener { - public static final String FRAGMENT_TAG = BuildConfig.APPLICATION_ID + ".save_state"; + public static final String FRAGMENT_TAG = "save_state"; private static SparseIntArray buttonsActionsMap = new SparseIntArray(); static { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java index 563d110675..ec6d55db5f 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/platform/PlatformGamesFragment.java @@ -10,13 +10,12 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import org.dolphinemu.dolphinemu.BuildConfig; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.adapters.GameAdapter; public final class PlatformGamesFragment extends Fragment implements PlatformGamesView { - private static final String ARG_PLATFORM = BuildConfig.APPLICATION_ID + ".PLATFORM"; + private static final String ARG_PLATFORM = "platform"; private PlatformGamesPresenter mPresenter = new PlatformGamesPresenter(this); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsActivity.java index 5f320e86df..c5b12165ff 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsActivity.java @@ -10,7 +10,6 @@ import android.view.MenuInflater; import android.view.MenuItem; import android.widget.Toast; -import org.dolphinemu.dolphinemu.BuildConfig; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.model.settings.SettingSection; @@ -19,6 +18,8 @@ import java.util.HashMap; public final class SettingsActivity extends AppCompatActivity implements SettingsActivityView { + private static final String ARG_FILE_NAME = "file_name"; + private static final String FRAGMENT_TAG = "settings"; private SettingsActivityPresenter mPresenter = new SettingsActivityPresenter(this); @Override @@ -29,7 +30,7 @@ public final class SettingsActivity extends AppCompatActivity implements Setting setContentView(R.layout.activity_settings); Intent launcher = getIntent(); - String filename = launcher.getStringExtra(ARGUMENT_FILE_NAME); + String filename = launcher.getStringExtra(ARG_FILE_NAME); mPresenter.onCreate(savedInstanceState, filename); } @@ -93,7 +94,7 @@ public final class SettingsActivity extends AppCompatActivity implements Setting transaction.addToBackStack(null); mPresenter.addToStack(); } - transaction.replace(R.id.frame_content, SettingsFragment.newInstance(menuTag), SettingsFragment.FRAGMENT_TAG); + transaction.replace(R.id.frame_content, SettingsFragment.newInstance(menuTag), FRAGMENT_TAG); transaction.commit(); } @@ -170,16 +171,14 @@ public final class SettingsActivity extends AppCompatActivity implements Setting private SettingsFragment getFragment() { - return (SettingsFragment) getFragmentManager().findFragmentByTag(SettingsFragment.FRAGMENT_TAG); + return (SettingsFragment) getFragmentManager().findFragmentByTag(FRAGMENT_TAG); } - public static final String ARGUMENT_FILE_NAME = BuildConfig.APPLICATION_ID + ".file_name"; - public static void launch(Context context, String menuTag) { Intent settings = new Intent(context, SettingsActivity.class); - settings.putExtra(ARGUMENT_FILE_NAME, menuTag); + settings.putExtra(ARG_FILE_NAME, menuTag); context.startActivity(settings); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsActivityPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsActivityPresenter.java index f78e37098b..9e68c00d20 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsActivityPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsActivityPresenter.java @@ -2,9 +2,6 @@ package org.dolphinemu.dolphinemu.ui.settings; import android.os.Bundle; -import org.dolphinemu.dolphinemu.BuildConfig; -import org.dolphinemu.dolphinemu.DolphinApplication; -import org.dolphinemu.dolphinemu.NativeLibrary; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.model.settings.SettingSection; import org.dolphinemu.dolphinemu.utils.Log; @@ -15,7 +12,7 @@ import java.util.HashMap; public final class SettingsActivityPresenter { - private static final String SHOULD_SAVE = BuildConfig.APPLICATION_ID + ".should_save"; + private static final String KEY_SHOULD_SAVE = "should_save"; private SettingsActivityView mView; @@ -43,7 +40,7 @@ public final class SettingsActivityPresenter } else { - mShouldSave = savedInstanceState.getBoolean(SHOULD_SAVE); + mShouldSave = savedInstanceState.getBoolean(KEY_SHOULD_SAVE); } } @@ -106,7 +103,7 @@ public final class SettingsActivityPresenter public void saveState(Bundle outState) { - outState.putBoolean(SHOULD_SAVE, mShouldSave); + outState.putBoolean(KEY_SHOULD_SAVE, mShouldSave); } public void onGcPadSettingChanged(String key, int value) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragment.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragment.java index d8c3d7cc81..19433dc2a5 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragment.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragment.java @@ -11,7 +11,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import org.dolphinemu.dolphinemu.BuildConfig; import org.dolphinemu.dolphinemu.R; import org.dolphinemu.dolphinemu.model.settings.Setting; import org.dolphinemu.dolphinemu.model.settings.SettingSection; @@ -24,6 +23,8 @@ import java.util.HashMap; public final class SettingsFragment extends Fragment implements SettingsFragmentView { + private static final String ARGUMENT_MENU_TAG = "menu_tag"; + private SettingsFragmentPresenter mPresenter = new SettingsFragmentPresenter(this); private SettingsActivityView mActivity; @@ -174,10 +175,6 @@ public final class SettingsFragment extends Fragment implements SettingsFragment mActivity.onExtensionSettingChanged(key, value); } - public static final String FRAGMENT_TAG = BuildConfig.APPLICATION_ID + ".fragment.settings"; - - public static final String ARGUMENT_MENU_TAG = FRAGMENT_TAG + ".menu_tag"; - public static Fragment newInstance(String menuTag) { SettingsFragment fragment = new SettingsFragment();