master
Zhengyu Peng 2 years ago
parent 6c841a629f
commit fe16668440

@ -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()",

@ -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()

@ -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)
}
}

@ -6,4 +6,13 @@
android:layout_height="match_parent"
tools:context=".ControlActivity">
<view
android:id="@+id/view"
class="com.rookiedev.hexapod.view.ControlView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Loading…
Cancel
Save