@@ -22,10 +22,6 @@ class MainActivity : AppCompatActivity() {
2222
2323 private lateinit var btnToggleService: Button
2424
25- // Connection Mode
26- private lateinit var layoutConnectionMode: View
27- private lateinit var tvConnectionModeValue: TextView
28-
2925 // Auto Start
3026 private lateinit var layoutAutoStart: View
3127 private lateinit var tvAutoStartValue: TextView
@@ -48,15 +44,6 @@ class MainActivity : AppCompatActivity() {
4844 }
4945 }
5046
51- private val connectionModes by lazy {
52- arrayOf(
53- getString(R .string.mode_network_discovery),
54- getString(R .string.mode_wifi_direct),
55- getString(R .string.mode_hotspot_phone),
56- getString(R .string.mode_hotspot_headunit)
57- )
58- }
59-
6047 private val autoStartModes by lazy {
6148 arrayOf(
6249 getString(R .string.auto_start_no),
@@ -78,9 +65,6 @@ class MainActivity : AppCompatActivity() {
7865 private fun initializeViews () {
7966 btnToggleService = findViewById(R .id.btnToggleService)
8067
81- layoutConnectionMode = findViewById(R .id.layoutConnectionMode)
82- tvConnectionModeValue = findViewById(R .id.tvConnectionModeValue)
83-
8468 layoutAutoStart = findViewById(R .id.layoutAutoStart)
8569 tvAutoStartValue = findViewById(R .id.tvAutoStartValue)
8670
@@ -97,7 +81,7 @@ class MainActivity : AppCompatActivity() {
9781 layoutAbout.setOnClickListener {
9882 MaterialAlertDialogBuilder (this , R .style.DarkAlertDialog )
9983 .setTitle(R .string.about)
100- .setMessage(" Wireless Helper is a trigger app for Headunit Revived.\n\n Developed by André Rinas\n © 2026" )
84+ .setMessage(" Wireless Helper is a trigger app for Headunit Revived.\n\n You need to set 'Wireless Helper' in 'Wireless Mode'-Setting at Headunit Revived for this to work. \n\ n Developed by André Rinas\n © 2026" )
10185 .setPositiveButton(android.R .string.ok, null )
10286 .show()
10387 }
@@ -106,21 +90,6 @@ class MainActivity : AppCompatActivity() {
10690 if (isServiceRunning) stopLauncherService() else checkPermissionsAndStart()
10791 }
10892
109- layoutConnectionMode.setOnClickListener {
110- val prefs = getSharedPreferences(" WirelessHelperPrefs" , Context .MODE_PRIVATE )
111- val currentMode = prefs.getInt(" connection_mode" , 0 )
112-
113- MaterialAlertDialogBuilder (this , R .style.DarkAlertDialog )
114- .setTitle(R .string.connection_mode_label)
115- .setSingleChoiceItems(connectionModes, currentMode) { dialog, which ->
116- prefs.edit { putInt(" connection_mode" , which) }
117- tvConnectionModeValue.text = connectionModes[which]
118- dialog.dismiss()
119- }
120- .setNegativeButton(android.R .string.cancel, null )
121- .show()
122- }
123-
12493 layoutAutoStart.setOnClickListener {
12594 val prefs = getSharedPreferences(" WirelessHelperPrefs" , Context .MODE_PRIVATE )
12695 val currentMode = prefs.getInt(" auto_start_mode" , 0 )
@@ -177,9 +146,6 @@ class MainActivity : AppCompatActivity() {
177146 private fun restoreState () {
178147 val prefs = getSharedPreferences(" WirelessHelperPrefs" , Context .MODE_PRIVATE )
179148
180- val connMode = prefs.getInt(" connection_mode" , 0 )
181- tvConnectionModeValue.text = connectionModes.getOrElse(connMode) { connectionModes[0 ] }
182-
183149 val autoMode = prefs.getInt(" auto_start_mode" , 0 )
184150 updateAutoStartUI(autoMode)
185151
@@ -194,11 +160,11 @@ class MainActivity : AppCompatActivity() {
194160 when (mode) {
195161 0 -> { // No
196162 layoutBluetoothDevice.visibility = View .GONE
197- layoutAutoStart.setBackgroundResource(R .drawable.bg_item_bottom )
163+ layoutAutoStart.setBackgroundResource(R .drawable.bg_item_single )
198164 }
199165 1 -> { // Bluetooth
200166 layoutBluetoothDevice.visibility = View .VISIBLE
201- layoutAutoStart.setBackgroundResource(R .drawable.bg_item_middle )
167+ layoutAutoStart.setBackgroundResource(R .drawable.bg_item_top )
202168 layoutBluetoothDevice.setBackgroundResource(R .drawable.bg_item_bottom)
203169 }
204170 }
@@ -266,4 +232,4 @@ class MainActivity : AppCompatActivity() {
266232 if (requestCode == 101 ) showBluetoothDeviceSelector()
267233 }
268234 }
269- }
235+ }
0 commit comments