diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityView.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityView.java deleted file mode 100644 index 464d0ea165..0000000000 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityView.java +++ /dev/null @@ -1,137 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later - -package org.dolphinemu.dolphinemu.features.settings.ui; - -import android.os.Bundle; - -import androidx.annotation.NonNull; -import androidx.fragment.app.DialogFragment; - -import org.dolphinemu.dolphinemu.features.settings.model.Settings; - -/** - * Abstraction for the Activity that manages SettingsFragments. - */ -public interface SettingsActivityView -{ - /** - * Show a new SettingsFragment. - * - * @param menuTag Identifier for the settings group that should be displayed. - * @param addToStack Whether or not this fragment should replace a previous one. - */ - void showSettingsFragment(MenuTag menuTag, Bundle extras, boolean addToStack, String gameId); - - /** - * Shows a DialogFragment. - * - * Only one can be shown at a time. - */ - void showDialogFragment(DialogFragment fragment); - - /** - * Called by a contained Fragment to get access to the Setting HashMap - * loaded from disk, so that each Fragment doesn't need to perform its own - * read operation. - * - * @return A possibly null HashMap of Settings. - */ - Settings getSettings(); - - /** - * Called when an asynchronous load operation completes. - * - * @param settings The (possibly null) result of the ini load operation. - */ - void onSettingsFileLoaded(Settings settings); - - /** - * Called when an asynchronous load operation fails. - */ - void onSettingsFileNotFound(); - - /** - * Display a popup text message on screen. - * - * @param message The contents of the onscreen message. - */ - void showToastMessage(String message); - - /** - * End the activity. - */ - void finish(); - - /** - * Called by a containing Fragment to tell the Activity that a setting was changed; - * unless this has been called, the Activity will not save to disk. - */ - 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(); - - /** - * Called by a containing Fragment to 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); - - /** - * Show loading dialog while loading the settings - */ - void showLoading(); - - /** - * Hide the loading dialog - */ - void hideLoading(); - - /** - * Tell the user that there is junk in the game INI and ask if they want to delete the whole file. - */ - void showGameIniJunkDeletionQuestion(); - - /** - * Accesses the material toolbar layout and changes the title - */ - void setToolbarTitle(String title); - - /** - * 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. - * @return The height of the warning view, or 0 if the view is now invisible. - */ - int setOldControllerSettingsWarningVisibility(boolean visible); -} diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityView.kt b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityView.kt new file mode 100644 index 0000000000..435d23fad6 --- /dev/null +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivityView.kt @@ -0,0 +1,135 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +package org.dolphinemu.dolphinemu.features.settings.ui + +import android.os.Bundle +import androidx.fragment.app.DialogFragment +import org.dolphinemu.dolphinemu.features.settings.model.Settings + +/** + * Abstraction for the Activity that manages SettingsFragments. + */ +interface SettingsActivityView { + /** + * Show a new SettingsFragment. + * + * @param menuTag Identifier for the settings group that should be displayed. + * @param addToStack Whether or not this fragment should replace a previous one. + */ + fun showSettingsFragment( + menuTag: MenuTag, + extras: Bundle?, + addToStack: Boolean, + gameId: String + ) + + /** + * Shows a DialogFragment. + * + * Only one can be shown at a time. + */ + fun showDialogFragment(fragment: DialogFragment) + + /** + * Called by a contained Fragment to get access to the Setting HashMap + * loaded from disk, so that each Fragment doesn't need to perform its own + * read operation. + * + * @return A possibly null HashMap of Settings. + */ + val settings: Settings + + /** + * Called when an asynchronous load operation completes. + * + * @param settings The (possibly null) result of the ini load operation. + */ + fun onSettingsFileLoaded(settings: Settings) + + /** + * Called when an asynchronous load operation fails. + */ + fun onSettingsFileNotFound() + + /** + * Display a popup text message on screen. + * + * @param message The contents of the onscreen message. + */ + fun showToastMessage(message: String) + + /** + * End the activity. + */ + fun finish() + + /** + * Called by a containing Fragment to tell the Activity that a Setting was changed; + * unless this has been called, the Activity will not save to disk. + */ + 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() + + /** + * Called by a containing Fragment to 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 + * Setting, 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 + + /** + * Show loading dialog while loading the settings + */ + fun showLoading() + + /** + * Hide the loading dialog + */ + fun hideLoading() + + /** + * Tell the user that there is junk in the game INI and ask if they want to delete the whole file. + */ + fun showGameIniJunkDeletionQuestion() + + /** + * Accesses the material toolbar layout and changes the title + */ + fun setToolbarTitle(title: String) + /** + * 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. + * @return The height of the warning view, or 0 if the view is now invisible. + */ + fun setOldControllerSettingsWarningVisibility(visible: Boolean): Int +}