From fa31a36d9d69b8b7301320860bd5e40fc78134a0 Mon Sep 17 00:00:00 2001 From: Zhengyu Peng Date: Tue, 22 Feb 2022 22:28:09 -0500 Subject: [PATCH] Update MainActivity.kt --- .../com/rookiedev/hexapod/MainActivity.kt | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 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 4326f27..085212b 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 @@ -33,24 +33,30 @@ class MainActivity : AppCompatActivity() { private const val SHARED_PREFS_TAB = "TAB" private const val SHARED_PREFS_DEVICE_NAME = "DEVICE_NAME" private const val SHARED_PREFS_DEVICE_ADDRESS = "DEVICE_ADDRESS" + + private const val TAB_WIFI = "WiFi" + private const val TAB_BLUETOOTH = "Bluetooth" } private var mContext: Context? = null + private lateinit var tabLayout: TabLayout + private lateinit var ipInput: TextInputEditText private lateinit var portInput: TextInputEditText private lateinit var btDeviceName: TextView private lateinit var btDeviceMac: TextView - private lateinit var tabLayout: TabLayout - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) mContext = applicationContext + // Tab layout + tabLayout = findViewById(R.id.tab) + // TCP val ipLayout = findViewById(R.id.ip_input_layout) val portLayout = findViewById(R.id.port_input_layout) @@ -61,23 +67,26 @@ class MainActivity : AppCompatActivity() { val selectedDevice = findViewById(R.id.selected) btDeviceName = findViewById(R.id.textView_device_name) btDeviceMac = findViewById(R.id.textView_device_mac) - - val buttonConnect = findViewById