diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2ee878e272..f774245935 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -86,11 +86,6 @@ android:name=".activities.HistoryBrowseActivity" android:exported="false" android:theme="@style/AppTheme" /> - - Deliver this part of bolus wizard result [%] Bolus wizard performs calculation but only this part of calculated insulin is delivered. Useful with SMB algorithm. Increasing max basal value because setting is lower than your max basal in profile - Selected: Units wizard_calculation_visible wizard_correction_percent @@ -545,7 +544,6 @@ wear_showbgi Lower value of in range area (display only) Higher value of in range area (display only) - Invalid % entry Random BG Generate random BG data (Demo mode only) BG @@ -576,17 +574,6 @@ Large display skin Skin - Compare profiles - Profile helper - Default profile - Current profile - Available profile - Profile type - Age: %1$.0f TDD: %2$.0f U - Age: %1$.0f TDD: %2$.0f U %3$d%% - Age: %1$.0f Weight: %2$.0f kg - % of basal - DPV Default profile RileyLink status: Unable to create profile. Profile is invalid. Don\'t kill my app? @@ -662,8 +649,6 @@ Sort Loop status Graph scale - Profile 1 - Profile 2 open settings set carb timer alarm All diff --git a/ui/src/main/AndroidManifest.xml b/ui/src/main/AndroidManifest.xml index 655b7388cb..1f5c3c5f46 100644 --- a/ui/src/main/AndroidManifest.xml +++ b/ui/src/main/AndroidManifest.xml @@ -47,6 +47,10 @@ android:name="info.nightscout.ui.activities.TreatmentsActivity" android:exported="false" android:theme="@style/AppTheme" /> + diff --git a/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt rename to ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt index 29bfbb5acb..fa47e2b9ff 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.activities +package info.nightscout.ui.activities import android.annotation.SuppressLint import android.os.Bundle @@ -8,9 +8,8 @@ import android.widget.ArrayAdapter import android.widget.TextView import com.google.android.material.tabs.TabLayout import com.google.common.collect.Lists -import info.nightscout.androidaps.R +import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.databinding.ActivityProfilehelperBinding import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction @@ -21,12 +20,13 @@ import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.profile.PureProfile -import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventLocalProfileChanged import info.nightscout.shared.extensions.toVisibility import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T +import info.nightscout.ui.R +import info.nightscout.ui.databinding.ActivityProfilehelperBinding import info.nightscout.ui.defaultProfile.DefaultProfile import info.nightscout.ui.defaultProfile.DefaultProfileDPV import io.reactivex.rxjava3.core.Single @@ -41,7 +41,6 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() { @Inject lateinit var profileFunction: ProfileFunction @Inject lateinit var defaultProfile: DefaultProfile @Inject lateinit var defaultProfileDPV: DefaultProfileDPV - @Inject lateinit var profilePlugin: ProfilePlugin @Inject lateinit var dateUtil: DateUtil @Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var repository: AppRepository @@ -135,8 +134,8 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() { else defaultProfileDPV.profile(age, tdd, pct / 100.0, profileFunction.getUnits()) profile?.let { OKDialog.showConfirmation(this, rh.gs(R.string.careportal_profileswitch), rh.gs(R.string.copytolocalprofile), Runnable { - profilePlugin.addProfile( - profilePlugin.copyFrom( + activePlugin.activeProfileSource.addProfile( + activePlugin.activeProfileSource.copyFrom( it, "DefaultProfile " + dateUtil.dateAndTimeAndSecondsString(dateUtil.now()) .replace(".", "/") @@ -315,4 +314,4 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() { super.onPause() disposable.clear() } -} +} \ No newline at end of file diff --git a/ui/src/main/java/info/nightscout/ui/di/UiModule.kt b/ui/src/main/java/info/nightscout/ui/di/UiModule.kt index c7c43c22ba..ae386942e8 100644 --- a/ui/src/main/java/info/nightscout/ui/di/UiModule.kt +++ b/ui/src/main/java/info/nightscout/ui/di/UiModule.kt @@ -4,6 +4,7 @@ import dagger.Module import dagger.android.ContributesAndroidInjector import info.nightscout.ui.activities.BolusProgressHelperActivity import info.nightscout.ui.activities.ErrorHelperActivity +import info.nightscout.ui.activities.ProfileHelperActivity import info.nightscout.ui.activities.StatsActivity import info.nightscout.ui.activities.SurveyActivity import info.nightscout.ui.activities.TDDStatsActivity @@ -35,6 +36,7 @@ abstract class UiModule { @ContributesAndroidInjector abstract fun contributesStatsActivity(): StatsActivity @ContributesAndroidInjector abstract fun contributesSurveyActivity(): SurveyActivity @ContributesAndroidInjector abstract fun contributesTreatmentsActivity(): TreatmentsActivity + @ContributesAndroidInjector abstract fun contributesProfileHelperActivityActivity(): ProfileHelperActivity @ContributesAndroidInjector abstract fun contributesTreatmentsBolusFragment(): TreatmentsBolusCarbsFragment @ContributesAndroidInjector abstract fun contributesTreatmentsTemporaryBasalsFragment(): TreatmentsTemporaryBasalsFragment diff --git a/app/src/main/res/layout/activity_profilehelper.xml b/ui/src/main/res/layout/activity_profilehelper.xml similarity index 99% rename from app/src/main/res/layout/activity_profilehelper.xml rename to ui/src/main/res/layout/activity_profilehelper.xml index c5749de48f..8f2094ebdc 100644 --- a/app/src/main/res/layout/activity_profilehelper.xml +++ b/ui/src/main/res/layout/activity_profilehelper.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context=".activities.ProfileHelperActivity"> + tools:context="info.nightscout.ui.activities.ProfileHelperActivity"> Show loop records Hide loop records + + Profile 1 + Profile 2 + Profile type + % of basal + Selected: + Compare profiles + Profile helper + Default profile + Current profile + Available profile + Age: %1$.0f TDD: %2$.0f U + Age: %1$.0f TDD: %2$.0f U %3$d%% + Age: %1$.0f Weight: %2$.0f kg + DPV Default profile + Invalid % entry +