master
Zhengyu Peng 3 years ago
parent 32bbeb25d8
commit 49a53e13e6

@ -185,15 +185,15 @@ class ControlActivity : AppCompatActivity() {
controlImage!!.setImageResource(R.drawable.ic_control_circle_standby) controlImage!!.setImageResource(R.drawable.ic_control_circle_standby)
buttonRotateX!!.backgroundTintList = buttonRotateX!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateY!!.backgroundTintList = buttonRotateY!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateZ!!.backgroundTintList = buttonRotateZ!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonClimb!!.backgroundTintList = buttonClimb!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonTwist!!.backgroundTintList = buttonTwist!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
} }
} else if (length >= radius / 3 && length < 2 * radius / 3) { } else if (length >= radius / 3 && length < 2 * radius / 3) {
val angle = atan2(coorY, coorX) val angle = atan2(coorY, coorX)
@ -223,15 +223,15 @@ class ControlActivity : AppCompatActivity() {
} }
} }
buttonRotateX!!.backgroundTintList = buttonRotateX!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateY!!.backgroundTintList = buttonRotateY!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateZ!!.backgroundTintList = buttonRotateZ!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonClimb!!.backgroundTintList = buttonClimb!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonTwist!!.backgroundTintList = buttonTwist!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
} else if (length >= 2 * radius / 3 && length < radius) { } else if (length >= 2 * radius / 3 && length < radius) {
val angle = atan2(coorY, coorX) val angle = atan2(coorY, coorX)
if (angle > -PI / 4 && angle <= PI / 4) { if (angle > -PI / 4 && angle <= PI / 4) {
@ -260,15 +260,15 @@ class ControlActivity : AppCompatActivity() {
} }
} }
buttonRotateX!!.backgroundTintList = buttonRotateX!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateY!!.backgroundTintList = buttonRotateY!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateZ!!.backgroundTintList = buttonRotateZ!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonClimb!!.backgroundTintList = buttonClimb!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonTwist!!.backgroundTintList = buttonTwist!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
} }
return true return true
} }
@ -283,13 +283,13 @@ class ControlActivity : AppCompatActivity() {
buttonRotateX!!.backgroundTintList = buttonRotateX!!.backgroundTintList =
applicationContext.getColorStateList(R.color.purple_500) applicationContext.getColorStateList(R.color.purple_500)
buttonRotateY!!.backgroundTintList = buttonRotateY!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateZ!!.backgroundTintList = buttonRotateZ!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonClimb!!.backgroundTintList = buttonClimb!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonTwist!!.backgroundTintList = buttonTwist!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
} }
} }
@ -299,15 +299,15 @@ class ControlActivity : AppCompatActivity() {
currentState = CMD_ROTATEY currentState = CMD_ROTATEY
controlImage!!.setImageResource(R.drawable.ic_control_circle) controlImage!!.setImageResource(R.drawable.ic_control_circle)
buttonRotateX!!.backgroundTintList = buttonRotateX!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateY!!.backgroundTintList = buttonRotateY!!.backgroundTintList =
applicationContext.getColorStateList(R.color.purple_500) applicationContext.getColorStateList(R.color.purple_500)
buttonRotateZ!!.backgroundTintList = buttonRotateZ!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonClimb!!.backgroundTintList = buttonClimb!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonTwist!!.backgroundTintList = buttonTwist!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
} }
} }
@ -317,15 +317,15 @@ class ControlActivity : AppCompatActivity() {
currentState = CMD_ROTATEZ currentState = CMD_ROTATEZ
controlImage!!.setImageResource(R.drawable.ic_control_circle) controlImage!!.setImageResource(R.drawable.ic_control_circle)
buttonRotateX!!.backgroundTintList = buttonRotateX!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateY!!.backgroundTintList = buttonRotateY!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateZ!!.backgroundTintList = buttonRotateZ!!.backgroundTintList =
applicationContext.getColorStateList(R.color.purple_500) applicationContext.getColorStateList(R.color.purple_500)
buttonClimb!!.backgroundTintList = buttonClimb!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonTwist!!.backgroundTintList = buttonTwist!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
} }
} }
@ -335,15 +335,15 @@ class ControlActivity : AppCompatActivity() {
currentState = CMD_CLIMBFORWARD currentState = CMD_CLIMBFORWARD
controlImage!!.setImageResource(R.drawable.ic_control_circle) controlImage!!.setImageResource(R.drawable.ic_control_circle)
buttonRotateX!!.backgroundTintList = buttonRotateX!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateY!!.backgroundTintList = buttonRotateY!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateZ!!.backgroundTintList = buttonRotateZ!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonClimb!!.backgroundTintList = buttonClimb!!.backgroundTintList =
applicationContext.getColorStateList(R.color.purple_500) applicationContext.getColorStateList(R.color.purple_500)
buttonTwist!!.backgroundTintList = buttonTwist!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
} }
} }
@ -353,13 +353,13 @@ class ControlActivity : AppCompatActivity() {
currentState = CMD_TWIST currentState = CMD_TWIST
controlImage!!.setImageResource(R.drawable.ic_control_circle) controlImage!!.setImageResource(R.drawable.ic_control_circle)
buttonRotateX!!.backgroundTintList = buttonRotateX!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateY!!.backgroundTintList = buttonRotateY!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateZ!!.backgroundTintList = buttonRotateZ!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonClimb!!.backgroundTintList = buttonClimb!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonTwist!!.backgroundTintList = buttonTwist!!.backgroundTintList =
applicationContext.getColorStateList(R.color.purple_500) applicationContext.getColorStateList(R.color.purple_500)
} }
@ -431,15 +431,15 @@ class ControlActivity : AppCompatActivity() {
controlImage!!.setImageResource(R.drawable.ic_control_circle_standby) controlImage!!.setImageResource(R.drawable.ic_control_circle_standby)
buttonRotateX!!.backgroundTintList = buttonRotateX!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateY!!.backgroundTintList = buttonRotateY!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonRotateZ!!.backgroundTintList = buttonRotateZ!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonClimb!!.backgroundTintList = buttonClimb!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
buttonTwist!!.backgroundTintList = buttonTwist!!.backgroundTintList =
applicationContext.getColorStateList(R.color.grey_500) applicationContext.getColorStateList(R.color.grey_700)
} }

@ -9,7 +9,8 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="@color/grey_500">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp" android:layout_width="0dp"

@ -7,6 +7,7 @@
<color name="grey_200">#FFEEEEEE</color> <color name="grey_200">#FFEEEEEE</color>
<color name="grey_500">#FF9E9E9E</color> <color name="grey_500">#FF9E9E9E</color>
<color name="grey_700">#FF616161</color> <color name="grey_700">#FF616161</color>
<color name="grey_800">#FF424242</color>
<color name="teal_200">#FF03DAC5</color> <color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color> <color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color> <color name="black">#FF000000</color>

@ -30,8 +30,8 @@
<style name="Theme.Hexapod.ButtonInactive" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> <style name="Theme.Hexapod.ButtonInactive" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. --> <!-- Primary brand color. -->
<item name="colorPrimary">@color/grey_500</item> <item name="colorPrimary">@color/grey_700</item>
<item name="colorPrimaryVariant">@color/grey_700</item> <item name="colorPrimaryVariant">@color/grey_800</item>
<item name="colorOnPrimary">@color/white</item> <item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. --> <!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item> <item name="colorSecondary">@color/teal_200</item>

Loading…
Cancel
Save