adjust GUI

master
Zhengyu Peng 2 years ago
parent f5e942ee33
commit 754c77fc3d

@ -184,7 +184,7 @@ class ControlActivity : AppCompatActivity() {
val coorY = touchY - rightHeight / 2
val length = sqrt(coorX.pow(2) + coorY.pow(2))
if (length < rightRadius / 3) {
if (length < rightRadius / 4) {
if (currentState != CMD_STANDBY) {
sendMessageAsync(CMD_STANDBY)
currentState = CMD_STANDBY
@ -192,7 +192,7 @@ class ControlActivity : AppCompatActivity() {
leftControlImage!!.setImageResource(R.drawable.ic_control_left)
}
} else if (length >= rightRadius / 3 && length < 2 * rightRadius / 3) {
} else if (length >= rightRadius / 4 && length < 2 * rightRadius / 3) {
val angle = atan2(coorY, coorX)
if (angle > -7 * PI / 8 && angle < -5 * PI / 8) {
if (currentState != CMD_WALK_L45) {

@ -30,8 +30,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -36,8 +36,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -36,8 +36,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -30,8 +30,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#6200ee"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -36,8 +36,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -36,8 +36,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -36,8 +36,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -36,8 +36,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -36,8 +36,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -36,8 +36,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -36,8 +36,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -36,8 +36,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -36,8 +36,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

@ -36,8 +36,8 @@
android:strokeColor="#00000000"
android:strokeLineCap="round"/>
<path
android:pathData="M114.586,114.786a50,50 59.624,1 0,70.711 70.711a50,50 59.624,1 0,-70.711 -70.711z"
android:strokeWidth="0.999998"
android:pathData="M123.483,123.483a37.5,37.5 53.174,1 0,53.033 53.033a37.5,37.5 53.174,1 0,-53.033 -53.033z"
android:strokeWidth="0.749999"
android:fillColor="#000000"
android:strokeColor="#00000000"
android:strokeLineCap="round"/>

Loading…
Cancel
Save