From fd09104be9d6a7e85a0738f999d8e4d92dc2bab2 Mon Sep 17 00:00:00 2001 From: Zhengyu Peng Date: Tue, 15 Feb 2022 17:42:55 -0500 Subject: [PATCH] Update MainActivity.kt --- .../com/rookiedev/hexapod/MainActivity.kt | 49 ++++++++++++++++--- 1 file changed, 41 insertions(+), 8 deletions(-) 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 3163833..2e7efbb 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 @@ -2,34 +2,45 @@ package com.rookiedev.hexapod import android.content.Intent import android.net.InetAddresses.isNumericAddress -import androidx.appcompat.app.AppCompatActivity import android.os.Bundle -import android.widget.Button -import android.widget.Toast -import com.google.android.material.textfield.TextInputEditText import android.text.Editable - import android.text.TextWatcher import android.text.method.LinkMovementMethod +import android.widget.Button import android.widget.TextView +import androidx.appcompat.app.AppCompatActivity +import com.google.android.material.textfield.TextInputEditText import com.google.android.material.textfield.TextInputLayout +import java.lang.String +import kotlin.CharSequence +import kotlin.Int +import kotlin.apply +import kotlin.toString class MainActivity : AppCompatActivity() { + private val SHAREDPREFSNAME = "com.rookiedev.hexapod_preferences" + private val SHAREDPREFSIP = "IP" + private val SHAREDPREFSPORT = "PORT" + + private lateinit var ipInput:TextInputEditText + private lateinit var portInput:TextInputEditText override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) - val ipInput = findViewById(R.id.ip_input) - val portInput = findViewById(R.id.port_input) + ipInput = findViewById(R.id.ip_input) + portInput = findViewById(R.id.port_input) val buttonConnect = findViewById