Merge pull request #14076 from Simonx22/remove-action1-interface

Android: Replace Action1 helper with Kotlin lambda
This commit is contained in:
JosJuice 2025-11-08 11:42:38 +01:00 committed by GitHub
commit 9d27c145b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 11 deletions

View File

@ -29,7 +29,6 @@ import org.dolphinemu.dolphinemu.fragments.GridOptionDialogFragment
import org.dolphinemu.dolphinemu.services.GameFileCacheManager import org.dolphinemu.dolphinemu.services.GameFileCacheManager
import org.dolphinemu.dolphinemu.ui.platform.PlatformGamesView import org.dolphinemu.dolphinemu.ui.platform.PlatformGamesView
import org.dolphinemu.dolphinemu.ui.platform.PlatformTab import org.dolphinemu.dolphinemu.ui.platform.PlatformTab
import org.dolphinemu.dolphinemu.utils.Action1
import org.dolphinemu.dolphinemu.utils.AfterDirectoryInitializationRunner import org.dolphinemu.dolphinemu.utils.AfterDirectoryInitializationRunner
import org.dolphinemu.dolphinemu.utils.DirectoryInitialization import org.dolphinemu.dolphinemu.utils.DirectoryInitialization
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper import org.dolphinemu.dolphinemu.utils.FileBrowserHelper
@ -257,11 +256,11 @@ class MainActivity : AppCompatActivity(), MainView, OnRefreshListener, ThemeProv
override fun showGridOptions() = override fun showGridOptions() =
GridOptionDialogFragment().show(supportFragmentManager, "gridOptions") GridOptionDialogFragment().show(supportFragmentManager, "gridOptions")
private fun forEachPlatformGamesView(action: Action1<PlatformGamesView>) { private fun forEachPlatformGamesView(action: (PlatformGamesView) -> Unit) {
for (platformTab in PlatformTab.values()) { for (platformTab in PlatformTab.values()) {
val fragment = getPlatformGamesView(platformTab) val fragment = getPlatformGamesView(platformTab)
if (fragment != null) { if (fragment != null) {
action.call(fragment) action(fragment)
} }
} }
} }

View File

@ -1,8 +0,0 @@
// SPDX-License-Identifier: GPL-2.0-or-later
package org.dolphinemu.dolphinemu.utils;
public interface Action1<T>
{
void call(T t);
}