[F] Fix settings back button

This commit is contained in:
Azalea Gui
2023-01-23 22:20:09 -05:00
parent 5c8e526930
commit 49f99abdbf
2 changed files with 12 additions and 1 deletions
@@ -1,6 +1,7 @@
package org.hydev.wearsync
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
@@ -25,6 +26,16 @@ class ActivitySettings : AppCompatActivity()
supportActionBar?.setDisplayHomeAsUpEnabled(true)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
android.R.id.home -> {
finish()
true
}
else -> super.onOptionsItemSelected(item)
}
}
class SettingsFragment : PreferenceFragmentCompat()
{
val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
@@ -13,7 +13,7 @@ import java.util.*
internal class BluetoothHandler private constructor(context: Context) {
private var currentTimeCounter = 0
val batteryChannel = Channel<UInt>(UNLIMITED)
val batteryChannel = Channel<BatteryMeasurement>(UNLIMITED)
val heartRateChannel = Channel<HeartRateMeasurement>(UNLIMITED)
val bloodPressureChannel = Channel<BloodPressureMeasurement>(UNLIMITED)
val glucoseChannel = Channel<GlucoseMeasurement>(UNLIMITED)