From 49a53e13e638141218e4fbe947345574fe96e2be Mon Sep 17 00:00:00 2001 From: Zhengyu Peng Date: Wed, 23 Feb 2022 15:13:49 -0500 Subject: [PATCH] update --- .../com/rookiedev/hexapod/ControlActivity.kt | 80 +++++++++---------- .../src/main/res/layout/activity_control.xml | 3 +- .../app/src/main/res/values/colors.xml | 1 + .../app/src/main/res/values/themes.xml | 4 +- 4 files changed, 45 insertions(+), 43 deletions(-) diff --git a/software/android/app/src/main/java/com/rookiedev/hexapod/ControlActivity.kt b/software/android/app/src/main/java/com/rookiedev/hexapod/ControlActivity.kt index 1c11036..2edc5c0 100644 --- a/software/android/app/src/main/java/com/rookiedev/hexapod/ControlActivity.kt +++ b/software/android/app/src/main/java/com/rookiedev/hexapod/ControlActivity.kt @@ -185,15 +185,15 @@ class ControlActivity : AppCompatActivity() { controlImage!!.setImageResource(R.drawable.ic_control_circle_standby) buttonRotateX!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateY!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateZ!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonClimb!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonTwist!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) } } else if (length >= radius / 3 && length < 2 * radius / 3) { val angle = atan2(coorY, coorX) @@ -223,15 +223,15 @@ class ControlActivity : AppCompatActivity() { } } buttonRotateX!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateY!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateZ!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonClimb!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonTwist!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) } else if (length >= 2 * radius / 3 && length < radius) { val angle = atan2(coorY, coorX) if (angle > -PI / 4 && angle <= PI / 4) { @@ -260,15 +260,15 @@ class ControlActivity : AppCompatActivity() { } } buttonRotateX!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateY!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateZ!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonClimb!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonTwist!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) } return true } @@ -283,13 +283,13 @@ class ControlActivity : AppCompatActivity() { buttonRotateX!!.backgroundTintList = applicationContext.getColorStateList(R.color.purple_500) buttonRotateY!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateZ!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonClimb!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonTwist!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) } } @@ -299,15 +299,15 @@ class ControlActivity : AppCompatActivity() { currentState = CMD_ROTATEY controlImage!!.setImageResource(R.drawable.ic_control_circle) buttonRotateX!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateY!!.backgroundTintList = applicationContext.getColorStateList(R.color.purple_500) buttonRotateZ!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonClimb!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonTwist!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) } } @@ -317,15 +317,15 @@ class ControlActivity : AppCompatActivity() { currentState = CMD_ROTATEZ controlImage!!.setImageResource(R.drawable.ic_control_circle) buttonRotateX!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateY!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateZ!!.backgroundTintList = applicationContext.getColorStateList(R.color.purple_500) buttonClimb!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonTwist!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) } } @@ -335,15 +335,15 @@ class ControlActivity : AppCompatActivity() { currentState = CMD_CLIMBFORWARD controlImage!!.setImageResource(R.drawable.ic_control_circle) buttonRotateX!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateY!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateZ!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonClimb!!.backgroundTintList = applicationContext.getColorStateList(R.color.purple_500) buttonTwist!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) } } @@ -353,13 +353,13 @@ class ControlActivity : AppCompatActivity() { currentState = CMD_TWIST controlImage!!.setImageResource(R.drawable.ic_control_circle) buttonRotateX!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateY!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateZ!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonClimb!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonTwist!!.backgroundTintList = applicationContext.getColorStateList(R.color.purple_500) } @@ -431,15 +431,15 @@ class ControlActivity : AppCompatActivity() { controlImage!!.setImageResource(R.drawable.ic_control_circle_standby) buttonRotateX!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateY!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonRotateZ!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonClimb!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) buttonTwist!!.backgroundTintList = - applicationContext.getColorStateList(R.color.grey_500) + applicationContext.getColorStateList(R.color.grey_700) } diff --git a/software/android/app/src/main/res/layout/activity_control.xml b/software/android/app/src/main/res/layout/activity_control.xml index 98720c0..74fe607 100644 --- a/software/android/app/src/main/res/layout/activity_control.xml +++ b/software/android/app/src/main/res/layout/activity_control.xml @@ -9,7 +9,8 @@ + android:layout_height="match_parent" + android:background="@color/grey_500"> #FFEEEEEE #FF9E9E9E #FF616161 + #FF424242 #FF03DAC5 #FF018786 #FF000000 diff --git a/software/android/app/src/main/res/values/themes.xml b/software/android/app/src/main/res/values/themes.xml index 50f1507..0ea8b91 100644 --- a/software/android/app/src/main/res/values/themes.xml +++ b/software/android/app/src/main/res/values/themes.xml @@ -30,8 +30,8 @@