基本调通 回调
This commit is contained in:
@@ -15,28 +15,43 @@ import java.io.BufferedReader
|
||||
import java.io.InputStreamReader
|
||||
|
||||
|
||||
class MakeupActivity : FaceActivity() {
|
||||
class MakeupActivity : FaceActivity()
|
||||
{
|
||||
|
||||
private var curIndex = 0
|
||||
private var pngFilesByFolder: List<FolderInfo>? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val motion = Motion().apply {
|
||||
type = "4"
|
||||
png_names.add("4.png")
|
||||
}
|
||||
FaceInit(this)
|
||||
|
||||
val initArg = InitArg().apply {
|
||||
action_fps = 10
|
||||
zoom = 1.5f
|
||||
this.motion = motion
|
||||
}
|
||||
|
||||
SetInitArg(initArg.toJson())
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
FaceInit(this)
|
||||
Toast.makeText(this, "4.png", Toast.LENGTH_LONG).show()
|
||||
|
||||
var motion = getMotionByIndex(0);
|
||||
var jsonString = motion.toJson()
|
||||
val result = PreLoadAction(jsonString) { motion_type ->
|
||||
// 在这里处理回调结果
|
||||
println("OnLoadActionFinished: $motion_type")
|
||||
ChangeState(motion_type);
|
||||
}
|
||||
//Toast.makeText(this, "4.png", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
private fun getMotionByIndex(index: Int): Motion {
|
||||
pngFilesByFolder?.let { folders ->
|
||||
val motion = Motion().apply {
|
||||
type = folders[index].folderName
|
||||
png_names = folders[index].fileList
|
||||
}
|
||||
return motion
|
||||
}
|
||||
return Motion()
|
||||
}
|
||||
|
||||
private fun getCurMotionState(index: Int): String {
|
||||
|
||||
Reference in New Issue
Block a user