Careportal actions to Actions plugin
This commit is contained in:
parent
8a4b17f6f9
commit
5c9ab721ce
9 changed files with 524 additions and 111 deletions
|
@ -19,9 +19,11 @@ 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.FillDialog
|
||||
import info.nightscout.androidaps.plugins.general.actions.dialogs.NewExtendedBolusDialog
|
||||
import info.nightscout.androidaps.plugins.general.actions.dialogs.NewTempBasalDialog
|
||||
import info.nightscout.androidaps.plugins.general.careportal.CareportalFragment
|
||||
import info.nightscout.androidaps.plugins.general.overview.dialogs.ProfileSwitchDialog
|
||||
import info.nightscout.androidaps.plugins.general.overview.dialogs.TempTargetDialog
|
||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin
|
||||
|
@ -30,6 +32,7 @@ import info.nightscout.androidaps.utils.*
|
|||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import kotlinx.android.synthetic.main.actions_fragment.*
|
||||
import kotlinx.android.synthetic.main.careportal_stats_fragment.*
|
||||
import java.util.*
|
||||
|
||||
class ActionsFragment : Fragment() {
|
||||
|
@ -80,6 +83,15 @@ class ActionsFragment : Fragment() {
|
|||
actions_fill.setOnClickListener { fragmentManager?.let { FillDialog().show(it, "FillDialog") } }
|
||||
actions_historybrowser.setOnClickListener { startActivity(Intent(context, HistoryBrowseActivity::class.java)) }
|
||||
actions_tddstats.setOnClickListener { startActivity(Intent(context, TDDStatsActivity::class.java)) }
|
||||
actions_bgcheck.setOnClickListener {
|
||||
fragmentManager?.let { CareDialog().setOptions(CareDialog.EventType.BGCHECK, R.string.careportal_bgcheck).show(it, "Actions") }
|
||||
}
|
||||
actions_cgmsensorinsert.setOnClickListener {
|
||||
fragmentManager?.let { CareDialog().setOptions(CareDialog.EventType.SENSOR_INSERT, R.string.careportal_cgmsensorinsert).show(it, "Actions") }
|
||||
}
|
||||
actions_pumpbatterychange.setOnClickListener {
|
||||
fragmentManager?.let { CareDialog().setOptions(CareDialog.EventType.BATTERY_CHANGE, R.string.careportal_pumpbatterychange).show(it, "Actions") }
|
||||
}
|
||||
|
||||
SP.putBoolean(R.string.key_objectiveuseactions, true)
|
||||
}
|
||||
|
@ -90,43 +102,27 @@ class ActionsFragment : Fragment() {
|
|||
disposable += RxBus
|
||||
.toObservable(EventInitializationChanged::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({
|
||||
updateGui()
|
||||
}, {
|
||||
FabricPrivacy.logException(it)
|
||||
})
|
||||
.subscribe({ updateGui() }, { FabricPrivacy.logException(it) })
|
||||
disposable += RxBus
|
||||
.toObservable(EventRefreshOverview::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({
|
||||
updateGui()
|
||||
}, {
|
||||
FabricPrivacy.logException(it)
|
||||
})
|
||||
.subscribe({ updateGui() }, { FabricPrivacy.logException(it) })
|
||||
disposable += RxBus
|
||||
.toObservable(EventExtendedBolusChange::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({
|
||||
updateGui()
|
||||
}, {
|
||||
FabricPrivacy.logException(it)
|
||||
})
|
||||
.subscribe({ updateGui() }, { FabricPrivacy.logException(it) })
|
||||
disposable += RxBus
|
||||
.toObservable(EventTempBasalChange::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({
|
||||
updateGui()
|
||||
}, {
|
||||
FabricPrivacy.logException(it)
|
||||
})
|
||||
.subscribe({ updateGui() }, { FabricPrivacy.logException(it) })
|
||||
disposable += RxBus
|
||||
.toObservable(EventCustomActionsChanged::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({
|
||||
updateGui()
|
||||
}, {
|
||||
FabricPrivacy.logException(it)
|
||||
})
|
||||
.subscribe({ updateGui() }, { FabricPrivacy.logException(it) })
|
||||
disposable += RxBus
|
||||
.toObservable(EventCareportalEventChange::class.java)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({ updateGui() }, { FabricPrivacy.logException(it) })
|
||||
updateGui()
|
||||
}
|
||||
|
||||
|
@ -193,6 +189,9 @@ class ActionsFragment : Fragment() {
|
|||
|
||||
actions_temptarget?.visibility = if (!Config.APS) View.GONE else View.VISIBLE
|
||||
actions_tddstats?.visibility = if (!pump.pumpDescription.supportsTDDs) View.GONE else View.VISIBLE
|
||||
activity?.let { activity ->
|
||||
CareportalFragment.updateAge(activity, careportal_sensorage, careportal_insulinage, careportal_canulaage, careportal_pbage)
|
||||
}
|
||||
checkPumpCustomActions()
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.general.actions
|
||||
|
||||
import info.nightscout.androidaps.Config
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.interfaces.PluginDescription
|
||||
|
@ -8,6 +9,8 @@ import info.nightscout.androidaps.interfaces.PluginType
|
|||
object ActionsPlugin : PluginBase(PluginDescription()
|
||||
.mainType(PluginType.GENERAL)
|
||||
.fragmentClass(ActionsFragment::class.qualifiedName)
|
||||
.enableByDefault(Config.APS || Config.PUMPCONTROL)
|
||||
.visibleByDefault(Config.APS || Config.PUMPCONTROL)
|
||||
.pluginName(R.string.actions)
|
||||
.shortName(R.string.actions_shortname)
|
||||
.description(R.string.description_actions))
|
||||
|
|
|
@ -0,0 +1,143 @@
|
|||
package info.nightscout.androidaps.plugins.general.actions.dialogs
|
||||
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.annotation.StringRes
|
||||
import com.google.common.base.Joiner
|
||||
import info.nightscout.androidaps.Constants
|
||||
import info.nightscout.androidaps.MainApp
|
||||
import info.nightscout.androidaps.R
|
||||
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.okcancel.*
|
||||
import org.json.JSONObject
|
||||
import java.text.DecimalFormat
|
||||
import java.util.*
|
||||
|
||||
class CareDialog : DialogFragmentWithDate() {
|
||||
|
||||
enum class EventType {
|
||||
BGCHECK,
|
||||
SENSOR_INSERT,
|
||||
BATTERY_CHANGE
|
||||
}
|
||||
|
||||
private var options: EventType = EventType.BGCHECK
|
||||
@StringRes
|
||||
private var event: Int = R.string.none
|
||||
|
||||
fun setOptions(options: EventType, @StringRes event: Int): CareDialog {
|
||||
this.options = options
|
||||
this.event = event
|
||||
return this
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(savedInstanceState: Bundle) {
|
||||
super.onSaveInstanceState(savedInstanceState)
|
||||
savedInstanceState.putDouble("actions_care_bg", actions_care_bg.value)
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?): View? {
|
||||
onCreateView()
|
||||
return inflater.inflate(R.layout.actions_care_dialog, container, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
actions_care_icon.setImageResource(when (options) {
|
||||
EventType.BGCHECK -> R.drawable.icon_cp_bgcheck
|
||||
EventType.SENSOR_INSERT -> R.drawable.icon_cp_cgm_insert
|
||||
EventType.BATTERY_CHANGE -> R.drawable.icon_cp_pump_battery
|
||||
})
|
||||
actions_care_title.text = MainApp.gs(when (options) {
|
||||
EventType.BGCHECK -> R.string.careportal_bgcheck
|
||||
EventType.SENSOR_INSERT -> R.string.careportal_cgmsensorinsert
|
||||
EventType.BATTERY_CHANGE -> R.string.careportal_pumpbatterychange
|
||||
})
|
||||
|
||||
when (options) {
|
||||
EventType.SENSOR_INSERT,
|
||||
EventType.BATTERY_CHANGE -> {
|
||||
action_care_bg_layout.visibility = View.GONE
|
||||
actions_care_bgsource.visibility = View.GONE
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
|
||||
val bg = Profile.fromMgdlToUnits(GlucoseStatus.getGlucoseStatusData()?.glucose
|
||||
?: 0.0, ProfileFunctions.getSystemUnits())
|
||||
val bgTextWatcher: 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) {
|
||||
if (actions_care_sensor.isChecked) actions_care_meter.isChecked = true
|
||||
}
|
||||
}
|
||||
|
||||
if (ProfileFunctions.getSystemUnits() == Constants.MMOL)
|
||||
actions_care_bg.setParams(savedInstanceState?.getDouble("actions_care_bg")
|
||||
?: bg, 0.0, 30.0, 0.1, DecimalFormat("0.0"), false, ok, bgTextWatcher)
|
||||
else
|
||||
actions_care_bg.setParams(savedInstanceState?.getDouble("actions_care_bg")
|
||||
?: bg, 0.0, 500.0, 1.0, DecimalFormat("0"), false, ok, bgTextWatcher)
|
||||
}
|
||||
|
||||
override fun submit() {
|
||||
val enteredBy = SP.getString("careportal_enteredby", "")
|
||||
val unitResId = if (ProfileFunctions.getSystemUnits() == Constants.MGDL) R.string.mgdl else R.string.mmol
|
||||
|
||||
val json = JSONObject()
|
||||
val actions: LinkedList<String> = LinkedList()
|
||||
actions.add("<b>" + MainApp.gs(event) + "</b>")
|
||||
if (options == EventType.BGCHECK) {
|
||||
val type =
|
||||
when {
|
||||
actions_care_meter.isChecked -> "Finger"
|
||||
actions_care_sensor.isChecked -> "Sensor"
|
||||
else -> "Manual"
|
||||
}
|
||||
actions.add(MainApp.gs(R.string.careportal_newnstreatment_glucosetype) + ": " + Translator.translate(type))
|
||||
actions.add(MainApp.gs(R.string.treatments_wizard_bg_label) + ": " + Profile.toCurrentUnitsString(actions_care_bg.value) + " " + MainApp.gs(unitResId))
|
||||
json.put("glucose", actions_care_bg.value)
|
||||
json.put("glucoseType", type)
|
||||
}
|
||||
val notes = actions_care_notes.text.toString()
|
||||
if (notes.isNotEmpty()) {
|
||||
actions.add(MainApp.gs(R.string.careportal_newnstreatment_notes_label) + ": " + notes)
|
||||
json.put("notes", notes)
|
||||
}
|
||||
if (eventTimeChanged) {
|
||||
actions.add(MainApp.gs(R.string.time) + ": " + DateUtil.dateAndTimeString(eventTime))
|
||||
}
|
||||
|
||||
json.put("created_at", DateUtil.toISOString(eventTime))
|
||||
json.put("eventType", when (options) {
|
||||
EventType.BGCHECK -> CareportalEvent.BGCHECK
|
||||
EventType.SENSOR_INSERT -> CareportalEvent.SENSORCHANGE
|
||||
EventType.BATTERY_CHANGE -> CareportalEvent.PUMPBATTERYCHANGE
|
||||
})
|
||||
json.put("units", ProfileFunctions.getSystemUnits())
|
||||
if (enteredBy.isNotEmpty())
|
||||
json.put("enteredBy", enteredBy)
|
||||
|
||||
activity?.let { activity ->
|
||||
OKDialog.showConfirmation(activity, HtmlHelper.fromHtml(Joiner.on("<br/>").join(actions))) {
|
||||
MainApp.getDbHelper().createCareportalEventFromJsonIfNotExists(json)
|
||||
NSUpload.uploadCareportalEntryToNS(json)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.general.careportal;
|
||||
|
||||
import info.nightscout.androidaps.Config;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.interfaces.PluginBase;
|
||||
import info.nightscout.androidaps.interfaces.PluginDescription;
|
||||
|
@ -22,10 +23,14 @@ public class CareportalPlugin extends PluginBase {
|
|||
.fragmentClass(CareportalFragment.class.getName())
|
||||
.pluginName(R.string.careportal)
|
||||
.shortName(R.string.careportal_shortname)
|
||||
.visibleByDefault(true)
|
||||
.enableByDefault(true)
|
||||
.visibleByDefault(Config.NSCLIENT)
|
||||
.enableByDefault(Config.NSCLIENT)
|
||||
.description(R.string.description_careportal)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean specialEnableCondition() {
|
||||
return Config.NSCLIENT;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ import android.text.format.DateFormat;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
|
@ -103,9 +105,10 @@ public class NewNSTreatmentDialog extends AppCompatDialogFragment implements Vie
|
|||
|
||||
private static Integer seconds = null;
|
||||
|
||||
public void setOptions(OptionsToShow options, int event) {
|
||||
public NewNSTreatmentDialog setOptions(OptionsToShow options, int event) {
|
||||
this.options = options;
|
||||
this.event = MainApp.gs(event);
|
||||
return this;
|
||||
}
|
||||
|
||||
public NewNSTreatmentDialog() {
|
||||
|
@ -120,7 +123,10 @@ public class NewNSTreatmentDialog extends AppCompatDialogFragment implements Vie
|
|||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
if (options == null) return null;
|
||||
getDialog().setTitle(MainApp.gs(options.eventName));
|
||||
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
|
||||
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
|
||||
setCancelable(true);
|
||||
getDialog().setCanceledOnTouchOutside(false);
|
||||
setStyle(DialogFragment.STYLE_NORMAL, getTheme());
|
||||
View view = inflater.inflate(R.layout.careportal_newnstreatment_dialog, container, false);
|
||||
|
||||
|
@ -392,6 +398,13 @@ public class NewNSTreatmentDialog extends AppCompatDialogFragment implements Vie
|
|||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
|
|
140
app/src/main/res/layout/actions_care_dialog.xml
Normal file
140
app/src/main/res/layout/actions_care_dialog.xml
Normal file
|
@ -0,0 +1,140 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:focusableInTouchMode="true"
|
||||
android:minWidth="300dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:padding="10dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/actions_care_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/icon_actions_profileswitch"
|
||||
android:contentDescription="@string/careportal_profileswitch" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/actions_care_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:text="@string/careportal_profileswitch"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/action_care_bg_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:width="120dp"
|
||||
android:padding="10dp"
|
||||
android:text="@string/treatments_wizard_bg_label"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Small"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<info.nightscout.androidaps.utils.NumberPicker
|
||||
android:id="@+id/actions_care_bg"
|
||||
android:layout_width="130dp"
|
||||
android:layout_height="40dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/actions_care_bgunits"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="start"
|
||||
android:minWidth="45dp"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text="@string/mgdl"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/actions_care_bgsource"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/actions_care_meter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="false"
|
||||
android:text="@string/careportal_newnstreatment_meter" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/actions_care_sensor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:text="@string/careportal_newnstreatment_sensor" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/actions_care_other"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/careportal_newnstreatment_other" />
|
||||
</RadioGroup>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:labelFor="@+id/actions_care_notes"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:width="120dp"
|
||||
android:padding="10dp"
|
||||
android:text="@string/careportal_newnstreatment_notes_label"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Small"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/actions_care_notes"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:width="180dp"
|
||||
android:inputType="text" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/datetime" />
|
||||
|
||||
<include layout="@layout/okcancel" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
|
@ -1,138 +1,248 @@
|
|||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".plugins.general.actions.ActionsFragment">
|
||||
|
||||
<ScrollView
|
||||
<LinearLayout
|
||||
android:id="@+id/action_buttons_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/action_buttons_layout"
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_marginTop="15dp"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:text="@string/actions" />
|
||||
|
||||
<androidx.gridlayout.widget.GridLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dip"
|
||||
app:columnCount="2">
|
||||
|
||||
<info.nightscout.androidaps.utils.SingleClickButton
|
||||
android:id="@+id/actions_profileswitch"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="fill_parent"
|
||||
style="@style/ButtonSmallFontStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableTop="@drawable/icon_actions_profileswitch"
|
||||
android:text="@string/careportal_profileswitch" />
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/careportal_profileswitch"
|
||||
|
||||
app:layout_column="0"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill"
|
||||
app:layout_row="0" />
|
||||
|
||||
<info.nightscout.androidaps.utils.SingleClickButton
|
||||
android:id="@+id/actions_temptarget"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="fill_parent"
|
||||
style="@style/ButtonSmallFontStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableTop="@drawable/icon_actions_temptarget"
|
||||
android:text="@string/careportal_temporarytarget" />
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/careportal_temporarytarget"
|
||||
|
||||
app:layout_column="1"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill"
|
||||
app:layout_row="0" />
|
||||
|
||||
<info.nightscout.androidaps.utils.SingleClickButton
|
||||
android:id="@+id/actions_settempbasal"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="fill_parent"
|
||||
style="@style/ButtonSmallFontStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableTop="@drawable/icon_actions_starttempbasal"
|
||||
android:text="@string/overview_tempbasal_button" />
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/overview_tempbasal_button"
|
||||
|
||||
app:layout_column="0"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill"
|
||||
app:layout_row="1" />
|
||||
|
||||
<info.nightscout.androidaps.utils.SingleClickButton
|
||||
android:id="@+id/actions_canceltempbasal"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="fill_parent"
|
||||
style="@style/ButtonSmallFontStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableTop="@drawable/icon_cancelbasal"
|
||||
android:text="Cancel temp basal" />
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/canceltemp"
|
||||
android:visibility="gone"
|
||||
|
||||
app:layout_column="0"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill"
|
||||
app:layout_row="1" />
|
||||
|
||||
<info.nightscout.androidaps.utils.SingleClickButton
|
||||
android:id="@+id/actions_extendedbolus"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="fill_parent"
|
||||
style="@style/ButtonSmallFontStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableTop="@drawable/icon_actions_startextbolus"
|
||||
android:text="@string/overview_extendedbolus_button" />
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/overview_extendedbolus_button"
|
||||
|
||||
app:layout_column="1"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill"
|
||||
app:layout_row="1" />
|
||||
|
||||
<info.nightscout.androidaps.utils.SingleClickButton
|
||||
android:id="@+id/actions_extendedbolus_cancel"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="fill_parent"
|
||||
style="@style/ButtonSmallFontStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableTop="@drawable/icon_actions_cancelextbolus"
|
||||
android:text="@string/overview_extendedbolus_cancel_button" />
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/overview_extendedbolus_cancel_button"
|
||||
android:visibility="gone"
|
||||
|
||||
app:layout_column="1"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill"
|
||||
app:layout_row="1" />
|
||||
|
||||
</androidx.gridlayout.widget.GridLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:paddingBottom="15dp"
|
||||
android:text="@string/careportal" />
|
||||
|
||||
<include
|
||||
android:id="@+id/careportal_stats"
|
||||
layout="@layout/careportal_stats_fragment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.gridlayout.widget.GridLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dip"
|
||||
app:columnCount="2">
|
||||
|
||||
<info.nightscout.androidaps.utils.SingleClickButton
|
||||
android:id="@+id/actions_bgcheck"
|
||||
style="@style/ButtonSmallFontStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:drawableTop="@drawable/icon_cp_bgcheck"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/careportal_bgcheck"
|
||||
|
||||
app:layout_column="0"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill"
|
||||
app:layout_row="2" />
|
||||
|
||||
<info.nightscout.androidaps.utils.SingleClickButton
|
||||
android:id="@+id/actions_fill"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="fill_parent"
|
||||
style="@style/ButtonSmallFontStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableTop="@drawable/icon_cp_pump_canula"
|
||||
android:text="@string/primefill" />
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/primefill"
|
||||
|
||||
app:layout_column="1"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill"
|
||||
app:layout_row="2" />
|
||||
|
||||
<info.nightscout.androidaps.utils.SingleClickButton
|
||||
android:id="@+id/actions_cgmsensorinsert"
|
||||
style="@style/ButtonSmallFontStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:drawableTop="@drawable/icon_cp_cgm_insert"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/careportal_cgmsensorinsert"
|
||||
app:layout_column="0"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill"
|
||||
app:layout_row="3" />
|
||||
|
||||
<info.nightscout.androidaps.utils.SingleClickButton
|
||||
android:id="@+id/actions_pumpbatterychange"
|
||||
style="@style/ButtonSmallFontStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:drawableTop="@drawable/icon_cp_pump_battery"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/careportal_pumpbatterychange"
|
||||
app:layout_column="1"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill"
|
||||
app:layout_row="3" />
|
||||
|
||||
</androidx.gridlayout.widget.GridLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="15dp"
|
||||
android:paddingEnd="15dp"
|
||||
android:text="@string/tools" />
|
||||
|
||||
<androidx.gridlayout.widget.GridLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dip"
|
||||
app:columnCount="2">
|
||||
|
||||
<info.nightscout.androidaps.utils.SingleClickButton
|
||||
android:id="@+id/actions_historybrowser"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="fill_parent"
|
||||
style="@style/ButtonSmallFontStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableTop="@drawable/icon_danarhistory"
|
||||
android:text="@string/nav_historybrowser" />
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/nav_historybrowser"
|
||||
app:layout_column="0"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill"
|
||||
app:layout_row="4" />
|
||||
|
||||
<info.nightscout.androidaps.utils.SingleClickButton
|
||||
android:id="@+id/actions_tddstats"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="fill_parent"
|
||||
style="@style/ButtonSmallFontStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_weight="0.5"
|
||||
android:drawableTop="@drawable/icon_danarstats"
|
||||
android:text="@string/danar_stats_tdd" />
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="0dp"
|
||||
android:text="@string/danar_stats_tdd"
|
||||
|
||||
</LinearLayout>
|
||||
app:layout_column="1"
|
||||
app:layout_columnWeight="1"
|
||||
app:layout_gravity="fill"
|
||||
app:layout_row="4" />
|
||||
|
||||
</ScrollView>
|
||||
</androidx.gridlayout.widget.GridLayout>
|
||||
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
<androidx.gridlayout.widget.GridLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:padding="10dip"
|
||||
app:columnCount="3">
|
||||
|
||||
|
|
|
@ -1683,5 +1683,6 @@
|
|||
<string name="randombg">Random BG</string>
|
||||
<string name="description_source_randombg">Generate random BG data (Demo mode only)</string>
|
||||
<string name="randombg_short">BG</string>
|
||||
<string name="tools">Tools</string>
|
||||
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue