Skip to content

Commit

Permalink
Start re-organizing the Android backend
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Feb 23, 2025
1 parent fa1a774 commit bb93aa4
Show file tree
Hide file tree
Showing 16 changed files with 15 additions and 15 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tech.kinc
package tech.kore

import android.app.NativeActivity
import android.content.Context
Expand All @@ -18,9 +18,9 @@ import android.view.WindowManager
import android.view.inputmethod.InputMethodManager
import kotlin.system.exitProcess

class KincActivity: NativeActivity(), KeyEvent.Callback {
class KoreActivity: NativeActivity(), KeyEvent.Callback {
companion object {
var instance: KincActivity? = null
var instance: KoreActivity? = null

@JvmStatic
fun showKeyboard() {
Expand Down Expand Up @@ -107,7 +107,7 @@ class KincActivity: NativeActivity(), KeyEvent.Callback {
}
}

class MyHandler(private val kincActivity: KincActivity) : Handler() {
class MyHandler(private val kincActivity: KoreActivity) : Handler() {
override fun handleMessage(msg: Message) {
kincActivity.hideSystemUI()
}
Expand Down Expand Up @@ -157,9 +157,9 @@ class KincActivity: NativeActivity(), KeyEvent.Callback {
}

override fun onKeyMultiple(keyCode: Int, count: Int, event: KeyEvent): Boolean {
this.nativeKincKeyPress(event.characters)
this.nativeKoreKeyPress(event.characters)
return false
}

private external fun nativeKincKeyPress(chars: String)
private external fun nativeKoreKeyPress(chars: String)
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package tech.kinc
package tech.kore

import java.util.ArrayList

import android.view.Surface

class KincMoviePlayer(var path: String) {
class KoreMoviePlayer(var path: String) {
companion object {
var players = ArrayList<KincMoviePlayer?>()
var players = ArrayList<KoreMoviePlayer?>()

@JvmStatic
fun updateAll() {
for (player in KincMoviePlayer.players) {
for (player in KoreMoviePlayer.players) {
player!!.update()
}
}
Expand All @@ -20,21 +20,21 @@ class KincMoviePlayer(var path: String) {
}
}

private var movieTexture: KincMovieTexture? = null
private var movieTexture: KoreMovieTexture? = null
var id: Int = players.size

init {
players.add(this)
}

fun init() {
movieTexture = KincMovieTexture()
movieTexture = KoreMovieTexture()
val surface = Surface(movieTexture!!.surfaceTexture)
nativeCreate(path, surface, id)
surface.release()
}

fun getMovieTexture(): KincMovieTexture? {
fun getMovieTexture(): KoreMovieTexture? {
return movieTexture
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package tech.kinc
package tech.kore

import android.graphics.SurfaceTexture
import android.graphics.SurfaceTexture.OnFrameAvailableListener
import android.opengl.GLES20

class KincMovieTexture: OnFrameAvailableListener {
class KoreMovieTexture: OnFrameAvailableListener {
private val GL_TEXTURE_EXTERNAL_OES: Int = 0x8D65

var textureId: Int = 0
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit bb93aa4

Please sign in to comment.