From 4e0fc6cfe59ac2f2a8ca189da8d9d50699013af5 Mon Sep 17 00:00:00 2001 From: Ryan Meredith Date: Mon, 30 Mar 2020 05:15:50 -0400 Subject: [PATCH] Android: Reduce Submenu height by 25 percent --- .../settings/model/view/SubmenuSetting.java | 5 ++-- .../features/settings/ui/SettingsAdapter.java | 2 +- .../ui/SettingsFragmentPresenter.java | 22 ++++++++-------- .../ui/viewholder/SubmenuViewHolder.java | 9 +------ .../res/layout/list_item_setting_submenu.xml | 25 +++++++++++++++++++ 5 files changed, 40 insertions(+), 23 deletions(-) create mode 100644 Source/Android/app/src/main/res/layout/list_item_setting_submenu.xml diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SubmenuSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SubmenuSetting.java index a8d03d0e76..7492d30ed7 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SubmenuSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SubmenuSetting.java @@ -7,10 +7,9 @@ public final class SubmenuSetting extends SettingsItem { private MenuTag mMenuKey; - public SubmenuSetting(String key, Setting setting, int titleId, int descriptionId, - MenuTag menuKey) + public SubmenuSetting(String key, Setting setting, int titleId, MenuTag menuKey) { - super(key, null, setting, titleId, descriptionId); + super(key, null, setting, titleId, 0); mMenuKey = menuKey; } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java index f11a183626..6b3a39a74c 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsAdapter.java @@ -105,7 +105,7 @@ public final class SettingsAdapter extends RecyclerView.Adapter sl) { - sl.add(new SubmenuSetting(null, null, R.string.general_submenu, 0, MenuTag.CONFIG_GENERAL)); - sl.add(new SubmenuSetting(null, null, R.string.interface_submenu, 0, MenuTag.CONFIG_INTERFACE)); - sl.add(new SubmenuSetting(null, null, R.string.audio_submenu, 0, MenuTag.CONFIG_AUDIO)); - sl.add(new SubmenuSetting(null, null, R.string.paths_submenu, 0, MenuTag.CONFIG_PATHS)); - sl.add(new SubmenuSetting(null, null, R.string.gamecube_submenu, 0, MenuTag.CONFIG_GAME_CUBE)); - sl.add(new SubmenuSetting(null, null, R.string.wii_submenu, 0, MenuTag.CONFIG_WII)); - sl.add(new SubmenuSetting(null, null, R.string.advanced_submenu, 0, MenuTag.CONFIG_ADVANCED)); - sl.add(new SubmenuSetting(null, null, R.string.debug_submenu, 0, MenuTag.DEBUG)); + sl.add(new SubmenuSetting(null, null, R.string.general_submenu, MenuTag.CONFIG_GENERAL)); + sl.add(new SubmenuSetting(null, null, R.string.interface_submenu, MenuTag.CONFIG_INTERFACE)); + sl.add(new SubmenuSetting(null, null, R.string.audio_submenu, MenuTag.CONFIG_AUDIO)); + sl.add(new SubmenuSetting(null, null, R.string.paths_submenu, MenuTag.CONFIG_PATHS)); + sl.add(new SubmenuSetting(null, null, R.string.gamecube_submenu, MenuTag.CONFIG_GAME_CUBE)); + sl.add(new SubmenuSetting(null, null, R.string.wii_submenu, MenuTag.CONFIG_WII)); + sl.add(new SubmenuSetting(null, null, R.string.advanced_submenu, MenuTag.CONFIG_ADVANCED)); + sl.add(new SubmenuSetting(null, null, R.string.debug_submenu, MenuTag.DEBUG)); sl.add(new HeaderSetting(null, null, R.string.gametdb_thanks, 0)); } @@ -499,8 +499,8 @@ public final class SettingsFragmentPresenter R.array.aspectRatioValues, 0, aspectRatio)); sl.add(new HeaderSetting(null, null, R.string.graphics_enhancements_and_hacks, 0)); - sl.add(new SubmenuSetting(null, null, R.string.enhancements_submenu, 0, MenuTag.ENHANCEMENTS)); - sl.add(new SubmenuSetting(null, null, R.string.hacks_submenu, 0, MenuTag.HACKS)); + sl.add(new SubmenuSetting(null, null, R.string.enhancements_submenu, MenuTag.ENHANCEMENTS)); + sl.add(new SubmenuSetting(null, null, R.string.hacks_submenu, MenuTag.HACKS)); } private void addEnhanceSettings(ArrayList sl) @@ -589,7 +589,7 @@ public final class SettingsFragmentPresenter helper.SupportsExtension("GL_ANDROID_extension_pack_es31a"))) { sl.add(new SubmenuSetting(SettingsFile.KEY_STEREO_MODE, null, R.string.stereoscopy_submenu, - R.string.stereoscopy_submenu_description, MenuTag.STEREOSCOPY)); + MenuTag.STEREOSCOPY)); } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SubmenuViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SubmenuViewHolder.java index 5edfb3f50a..746e2e6900 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SubmenuViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SubmenuViewHolder.java @@ -13,7 +13,6 @@ public final class SubmenuViewHolder extends SettingViewHolder private SubmenuSetting mItem; private TextView mTextSettingName; - private TextView mTextSettingDescription; public SubmenuViewHolder(View itemView, SettingsAdapter adapter) { @@ -24,7 +23,6 @@ public final class SubmenuViewHolder extends SettingViewHolder protected void findViews(View root) { mTextSettingName = (TextView) root.findViewById(R.id.text_setting_name); - mTextSettingDescription = (TextView) root.findViewById(R.id.text_setting_description); } @Override @@ -33,11 +31,6 @@ public final class SubmenuViewHolder extends SettingViewHolder mItem = (SubmenuSetting) item; mTextSettingName.setText(item.getNameId()); - - if (item.getDescriptionId() > 0) - { - mTextSettingDescription.setText(item.getDescriptionId()); - } } @Override @@ -45,4 +38,4 @@ public final class SubmenuViewHolder extends SettingViewHolder { getAdapter().onSubmenuClick(mItem); } -} \ No newline at end of file +} diff --git a/Source/Android/app/src/main/res/layout/list_item_setting_submenu.xml b/Source/Android/app/src/main/res/layout/list_item_setting_submenu.xml new file mode 100644 index 0000000000..e640620a3f --- /dev/null +++ b/Source/Android/app/src/main/res/layout/list_item_setting_submenu.xml @@ -0,0 +1,25 @@ + + + + + +