summaryrefslogtreecommitdiff
path: root/src/android
diff options
context:
space:
mode:
authorGravatar Charles Lombardo2023-03-07 21:15:02 -0500
committerGravatar bunnei2023-06-03 00:05:38 -0700
commitc39bf17f835122bdd1292271aac01498bb43286e (patch)
tree9475ef7e9150b3e80b4160a7225fc707fe82ff51 /src/android
parentandroid: Convert SettingsFragmentPresenter to Kotlin (diff)
downloadyuzu-c39bf17f835122bdd1292271aac01498bb43286e.tar.gz
yuzu-c39bf17f835122bdd1292271aac01498bb43286e.tar.xz
yuzu-c39bf17f835122bdd1292271aac01498bb43286e.zip
android: Convert SettingsFragmentView to Kotlin
Diffstat (limited to 'src/android')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentView.kt (renamed from src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentView.java)33
1 files changed, 15 insertions, 18 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentView.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentView.kt
index 3c1743fab..c4a586329 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentView.java
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentView.kt
@@ -1,25 +1,22 @@
1package org.yuzu.yuzu_emu.features.settings.ui; 1package org.yuzu.yuzu_emu.features.settings.ui
2 2
3import androidx.fragment.app.FragmentActivity; 3import androidx.fragment.app.FragmentActivity
4 4import org.yuzu.yuzu_emu.features.settings.model.Setting
5import org.yuzu.yuzu_emu.features.settings.model.Setting; 5import org.yuzu.yuzu_emu.features.settings.model.Settings
6import org.yuzu.yuzu_emu.features.settings.model.Settings; 6import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem
7import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem;
8
9import java.util.ArrayList;
10 7
11/** 8/**
12 * Abstraction for a screen showing a list of settings. Instances of 9 * Abstraction for a screen showing a list of settings. Instances of
13 * this type of view will each display a layer of the setting hierarchy. 10 * this type of view will each display a layer of the setting hierarchy.
14 */ 11 */
15public interface SettingsFragmentView { 12interface SettingsFragmentView {
16 /** 13 /**
17 * Called by the containing Activity to notify the Fragment that an 14 * Called by the containing Activity to notify the Fragment that an
18 * asynchronous load operation completed. 15 * asynchronous load operation completed.
19 * 16 *
20 * @param settings The (possibly null) result of the ini load operation. 17 * @param settings The (possibly null) result of the ini load operation.
21 */ 18 */
22 void onSettingsFileLoaded(Settings settings); 19 fun onSettingsFileLoaded(settings: Settings?)
23 20
24 /** 21 /**
25 * Pass a settings HashMap to the containing activity, so that it can 22 * Pass a settings HashMap to the containing activity, so that it can
@@ -28,25 +25,25 @@ public interface SettingsFragmentView {
28 * 25 *
29 * @param settings An ArrayList containing all the settings HashMaps. 26 * @param settings An ArrayList containing all the settings HashMaps.
30 */ 27 */
31 void passSettingsToActivity(Settings settings); 28 fun passSettingsToActivity(settings: Settings)
32 29
33 /** 30 /**
34 * Pass an ArrayList to the View so that it can be displayed on screen. 31 * Pass an ArrayList to the View so that it can be displayed on screen.
35 * 32 *
36 * @param settingsList The result of converting the HashMap to an ArrayList 33 * @param settingsList The result of converting the HashMap to an ArrayList
37 */ 34 */
38 void showSettingsList(ArrayList<SettingsItem> settingsList); 35 fun showSettingsList(settingsList: ArrayList<SettingsItem>)
39 36
40 /** 37 /**
41 * Called by the containing Activity when an asynchronous load operation fails. 38 * Called by the containing Activity when an asynchronous load operation fails.
42 * Instructs the Fragment to load the settings screen with defaults selected. 39 * Instructs the Fragment to load the settings screen with defaults selected.
43 */ 40 */
44 void loadDefaultSettings(); 41 fun loadDefaultSettings()
45 42
46 /** 43 /**
47 * @return The Fragment's containing activity. 44 * @return The Fragment's containing activity.
48 */ 45 */
49 FragmentActivity getActivity(); 46 val fragmentActivity: FragmentActivity
50 47
51 /** 48 /**
52 * Tell the Fragment to tell the containing Activity to show a new 49 * Tell the Fragment to tell the containing Activity to show a new
@@ -54,7 +51,7 @@ public interface SettingsFragmentView {
54 * 51 *
55 * @param menuKey Identifier for the settings group that should be shown. 52 * @param menuKey Identifier for the settings group that should be shown.
56 */ 53 */
57 void loadSubMenu(String menuKey); 54 fun loadSubMenu(menuKey: String)
58 55
59 /** 56 /**
60 * Tell the Fragment to tell the containing activity to display a toast message. 57 * Tell the Fragment to tell the containing activity to display a toast message.
@@ -62,17 +59,17 @@ public interface SettingsFragmentView {
62 * @param message Text to be shown in the Toast 59 * @param message Text to be shown in the Toast
63 * @param is_long Whether this should be a long Toast or short one. 60 * @param is_long Whether this should be a long Toast or short one.
64 */ 61 */
65 void showToastMessage(String message, boolean is_long); 62 fun showToastMessage(message: String?, is_long: Boolean)
66 63
67 /** 64 /**
68 * Have the fragment add a setting to the HashMap. 65 * Have the fragment add a setting to the HashMap.
69 * 66 *
70 * @param setting The (possibly previously missing) new setting. 67 * @param setting The (possibly previously missing) new setting.
71 */ 68 */
72 void putSetting(Setting setting); 69 fun putSetting(setting: Setting)
73 70
74 /** 71 /**
75 * Have the fragment tell the containing Activity that a setting was modified. 72 * Have the fragment tell the containing Activity that a setting was modified.
76 */ 73 */
77 void onSettingChanged(); 74 fun onSettingChanged()
78} 75}