...
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package bums.lunatic.launcher.workers
|
||||
|
||||
import bums.lunatic.launcher.utils.Blog
|
||||
import com.google.android.gms.wearable.MessageEvent
|
||||
import com.google.android.gms.wearable.WearableListenerService
|
||||
|
||||
class WatchGestureService : WearableListenerService() {
|
||||
override fun onMessageReceived(messageEvent: MessageEvent) {
|
||||
when (messageEvent.path) {
|
||||
"/gesture/next" -> {
|
||||
// 런처의 다음 페이지로 이동하거나, 이북 앱에 키 이벤트 전송
|
||||
handleGestureAction("NEXT")
|
||||
}
|
||||
"/gesture/prev" -> {
|
||||
handleGestureAction("PREV")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleGestureAction(action: String) {
|
||||
// Broadcast를 런처 메인 Activity로 쏘거나,
|
||||
// 직접 AccessibilityService를 호출하여 시스템 이벤트를 발생시킵니다.
|
||||
Blog.LOGE("WatchGesture", "Gesture Received: $action")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user