From fe16668440e5be1ab12d4cabd5ef863a6a8dc942 Mon Sep 17 00:00:00 2001 From: Zhengyu Peng Date: Sun, 13 Feb 2022 22:05:45 -0500 Subject: [PATCH] update --- .../com/rookiedev/hexapod/ControlActivity.kt | 3 +++ .../com/rookiedev/hexapod/MainActivity.kt | 4 +-- .../com/rookiedev/hexapod/view/ControlView.kt | 26 +++++++++++++++++++ .../src/main/res/layout/activity_control.xml | 9 +++++++ 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 software/android/app/src/main/java/com/rookiedev/hexapod/view/ControlView.kt 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 a5d80e4..be55792 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 @@ -18,6 +18,7 @@ enum class BehaviorOption( "BEHAVIOR_DEFAULT", WindowInsetsController.BEHAVIOR_DEFAULT ), + // "Sticky immersive mode". Swipe from the edge to temporarily reveal the hidden bar. ShowTransientBarsBySwipe( "BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE", @@ -37,11 +38,13 @@ enum class TypeOption( "systemBars()", WindowInsets.Type.systemBars() ), + // The status bar only. StatusBar( "statusBars()", WindowInsets.Type.statusBars() ), + // The navigation bar only NavigationBar( "navigationBars()", diff --git a/software/android/app/src/main/java/com/rookiedev/hexapod/MainActivity.kt b/software/android/app/src/main/java/com/rookiedev/hexapod/MainActivity.kt index 5aa1b77..6d5a74e 100644 --- a/software/android/app/src/main/java/com/rookiedev/hexapod/MainActivity.kt +++ b/software/android/app/src/main/java/com/rookiedev/hexapod/MainActivity.kt @@ -12,8 +12,6 @@ import android.text.Editable import android.text.TextWatcher - - class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -37,7 +35,7 @@ class MainActivity : AppCompatActivity() { override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {} override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {} override fun afterTextChanged(s: Editable) { - if (isNumericAddress(s.toString())){ + if (isNumericAddress(s.toString())) { Toast.makeText(this@MainActivity, "Correct", Toast.LENGTH_SHORT).show() } else { Toast.makeText(this@MainActivity, "Wrong", Toast.LENGTH_SHORT).show() diff --git a/software/android/app/src/main/java/com/rookiedev/hexapod/view/ControlView.kt b/software/android/app/src/main/java/com/rookiedev/hexapod/view/ControlView.kt new file mode 100644 index 0000000..e802a61 --- /dev/null +++ b/software/android/app/src/main/java/com/rookiedev/hexapod/view/ControlView.kt @@ -0,0 +1,26 @@ +package com.rookiedev.hexapod.view + +import android.content.Context +import android.util.AttributeSet +import android.view.ViewGroup + +class ControlView : ViewGroup { + private val mContext: Context? = null + + constructor(context: Context) : super(context) { + // ... + } + + constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) { + // ... + } + + override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) { + TODO("Not yet implemented") + } + + override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec) + } + +} 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 507f201..5ea075e 100644 --- a/software/android/app/src/main/res/layout/activity_control.xml +++ b/software/android/app/src/main/res/layout/activity_control.xml @@ -6,4 +6,13 @@ android:layout_height="match_parent" tools:context=".ControlActivity"> + \ No newline at end of file