Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(shortcuts): copy active thread reference #8994

Mergedmaria-rcksmerged 7 commits intomain fromrefs/pull/8994/headmerged by maria-rcks View on GitHub

Showing 20 changed files with 58 additions and 1 deletion (loading 17).

x
0 of 20 viewed, 20 left
46 additions and 0 deletionsapps/mobile/modules/t3-native-controls/android/src/main/java/expo/modules/t3nativecontrols/T3KeyboardCommandsModule.ktAdded
View file
@@ -0,0 +1,46 @@
+package expo.modules.t3nativecontrols
+​
+import android.content.Context
+import android.view.KeyEvent
+import expo.modules.kotlin.AppContext
+import expo.modules.kotlin.modules.Module
+import expo.modules.kotlin.modules.ModuleDefinition
+import expo.modules.kotlin.viewevent.EventDispatcher
+import expo.modules.kotlin.views.ExpoView
+​
+class T3KeyboardCommandsModule : Module() {
+ override fun definition() = ModuleDefinition {
+ Name("T3KeyboardCommands")
+​
+ View(T3KeyboardCommandsView::class) {
+ Prop("enabledCommands") { view: T3KeyboardCommandsView, commands: List<String> ->
+ view.enabledCommands = commands.toSet()
+ }
+ Events("onCommand")
+ }
+ }
+}
+​
+class T3KeyboardCommandsView(
+ context: Context,
+ appContext: AppContext
+) : ExpoView(context, appContext) {
+ private val onCommand by EventDispatcher()
+ var enabledCommands = emptySet<String>()
+​