-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bd7976
commit 2b7a690
Showing
47 changed files
with
17,291 additions
and
1,563 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
nodeLinker: node-modules | ||
nmHoistingLimits: workspaces | ||
|
||
plugins: | ||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs | ||
spec: "@yarnpkg/plugin-interactive-tools" | ||
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs | ||
spec: "@yarnpkg/plugin-workspace-tools" | ||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-3.6.1.cjs | ||
yarnPath: .yarn/releases/yarn-4.1.0.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
package com.gifplayer | ||
|
||
import android.util.Log | ||
import com.facebook.react.bridge.Arguments | ||
import com.facebook.react.bridge.WritableMap | ||
import com.facebook.react.uimanager.events.Event | ||
|
||
|
||
class EventManager { | ||
|
||
} | ||
|
||
data class OnLoadPayloadType(val duration: Double, val frameCount: Int) | ||
|
||
open class OnLoadEvent( | ||
surfaceId: Int, | ||
viewId: Int, | ||
private val payload: OnLoadPayloadType | ||
) : Event<OnLoadEvent>(surfaceId, viewId) { | ||
override fun getEventName() = NAME | ||
|
||
override fun getEventData(): WritableMap? { | ||
return createPayload() | ||
} | ||
|
||
private fun createPayload() = Arguments.createMap().apply { | ||
putDouble("duration", payload.duration) | ||
putInt("frameCount", payload.frameCount) | ||
} | ||
|
||
companion object { | ||
const val NAME = "topLoadEvent" | ||
const val EVENT_PROP_NAME = "onLoad" | ||
} | ||
} | ||
|
||
|
||
open class OnStartEvent( | ||
surfaceId: Int, | ||
viewId: Int, | ||
private val payload: String | ||
) : Event<OnStartEvent>(surfaceId, viewId) { | ||
override fun getEventName() = NAME | ||
|
||
override fun getEventData(): WritableMap? { | ||
return createPayload() | ||
} | ||
|
||
private fun createPayload() = Arguments.createMap().apply { | ||
putString("arg", payload) | ||
} | ||
|
||
companion object { | ||
const val NAME = "topStartEvent" | ||
const val EVENT_PROP_NAME = "onStart" | ||
} | ||
} | ||
|
||
|
||
open class OnStopEvent( | ||
surfaceId: Int, | ||
viewId: Int, | ||
private val payload: String | ||
) : Event<OnStopEvent>(surfaceId, viewId) { | ||
override fun getEventName() = NAME | ||
|
||
override fun getEventData(): WritableMap? { | ||
return createPayload() | ||
} | ||
|
||
private fun createPayload() = Arguments.createMap().apply { | ||
putString("arg", payload) | ||
} | ||
|
||
companion object { | ||
const val NAME = "topStopEvent" | ||
const val EVENT_PROP_NAME = "onStop" | ||
} | ||
} | ||
|
||
open class OnEndEvent( | ||
surfaceId: Int, | ||
viewId: Int, | ||
private val payload: String | ||
) : Event<OnEndEvent>(surfaceId, viewId) { | ||
override fun getEventName() = NAME | ||
|
||
override fun getEventData(): WritableMap? { | ||
return createPayload() | ||
} | ||
|
||
private fun createPayload() = Arguments.createMap().apply { | ||
putString("arg", payload) | ||
} | ||
|
||
companion object { | ||
const val NAME = "topEndEvent" | ||
const val EVENT_PROP_NAME = "onEnd" | ||
} | ||
} | ||
|
||
|
||
open class OnFrameEvent( | ||
surfaceId: Int, | ||
viewId: Int, | ||
private val payload: Int | ||
) : Event<OnFrameEvent>(surfaceId, viewId) { | ||
override fun getEventName() = NAME | ||
|
||
override fun getEventData(): WritableMap? { | ||
return createPayload() | ||
} | ||
|
||
private fun createPayload() = Arguments.createMap().apply { | ||
putInt("frameNumber", payload) | ||
} | ||
|
||
companion object { | ||
const val NAME = "topFrameEvent" | ||
const val EVENT_PROP_NAME = "onFrame" | ||
} | ||
} | ||
|
||
open class OnErrorEvent( | ||
surfaceId: Int, | ||
viewId: Int, | ||
private val payload: String | ||
) : Event<OnErrorEvent>(surfaceId, viewId) { | ||
override fun getEventName() = NAME | ||
|
||
override fun getEventData(): WritableMap? { | ||
return createPayload() | ||
} | ||
|
||
private fun createPayload() = Arguments.createMap().apply { | ||
putString("error", payload) | ||
} | ||
|
||
companion object { | ||
const val NAME = "topErrorEvent" | ||
const val EVENT_PROP_NAME = "onError" | ||
} | ||
} |
Oops, something went wrong.