Commit d8b9f554 authored by zhangyanan's avatar zhangyanan

first commit

parents
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
/build
\ No newline at end of file
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdk 30
defaultConfig {
applicationId "com.health.actiondemo"
minSdk 21
targetSdk 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters "armeabi-v7a", 'arm64-v8a'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.health.android:videoplay:1.0.0-SNAPSHOT'
implementation 'com.alibaba:fastjson:1.2.51'
// testImplementation 'junit:junit:4.+'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.health.actiondemo">
<application
android:name=".DemoApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".ActionCountActivity"
android:exported="false" />
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
package com.health.actiondemo
import android.app.Activity
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.text.TextUtils
import android.util.Log
import android.widget.TextView
import com.alibaba.fastjson.JSON
import com.health.baselibrary.utils.StringUtils
import com.health.videoplay.bean.StandardConditonsModel
import com.health.videoplay.util.CalFrameDelegate
import com.healthhope.opengl.PoseCameraView
import java.io.BufferedReader
import java.io.InputStreamReader
import java.lang.StringBuilder
import java.util.HashMap
class ActionCountActivity : Activity() {
private var poseView:PoseCameraView? = null
private var textInfo: TextView? = null
private var textCount: TextView? = null
private var textResult: TextView? = null
private var textDebug1:TextView? = null
private var textDebug2:TextView? = null
private var textDebug3:TextView? = null
private val calFrameDelegate = CalFrameDelegate()
private val mainHandler = Handler(Looper.getMainLooper())
private var containJump = false
private var aCount = 0
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_action_count)
initInfo()
textInfo = findViewById(R.id.text_info)
textCount = findViewById(R.id.text_count)
textResult = findViewById(R.id.result_info)
textDebug1 = findViewById(R.id.text_debug_1)
textDebug2 = findViewById(R.id.text_debug_2)
textDebug3 = findViewById(R.id.text_debug_3)
val intExtra = intent.getIntExtra("actionType", 0)
//动作检查
calFrameDelegate.setCheckType(CalFrameDelegate.TYPE_ACTION_CHECK)
when(intExtra) {
//蹲起
0 -> {
textInfo?.text = "蹲起:"
val info:List<StandardConditonsModel> = JSON.parseArray(getRawText(R.raw.action_dunqi), StandardConditonsModel::class.java)
calFrameDelegate.setActionCheckConditions(info)
}
//开合跳
1 -> {
textInfo?.text = "开合跳:"
containJump = true
val info:List<StandardConditonsModel> = JSON.parseArray(getRawText(R.raw.gameinfo), StandardConditonsModel::class.java)
calFrameDelegate.setActionCheckConditions(info)
}
//跳
2 -> {
textInfo?.text = "跳跃:"
}
}
calFrameDelegate.setGainResultListener(object: CalFrameDelegate.OnGainResultListener{
override fun onResult(conditonsModel: StandardConditonsModel?, result: Byte) {
Log.i("ademo","result--->" + result)
setResult(result.toString())
when (result) {
CalFrameDelegate.ResultCode.RESULT_OK -> {
if (containJump) {
// if (poseView?.getRenderHelper()?.isJump == true) {
updateInfo()
// }
} else {
updateInfo()
}
}
}
}
override fun onWakeUpProcess(wakeUpProcess: Float) {
}
})
calFrameDelegate.setInfoListener(object: CalFrameDelegate.OnInfoListener{
override fun onConstantInfo(constants: MutableMap<String, Double>?) {
val sb = StringBuilder()
for ((key, value) in constants!!) {
sb.append(transConstantsNameToCh(key) + ":" + StringUtils.formatNum(value, 1))
.append("\n")
}
mainHandler.post{
textDebug1?.text = sb.toString()
}
}
override fun onCondition(conditionType: String?, bodyKeys: MutableList<String>?, ax: Double, a: Double, b: Double, by: Double) {
if (TextUtils.isEmpty(conditionType)) {
runOnUiThread { textDebug2?.setText("无标注信息") }
return
}
val sb = StringBuilder()
if ("0" == conditionType) {
sb.append("角度").append("\n")
} else if ("1" == conditionType) {
sb.append("高差").append("\n")
} else if ("2" == conditionType) {
sb.append("水平差").append("\n")
} else {
sb.append("距离").append("\n")
}
// sb.append("conditionType:" + conditionType).append("\n");
// sb.append("conditionType:" + conditionType).append("\n");
sb.append("calPoints:")
for (i in bodyKeys!!.indices) {
if (i < bodyKeys.size - 1) {
sb.append(pointChNames.get(bodyKeys[i])).append("_")
} else {
sb.append(pointChNames.get(bodyKeys[i]))
}
}
sb.append("\n")
sb.append("ax=").append(StringUtils.formatNum(ax, 1)).append("\n")
.append("a=").append(StringUtils.formatNum(a, 1)).append("\n")
.append("b=").append(StringUtils.formatNum(b, 1)).append("\n")
.append("by=").append(StringUtils.formatNum(by, 1))
runOnUiThread { textDebug2?.setText(sb.toString()) }
}
override fun onCalInfo(calResult: Double) {
var cal = calResult
if (java.lang.Double.isNaN(cal) || java.lang.Double.isInfinite(cal)) {
cal = 0.0
}
runOnUiThread {
textDebug3?.setText(
"""
calResult:
${StringUtils.formatNum(cal, 1)}
""".trimIndent()
)
}
}
})
poseView = findViewById(R.id.pose_camera)
poseView?.getRenderHelper()?.setOnFrameListener { pointFS ->
Log.i("ademo","on onFrame")
calFrameDelegate.onFrame(pointFS)
}
}
override fun onResume() {
super.onResume()
poseView?.onResume()
}
override fun onPause() {
super.onPause()
poseView?.onPause()
}
private fun updateInfo() {
mainHandler.post{
aCount++
textCount?.text = aCount.toString()
}
}
private fun setResult(info: String) {
mainHandler.post{
textResult?.text = "result-->$info"
}
}
private fun getRawText(resId: Int):String {
val openRawResource = resources.openRawResource(resId)
val bufferedReader = BufferedReader(InputStreamReader(openRawResource))
return bufferedReader.readText()
}
// private val bodyConstants = HashMap<String, Double>()
private val pointChNames = HashMap<String, String>()
fun initInfo() {
// /** 头顶-脖子 高差 */
// bodyConstants["OH_NK_1"] = -65.36
// /** 左膝-左踝 高差*/
// bodyConstants["LK_LA_1"] = -76.64
// /** 右膝-右踝 高差 */
// bodyConstants["RK_RA_1"] = -69.72
// /** 左胯-左膝 高差 */
// bodyConstants["LP_LK_1"] = -75.49
// /** 右胯-右膝 高差 */
// bodyConstants["RP_RK_1"] = -82.85
// /** 左肩-右肩 水平*/
// bodyConstants["LS_RS_2"] = -80.90
// /** 左肩-右肩 连线*/
// bodyConstants["LS_RS_3"] = 80.91
pointChNames["RK"] = "右膝"
pointChNames["LK"] = "左膝"
pointChNames["RA"] = "右踝"
pointChNames["LA"] = "左踝"
pointChNames["LW"] = "左腕"
pointChNames["RW"] = "右腕"
pointChNames["LE"] = "左耳"
pointChNames["RE"] = "右耳"
pointChNames["LS"] = "左肩"
pointChNames["RS"] = "右肩"
pointChNames["LL"] = "左水平"
pointChNames["RL"] = "右水平"
pointChNames["LP"] = "左髋"
pointChNames["RP"] = "右髋"
pointChNames["LEW"] = "左肘"
pointChNames["REW"] = "右肘"
pointChNames["OH"] = "头顶"
pointChNames["NK"] = "脖子"
}
private fun transConstantsNameToCh(key: String): String? {
val sb = StringBuilder()
val s = key.split("_").toTypedArray()
sb.append(pointChNames[s[0]]).append("_")
sb.append(pointChNames[s[1]]).append("_")
if ("0" == s[2]) {
sb.append("角度")
} else if ("1" == s[2]) {
sb.append("高差")
} else if ("2" == s[2]) {
sb.append("水平差")
} else {
sb.append("距离")
}
return sb.toString()
}
}
\ No newline at end of file
package com.health.actiondemo
import android.app.Application
import android.util.Log
import com.health.HealthSportCoachSdk
import com.healthhope.xlog.XLog
/**
* 创建者: zhangyanan
* 创建时间:2021/11/26 15:07
* 文件说明:
*/
class DemoApplication: Application() {
private val key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDbpITGpWvUwR6KY+hchA07TkPCDlSd3pPELE1TnlVlsm0vRgpPPv1wbXhpAY3D7cl3piWJfoj/wnSyhKAqLzW36wRnDe1mCxexjVHY3TCs5tjcrL6zHUgOjwq/F4J1LAe9P18nc4y2M7fSpR/GlcqGLajDIeoW+JJ3jtoJnAHhZEpkdwfbRKe56IKOWAW3qds0DsZz/FMxsoB+MOO4CdylQtjbpv87SPzzjtJ/Hxx8fT+gb1cAuhFGEs1ZLHCeC07u+jfTYk6RY9cMPq6c0DqtzKYqCys5eQvkvvquCE4kI1a6GIZMlqc7FUMmnKGPhsXUnVzI0hGGQBMPyv8FIjYbAgMBAAECggEBALbFLTO73YIZ/Zb9UhMCU5xhISMvF5yS5XVdxC7r13Ybxp2K8/NDoFPY1FTU1SoQChEFccD7SXdCUidnE3xm8pWL/Irg3QaH/nxh85S5YtLN+fGP0dRsblSnFTM0lft42yvQuxayIYpQeQvRGiL+7JtBDWjrJMdeq0rP1YIfjrUFWyv+vtYTguWXLerYtU6H0by3WQA3MGRiNuIrV5mSZxIkT3Xjw1ctibHXoQintRcvji92jHkm8nMTng1BfaI6Heeg+wsAHAA5+RI/bPT56OE6ya0fD8vcnTru0fcx1xSzwdLYON+bLCFpnjkdKgAJcN0q+xYbn6oqWBMRgnQum/kCgYEA/MC15OQQcflzbASUpUvmN+npeUTiIIZgQXXX8N+iVkqbpmYieuU6pM8xZ6H1+XzkOJuGvwRz8TjReINnoagDWom4nWTRFNfPdE3P3mwNMfrBlg1IalTmRPDMxwbxdk0ZsjqJG4KcnDRrXHYMN0BBhdFOUoIeonxwLYg6RKVKao0CgYEA3nbpK3e9Y8E6FELlZ4gWr9zrfkwPZy0dLTm/ngVcbeifq19Ge0gAh59XyPHD0BlJSOSsrULYVWpr3EwPl8Dl8b/KLvnvBCmCUPOijVe753REz9R3Un6HNv87Fbx8iHLV2Awql04g6Z1LHLi5v1l0dd3z6Oi+FNIjcYTfcD/LjUcCgYEAgfYNES57jj83rBkG3Z+TNrjdxe83XoX5xG71o/M5o6klM4BcxlhLuSaYPrM2qRwgtUKzHFEL1MLkYlUe2i5r2wfpl3SZVWBKWYERG0rv1f0bwS3/SD1zUYuHn+bgDXZDejNDAJQ+Nst1UMuaKGavykD/RsmFOwNFIwRjAZ0EEJkCgYEAnntX4P+MjGQ7W/PMOdVZVC+uFGtbDcW142IggBKRpjryhMN7EphYyEVb5GtXdAiPjL5bxZK5SyBldqs48IMbTP20q4KiI/TuQX1PcCHwWxMZcnWKC9rXuPZawUFl9k7YyPDh5qhiCgtkVzHCIe84aD+WY3Zq86pAVb6y7uSDvkECgYBy47HICr++gAIb1xB7YLssVi+wTWR5GaYd83VtmDuBPmk8rBMquN7xMtTeAMf213RjJ2frX0xSAVPqZvzhfrNLu57vNtlNRNMYUr/vPDIVloLighgVjzganxJlZNgOyuQbQbRFfNcNNCB8nc8Vtlk9KnwEokbrvNFtbtxumqbg+w=="
override fun onCreate() {
super.onCreate()
XLog.init()
initSDK()
}
private fun initSDK() {
HealthSportCoachSdk.init(this, "5e50101e0ad46509d9cc4d2b", key, 0, null, false, false, object: HealthSportCoachSdk.InitListener{
override fun onInitFalid(errorinfo: String?) {
Log.i("ademo", "初始化失败" + errorinfo)
}
override fun onInitSuccess() {
Log.i("ademo", "初始化成功")
}
})
}
}
\ No newline at end of file
package com.health.actiondemo
import android.Manifest
import android.app.Activity
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.Toast
import com.health.actiondemo.permissons.OnPermissionListener
import com.health.actiondemo.permissons.PermissionKit
class MainActivity : Activity() {
init {
System.loadLibrary("mnncore")
}
private var action1: Button? = null
private var action2: Button? = null
private var action3: Button? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
requestCamera()
action1 = findViewById(R.id.action_1)
action2 = findViewById(R.id.action_2)
action3 = findViewById(R.id.action_3)
action1?.setOnClickListener {
val jumpIntent = Intent(this, ActionCountActivity::class.java)
jumpIntent.putExtra("actionType", 0)
startActivity(jumpIntent)
}
action2?.setOnClickListener {
val jumpIntent = Intent(this, ActionCountActivity::class.java)
jumpIntent.putExtra("actionType", 1)
startActivity(jumpIntent)
}
action3?.setOnClickListener {
val jumpIntent = Intent(this, ActionCountActivity::class.java)
jumpIntent.putExtra("actionType", 2)
startActivity(jumpIntent)
}
}
private fun requestCamera() {
PermissionKit.getInstance().requestPermission(this, 1023, object :
OnPermissionListener {
override fun onSuccess(requestCode: Int, vararg permissions: String?) {
showToast("相机授权成功")
}
override fun onFail(requestCode: Int, vararg permissions: String?) {
showToast("相机授权失败")
}
}, Manifest.permission.CAMERA)
}
private fun showToast(str: String) {
Toast.makeText(this, str, Toast.LENGTH_LONG).show()
}
}
\ No newline at end of file
package com.health.actiondemo.permissons;
/**
* 权限监听接口
*/
public interface OnPermissionListener {
//悬浮窗
int PERMISSION_ALERT_WINDOW = 0xad1;
//系统设置
int PERMISSION_WRITE_SETTING = 0xad2;
//去设置
int PERMISSION_SETTING = 0xad3;
/**
* 授权成功
*
* @param requestCode 请求码
* @param permissions 所有同意权限
*/
void onSuccess(int requestCode, String... permissions);
/**
* 授权失败
*
* @param requestCode 请求码
* @param permissions 未同意权限
*/
void onFail(int requestCode, String... permissions);
}
package com.health.actiondemo.permissons;
/**
* 自定义引导设置权限
*/
public interface onCustomGuide {
/**
* 再次询问
*/
void againRequest();
/**
* 去设置
*/
void goSetting();
}
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ActionCountActivity">
<com.healthhope.opengl.PoseCameraView
android:id="@+id/pose_camera"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<TextView
android:id="@+id/text_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:background="@color/black10"
android:padding="5dp"
android:textSize="43dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginEnd="15dp"
android:text="动作名称:"
/>
<TextView
android:id="@+id/text_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:background="@color/black10"
android:padding="5dp"
android:textSize="43dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@+id/text_info"
android:layout_marginEnd="15dp"
android:text="0"
/>
<TextView
android:id="@+id/result_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:textSize="15dp"
android:layout_marginEnd="15dp"
android:layout_marginTop="10dp"
android:text="resut--"
android:textColor="@color/white"
android:background="@color/black10"
android:padding="5dp"
/>
<TextView
android:id="@+id/text_debug_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"
app:layout_constraintTop_toBottomOf="@+id/text_info"
app:layout_constraintStart_toStartOf="parent"
android:textColor="@color/white"
android:background="@color/black10"
android:padding="5dp"
android:text="信息1"
/>
<TextView
android:id="@+id/text_debug_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"
app:layout_constraintTop_toBottomOf="@+id/text_debug_1"
app:layout_constraintStart_toStartOf="parent"
android:textColor="@color/white"
android:background="@color/black10"
android:padding="5dp"
android:text="信息1"
/>
<TextView
android:id="@+id/text_debug_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"
app:layout_constraintTop_toBottomOf="@+id/text_debug_2"
app:layout_constraintStart_toStartOf="parent"
android:textColor="@color/white"
android:background="@color/black10"
android:padding="5dp"
android:text="信息1"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
tools:context=".MainActivity">
<Button
android:id="@+id/action_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="蹲起计数"
/>
<Button
android:id="@+id/action_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开合跳计数"
/>
<Button
android:id="@+id/action_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="跳跃计数"
/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
[
{
"conditionType": "0",
"angleDifferenceLimit": {
"standardAngleA": "120",
"standardAngleB": "0",
"errorAngleA2X": "160",
"errorAngleB2Y": null,
"caculateUserAnglePoint": [
"LP",
"LK",
"LA"
]
},
"positionDifferenceLimit": null,
"innerStandardLimitPrompt": "完美",
"innerErrorLimitA2XPrompt": "屈膝,重心向后",
"innerErrorLimitB2YPrompt": ""
}
]
\ No newline at end of file
[
{
"conditionType": "0",
"angleDifferenceLimit": {
"standardAngleA": "180",
"standardAngleB": "150",
"errorAngleA2X": null,
"errorAngleB2Y": "30",
"caculateUserAnglePoint": [
"LEW",
"LS",
"LP"
]
},
"positionDifferenceLimit": null,
"innerStandardLimitPrompt": "完美",
"innerErrorLimitA2XPrompt": "",
"innerErrorLimitB2YPrompt": "双臂伸直,举过头顶"
},
{
"conditionType": "0",
"angleDifferenceLimit": {
"standardAngleA": "75",
"standardAngleB": "0",
"errorAngleA2X": "85",
"errorAngleB2Y": null,
"caculateUserAnglePoint": [
"LP",
"LK",
"RL"
]
},
"positionDifferenceLimit": null,
"innerStandardLimitPrompt": "完美",
"innerErrorLimitA2XPrompt": "双腿左右尽量分开",
"innerErrorLimitB2YPrompt": ""
}
]
\ No newline at end of file
[
{
"conditionType": "0",
"angleDifferenceLimit": {
"standardAngleA": "180",
"standardAngleB": "150",
"errorAngleA2X": null,
"errorAngleB2Y": "90",
"caculateUserAnglePoint": [
"LEW",
"LS",
"LP"
]
},
"positionDifferenceLimit": null,
"innerStandardLimitPrompt": "完美",
"innerErrorLimitA2XPrompt": "",
"innerErrorLimitB2YPrompt": "双臂伸直,举过头顶"
},
{
"conditionType": "0",
"angleDifferenceLimit": {
"standardAngleA": "75",
"standardAngleB": "0",
"errorAngleA2X": "85",
"errorAngleB2Y": null,
"caculateUserAnglePoint": [
"LP",
"LK",
"RL"
]
},
"positionDifferenceLimit": null,
"innerStandardLimitPrompt": "完美",
"innerErrorLimitA2XPrompt": "双腿左右尽量分开",
"innerErrorLimitB2YPrompt": ""
}
]
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Actiondemo" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
\ No newline at end of file
This diff is collapsed.
<resources>
<string name="app_name">actiondemo</string>
</resources>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.Actiondemo" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven {
allowInsecureProtocol = true
url 'http://artifactory.jiankangyouyi.com/artifactory/libs-snapshot-local'
credentials {
username = 'admin'
password = 'AP6yfcVsaus48uuHKuVhvo1Aa8LRRYcp8CfVFw'
}
}
google()
mavenCentral()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
allowInsecureProtocol = true
url 'http://artifactory.jiankangyouyi.com/artifactory/libs-snapshot-local'
credentials {
username = 'admin'
password = 'AP6yfcVsaus48uuHKuVhvo1Aa8LRRYcp8CfVFw'
}
}
google()
mavenCentral()
mavenLocal()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
\ No newline at end of file
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
\ No newline at end of file
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Fri Nov 26 18:15:29 CST 2021
sdk.dir=C\:\\active_file\\sdk
include ':app'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment