diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt index 495042ed26..d13dec97ee 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt @@ -27,12 +27,12 @@ import info.nightscout.androidaps.activities.PreferencesActivity import info.nightscout.androidaps.diaconn.events.EventDiaconnG8PumpLogReset import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.maintenance.formats.EncryptedPrefsFormat -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.PrefImportSummaryDialog import info.nightscout.androidaps.utils.protection.PasswordCheck import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.dialogs.TwoMessagesAlertDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt index 047e8f146e..9c90e0a964 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt @@ -45,17 +45,17 @@ import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.protection.ProtectionCheck -import info.nightscout.core.ui.elements.SingleClickButton -import info.nightscout.core.ui.UIRunnable import info.nightscout.automation.AutomationPlugin import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.iob.displayText import info.nightscout.core.profile.toSignedUnitsString import info.nightscout.core.profile.toTargetRangeString import info.nightscout.core.profile.toUnits +import info.nightscout.core.ui.UIRunnable import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.elements.SingleClickButton +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.wizard.QuickWizard import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.kt index ffe1b3f728..4b8979a032 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.kt @@ -17,7 +17,7 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Effec import info.nightscout.androidaps.plugins.general.overview.graphExtensions.GlucoseValueDataPoint import info.nightscout.androidaps.plugins.general.overview.graphExtensions.TimeAsXAxisLabelFormatter import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.interfaces.utils.Round diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt index c0398c51d2..a6472fe6ee 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt @@ -16,13 +16,13 @@ import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.services.AlarmSoundServiceHelper import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.iob.generateCOBString import info.nightscout.core.iob.round import info.nightscout.core.profile.fromMgdlToUnits import info.nightscout.core.profile.toMgdl import info.nightscout.core.profile.toTargetRangeString +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.wizard.BolusWizard import info.nightscout.core.wizard.QuickWizard import info.nightscout.core.wizard.QuickWizardEntry diff --git a/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/PrefImportSummaryDialog.kt b/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/PrefImportSummaryDialog.kt index 8b5e3bae14..76482f1122 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/PrefImportSummaryDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/PrefImportSummaryDialog.kt @@ -18,7 +18,7 @@ import androidx.annotation.StyleRes import androidx.appcompat.view.ContextThemeWrapper import com.google.android.material.dialog.MaterialAlertDialogBuilder import info.nightscout.androidaps.R -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.maintenance.Prefs import info.nightscout.interfaces.maintenance.PrefsStatus import info.nightscout.shared.extensions.runOnUiThread diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 721c727511..df0ec70b04 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -110,7 +110,6 @@ This value is called Max IOB in OpenAPS context\nThis is maximal insulin in [U] APS can deliver at once. Language You will be asked for master password, which will be used to encrypt exported preferences. - You will be asked for master password, which is needed to decrypt imported preferences. Export canceled! Preferences were NOT exported! Import canceled! Preferences were NOT imported! Cannot import preferences! diff --git a/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt b/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt index 8684bacef0..7e3f785f58 100644 --- a/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt +++ b/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt @@ -11,7 +11,6 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dialogs.DialogFragmentWithDate -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.automation.AutomationEvent import info.nightscout.automation.AutomationPlugin import info.nightscout.automation.R @@ -23,6 +22,7 @@ import info.nightscout.automation.events.EventAutomationUpdateAction import info.nightscout.automation.events.EventAutomationUpdateGui import info.nightscout.automation.events.EventAutomationUpdateTrigger import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.shared.extensions.toVisibility diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerBTDevice.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerBTDevice.kt index 17cbafa370..13a851d10a 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerBTDevice.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerBTDevice.kt @@ -9,14 +9,14 @@ import android.widget.LinearLayout import androidx.core.app.ActivityCompat import com.google.common.base.Optional import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.automation.AutomationPlugin import info.nightscout.automation.R import info.nightscout.automation.elements.ComparatorConnect import info.nightscout.automation.elements.InputDropdownMenu import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel +import info.nightscout.core.ui.toast.ToastUtils +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.events.EventBTChange import info.nightscout.rx.logging.LTag import org.json.JSONObject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt index 31be63bbb5..9e1dbb77c6 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt @@ -1,10 +1,24 @@ package info.nightscout.androidaps.utils.protection import androidx.biometric.BiometricPrompt -import androidx.biometric.BiometricPrompt.* +import androidx.biometric.BiometricPrompt.AuthenticationResult +import androidx.biometric.BiometricPrompt.ERROR_CANCELED +import androidx.biometric.BiometricPrompt.ERROR_HW_NOT_PRESENT +import androidx.biometric.BiometricPrompt.ERROR_HW_UNAVAILABLE +import androidx.biometric.BiometricPrompt.ERROR_LOCKOUT +import androidx.biometric.BiometricPrompt.ERROR_LOCKOUT_PERMANENT +import androidx.biometric.BiometricPrompt.ERROR_NEGATIVE_BUTTON +import androidx.biometric.BiometricPrompt.ERROR_NO_BIOMETRICS +import androidx.biometric.BiometricPrompt.ERROR_NO_DEVICE_CREDENTIAL +import androidx.biometric.BiometricPrompt.ERROR_NO_SPACE +import androidx.biometric.BiometricPrompt.ERROR_TIMEOUT +import androidx.biometric.BiometricPrompt.ERROR_UNABLE_TO_PROCESS +import androidx.biometric.BiometricPrompt.ERROR_USER_CANCELED +import androidx.biometric.BiometricPrompt.ERROR_VENDOR +import androidx.biometric.BiometricPrompt.PromptInfo import androidx.fragment.app.FragmentActivity import info.nightscout.core.main.R -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.shared.extensions.runOnUiThread import java.util.concurrent.Executors diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt index 52efa43b9a..ff1af870d2 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt @@ -14,8 +14,8 @@ import androidx.annotation.StringRes import com.google.android.material.dialog.MaterialAlertDialogBuilder import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvider import info.nightscout.androidaps.utils.CryptoUtil -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.main.R +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.shared.sharedPreferences.SP import java.io.File diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt index 00d3e0d556..5297a91054 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt @@ -1,7 +1,6 @@ package info.nightscout.androidaps.utils.ui import android.Manifest -import kotlin.jvm.JvmOverloads import android.bluetooth.BluetoothManager import android.content.Context import android.content.pm.PackageManager @@ -10,8 +9,8 @@ import android.util.AttributeSet import androidx.core.app.ActivityCompat import androidx.preference.ListPreference import info.nightscout.core.main.R -import info.nightscout.androidaps.utils.ToastUtils -import java.util.* +import info.nightscout.core.ui.toast.ToastUtils +import java.util.Vector class BluetoothDevicePreference @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : ListPreference(context, attrs) { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt index 3f93fdeae2..f499656f4a 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt @@ -23,9 +23,7 @@ import android.widget.Button import android.widget.LinearLayout import info.nightscout.core.main.R import info.nightscout.core.main.databinding.NumberPickerLayoutBinding -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.androidaps.utils.ToastUtils -import info.nightscout.shared.SafeParse +import info.nightscout.core.ui.toast.ToastUtils import java.text.NumberFormat import java.util.concurrent.Executors import java.util.concurrent.ScheduledExecutorService @@ -69,6 +67,20 @@ open class NumberPicker(context: Context, attrs: AttributeSet? = null) : LinearL false }) + private fun Boolean.toVisibility() = if (this) View.VISIBLE else View.GONE + private fun stringToDouble(inputString: String?, defaultValue: Double = 0.0): Double { + var input = inputString ?: return defaultValue + var result = defaultValue + input = input.replace(",", ".") + input = input.replace("−", "-") + if (input == "") return defaultValue + try { + result = input.toDouble() + } catch (e: Exception) { +// log.error("Error parsing " + input + " to double"); + } + return result + } private inner class UpdateCounterTask(private val mInc: Boolean) : Runnable { private var repeated = 0 @@ -121,7 +133,7 @@ open class NumberPicker(context: Context, attrs: AttributeSet? = null) : LinearL override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {} override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {} override fun afterTextChanged(s: Editable) { - if (focused) currentValue = SafeParse.stringToDouble(binding.editText.text.toString()) + if (focused) currentValue = stringToDouble(binding.editText.text.toString()) callValueChangedListener() val inValid = currentValue > maxValue || currentValue < minValue okButton?.visibility = inValid.not().toVisibility() @@ -174,7 +186,7 @@ open class NumberPicker(context: Context, attrs: AttributeSet? = null) : LinearL binding.editText.addTextChangedListener(textWatcher) binding.editText.onFocusChangeListener = OnFocusChangeListener { _: View?, hasFocus: Boolean -> if (!hasFocus) { - currentValue = SafeParse.stringToDouble(binding.editText.text.toString()) + currentValue = stringToDouble(binding.editText.text.toString()) if (currentValue > maxValue) { currentValue = maxValue ToastUtils.warnToast(context, R.string.youareonallowedlimit) diff --git a/core/core-main/src/main/java/info/nightscout/core/toast/ToastUtilsExtension.kt b/core/core-main/src/main/java/info/nightscout/core/toast/ToastUtilsExtension.kt new file mode 100644 index 0000000000..5777495f3f --- /dev/null +++ b/core/core-main/src/main/java/info/nightscout/core/toast/ToastUtilsExtension.kt @@ -0,0 +1,18 @@ +package info.nightscout.core.toast + +import android.content.Context +import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification +import info.nightscout.core.ui.toast.ToastUtils +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.rx.bus.RxBus + +fun ToastUtils.showToastAdNotification( + ctx: Context?, rxBus: RxBus, + string: String?, soundID: Int +) { + showToastInUiThread(ctx, string) + playSound(ctx, soundID) + val notification = Notification(Notification.TOAST_ALARM, string!!, Notification.URGENT) + rxBus.send(EventNewNotification(notification)) +} + diff --git a/core/ui/build.gradle b/core/ui/build.gradle index 85b1b18ce0..fbb185544f 100644 --- a/core/ui/build.gradle +++ b/core/ui/build.gradle @@ -9,6 +9,10 @@ apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" android { namespace 'info.nightscout.core.ui' + + buildFeatures { + viewBinding true + } } dependencies { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ToastUtils.kt b/core/ui/src/main/java/info/nightscout/core/ui/toast/ToastUtils.kt similarity index 80% rename from core/core-main/src/main/java/info/nightscout/androidaps/utils/ToastUtils.kt rename to core/ui/src/main/java/info/nightscout/core/ui/toast/ToastUtils.kt index 3406711f11..cc9d457c2f 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ToastUtils.kt +++ b/core/ui/src/main/java/info/nightscout/core/ui/toast/ToastUtils.kt @@ -1,10 +1,12 @@ -package info.nightscout.androidaps.utils +package info.nightscout.core.ui.toast import android.annotation.SuppressLint import android.content.Context import android.media.MediaPlayer import android.os.Handler import android.os.Looper +import android.text.Html +import android.text.Spanned import android.view.LayoutInflater import android.widget.ImageView import android.widget.TextView @@ -12,12 +14,8 @@ import android.widget.Toast import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.appcompat.view.ContextThemeWrapper -import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.core.main.R +import info.nightscout.core.ui.R import info.nightscout.core.ui.getThemeColor -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.utils.HtmlHelper -import info.nightscout.rx.bus.RxBus object ToastUtils { @@ -78,29 +76,23 @@ object ToastUtils { val toast: Toast = Toast.makeText( ctx, - HtmlHelper.fromHtml("" + string + ""), + fromHtml("" + string + ""), Toast.LENGTH_SHORT ) toast.show() } } - fun showToastInUiThread( - ctx: Context?, rxBus: RxBus, - string: String?, soundID: Int - ) { - showToastInUiThread(ctx, string) - playSound(ctx, soundID) - val notification = Notification(Notification.TOAST_ALARM, string!!, Notification.URGENT) - rxBus.send(EventNewNotification(notification)) - } - - private fun playSound(ctx: Context?, soundID: Int) { + fun playSound(ctx: Context?, soundID: Int) { val soundMP = MediaPlayer.create(ctx, soundID) soundMP.start() soundMP.setOnCompletionListener { obj: MediaPlayer -> obj.release() } } + private fun fromHtml(source: String): Spanned { + return Html.fromHtml(source, Html.FROM_HTML_MODE_LEGACY) + } + object Long { fun warnToast(ctx: Context?, string: String) { diff --git a/core/core-main/src/main/res/drawable/ic_toast_check.xml b/core/ui/src/main/res/drawable/ic_toast_check.xml similarity index 100% rename from core/core-main/src/main/res/drawable/ic_toast_check.xml rename to core/ui/src/main/res/drawable/ic_toast_check.xml diff --git a/core/core-main/src/main/res/drawable/ic_toast_delete_confirm.xml b/core/ui/src/main/res/drawable/ic_toast_delete_confirm.xml similarity index 100% rename from core/core-main/src/main/res/drawable/ic_toast_delete_confirm.xml rename to core/ui/src/main/res/drawable/ic_toast_delete_confirm.xml diff --git a/core/core-main/src/main/res/drawable/ic_toast_error.xml b/core/ui/src/main/res/drawable/ic_toast_error.xml similarity index 100% rename from core/core-main/src/main/res/drawable/ic_toast_error.xml rename to core/ui/src/main/res/drawable/ic_toast_error.xml diff --git a/core/core-main/src/main/res/drawable/ic_toast_info.xml b/core/ui/src/main/res/drawable/ic_toast_info.xml similarity index 100% rename from core/core-main/src/main/res/drawable/ic_toast_info.xml rename to core/ui/src/main/res/drawable/ic_toast_info.xml diff --git a/core/core-main/src/main/res/drawable/ic_toast_warn.xml b/core/ui/src/main/res/drawable/ic_toast_warn.xml similarity index 100% rename from core/core-main/src/main/res/drawable/ic_toast_warn.xml rename to core/ui/src/main/res/drawable/ic_toast_warn.xml diff --git a/core/core-main/src/main/res/layout/toast.xml b/core/ui/src/main/res/layout/toast.xml similarity index 100% rename from core/core-main/src/main/res/layout/toast.xml rename to core/ui/src/main/res/layout/toast.xml diff --git a/core/ui/src/main/res/values/strings.xml b/core/ui/src/main/res/values/strings.xml index 3973c2acde..1c213f6e9a 100644 --- a/core/ui/src/main/res/values/strings.xml +++ b/core/ui/src/main/res/values/strings.xml @@ -9,4 +9,7 @@ Yes No + + You will be asked for master password, which is needed to decrypt imported preferences. + \ No newline at end of file diff --git a/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt b/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt index 13c56ead2e..9afefc49ad 100644 --- a/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt @@ -14,8 +14,8 @@ import android.provider.Settings import androidx.core.content.ContextCompat import androidx.fragment.app.FragmentActivity import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.Config import info.nightscout.interfaces.notifications.Notification diff --git a/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt index f1641ef0e5..385dae2c9f 100644 --- a/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt @@ -2,8 +2,9 @@ package info.nightscout.implementation import android.content.Context import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.main.R +import info.nightscout.core.toast.showToastAdNotification +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.interfaces.utils.HardLimits @@ -101,7 +102,7 @@ class HardLimitsImpl @Inject constructor( msg += rh.gs(R.string.valuelimitedto, value, newValue) aapsLogger.error(msg) disposable += repository.runTransaction(InsertTherapyEventAnnouncementTransaction(msg)).subscribe() - ToastUtils.showToastInUiThread(context, rxBus, msg, R.raw.error) + ToastUtils.showToastAdNotification(context, rxBus, msg, R.raw.error) } return newValue } diff --git a/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt b/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt index 16cc20692a..da3dcffed3 100644 --- a/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt @@ -5,7 +5,7 @@ import android.content.Intent import android.os.Bundle import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.receivers.Intents -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.GlucoseValue import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.XDripBroadcast diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt index 89ba9b17c3..12ff59c4a6 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt @@ -5,7 +5,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerDialogFragment -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.plugins.R import info.nightscout.plugins.constraints.objectives.events.EventObjectivesUpdateGui import info.nightscout.plugins.constraints.objectives.objectives.Objective diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt index ad382c97ec..dca46a5df4 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt @@ -14,9 +14,9 @@ import com.google.common.primitives.Ints.min import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.smsCommunicator.SmsCommunicator diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt index 8baba7246f..13d5950199 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt @@ -12,10 +12,10 @@ import info.nightscout.androidaps.extensions.blockFromJsonArray import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.core.profile.toMgdl import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt index e2c2070f0e..e42dd14398 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt @@ -12,8 +12,9 @@ import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceScreen import androidx.preference.SwitchPreference import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.toast.showToastAdNotification +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants @@ -186,7 +187,7 @@ class NSClientPlugin @Inject constructor( } return fromHtml(newTextLog.toString()) } catch (e: OutOfMemoryError) { - ToastUtils.showToastInUiThread(context, rxBus, "Out of memory!\nStop using this phone !!!", R.raw.error) + ToastUtils.showToastAdNotification(context, rxBus, "Out of memory!\nStop using this phone !!!", R.raw.error) } return fromHtml("") } diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt index 951e2ba96e..0e6715af29 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -12,8 +12,9 @@ import androidx.work.OneTimeWorkRequest import androidx.work.WorkInfo import androidx.work.WorkManager import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.toast.showToastAdNotification +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants @@ -226,7 +227,7 @@ class NSClientV3Plugin @Inject constructor( } return HtmlHelper.fromHtml(newTextLog.toString()) } catch (e: OutOfMemoryError) { - ToastUtils.showToastInUiThread(context, rxBus, "Out of memory!\nStop using this phone !!!", R.raw.error) + ToastUtils.showToastAdNotification(context, rxBus, "Out of memory!\nStop using this phone !!!", R.raw.error) } return HtmlHelper.fromHtml("") } diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt index 2de4878b9d..76e0cf2a89 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt @@ -7,8 +7,9 @@ import androidx.preference.PreferenceFragmentCompat import dagger.android.HasAndroidInjector import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.receivers.ReceiverStatusStore -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.toast.showToastAdNotification +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.Constants import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription @@ -171,7 +172,7 @@ class TidepoolPlugin @Inject constructor( } textLog = HtmlHelper.fromHtml(newTextLog.toString()) } catch (e: OutOfMemoryError) { - ToastUtils.showToastInUiThread(context, rxBus, "Out of memory!\nStop using this phone !!!", R.raw.error) + ToastUtils.showToastAdNotification(context, rxBus, "Out of memory!\nStop using this phone !!!", R.raw.error) } } diff --git a/pump/danar/build.gradle b/pump/danar/build.gradle index 2cdabf540c..f60b31fac2 100644 --- a/pump/danar/build.gradle +++ b/pump/danar/build.gradle @@ -20,6 +20,7 @@ dependencies { implementation project(':app-wear-shared:shared') implementation project(':core:core-main') implementation project(':core:fabric') + implementation project(':core:ui') implementation project(':pump:dana') implementation project(':interfaces') } \ No newline at end of file diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java index 8152625dd4..5792e928cc 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java @@ -40,8 +40,8 @@ import info.nightscout.androidaps.danar.comm.MsgHistorySuspend; import info.nightscout.androidaps.danar.comm.MsgPCCommStart; import info.nightscout.androidaps.danar.comm.MsgPCCommStop; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; -import info.nightscout.androidaps.utils.ToastUtils; import info.nightscout.core.fabric.FabricPrivacy; +import info.nightscout.core.ui.toast.ToastUtils; import info.nightscout.interfaces.notifications.Notification; import info.nightscout.interfaces.plugin.ActivePlugin; import info.nightscout.interfaces.profile.Profile; diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index a0eb2f63dd..9fe5ea4e57 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -20,8 +20,8 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotifi import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.notifications.Notification diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/BLEScanActivity.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/BLEScanActivity.kt index 96ab578ecc..1c7ca6542c 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/BLEScanActivity.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/BLEScanActivity.kt @@ -26,7 +26,7 @@ import info.nightscout.androidaps.danars.databinding.DanarsBlescannerActivityBin import info.nightscout.androidaps.danars.events.EventDanaRSDeviceChange import info.nightscout.androidaps.extensions.safeEnable import info.nightscout.androidaps.plugins.pump.common.ble.BlePreCheck -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.shared.sharedPreferences.SP import java.util.regex.Pattern import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt index 7b058e89b3..084a38d2ce 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt @@ -34,7 +34,7 @@ import info.nightscout.androidaps.extensions.notify import info.nightscout.androidaps.extensions.waitMillis import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.pump.PumpSync import info.nightscout.rx.bus.RxBus diff --git a/pump/diaconn/build.gradle b/pump/diaconn/build.gradle index 0f899fc708..3356efd9d3 100644 --- a/pump/diaconn/build.gradle +++ b/pump/diaconn/build.gradle @@ -36,6 +36,7 @@ dependencies { api "androidx.room:room-ktx:$room_version" api "androidx.room:room-runtime:$room_version" api "androidx.room:room-rxjava3:$room_version" + implementation project(path: ':core:ui') kapt "androidx.room:room-compiler:$room_version" api "com.squareup.okhttp3:okhttp:$okhttp3_version" diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt index 2ea58347eb..7bd5144ea8 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt @@ -18,8 +18,8 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotifi import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.constraints.Constraints import info.nightscout.interfaces.notifications.Notification diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8BLEScanActivity.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8BLEScanActivity.kt index 8bf851e9c9..013790865f 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8BLEScanActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8BLEScanActivity.kt @@ -29,7 +29,7 @@ import info.nightscout.androidaps.diaconn.databinding.DiaconnG8BlescannerActivit import info.nightscout.androidaps.diaconn.events.EventDiaconnG8DeviceChange import info.nightscout.androidaps.extensions.safeEnable import info.nightscout.androidaps.plugins.pump.common.ble.BlePreCheck -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.shared.sharedPreferences.SP import java.util.UUID import javax.inject.Inject diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt index 8f2c86c0dd..9153917af9 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt @@ -9,8 +9,8 @@ import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.diaconn.DiaconnG8Pump import info.nightscout.androidaps.diaconn.R import info.nightscout.androidaps.diaconn.databinding.DiaconnG8UserOptionsActivityBinding -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.queue.CommandQueue diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt index 6d5df45aaa..7fdb3bc71d 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt @@ -27,7 +27,7 @@ import info.nightscout.androidaps.diaconn.packet.InjectionBlockReportPacket import info.nightscout.androidaps.diaconn.packet.InsulinLackReportPacket import info.nightscout.androidaps.extensions.notify import info.nightscout.androidaps.extensions.waitMillis -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventPumpStatusChanged diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchConnectNewFragment.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchConnectNewFragment.kt index 669ddb6734..1ff5cef20c 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchConnectNewFragment.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchConnectNewFragment.kt @@ -3,12 +3,16 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider -import info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel.EopatchViewModel.SetupStep.* import info.nightscout.androidaps.plugins.pump.eopatch.R import info.nightscout.androidaps.plugins.pump.eopatch.code.PatchStep import info.nightscout.androidaps.plugins.pump.eopatch.databinding.FragmentEopatchConnectNewBinding import info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel.EopatchViewModel -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel.EopatchViewModel.SetupStep.ACTIVATION_FAILED +import info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel.EopatchViewModel.SetupStep.BONDING_FAILED +import info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel.EopatchViewModel.SetupStep.GET_PATCH_INFO_FAILED +import info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel.EopatchViewModel.SetupStep.SCAN_FAILED +import info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel.EopatchViewModel.SetupStep.SELF_TEST_FAILED +import info.nightscout.core.ui.toast.ToastUtils class EopatchConnectNewFragment : EoBaseFragment() { diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchOverviewFragment.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchOverviewFragment.kt index c5f9453622..9d07f0306f 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchOverviewFragment.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchOverviewFragment.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.plugins.pump.eopatch.core.code.BolusType import info.nightscout.androidaps.plugins.pump.eopatch.databinding.FragmentEopatchOverviewBinding import info.nightscout.androidaps.plugins.pump.eopatch.extension.takeOne import info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel.EopatchOverviewViewModel -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchRotateKnobFragment.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchRotateKnobFragment.kt index 9f1920a548..74fdfc5557 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchRotateKnobFragment.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchRotateKnobFragment.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.plugins.pump.eopatch.R import info.nightscout.androidaps.plugins.pump.eopatch.code.PatchStep import info.nightscout.androidaps.plugins.pump.eopatch.databinding.FragmentEopatchRotateKnobBinding import info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel.EopatchViewModel -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.ui.toast.ToastUtils class EopatchRotateKnobFragment : EoBaseFragment() { diff --git a/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt index 848ccfb4d0..f653e0b8f2 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt @@ -11,9 +11,9 @@ import com.google.common.collect.Lists import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.stats.TddCalculator -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.plugin.ActivePlugin diff --git a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt index a098f84ccc..53539a6482 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt @@ -3,7 +3,7 @@ package info.nightscout.ui.activities import android.os.Bundle import android.widget.ArrayAdapter import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.interfaces.ui.ActivityNames diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt index fbed6dc204..a66a3b1f0f 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt @@ -20,9 +20,9 @@ import info.nightscout.androidaps.events.EventNewHistoryData import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.database.entities.Carbs diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt index 80a1289d71..fbbe9d37cc 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt @@ -16,10 +16,10 @@ import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.Translator import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt index 6b451d3105..6d20fb8ab4 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt @@ -19,9 +19,9 @@ import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.isInProgress import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt index 9bfbb74b91..f793bac2c2 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt @@ -22,9 +22,9 @@ import info.nightscout.androidaps.events.EventNewHistoryData import info.nightscout.androidaps.extensions.getCustomizedName import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt index f7bdaf425f..954f371678 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt @@ -22,10 +22,10 @@ import info.nightscout.androidaps.extensions.highValueToUnitsToString import info.nightscout.androidaps.extensions.lowValueToUnitsToString import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.Translator import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt index 426f74d3cd..491f8c4d3a 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt @@ -20,9 +20,9 @@ import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.extensions.toTemporaryBasal import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.UserEntry.Action diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt index a4c67d3b5f..921e5829cd 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt @@ -13,10 +13,10 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt index 593c584298..dc2f735e6d 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt @@ -14,11 +14,11 @@ import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS import info.nightscout.core.profile.toMgdl import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt index 4b1a8c1582..97c1806957 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/ExtendedBolusDialog.kt @@ -9,9 +9,9 @@ import com.google.common.base.Joiner import info.nightscout.androidaps.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.constraints.Constraint diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt index 600039c02f..7981511ef8 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/FillDialog.kt @@ -10,9 +10,9 @@ import info.nightscout.androidaps.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt index b748719863..ea7d385819 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/InsulinDialog.kt @@ -13,12 +13,12 @@ import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.extensions.toSignedString import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.core.profile.toMgdl import info.nightscout.core.pumpExtensions.insertBolusTransaction import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt index 2886a74d3d..a7b6270c93 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/LoopDialog.kt @@ -12,10 +12,10 @@ import android.view.WindowManager import androidx.fragment.app.FragmentManager import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt index 9981ca2fac..c0a675c948 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/ProfileSwitchDialog.kt @@ -13,10 +13,10 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.core.profile.toMgdl import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt index e1f4c509e4..4b3b16dfd1 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/TempBasalDialog.kt @@ -9,9 +9,9 @@ import com.google.common.base.Joiner import info.nightscout.androidaps.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.constraints.Constraint diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt index 1a33e3e965..63301cd664 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/TempTargetDialog.kt @@ -11,11 +11,11 @@ import com.google.common.collect.Lists import info.nightscout.androidaps.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.core.profile.toCurrentUnitsString import info.nightscout.core.profile.toMgdl import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt index 446b484c99..f045d33f1e 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/TreatmentDialog.kt @@ -12,11 +12,11 @@ import info.nightscout.androidaps.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.core.pumpExtensions.insertBolusTransaction import info.nightscout.core.pumpExtensions.insertCarbsTransaction import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/WizardDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/WizardDialog.kt index 27f6d66cb4..bb81a7f4b0 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/WizardDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/WizardDialog.kt @@ -22,12 +22,12 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.iob.round import info.nightscout.core.profile.toMgdl import info.nightscout.core.profile.toUnitsString +import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.wizard.BolusWizard import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper