diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/CalibrationDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/CalibrationDialog.kt similarity index 92% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/CalibrationDialog.kt rename to app/src/main/java/info/nightscout/androidaps/dialogs/CalibrationDialog.kt index 0e18ee72ff..94c98aff0e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/CalibrationDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/CalibrationDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.overview.dialogs +package info.nightscout.androidaps.dialogs import android.os.Bundle import android.view.LayoutInflater @@ -15,7 +15,7 @@ import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.OKDialog import info.nightscout.androidaps.utils.XdripCalibrations import kotlinx.android.synthetic.main.okcancel.* -import kotlinx.android.synthetic.main.overview_calibration_dialog.* +import kotlinx.android.synthetic.main.dialog_calibration.* import java.text.DecimalFormat import java.util.* @@ -29,7 +29,7 @@ class CalibrationDialog : DialogFragmentWithDate() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { onCreateView() - return inflater.inflate(R.layout.overview_calibration_dialog, container, false) + return inflater.inflate(R.layout.dialog_calibration, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/CarbsDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/CarbsDialog.kt rename to app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt index b516e84b8f..741ffed3e3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/CarbsDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.overview.dialogs +package info.nightscout.androidaps.dialogs import android.os.Bundle import android.text.Editable @@ -23,8 +23,7 @@ import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin import info.nightscout.androidaps.utils.* import kotlinx.android.synthetic.main.notes.* import kotlinx.android.synthetic.main.okcancel.* -import kotlinx.android.synthetic.main.overview_carbs_dialog.* -import org.slf4j.LoggerFactory +import kotlinx.android.synthetic.main.dialog_carbs.* import java.text.DecimalFormat import java.util.* import kotlin.math.max @@ -74,7 +73,7 @@ class CarbsDialog : DialogFragmentWithDate() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { onCreateView() - return inflater.inflate(R.layout.overview_carbs_dialog, container, false) + return inflater.inflate(R.layout.dialog_carbs, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/dialogs/CareDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/actions/dialogs/CareDialog.kt rename to app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt index 1597d13959..ac47fdfea4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/dialogs/CareDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.actions.dialogs +package info.nightscout.androidaps.dialogs import android.os.Bundle import android.text.Editable @@ -15,10 +15,9 @@ import info.nightscout.androidaps.data.Profile import info.nightscout.androidaps.db.CareportalEvent import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions import info.nightscout.androidaps.plugins.general.nsclient.NSUpload -import info.nightscout.androidaps.plugins.general.overview.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.androidaps.utils.* -import kotlinx.android.synthetic.main.actions_care_dialog.* +import kotlinx.android.synthetic.main.dialog_care.* import kotlinx.android.synthetic.main.okcancel.* import kotlinx.android.synthetic.main.notes.* import org.json.JSONObject @@ -51,7 +50,7 @@ class CareDialog : DialogFragmentWithDate() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { onCreateView() - return inflater.inflate(R.layout.actions_care_dialog, container, false) + return inflater.inflate(R.layout.dialog_care, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/DialogFragmentWithDate.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/DialogFragmentWithDate.kt rename to app/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt index a1f04e2aaa..408188399b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/DialogFragmentWithDate.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.overview.dialogs +package info.nightscout.androidaps.dialogs import android.app.DatePickerDialog import android.app.TimePickerDialog diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/dialogs/ExtendedBolusDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt similarity index 92% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/actions/dialogs/ExtendedBolusDialog.kt rename to app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt index 2ea30fb0e7..6baa64f76c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/dialogs/ExtendedBolusDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.actions.dialogs +package info.nightscout.androidaps.dialogs import android.content.Intent import android.os.Bundle @@ -10,13 +10,12 @@ import info.nightscout.androidaps.MainApp import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin -import info.nightscout.androidaps.plugins.general.overview.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.OKDialog import info.nightscout.androidaps.utils.SafeParse -import kotlinx.android.synthetic.main.actions_extendedbolus_dialog.* +import kotlinx.android.synthetic.main.dialog_extendedbolus.* import kotlinx.android.synthetic.main.okcancel.* import java.text.DecimalFormat import java.util.* @@ -33,7 +32,7 @@ class ExtendedBolusDialog : DialogFragmentWithDate() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { onCreateView() - return inflater.inflate(R.layout.actions_extendedbolus_dialog, container, false) + return inflater.inflate(R.layout.dialog_extendedbolus, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/dialogs/FillDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/actions/dialogs/FillDialog.kt rename to app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt index 01469cca2e..e8e8621ce8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/dialogs/FillDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.actions.dialogs +package info.nightscout.androidaps.dialogs import android.content.Intent import android.os.Bundle @@ -14,11 +14,10 @@ import info.nightscout.androidaps.db.Source import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin import info.nightscout.androidaps.plugins.general.nsclient.NSUpload -import info.nightscout.androidaps.plugins.general.overview.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.* -import kotlinx.android.synthetic.main.actions_fill_dialog.* +import kotlinx.android.synthetic.main.dialog_fill.* import kotlinx.android.synthetic.main.notes.* import kotlinx.android.synthetic.main.okcancel.* import java.util.* @@ -34,7 +33,7 @@ class FillDialog : DialogFragmentWithDate() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { onCreateView() - return inflater.inflate(R.layout.actions_fill_dialog, container, false) + return inflater.inflate(R.layout.dialog_fill, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/InsulinDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/InsulinDialog.kt rename to app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt index d3d84c99b1..93821dd3b4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/InsulinDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.overview.dialogs +package info.nightscout.androidaps.dialogs import android.content.Intent import android.os.Bundle @@ -19,13 +19,13 @@ import info.nightscout.androidaps.db.TempTarget import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions +import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.* import kotlinx.android.synthetic.main.notes.* import kotlinx.android.synthetic.main.okcancel.* -import kotlinx.android.synthetic.main.overview_insulin_dialog.* -import org.slf4j.LoggerFactory +import kotlinx.android.synthetic.main.dialog_insulin.* import java.text.DecimalFormat import java.util.* import kotlin.math.abs @@ -70,7 +70,7 @@ class InsulinDialog : DialogFragmentWithDate() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { onCreateView() - return inflater.inflate(R.layout.overview_insulin_dialog, container, false) + return inflater.inflate(R.layout.dialog_insulin, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/ProfileSwitchDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/ProfileSwitchDialog.kt rename to app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt index 56dc112527..4644d950d3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/ProfileSwitchDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.overview.dialogs +package info.nightscout.androidaps.dialogs import android.os.Bundle import android.view.LayoutInflater @@ -17,7 +17,7 @@ import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.OKDialog import kotlinx.android.synthetic.main.notes.* import kotlinx.android.synthetic.main.okcancel.* -import kotlinx.android.synthetic.main.overview_profileswitch_dialog.* +import kotlinx.android.synthetic.main.dialog_profileswitch.* import java.text.DecimalFormat import java.util.* @@ -33,7 +33,7 @@ class ProfileSwitchDialog : DialogFragmentWithDate() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { onCreateView() - return inflater.inflate(R.layout.overview_profileswitch_dialog, container, false) + return inflater.inflate(R.layout.dialog_profileswitch, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/dialogs/TempBasalDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/actions/dialogs/TempBasalDialog.kt rename to app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt index 6c9c81e7b2..246a3357a4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/dialogs/TempBasalDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.actions.dialogs +package info.nightscout.androidaps.dialogs import android.content.Intent import android.os.Bundle @@ -12,13 +12,12 @@ import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.PumpDescription import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions -import info.nightscout.androidaps.plugins.general.overview.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.OKDialog import info.nightscout.androidaps.utils.SafeParse -import kotlinx.android.synthetic.main.actions_tempbasal_dialog.* +import kotlinx.android.synthetic.main.dialog_tempbasal.* import kotlinx.android.synthetic.main.okcancel.* import java.text.DecimalFormat import java.util.* @@ -37,7 +36,7 @@ class TempBasalDialog : DialogFragmentWithDate() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { onCreateView() - return inflater.inflate(R.layout.actions_tempbasal_dialog, container, false) + return inflater.inflate(R.layout.dialog_tempbasal, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/TempTargetDialog.kt rename to app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt index 79a3c396f6..498e2db510 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/TempTargetDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.overview.dialogs +package info.nightscout.androidaps.dialogs import android.os.Bundle import android.view.LayoutInflater @@ -18,7 +18,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin import info.nightscout.androidaps.utils.* import kotlinx.android.synthetic.main.okcancel.* -import kotlinx.android.synthetic.main.overview_temptarget_dialog.* +import kotlinx.android.synthetic.main.dialog_temptarget.* import java.text.DecimalFormat import java.util.* @@ -33,7 +33,7 @@ class TempTargetDialog : DialogFragmentWithDate() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { onCreateView() - return inflater.inflate(R.layout.overview_temptarget_dialog, container, false) + return inflater.inflate(R.layout.dialog_temptarget, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -53,6 +53,8 @@ class TempTargetDialog : DialogFragmentWithDate() { ?: Constants.MIN_TT_MGDL, Constants.MIN_TT_MGDL, Constants.MAX_TT_MGDL, 1.0, DecimalFormat("0"), false, ok) + val units = ProfileFunctions.getSystemUnits() + overview_temptarget_units.text = if (units == Constants.MMOL) MainApp.gs(R.string.mmol) else MainApp.gs(R.string.mgdl) // temp target context?.let { context -> val reasonList: List = Lists.newArrayList( diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/TreatmentDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/TreatmentDialog.kt rename to app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt index 767e9cef55..34e3047c8c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/TreatmentDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.overview.dialogs +package info.nightscout.androidaps.dialogs import android.content.Intent import android.os.Bundle @@ -15,11 +15,12 @@ import info.nightscout.androidaps.db.CareportalEvent import info.nightscout.androidaps.db.Source import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin +import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.* import kotlinx.android.synthetic.main.okcancel.* -import kotlinx.android.synthetic.main.overview_treatment_dialog.* +import kotlinx.android.synthetic.main.dialog_treatment.* import java.text.DecimalFormat import java.util.* import kotlin.math.abs @@ -56,7 +57,7 @@ class TreatmentDialog : DialogFragmentWithDate() { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { onCreateView() - return inflater.inflate(R.layout.overview_treatment_dialog, container, false) + return inflater.inflate(R.layout.dialog_treatment, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/WizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/WizardDialog.kt rename to app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt index 46462b0dfc..b55e63d713 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/WizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt @@ -1,6 +1,5 @@ -package info.nightscout.androidaps.plugins.general.overview.dialogs +package info.nightscout.androidaps.dialogs -import android.content.Context import android.os.Bundle import android.text.Editable import android.text.TextWatcher @@ -26,7 +25,7 @@ import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin import info.nightscout.androidaps.utils.* import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.disposables.CompositeDisposable -import kotlinx.android.synthetic.main.overview_wizard_dialog.* +import kotlinx.android.synthetic.main.dialog_wizard.* import org.slf4j.LoggerFactory import java.text.DecimalFormat import java.util.* @@ -36,16 +35,13 @@ class WizardDialog : DialogFragment() { private val log = LoggerFactory.getLogger(WizardDialog::class.java) private var wizard: BolusWizard? = null - private var parentContext: Context? = null //one shot guards private var okClicked: Boolean = false private val textWatcher = object : TextWatcher { override fun afterTextChanged(s: Editable) {} - override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {} - override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { calculateInsulin() } @@ -53,21 +49,11 @@ class WizardDialog : DialogFragment() { private var disposable: CompositeDisposable = CompositeDisposable() - override fun onAttach(context: Context) { - super.onAttach(context) - this.parentContext = context - } - override fun onStart() { super.onStart() dialog?.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) } - override fun onDetach() { - super.onDetach() - this.parentContext = null - } - override fun onSaveInstanceState(savedInstanceState: Bundle) { super.onSaveInstanceState(savedInstanceState) savedInstanceState.putDouble("treatments_wizard_bg_input", treatments_wizard_bg_input.value) @@ -83,7 +69,7 @@ class WizardDialog : DialogFragment() { isCancelable = true dialog?.setCanceledOnTouchOutside(false) - return inflater.inflate(R.layout.overview_wizard_dialog, container, false) + return inflater.inflate(R.layout.dialog_wizard, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { @@ -115,7 +101,7 @@ class WizardDialog : DialogFragment() { } else { okClicked = true calculateInsulin() - parentContext?.let { context -> + context?.let { context -> wizard?.confirmAndExecute(context) } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt index f3a492f52e..021966400d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt @@ -19,14 +19,14 @@ import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction -import info.nightscout.androidaps.plugins.general.actions.dialogs.CareDialog -import info.nightscout.androidaps.plugins.general.actions.dialogs.ExtendedBolusDialog -import info.nightscout.androidaps.plugins.general.actions.dialogs.FillDialog -import info.nightscout.androidaps.plugins.general.actions.dialogs.TempBasalDialog +import info.nightscout.androidaps.dialogs.CareDialog +import info.nightscout.androidaps.dialogs.ExtendedBolusDialog +import info.nightscout.androidaps.dialogs.FillDialog +import info.nightscout.androidaps.dialogs.TempBasalDialog import info.nightscout.androidaps.plugins.general.careportal.CareportalFragment import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity -import info.nightscout.androidaps.plugins.general.overview.dialogs.ProfileSwitchDialog -import info.nightscout.androidaps.plugins.general.overview.dialogs.TempTargetDialog +import info.nightscout.androidaps.dialogs.ProfileSwitchDialog +import info.nightscout.androidaps.dialogs.TempTargetDialog import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.FabricPrivacy diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.java index 6dbec3d1ab..27ea3c1fde 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.java @@ -87,13 +87,13 @@ import info.nightscout.androidaps.plugins.general.careportal.CareportalFragment; import info.nightscout.androidaps.plugins.general.nsclient.NSUpload; import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus; import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity; -import info.nightscout.androidaps.plugins.general.overview.dialogs.CalibrationDialog; -import info.nightscout.androidaps.plugins.general.overview.dialogs.CarbsDialog; -import info.nightscout.androidaps.plugins.general.overview.dialogs.InsulinDialog; -import info.nightscout.androidaps.plugins.general.overview.dialogs.TreatmentDialog; -import info.nightscout.androidaps.plugins.general.overview.dialogs.ProfileSwitchDialog; -import info.nightscout.androidaps.plugins.general.overview.dialogs.TempTargetDialog; -import info.nightscout.androidaps.plugins.general.overview.dialogs.WizardDialog; +import info.nightscout.androidaps.dialogs.CalibrationDialog; +import info.nightscout.androidaps.dialogs.CarbsDialog; +import info.nightscout.androidaps.dialogs.InsulinDialog; +import info.nightscout.androidaps.dialogs.TreatmentDialog; +import info.nightscout.androidaps.dialogs.ProfileSwitchDialog; +import info.nightscout.androidaps.dialogs.TempTargetDialog; +import info.nightscout.androidaps.dialogs.WizardDialog; import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData; import info.nightscout.androidaps.plugins.general.wear.ActionStringHandler; import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensData; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfileFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfileFragment.kt index 2ce470063e..218c0d798f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfileFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfileFragment.kt @@ -16,7 +16,7 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.data.Profile import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin -import info.nightscout.androidaps.plugins.general.overview.dialogs.ProfileSwitchDialog +import info.nightscout.androidaps.dialogs.ProfileSwitchDialog import info.nightscout.androidaps.plugins.insulin.InsulinOrefBasePlugin.MIN_DIA import info.nightscout.androidaps.plugins.profile.local.events.EventLocalProfileChanged import info.nightscout.androidaps.utils.* diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java index 9277bf8718..7f5c2baf79 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.java @@ -23,14 +23,11 @@ import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctions; import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesFragment; import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin; -import info.nightscout.androidaps.plugins.general.careportal.CareportalFragment; -import info.nightscout.androidaps.plugins.general.careportal.Dialogs.NewNSTreatmentDialog; -import info.nightscout.androidaps.plugins.general.careportal.OptionsToShow; import info.nightscout.androidaps.plugins.general.maintenance.ImportExportPrefs; import info.nightscout.androidaps.plugins.general.nsclient.NSClientPlugin; import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientStatus; import info.nightscout.androidaps.plugins.general.nsclient.services.NSClientService; -import info.nightscout.androidaps.plugins.general.overview.dialogs.ProfileSwitchDialog; +import info.nightscout.androidaps.dialogs.ProfileSwitchDialog; import info.nightscout.androidaps.plugins.profile.local.LocalProfileFragment; import info.nightscout.androidaps.plugins.profile.local.LocalProfilePlugin; import info.nightscout.androidaps.plugins.profile.ns.NSProfileFragment; diff --git a/app/src/main/res/layout/overview_calibration_dialog.xml b/app/src/main/res/layout/dialog_calibration.xml similarity index 89% rename from app/src/main/res/layout/overview_calibration_dialog.xml rename to app/src/main/res/layout/dialog_calibration.xml index d9991a70b8..5ffe161480 100644 --- a/app/src/main/res/layout/overview_calibration_dialog.xml +++ b/app/src/main/res/layout/dialog_calibration.xml @@ -3,7 +3,10 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - tools:context=".plugins.general.overview.dialogs.CalibrationDialog"> + android:focusableInTouchMode="true" + android:minWidth="300dp" + android:orientation="vertical" + tools:context=".dialogs.CalibrationDialog"> - @@ -30,19 +33,21 @@ android:id="@+id/actions_care_title" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_centerInParent="true" android:layout_gravity="center" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:text="@string/overview_calibration" android:textAlignment="center" android:textAppearance="?android:attr/textAppearanceLarge" /> - + + android:padding="5dp" /> + tools:context=".dialogs.CarbsDialog"> - + android:padding="5dp"> - - + + + + + android:orientation="vertical" + android:padding="5dp"> - - + android:orientation="horizontal" + android:padding="5dp">