summaryrefslogtreecommitdiff
path: root/Source/Android/app/src
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-03-15 03:30:37 -0400
committerCharles Lombardo <clombardo169@gmail.com>2023-03-15 17:35:48 -0400
commit508e56e2bfde9d83c028a61323db01101ee0a0ee (patch)
tree4cf0e80838308f13a7eaec68be79546ee8977aa1 /Source/Android/app/src
parent656d91cd183e52ae768b24f986e688bd3e1cc8f5 (diff)
Android: Convert SettingsFragmentView to Kotlin
Diffstat (limited to 'Source/Android/app/src')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java123
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.kt114
2 files changed, 114 insertions, 123 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java
deleted file mode 100644
index 809f26f7cc..0000000000
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.java
+++ /dev/null
@@ -1,123 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-package org.dolphinemu.dolphinemu.features.settings.ui;
-
-import androidx.annotation.NonNull;
-import androidx.fragment.app.DialogFragment;
-import androidx.fragment.app.FragmentActivity;
-
-import org.dolphinemu.dolphinemu.features.settings.model.Settings;
-import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
-
-import java.util.ArrayList;
-
-/**
- * Abstraction for a screen showing a list of settings. Instances of
- * this type of view will each display a layer of the setting hierarchy.
- */
-public interface SettingsFragmentView
-{
- /**
- * Called by the containing Activity to notify the Fragment that an
- * asynchronous load operation completed.
- *
- * @param settings The (possibly null) result of the ini load operation.
- */
- void onSettingsFileLoaded(Settings settings);
-
- /**
- * Pass an ArrayList of settings to the View so that it can be displayed on screen.
- *
- * @param settingsList The settings to display
- */
- void showSettingsList(ArrayList<SettingsItem> settingsList);
-
- /**
- * Called by the containing Activity when an asynchronous load operation fails.
- * Instructs the Fragment to load the settings screen with defaults selected.
- */
- void loadDefaultSettings();
-
- /**
- * @return The Fragment's containing activity.
- */
- FragmentActivity getActivity();
-
- /**
- * @return The Fragment's SettingsAdapter.
- */
- SettingsAdapter getAdapter();
-
- /**
- * Tell the Fragment to tell the containing Activity to show a new
- * Fragment containing a submenu of settings.
- *
- * @param menuKey Identifier for the settings group that should be shown.
- */
- void loadSubMenu(MenuTag menuKey);
-
- void showDialogFragment(DialogFragment fragment);
-
- /**
- * Tell the Fragment to tell the containing activity to display a toast message.
- *
- * @param message Text to be shown in the Toast
- */
- void showToastMessage(String message);
-
- /**
- * @return The backing settings store.
- */
- Settings getSettings();
-
- /**
- * Have the fragment tell the containing Activity that a setting was modified.
- */
- void onSettingChanged();
-
- /**
- * Refetches the values of all controller settings.
- *
- * To be used when loading an input profile or performing some other action that changes all
- * controller settings at once.
- */
- void onControllerSettingsChanged();
-
- /**
- * Have the fragment tell the containing Activity that the user wants to open the MenuTag
- * associated with a setting.
- *
- * @param menuTag The MenuTag of the setting.
- * @param value The current value of the setting.
- */
- void onMenuTagAction(@NonNull MenuTag menuTag, int value);
-
- /**
- * Returns whether anything will happen when the user wants to open the MenuTag associated with a
- * setting, given the current value of the setting.
- *
- * @param menuTag The MenuTag of the setting.
- * @param value The current value of the setting.
- */
- boolean hasMenuTagActionForValue(@NonNull MenuTag menuTag, int value);
-
- /**
- * Sets whether the input mapping dialog should detect inputs from all devices,
- * not just the device configured for the controller.
- */
- void setMappingAllDevices(boolean allDevices);
-
- /**
- * Returns whether the input mapping dialog should detect inputs from all devices,
- * not just the device configured for the controller.
- */
- boolean isMappingAllDevices();
-
- /**
- * Shows or hides a warning telling the user that they're using incompatible controller settings.
- * The warning is hidden by default.
- *
- * @param visible Whether the warning should be visible.
- */
- void setOldControllerSettingsWarningVisibility(boolean visible);
-}
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.kt
new file mode 100644
index 0000000000..fa861153dd
--- /dev/null
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentView.kt
@@ -0,0 +1,114 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+package org.dolphinemu.dolphinemu.features.settings.ui
+
+import androidx.fragment.app.DialogFragment
+import androidx.fragment.app.FragmentActivity
+import org.dolphinemu.dolphinemu.features.settings.model.Settings
+import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem
+
+/**
+ * Abstraction for a screen showing a list of settings. Instances of
+ * this type of view will each display a layer of the Setting hierarchy.
+ */
+interface SettingsFragmentView {
+ /**
+ * Called by the containing Activity to notify the Fragment that an
+ * asynchronous load operation completed.
+ *
+ * @param settings The (possibly null) result of the ini load operation.
+ */
+ fun onSettingsFileLoaded(settings: Settings)
+
+ /**
+ * Pass an ArrayList of settings to the View so that it can be displayed on screen.
+ *
+ * @param settingsList The settings to display
+ */
+ fun showSettingsList(settingsList: ArrayList<SettingsItem>)
+
+ /**
+ * Called by the containing Activity when an asynchronous load operation fails.
+ * Instructs the Fragment to load the settings screen with defaults selected.
+ */
+ fun loadDefaultSettings()
+
+ /**
+ * @return The Fragment's containing activity.
+ */
+ val fragmentActivity: FragmentActivity
+
+ /**
+ * @return The Fragment's SettingsAdapter.
+ */
+ val adapter: SettingsAdapter?
+
+ /**
+ * Tell the Fragment to tell the containing Activity to show a new
+ * Fragment containing a submenu of settings.
+ *
+ * @param menuKey Identifier for the settings group that should be shown.
+ */
+ fun loadSubMenu(menuKey: MenuTag)
+ fun showDialogFragment(fragment: DialogFragment)
+
+ /**
+ * Tell the Fragment to tell the containing activity to display a toast message.
+ *
+ * @param message Text to be shown in the Toast
+ */
+ fun showToastMessage(message: String)
+
+ /**
+ * @return The backing settings store.
+ */
+ val settings: Settings?
+
+ /**
+ * Have the fragment tell the containing Activity that a Setting was modified.
+ */
+ fun onSettingChanged()
+
+ /**
+ * Refetches the values of all controller settings.
+ *
+ * To be used when loading an input profile or performing some other action that changes all
+ * controller settings at once.
+ */
+ fun onControllerSettingsChanged()
+
+ /**
+ * Have the fragment tell the containing Activity that the user wants to open the MenuTag
+ * associated with a Setting.
+ *
+ * @param menuTag The MenuTag of the Setting.
+ * @param value The current value of the Setting.
+ */
+ fun onMenuTagAction(menuTag: MenuTag, value: Int)
+
+ /**
+ * Returns whether anything will happen when the user wants to open the MenuTag associated with a
+ * stringSetting, given the current value of the Setting.
+ *
+ * @param menuTag The MenuTag of the Setting.
+ * @param value The current value of the Setting.
+ */
+ fun hasMenuTagActionForValue(menuTag: MenuTag, value: Int): Boolean
+ /**
+ * Returns whether the input mapping dialog should detect inputs from all devices,
+ * not just the device configured for the controller.
+ */
+ /**
+ * Sets whether the input mapping dialog should detect inputs from all devices,
+ * not just the device configured for the controller.
+ */
+ var isMappingAllDevices: Boolean
+
+ /**
+ * Shows or hides a warning telling the user that they're using incompatible controller settings.
+ * The warning is hidden by default.
+ *
+ * @param visible Whether the warning should be visible.
+ */
+ fun setOldControllerSettingsWarningVisibility(visible: Boolean)
+}