summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-03-11 06:36:19 +0100
committerbunnei <bunneidev@gmail.com>2023-06-03 09:05:40 +0200
commit711aedeaae8c7652c7e8707bc32eb28e8fb82c77 (patch)
tree74be7f05a33b6a890af89abcc16cfd6d18a64782 /src/android
parentandroid: Convert DirectoryInitialization to Kotlin (diff)
downloadyuzu-711aedeaae8c7652c7e8707bc32eb28e8fb82c77.tar
yuzu-711aedeaae8c7652c7e8707bc32eb28e8fb82c77.tar.gz
yuzu-711aedeaae8c7652c7e8707bc32eb28e8fb82c77.tar.bz2
yuzu-711aedeaae8c7652c7e8707bc32eb28e8fb82c77.tar.lz
yuzu-711aedeaae8c7652c7e8707bc32eb28e8fb82c77.tar.xz
yuzu-711aedeaae8c7652c7e8707bc32eb28e8fb82c77.tar.zst
yuzu-711aedeaae8c7652c7e8707bc32eb28e8fb82c77.zip
Diffstat (limited to 'src/android')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryStateReceiver.java22
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryStateReceiver.kt15
2 files changed, 15 insertions, 22 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryStateReceiver.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryStateReceiver.java
deleted file mode 100644
index 62c9b018a..000000000
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryStateReceiver.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.yuzu.yuzu_emu.utils;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-
-import org.yuzu.yuzu_emu.utils.DirectoryInitialization.DirectoryInitializationState;
-
-public class DirectoryStateReceiver extends BroadcastReceiver {
- Action1<DirectoryInitializationState> callback;
-
- public DirectoryStateReceiver(Action1<DirectoryInitializationState> callback) {
- this.callback = callback;
- }
-
- @Override
- public void onReceive(Context context, Intent intent) {
- DirectoryInitializationState state = (DirectoryInitializationState) intent
- .getSerializableExtra(DirectoryInitialization.EXTRA_STATE);
- callback.call(state);
- }
-}
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryStateReceiver.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryStateReceiver.kt
new file mode 100644
index 000000000..20906941a
--- /dev/null
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/DirectoryStateReceiver.kt
@@ -0,0 +1,15 @@
+package org.yuzu.yuzu_emu.utils
+
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.Intent
+import org.yuzu.yuzu_emu.utils.DirectoryInitialization.DirectoryInitializationState
+
+class DirectoryStateReceiver(var callback: (DirectoryInitializationState) -> Unit) :
+ BroadcastReceiver() {
+ override fun onReceive(context: Context, intent: Intent) {
+ val state = intent
+ .getSerializableExtra(DirectoryInitialization.EXTRA_STATE) as DirectoryInitializationState
+ callback.invoke(state)
+ }
+}