diff options
| author | 2023-03-07 21:14:19 -0500 | |
|---|---|---|
| committer | 2023-06-03 00:05:37 -0700 | |
| commit | 469f0ec019752b041262acb6c704f0a822bbac65 (patch) | |
| tree | 0d90c0707185a5daf807e32e84ebdff4d90cd4cc /src/android | |
| parent | android: Convert SettingsActivityPresenter to Kotlin (diff) | |
| download | yuzu-469f0ec019752b041262acb6c704f0a822bbac65.tar.gz yuzu-469f0ec019752b041262acb6c704f0a822bbac65.tar.xz yuzu-469f0ec019752b041262acb6c704f0a822bbac65.zip | |
android: Convert SettingsActivityView to Kotlin
Diffstat (limited to 'src/android')
| -rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityView.kt (renamed from src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityView.java) | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityView.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityView.kt index 58ccf31b7..5a5c5d9cf 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityView.java +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivityView.kt | |||
| @@ -1,21 +1,20 @@ | |||
| 1 | package org.yuzu.yuzu_emu.features.settings.ui; | 1 | package org.yuzu.yuzu_emu.features.settings.ui |
| 2 | 2 | ||
| 3 | import android.content.IntentFilter; | 3 | import android.content.IntentFilter |
| 4 | 4 | import org.yuzu.yuzu_emu.features.settings.model.Settings | |
| 5 | import org.yuzu.yuzu_emu.features.settings.model.Settings; | 5 | import org.yuzu.yuzu_emu.utils.DirectoryStateReceiver |
| 6 | import org.yuzu.yuzu_emu.utils.DirectoryStateReceiver; | ||
| 7 | 6 | ||
| 8 | /** | 7 | /** |
| 9 | * Abstraction for the Activity that manages SettingsFragments. | 8 | * Abstraction for the Activity that manages SettingsFragments. |
| 10 | */ | 9 | */ |
| 11 | public interface SettingsActivityView { | 10 | interface SettingsActivityView { |
| 12 | /** | 11 | /** |
| 13 | * Show a new SettingsFragment. | 12 | * Show a new SettingsFragment. |
| 14 | * | 13 | * |
| 15 | * @param menuTag Identifier for the settings group that should be displayed. | 14 | * @param menuTag Identifier for the settings group that should be displayed. |
| 16 | * @param addToStack Whether or not this fragment should replace a previous one. | 15 | * @param addToStack Whether or not this fragment should replace a previous one. |
| 17 | */ | 16 | */ |
| 18 | void showSettingsFragment(String menuTag, boolean addToStack, String gameId); | 17 | fun showSettingsFragment(menuTag: String, addToStack: Boolean, gameId: String) |
| 19 | 18 | ||
| 20 | /** | 19 | /** |
| 21 | * Called by a contained Fragment to get access to the Setting HashMap | 20 | * Called by a contained Fragment to get access to the Setting HashMap |
| @@ -24,28 +23,19 @@ public interface SettingsActivityView { | |||
| 24 | * | 23 | * |
| 25 | * @return A possibly null HashMap of Settings. | 24 | * @return A possibly null HashMap of Settings. |
| 26 | */ | 25 | */ |
| 27 | Settings getSettings(); | 26 | var settings: Settings? |
| 28 | |||
| 29 | /** | ||
| 30 | * Used to provide the Activity with Settings HashMaps if a Fragment already | ||
| 31 | * has one; for example, if a rotation occurs, the Fragment will not be killed, | ||
| 32 | * but the Activity will, so the Activity needs to have its HashMaps resupplied. | ||
| 33 | * | ||
| 34 | * @param settings The ArrayList of all the Settings HashMaps. | ||
| 35 | */ | ||
| 36 | void setSettings(Settings settings); | ||
| 37 | 27 | ||
| 38 | /** | 28 | /** |
| 39 | * Called when an asynchronous load operation completes. | 29 | * Called when an asynchronous load operation completes. |
| 40 | * | 30 | * |
| 41 | * @param settings The (possibly null) result of the ini load operation. | 31 | * @param settings The (possibly null) result of the ini load operation. |
| 42 | */ | 32 | */ |
| 43 | void onSettingsFileLoaded(Settings settings); | 33 | fun onSettingsFileLoaded(settings: Settings?) |
| 44 | 34 | ||
| 45 | /** | 35 | /** |
| 46 | * Called when an asynchronous load operation fails. | 36 | * Called when an asynchronous load operation fails. |
| 47 | */ | 37 | */ |
| 48 | void onSettingsFileNotFound(); | 38 | fun onSettingsFileNotFound() |
| 49 | 39 | ||
| 50 | /** | 40 | /** |
| 51 | * Display a popup text message on screen. | 41 | * Display a popup text message on screen. |
| @@ -53,33 +43,33 @@ public interface SettingsActivityView { | |||
| 53 | * @param message The contents of the onscreen message. | 43 | * @param message The contents of the onscreen message. |
| 54 | * @param is_long Whether this should be a long Toast or short one. | 44 | * @param is_long Whether this should be a long Toast or short one. |
| 55 | */ | 45 | */ |
| 56 | void showToastMessage(String message, boolean is_long); | 46 | fun showToastMessage(message: String, is_long: Boolean) |
| 57 | 47 | ||
| 58 | /** | 48 | /** |
| 59 | * End the activity. | 49 | * End the activity. |
| 60 | */ | 50 | */ |
| 61 | void finish(); | 51 | fun finish() |
| 62 | 52 | ||
| 63 | /** | 53 | /** |
| 64 | * Called by a containing Fragment to tell the Activity that a setting was changed; | 54 | * Called by a containing Fragment to tell the Activity that a setting was changed; |
| 65 | * unless this has been called, the Activity will not save to disk. | 55 | * unless this has been called, the Activity will not save to disk. |
| 66 | */ | 56 | */ |
| 67 | void onSettingChanged(); | 57 | fun onSettingChanged() |
| 68 | 58 | ||
| 69 | /** | 59 | /** |
| 70 | * Show loading dialog while loading the settings | 60 | * Show loading dialog while loading the settings |
| 71 | */ | 61 | */ |
| 72 | void showLoading(); | 62 | fun showLoading() |
| 73 | 63 | ||
| 74 | /** | 64 | /** |
| 75 | * Hide the loading the dialog | 65 | * Hide the loading the dialog |
| 76 | */ | 66 | */ |
| 77 | void hideLoading(); | 67 | fun hideLoading() |
| 78 | 68 | ||
| 79 | /** | 69 | /** |
| 80 | * Show a hint to the user that the app needs the external storage to be mounted | 70 | * Show a hint to the user that the app needs the external storage to be mounted |
| 81 | */ | 71 | */ |
| 82 | void showExternalStorageNotMountedHint(); | 72 | fun showExternalStorageNotMountedHint() |
| 83 | 73 | ||
| 84 | /** | 74 | /** |
| 85 | * Start the DirectoryInitialization and listen for the result. | 75 | * Start the DirectoryInitialization and listen for the result. |
| @@ -87,12 +77,15 @@ public interface SettingsActivityView { | |||
| 87 | * @param receiver the broadcast receiver for the DirectoryInitialization | 77 | * @param receiver the broadcast receiver for the DirectoryInitialization |
| 88 | * @param filter the Intent broadcasts to be received. | 78 | * @param filter the Intent broadcasts to be received. |
| 89 | */ | 79 | */ |
| 90 | void startDirectoryInitializationService(DirectoryStateReceiver receiver, IntentFilter filter); | 80 | fun startDirectoryInitializationService( |
| 81 | receiver: DirectoryStateReceiver?, | ||
| 82 | filter: IntentFilter | ||
| 83 | ) | ||
| 91 | 84 | ||
| 92 | /** | 85 | /** |
| 93 | * Stop listening to the DirectoryInitialization. | 86 | * Stop listening to the DirectoryInitialization. |
| 94 | * | 87 | * |
| 95 | * @param receiver The broadcast receiver to unregister. | 88 | * @param receiver The broadcast receiver to unregister. |
| 96 | */ | 89 | */ |
| 97 | void stopListeningToDirectoryInitializationService(DirectoryStateReceiver receiver); | 90 | fun stopListeningToDirectoryInitializationService(receiver: DirectoryStateReceiver) |
| 98 | } | 91 | } |