Merge pull request #2241 from dv1/comboctl-dev

combov2: Fix pairing activity in pumpcontrol application
This commit is contained in:
Milos Kozak 2022-12-01 11:09:24 +01:00 committed by GitHub
commit 17368c92f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 7 deletions

View file

@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.plugins.pump.combov2">
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application> <application>
<activity <activity
android:name="info.nightscout.pump.combov2.activities.ComboV2PairingActivity" android:name=".activities.ComboV2PairingActivity"
android:exported="false" android:exported="false"
android:theme="@style/AppTheme.NoActionBar" /> android:theme="@style/AppTheme.NoActionBar" />
</application> </application>

View file

@ -44,6 +44,7 @@ import info.nightscout.interfaces.queue.CommandQueue
import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.interfaces.ui.UiInteraction
import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.interfaces.utils.DecimalFormatter
import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.interfaces.utils.TimeChangeType
import info.nightscout.pump.combov2.activities.ComboV2PairingActivity
import info.nightscout.rx.bus.RxBus import info.nightscout.rx.bus.RxBus
import info.nightscout.rx.events.EventDismissNotification import info.nightscout.rx.events.EventDismissNotification
import info.nightscout.rx.events.EventInitializationChanged import info.nightscout.rx.events.EventInitializationChanged
@ -326,6 +327,8 @@ class ComboV2Plugin @Inject constructor (
val pairPref: Preference? = findPreference(rh.gs(R.string.key_combov2_pair_with_pump)) val pairPref: Preference? = findPreference(rh.gs(R.string.key_combov2_pair_with_pump))
val unpairPref: Preference? = findPreference(rh.gs(R.string.key_combov2_unpair_pump)) val unpairPref: Preference? = findPreference(rh.gs(R.string.key_combov2_unpair_pump))
pairPref?.intent = Intent(activity, ComboV2PairingActivity::class.java)
val isInitiallyPaired = pairedStateUIFlow.value val isInitiallyPaired = pairedStateUIFlow.value
pairPref?.isEnabled = !isInitiallyPaired pairPref?.isEnabled = !isInitiallyPaired
unpairPref?.isEnabled = isInitiallyPaired unpairPref?.isEnabled = isInitiallyPaired

View file

@ -7,7 +7,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
tools:context=".plugins.pump.combov2.activities.ComboV2PairingActivity"> tools:context=".activities.ComboV2PairingActivity">
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/header" android:id="@+id/header"

View file

@ -12,9 +12,6 @@
android:title="@string/combov2_pair_with_pump_title" android:title="@string/combov2_pair_with_pump_title"
android:summary="@string/combov2_pair_with_pump_summary" android:summary="@string/combov2_pair_with_pump_summary"
android:shouldDisableView="true"> android:shouldDisableView="true">
<intent
android:targetClass="info.nightscout.pump.combov2.activities.ComboV2PairingActivity"
android:targetPackage="info.nightscout.androidaps" />
</Preference> </Preference>
<Preference <Preference