treatments UI cleanup

This commit is contained in:
Milos Kozak 2021-02-03 22:40:13 +01:00
parent 35c321862e
commit 0054fce4d9
19 changed files with 427 additions and 421 deletions

View file

@ -47,19 +47,19 @@ class TreatmentsFragment : DaggerFragment() {
setFragment(TreatmentsBolusFragment()) setFragment(TreatmentsBolusFragment())
setBackgroundColorOnSelected(it) setBackgroundColorOnSelected(it)
} }
binding.extendedboluses.setOnClickListener { binding.extendedBoluses.setOnClickListener {
setFragment(TreatmentsExtendedBolusesFragment()) setFragment(TreatmentsExtendedBolusesFragment())
setBackgroundColorOnSelected(it) setBackgroundColorOnSelected(it)
} }
binding.tempbasals.setOnClickListener { binding.tempBasals.setOnClickListener {
setFragment(TreatmentsTemporaryBasalsFragment()) setFragment(TreatmentsTemporaryBasalsFragment())
setBackgroundColorOnSelected(it) setBackgroundColorOnSelected(it)
} }
binding.temptargets.setOnClickListener { binding.tempTargets.setOnClickListener {
setFragment(TreatmentsTempTargetFragment()) setFragment(TreatmentsTempTargetFragment())
setBackgroundColorOnSelected(it) setBackgroundColorOnSelected(it)
} }
binding.profileswitches.setOnClickListener { binding.profileSwitches.setOnClickListener {
setFragment(TreatmentsProfileSwitchFragment()) setFragment(TreatmentsProfileSwitchFragment())
setBackgroundColorOnSelected(it) setBackgroundColorOnSelected(it)
} }
@ -103,16 +103,16 @@ class TreatmentsFragment : DaggerFragment() {
private fun setBackgroundColorOnSelected(selected: View) { private fun setBackgroundColorOnSelected(selected: View) {
binding.treatments.setBackgroundColor(resourceHelper.gc(R.color.defaultbackground)) binding.treatments.setBackgroundColor(resourceHelper.gc(R.color.defaultbackground))
binding.extendedboluses.setBackgroundColor(resourceHelper.gc(R.color.defaultbackground)) binding.extendedBoluses.setBackgroundColor(resourceHelper.gc(R.color.defaultbackground))
binding.tempbasals.setBackgroundColor(resourceHelper.gc(R.color.defaultbackground)) binding.tempBasals.setBackgroundColor(resourceHelper.gc(R.color.defaultbackground))
binding.temptargets.setBackgroundColor(resourceHelper.gc(R.color.defaultbackground)) binding.tempTargets.setBackgroundColor(resourceHelper.gc(R.color.defaultbackground))
binding.profileswitches.setBackgroundColor(resourceHelper.gc(R.color.defaultbackground)) binding.profileSwitches.setBackgroundColor(resourceHelper.gc(R.color.defaultbackground))
binding.careportal.setBackgroundColor(resourceHelper.gc(R.color.defaultbackground)) binding.careportal.setBackgroundColor(resourceHelper.gc(R.color.defaultbackground))
selected.setBackgroundColor(resourceHelper.gc(R.color.tabBgColorSelected)) selected.setBackgroundColor(resourceHelper.gc(R.color.tabBgColorSelected))
} }
private fun updateGui() { private fun updateGui() {
if (_binding == null) return if (_binding == null) return
binding.extendedboluses.visibility = (activePlugin.activePump.pumpDescription.isExtendedBolusCapable || treatmentsPlugin.extendedBolusesFromHistory.size() > 0).toVisibility() binding.extendedBoluses.visibility = (activePlugin.activePump.pumpDescription.isExtendedBolusCapable || treatmentsPlugin.extendedBolusesFromHistory.size() > 0).toVisibility()
} }
} }

View file

@ -62,7 +62,7 @@ class TreatmentsBolusFragment : DaggerFragment() {
binding.recyclerview.setHasFixedSize(true) binding.recyclerview.setHasFixedSize(true)
binding.recyclerview.layoutManager = LinearLayoutManager(view.context) binding.recyclerview.layoutManager = LinearLayoutManager(view.context)
binding.recyclerview.adapter = RecyclerViewAdapter(treatmentsPlugin.treatmentsFromHistory) binding.recyclerview.adapter = RecyclerViewAdapter(treatmentsPlugin.treatmentsFromHistory)
binding.reshreshFromNightscout.setOnClickListener { binding.refreshFromNightscout.setOnClickListener {
activity?.let { activity -> activity?.let { activity ->
OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.refresheventsfromnightscout) + "?") { OKDialog.showConfirmation(activity, resourceHelper.gs(R.string.refresheventsfromnightscout) + "?") {
treatmentsPlugin.service.resetTreatments() treatmentsPlugin.service.resetTreatments()
@ -86,7 +86,7 @@ class TreatmentsBolusFragment : DaggerFragment() {
} }
} }
val nsUploadOnly = sp.getBoolean(R.string.key_ns_upload_only, true) || !buildHelper.isEngineeringMode() val nsUploadOnly = sp.getBoolean(R.string.key_ns_upload_only, true) || !buildHelper.isEngineeringMode()
if (nsUploadOnly) binding.reshreshFromNightscout.visibility = View.GONE if (nsUploadOnly) binding.refreshFromNightscout.visibility = View.GONE
} }
@Synchronized @Synchronized

View file

@ -88,7 +88,8 @@ class TreatmentsCareportalFragment : DaggerFragment() {
if (nsUploadOnly) binding.refreshFromNightscout.visibility = View.GONE if (nsUploadOnly) binding.refreshFromNightscout.visibility = View.GONE
} }
@Synchronized override fun onResume() { @Synchronized
override fun onResume() {
super.onResume() super.onResume()
disposable.add(rxBus disposable.add(rxBus
.toObservable(EventCareportalEventChange::class.java) .toObservable(EventCareportalEventChange::class.java)
@ -98,7 +99,8 @@ class TreatmentsCareportalFragment : DaggerFragment() {
updateGui() updateGui()
} }
@Synchronized override fun onPause() { @Synchronized
override fun onPause() {
super.onPause() super.onPause()
disposable.clear() disposable.clear()
} }

View file

@ -105,9 +105,8 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() {
inner class RecyclerProfileViewAdapter(private var profileSwitchList: List<ProfileSwitch>) : RecyclerView.Adapter<ProfileSwitchViewHolder>() { inner class RecyclerProfileViewAdapter(private var profileSwitchList: List<ProfileSwitch>) : RecyclerView.Adapter<ProfileSwitchViewHolder>() {
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): ProfileSwitchViewHolder { override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): ProfileSwitchViewHolder =
return ProfileSwitchViewHolder(LayoutInflater.from(viewGroup.context).inflate(R.layout.treatments_profileswitch_item, viewGroup, false)) ProfileSwitchViewHolder(LayoutInflater.from(viewGroup.context).inflate(R.layout.treatments_profileswitch_item, viewGroup, false))
}
override fun onBindViewHolder(holder: ProfileSwitchViewHolder, position: Int) { override fun onBindViewHolder(holder: ProfileSwitchViewHolder, position: Int) {
val profileSwitch = profileSwitchList[position] val profileSwitch = profileSwitchList[position]
@ -132,7 +131,7 @@ class TreatmentsProfileSwitchFragment : DaggerFragment() {
return profileSwitchList.size return profileSwitchList.size
} }
inner class ProfileSwitchViewHolder internal constructor(itemView: View) : RecyclerView.ViewHolder(itemView){ inner class ProfileSwitchViewHolder internal constructor(itemView: View) : RecyclerView.ViewHolder(itemView) {
val binding = TreatmentsProfileswitchItemBinding.bind(itemView) val binding = TreatmentsProfileswitchItemBinding.bind(itemView)

View file

@ -1,212 +0,0 @@
package info.nightscout.androidaps.plugins.treatments.fragments;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import javax.inject.Inject;
import dagger.android.support.DaggerFragment;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.Intervals;
import info.nightscout.androidaps.db.Source;
import info.nightscout.androidaps.db.TempTarget;
import info.nightscout.androidaps.events.EventTempTargetChange;
import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.interfaces.ProfileFunction;
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload;
import info.nightscout.androidaps.plugins.general.nsclient.UploadQueue;
import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientRestart;
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
import info.nightscout.androidaps.utils.DateUtil;
import info.nightscout.androidaps.utils.DecimalFormatter;
import info.nightscout.androidaps.utils.FabricPrivacy;
import info.nightscout.androidaps.utils.alertDialogs.OKDialog;
import info.nightscout.androidaps.utils.buildHelper.BuildHelper;
import info.nightscout.androidaps.utils.resources.ResourceHelper;
import info.nightscout.androidaps.utils.sharedPreferences.SP;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
/**
* Created by mike on 13/01/17.
*/
public class TreatmentsTempTargetFragment extends DaggerFragment {
@Inject TreatmentsPlugin treatmentsPlugin;
@Inject SP sp;
@Inject RxBusWrapper rxBus;
@Inject ProfileFunction profileFunction;
@Inject ResourceHelper resourceHelper;
@Inject NSUpload nsUpload;
@Inject UploadQueue uploadQueue;
@Inject FabricPrivacy fabricPrivacy;
@Inject DateUtil dateUtil;
@Inject BuildHelper buildHelper;
private final CompositeDisposable disposable = new CompositeDisposable();
private RecyclerView recyclerView;
public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.TempTargetsViewHolder> {
Intervals<TempTarget> tempTargetList;
TempTarget currentlyActiveTarget;
RecyclerViewAdapter(Intervals<TempTarget> TempTargetList) {
this.tempTargetList = TempTargetList;
currentlyActiveTarget = tempTargetList.getValueByInterval(System.currentTimeMillis());
}
@NonNull
@Override
public TempTargetsViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.treatments_temptarget_item, viewGroup, false);
return new TempTargetsViewHolder(v);
}
@Override
public void onBindViewHolder(TempTargetsViewHolder holder, int position) {
String units = profileFunction.getUnits();
TempTarget tempTarget = tempTargetList.getReversed(position);
holder.ph.setVisibility(tempTarget.source == Source.PUMP ? View.VISIBLE : View.GONE);
holder.ns.setVisibility(NSUpload.isIdValid(tempTarget._id) ? View.VISIBLE : View.GONE);
if (!tempTarget.isEndingEvent()) {
holder.date.setText(dateUtil.dateAndTimeString(tempTarget.date) + " - " + dateUtil.timeString(tempTarget.originalEnd()));
holder.duration.setText(DecimalFormatter.to0Decimal(tempTarget.durationInMinutes) + " min");
holder.low.setText(tempTarget.lowValueToUnitsToString(units));
holder.high.setText(tempTarget.highValueToUnitsToString(units));
holder.reason.setText(tempTarget.reason);
} else {
holder.date.setText(dateUtil.dateAndTimeString(tempTarget.date));
holder.duration.setText(R.string.cancel);
holder.low.setText("");
holder.high.setText("");
holder.reason.setText("");
holder.reasonLabel.setText("");
holder.reasonColon.setText("");
}
if (tempTarget.isInProgress() && tempTarget == currentlyActiveTarget) {
holder.date.setTextColor(resourceHelper.gc(R.color.colorActive));
} else if (tempTarget.date > DateUtil.now()) {
holder.date.setTextColor(resourceHelper.gc(R.color.colorScheduled));
} else {
holder.date.setTextColor(holder.reasonColon.getCurrentTextColor());
}
holder.remove.setTag(tempTarget);
}
@Override
public int getItemCount() {
return tempTargetList.size();
}
@Override
public void onAttachedToRecyclerView(@NonNull RecyclerView recyclerView) {
super.onAttachedToRecyclerView(recyclerView);
}
class TempTargetsViewHolder extends RecyclerView.ViewHolder {
CardView cv;
TextView date;
TextView duration;
TextView low;
TextView high;
TextView reason;
TextView reasonLabel;
TextView reasonColon;
TextView remove;
TextView ph;
TextView ns;
TempTargetsViewHolder(View itemView) {
super(itemView);
cv = itemView.findViewById(R.id.temptargetrange_cardview);
date = itemView.findViewById(R.id.temptargetrange_date);
duration = itemView.findViewById(R.id.temptargetrange_duration);
low = itemView.findViewById(R.id.temptargetrange_low);
high = itemView.findViewById(R.id.temptargetrange_high);
reason = itemView.findViewById(R.id.temptargetrange_reason);
reasonLabel = itemView.findViewById(R.id.temptargetrange_reason_label);
reasonColon = itemView.findViewById(R.id.temptargetrange_reason_colon);
ph = itemView.findViewById(R.id.pump_sign);
ns = itemView.findViewById(R.id.ns_sign);
remove = itemView.findViewById(R.id.temptargetrange_remove);
remove.setOnClickListener(v -> {
final TempTarget tempTarget = (TempTarget) v.getTag();
OKDialog.showConfirmation(getContext(), resourceHelper.gs(R.string.removerecord),
resourceHelper.gs(R.string.careportal_temporarytarget) + ": " + tempTarget.friendlyDescription(profileFunction.getUnits(), resourceHelper) +
"\n" + dateUtil.dateAndTimeString(tempTarget.date),
(dialog, id) -> {
final String _id = tempTarget._id;
if (NSUpload.isIdValid(_id)) {
nsUpload.removeCareportalEntryFromNS(_id);
} else {
uploadQueue.removeID("dbAdd", _id);
}
MainApp.getDbHelper().delete(tempTarget);
}, null);
});
remove.setPaintFlags(remove.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
}
}
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.treatments_temptarget_fragment, container, false);
recyclerView = view.findViewById(R.id.temptargetrange_recyclerview);
recyclerView.setHasFixedSize(true);
LinearLayoutManager llm = new LinearLayoutManager(view.getContext());
recyclerView.setLayoutManager(llm);
RecyclerViewAdapter adapter = new RecyclerViewAdapter(treatmentsPlugin.getTempTargetsFromHistory());
recyclerView.setAdapter(adapter);
Button refreshFromNS = view.findViewById(R.id.temptargetrange_refreshfromnightscout);
refreshFromNS.setOnClickListener(v ->
OKDialog.showConfirmation(getContext(), resourceHelper.gs(R.string.refresheventsfromnightscout) + " ?", () -> {
MainApp.getDbHelper().resetTempTargets();
rxBus.send(new EventNSClientRestart());
}));
boolean nsUploadOnly = sp.getBoolean(R.string.key_ns_upload_only, true) || !buildHelper.isEngineeringMode();
if (nsUploadOnly)
refreshFromNS.setVisibility(View.GONE);
return view;
}
@Override
public synchronized void onResume() {
super.onResume();
disposable.add(rxBus
.toObservable(EventTempTargetChange.class)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(event -> updateGui(), fabricPrivacy::logException)
);
updateGui();
}
@Override
public synchronized void onPause() {
super.onPause();
disposable.clear();
}
private void updateGui() {
recyclerView.swapAdapter(new RecyclerViewAdapter(treatmentsPlugin.getTempTargetsFromHistory()), false);
}
}

View file

@ -0,0 +1,172 @@
package info.nightscout.androidaps.plugins.treatments.fragments
import android.annotation.SuppressLint
import android.content.DialogInterface
import android.graphics.Paint
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import dagger.android.support.DaggerFragment
import info.nightscout.androidaps.MainApp
import info.nightscout.androidaps.R
import info.nightscout.androidaps.data.Intervals
import info.nightscout.androidaps.databinding.TreatmentsTemptargetFragmentBinding
import info.nightscout.androidaps.databinding.TreatmentsTemptargetItemBinding
import info.nightscout.androidaps.db.Source
import info.nightscout.androidaps.db.TempTarget
import info.nightscout.androidaps.events.EventTempTargetChange
import info.nightscout.androidaps.interfaces.ActivePluginProvider
import info.nightscout.androidaps.interfaces.ProfileFunction
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
import info.nightscout.androidaps.plugins.general.nsclient.NSUpload
import info.nightscout.androidaps.plugins.general.nsclient.UploadQueue
import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientRestart
import info.nightscout.androidaps.plugins.treatments.fragments.TreatmentsTempTargetFragment.RecyclerViewAdapter.TempTargetsViewHolder
import info.nightscout.androidaps.utils.DateUtil
import info.nightscout.androidaps.utils.FabricPrivacy
import info.nightscout.androidaps.utils.alertDialogs.OKDialog.showConfirmation
import info.nightscout.androidaps.utils.buildHelper.BuildHelper
import info.nightscout.androidaps.utils.resources.ResourceHelper
import info.nightscout.androidaps.utils.sharedPreferences.SP
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable
import javax.inject.Inject
class TreatmentsTempTargetFragment : DaggerFragment() {
@Inject lateinit var activePlugin: ActivePluginProvider
@Inject lateinit var sp: SP
@Inject lateinit var rxBus: RxBusWrapper
@Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var resourceHelper: ResourceHelper
@Inject lateinit var nsUpload: NSUpload
@Inject lateinit var uploadQueue: UploadQueue
@Inject lateinit var fabricPrivacy: FabricPrivacy
@Inject lateinit var dateUtil: DateUtil
@Inject lateinit var buildHelper: BuildHelper
private val disposable = CompositeDisposable()
private var _binding: TreatmentsTemptargetFragmentBinding? = null
// This property is only valid between onCreateView and
// onDestroyView.
private val binding get() = _binding!!
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
TreatmentsTemptargetFragmentBinding.inflate(inflater, container, false).also { _binding = it }.root
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
binding.recyclerview.setHasFixedSize(true)
binding.recyclerview.layoutManager = LinearLayoutManager(view.context)
binding.recyclerview.adapter = RecyclerViewAdapter(activePlugin.activeTreatments.tempTargetsFromHistory)
binding.refreshFromNightscout.setOnClickListener {
context?.let { context ->
showConfirmation(context, resourceHelper.gs(R.string.refresheventsfromnightscout) + " ?", {
MainApp.getDbHelper().resetTempTargets()
rxBus.send(EventNSClientRestart())
})
}
}
val nsUploadOnly = sp.getBoolean(R.string.key_ns_upload_only, true) || !buildHelper.isEngineeringMode()
if (nsUploadOnly) binding.refreshFromNightscout.visibility = View.GONE
}
@Synchronized
override fun onResume() {
super.onResume()
disposable.add(rxBus
.toObservable(EventTempTargetChange::class.java)
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ updateGui() }, fabricPrivacy::logException)
)
updateGui()
}
@Synchronized
override fun onPause() {
super.onPause()
disposable.clear()
}
@Synchronized
override fun onDestroyView() {
super.onDestroyView()
_binding = null
}
private fun updateGui() {
if (_binding == null) return
binding.recyclerview.swapAdapter(RecyclerViewAdapter(activePlugin.activeTreatments.tempTargetsFromHistory), false)
}
inner class RecyclerViewAdapter internal constructor(var tempTargetList: Intervals<TempTarget>) : RecyclerView.Adapter<TempTargetsViewHolder>() {
var currentlyActiveTarget: TempTarget? = tempTargetList.getValueByInterval(System.currentTimeMillis())
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): TempTargetsViewHolder =
TempTargetsViewHolder(LayoutInflater.from(viewGroup.context).inflate(R.layout.treatments_temptarget_item, viewGroup, false))
@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: TempTargetsViewHolder, position: Int) {
val units = profileFunction.getUnits()
val tempTarget = tempTargetList.getReversed(position)
holder.binding.ph.visibility = if (tempTarget.source == Source.PUMP) View.VISIBLE else View.GONE
holder.binding.ns.visibility = if (NSUpload.isIdValid(tempTarget._id)) View.VISIBLE else View.GONE
if (!tempTarget.isEndingEvent) {
holder.binding.date.text = dateUtil.dateAndTimeString(tempTarget.date) + " - " + dateUtil.timeString(tempTarget.originalEnd())
holder.binding.duration.text = resourceHelper.gs(R.string.format_mins, tempTarget.durationInMinutes)
holder.binding.low.text = tempTarget.lowValueToUnitsToString(units)
holder.binding.high.text = tempTarget.highValueToUnitsToString(units)
holder.binding.reason.text = tempTarget.reason
} else {
holder.binding.date.text = dateUtil.dateAndTimeString(tempTarget.date)
holder.binding.duration.setText(R.string.cancel)
holder.binding.low.text = ""
holder.binding.high.text = ""
holder.binding.reason.text = ""
holder.binding.reasonLabel.text = ""
holder.binding.reasonColon.text = ""
}
if (tempTarget.isInProgress && tempTarget === currentlyActiveTarget) {
holder.binding.date.setTextColor(resourceHelper.gc(R.color.colorActive))
} else if (tempTarget.date > DateUtil.now()) {
holder.binding.date.setTextColor(resourceHelper.gc(R.color.colorScheduled))
} else {
holder.binding.date.setTextColor(holder.binding.reasonColon.currentTextColor)
}
holder.binding.remove.tag = tempTarget
}
override fun getItemCount(): Int = tempTargetList.size()
inner class TempTargetsViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val binding = TreatmentsTemptargetItemBinding.bind(view)
init {
binding.remove.setOnClickListener { v: View ->
val tempTarget = v.tag as TempTarget
context?.let { context ->
showConfirmation(context, resourceHelper.gs(R.string.removerecord),
"""
${resourceHelper.gs(R.string.careportal_temporarytarget)}: ${tempTarget.friendlyDescription(profileFunction.getUnits(), resourceHelper)}
${dateUtil.dateAndTimeString(tempTarget.date)}
""".trimIndent(),
{ _: DialogInterface?, _: Int ->
val id = tempTarget._id
if (NSUpload.isIdValid(id)) nsUpload.removeCareportalEntryFromNS(id)
else uploadQueue.removeID("dbAdd", id)
MainApp.getDbHelper().delete(tempTarget)
}, null)
}
}
binding.remove.paintFlags = binding.remove.paintFlags or Paint.UNDERLINE_TEXT_FLAG
}
}
}
}

View file

@ -88,10 +88,8 @@ class TreatmentsTemporaryBasalsFragment : DaggerFragment() {
inner class RecyclerViewAdapter internal constructor(private var tempBasalList: Intervals<TemporaryBasal>) : RecyclerView.Adapter<TempBasalsViewHolder>() { inner class RecyclerViewAdapter internal constructor(private var tempBasalList: Intervals<TemporaryBasal>) : RecyclerView.Adapter<TempBasalsViewHolder>() {
override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): TempBasalsViewHolder { override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): TempBasalsViewHolder =
val v = LayoutInflater.from(viewGroup.context).inflate(R.layout.treatments_tempbasals_item, viewGroup, false) TempBasalsViewHolder(LayoutInflater.from(viewGroup.context).inflate(R.layout.treatments_tempbasals_item, viewGroup, false))
return TempBasalsViewHolder(v)
}
override fun onBindViewHolder(holder: TempBasalsViewHolder, position: Int) { override fun onBindViewHolder(holder: TempBasalsViewHolder, position: Int) {
val tempBasal = tempBasalList.getReversed(position) val tempBasal = tempBasalList.getReversed(position)

View file

@ -17,7 +17,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="10dp" android:paddingStart="10dp"
android:text="@string/treatments_iobtotal_label_string" android:text="@string/treatments_iobtotal_label_string"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="RtlSymmetry" />
<TextView <TextView
android:id="@+id/iob_total" android:id="@+id/iob_total"
@ -25,14 +26,16 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="10dp" android:paddingStart="10dp"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold" /> android:textStyle="bold"
tools:ignore="RtlSymmetry" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="10dp" android:paddingStart="10dp"
android:text="@string/treatments_iobactivitytotal_label_string" android:text="@string/treatments_iobactivitytotal_label_string"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="RtlSymmetry" />
<TextView <TextView
android:id="@+id/iob_activity_total" android:id="@+id/iob_activity_total"
@ -40,7 +43,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="10dp" android:paddingStart="10dp"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold" /> android:textStyle="bold"
tools:ignore="RtlSymmetry" />
</LinearLayout> </LinearLayout>
@ -49,22 +53,24 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/reshresh_from_nightscout" android:id="@+id/refresh_from_nightscout"
style="?android:attr/buttonStyle" style="?android:attr/buttonStyle"
android:layout_width="match_parent" android:layout_width="0px"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_weight="1" android:layout_weight="1"
android:drawableStart="@drawable/ic_refresh"
android:text="@string/nav_refreshtreatments" /> android:text="@string/nav_refreshtreatments" />
<Button <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/delete_future_treatments" android:id="@+id/delete_future_treatments"
style="?android:attr/buttonStyle" style="?android:attr/buttonStyle"
android:layout_width="match_parent" android:layout_width="0px"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_weight="1" android:layout_weight="1"
android:drawableStart="@drawable/ic_remove"
android:text="@string/deletefuturetreatments" /> android:text="@string/deletefuturetreatments" />
</LinearLayout> </LinearLayout>
@ -72,8 +78,6 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview" android:id="@+id/recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent" />
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout> </LinearLayout>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/treatments_cardview" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -22,24 +22,27 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:gravity="center_vertical|right" android:gravity="center"
android:paddingLeft="10dp" android:paddingStart="10dp"
android:text="{fa-clock-o}" /> android:text="{fa-clock-o}"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/date" android:id="@+id/date"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="5dp" /> android:paddingStart="5dp"
tools:ignore="RtlSymmetry" />
<TextView <TextView
android:id="@+id/meal_or_correction" android:id="@+id/meal_or_correction"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginEnd="10dp"
android:layout_weight="1" android:layout_weight="1"
android:text="Meal" android:text="Meal"
android:textAlignment="textEnd" /> android:textAlignment="textEnd"
tools:ignore="HardcodedText" />
</LinearLayout> </LinearLayout>
@ -62,7 +65,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginRight="30dp" android:layout_marginEnd="30dp"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
@ -81,9 +84,9 @@
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginEnd="10dp"
android:layout_weight="1" android:layout_weight="1"
android:text="" /> android:text="" />
@ -91,23 +94,25 @@
android:id="@+id/pump" android:id="@+id/pump"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginEnd="10dp"
android:text="PH" android:text="PH"
android:textColor="@color/colorSetTempButton" /> android:textColor="@color/colorSetTempButton"
tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/ns" android:id="@+id/ns"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginEnd="10dp"
android:text="NS" android:text="NS"
android:textColor="@color/colorSetTempButton" /> android:textColor="@color/colorSetTempButton"
tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/invalid" android:id="@+id/invalid"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginEnd="10dp"
android:text="@string/invalid" android:text="@string/invalid"
android:textColor="@android:color/holo_red_light" /> android:textColor="@android:color/holo_red_light" />
@ -131,32 +136,33 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginRight="30dp" android:layout_marginEnd="30dp"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginRight="30dp" android:layout_marginEnd="30dp"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/calculation" android:id="@+id/calculation"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginEnd="10dp"
android:layout_weight="1" android:layout_weight="1"
android:paddingRight="10dp" android:paddingEnd="10dp"
android:text="@string/calculation_short" android:text="@string/calculation_short"
android:textAlignment="viewEnd" android:textAlignment="viewEnd"
android:textColor="@color/colorCalculatorButton" /> android:textColor="@color/colorCalculatorButton"
tools:ignore="RtlSymmetry" />
<TextView <TextView
android:id="@+id/remove" android:id="@+id/remove"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginEnd="10dp"
android:text="@string/overview_quickwizard_item_remove_button" android:text="@string/overview_quickwizard_item_remove_button"
android:textAlignment="viewEnd" android:textAlignment="viewEnd"
android:textColor="@android:color/holo_orange_light" /> android:textColor="@android:color/holo_orange_light" />
@ -166,7 +172,6 @@
<View <View
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="2dip" android:layout_height="2dip"
android:layout_alignParentBottom="true"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"

View file

@ -10,22 +10,24 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<Button <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/refresh_from_nightscout" android:id="@+id/refresh_from_nightscout"
style="?android:attr/buttonStyle" style="?android:attr/buttonStyle"
android:layout_width="wrap_content" android:layout_width="0px"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_weight="1" android:layout_weight="1"
android:text="@string/refresheventsfromnightscout" /> android:drawableStart="@drawable/ic_refresh"
android:text="@string/nav_refreshtreatments" />
<Button <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/remove_androidaps_started_events" android:id="@+id/remove_androidaps_started_events"
style="?android:attr/buttonStyle" style="?android:attr/buttonStyle"
android:layout_width="wrap_content" android:layout_width="0px"
android:layout_height="match_parent" android:layout_height="fill_parent"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_weight="1" android:layout_weight="1"
android:drawableStart="@drawable/ic_remove"
android:text="@string/careportal_removestartedevents" /> android:text="@string/careportal_removestartedevents" />
</LinearLayout> </LinearLayout>
@ -33,8 +35,6 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview" android:id="@+id/recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent" />
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout> </LinearLayout>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/careportal_cardview" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -26,7 +26,8 @@
android:gravity="center_vertical|end" android:gravity="center_vertical|end"
android:paddingStart="10dp" android:paddingStart="10dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="{fa-clock-o}" /> android:text="{fa-clock-o}"
tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/date" android:id="@+id/date"
@ -34,14 +35,16 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:text="1.1.2000 18:00" android:text="1.1.2000 18:00"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/duration" android:id="@+id/duration"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingEnd="10dp"/> android:paddingEnd="10dp"
tools:ignore="RtlSymmetry" />
<TextView <TextView
android:id="@+id/type" android:id="@+id/type"
@ -50,7 +53,8 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:text="" android:text=""
android:textStyle="bold" /> android:textStyle="bold"
tools:ignore="RtlSymmetry" />
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
@ -65,7 +69,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:text="NS" android:text="NS"
android:textColor="@color/colorSetTempButton" /> android:textColor="@color/colorSetTempButton"
tools:ignore="HardcodedText" />
</LinearLayout> </LinearLayout>
@ -80,9 +85,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="1" android:layout_weight="1"
android:paddingLeft="10dp" android:paddingStart="10dp"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:text="Activity" /> android:text="Activity"
tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/remove" android:id="@+id/remove"

View file

@ -8,8 +8,6 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview" android:id="@+id/recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent" />
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout> </LinearLayout>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -25,14 +26,16 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingStart="10dp" android:paddingStart="10dp"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="{fa-clock-o}" /> android:text="{fa-clock-o}"
tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/date" android:id="@+id/date"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="1.1.2000 18:00" android:text="1.1.2000 18:00"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/insulin" android:id="@+id/insulin"
@ -40,7 +43,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="10dp" android:paddingStart="10dp"
android:text="150%" android:text="150%"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/duration" android:id="@+id/duration"
@ -48,7 +52,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="10dp" android:paddingStart="10dp"
android:text="30 min" android:text="30 min"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText,RtlSymmetry" />
</LinearLayout> </LinearLayout>
@ -73,7 +78,8 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:text="10 min" android:text="10 min"
android:textStyle="bold" /> android:textStyle="bold"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -81,7 +87,8 @@
android:layout_gravity="top" android:layout_gravity="top"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/tempbasals_netratio_label_string" android:text="@string/tempbasals_netratio_label_string"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="RtlSymmetry" />
<TextView <TextView
android:id="@+id/ratio" android:id="@+id/ratio"
@ -90,7 +97,8 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:text="0.05 U/h" android:text="0.05 U/h"
android:textStyle="bold" /> android:textStyle="bold"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -98,7 +106,8 @@
android:layout_gravity="top" android:layout_gravity="top"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:text="@string/tempbasals_netinsulin_label_string" android:text="@string/tempbasals_netinsulin_label_string"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="RtlSymmetry" />
<TextView <TextView
android:id="@+id/insulin_so_far" android:id="@+id/insulin_so_far"
@ -107,7 +116,8 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:text="0.05 U" android:text="0.05 U"
android:textStyle="bold" /> android:textStyle="bold"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
@ -122,7 +132,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:text="PH" android:text="PH"
android:textColor="@color/colorSetTempButton" /> android:textColor="@color/colorSetTempButton"
tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/ns" android:id="@+id/ns"
@ -130,7 +141,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="10dp" android:layout_marginEnd="10dp"
android:text="NS" android:text="NS"
android:textColor="@color/colorSetTempButton" /> android:textColor="@color/colorSetTempButton"
tools:ignore="HardcodedText" />
</LinearLayout> </LinearLayout>
@ -155,7 +167,8 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginEnd="30dp" android:layout_marginEnd="30dp"
android:text="0.12 U" android:text="0.12 U"
android:textStyle="bold" /> android:textStyle="bold"
tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/remove" android:id="@+id/remove"

View file

@ -1,4 +1,5 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout 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" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -6,7 +7,7 @@
tools:context=".plugins.treatments.TreatmentsFragment"> tools:context=".plugins.treatments.TreatmentsFragment">
<com.google.android.flexbox.FlexboxLayout xmlns:app="http://schemas.android.com/apk/res-auto" <com.google.android.flexbox.FlexboxLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/defaultbackground" android:background="@color/defaultbackground"
@ -16,65 +17,77 @@
app:flexWrap="wrap" app:flexWrap="wrap"
app:justifyContent="center"> app:justifyContent="center">
<TextView <ImageView
android:id="@+id/treatments" android:id="@+id/treatments"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|center_horizontal" android:contentDescription="@string/bolus"
android:paddingLeft="5dp" android:scaleX="0.8"
android:paddingRight="5dp" android:scaleY="0.8"
android:text="@string/bolus" /> app:srcCompat="@drawable/ic_cp_bolus_carbs" />
<TextView <ImageView
android:id="@+id/extendedboluses" android:id="@+id/extended_boluses"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|center_horizontal" android:contentDescription="@string/extended_bolus"
android:paddingLeft="5dp" android:paddingStart="6dp"
android:paddingRight="5dp" android:paddingEnd="6dp"
android:text="@string/extended_bolus" /> android:scaleX="0.7"
android:scaleY="0.7"
app:srcCompat="@drawable/ic_actions_startextbolus" />
<TextView <ImageView
android:id="@+id/tempbasals" android:id="@+id/temp_basals"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|center_horizontal" android:contentDescription="@string/tempbasal_label"
android:paddingLeft="5dp" android:scaleX="0.7"
android:paddingRight="5dp" android:scaleY="0.7"
android:text="@string/tempbasal_label" /> app:srcCompat="@drawable/ic_actions_starttempbasal" />
<TextView <ImageView
android:id="@+id/temptargets" android:id="@+id/temp_targets"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|center_horizontal" android:contentDescription="@string/careportal_temporarytarget"
android:paddingLeft="5dp" android:scaleX="0.7"
android:paddingRight="5dp" android:scaleY="0.7"
android:text="@string/careportal_temporarytarget" /> app:srcCompat="@drawable/ic_temptarget_high" />
<TextView <ImageView
android:id="@+id/profileswitches" android:id="@+id/profile_switches"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|center_horizontal" android:contentDescription="@string/careportal_profileswitch"
android:paddingLeft="5dp" android:scaleX="0.7"
android:paddingRight="5dp" android:scaleY="0.7"
android:text="@string/careportal_profileswitch" /> app:srcCompat="@drawable/ic_actions_profileswitch" />
<TextView <ImageView
android:id="@+id/careportal" android:id="@+id/careportal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="wrap_content"
android:paddingStart="6dp"
android:paddingEnd="6dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical|center_horizontal" android:contentDescription="@string/careportal"
android:paddingLeft="5dp" android:scaleX="0.7"
android:paddingRight="5dp" android:scaleY="0.7"
android:text="@string/careportal" /> app:srcCompat="@drawable/ic_cp_note" />
</com.google.android.flexbox.FlexboxLayout> </com.google.android.flexbox.FlexboxLayout>

View file

@ -5,19 +5,18 @@
android:orientation="vertical" android:orientation="vertical"
tools:context="info.nightscout.androidaps.plugins.treatments.fragments.TreatmentsProfileSwitchFragment"> tools:context="info.nightscout.androidaps.plugins.treatments.fragments.TreatmentsProfileSwitchFragment">
<Button <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/refresh_from_nightscout" android:id="@+id/refresh_from_nightscout"
style="?android:attr/buttonStyle" style="?android:attr/buttonStyle"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:drawableStart="@drawable/ic_refresh"
android:text="@string/refresheventsfromnightscout" /> android:text="@string/refresheventsfromnightscout" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview" android:id="@+id/recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent" />
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout> </LinearLayout>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/profileswitch_cardview" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -26,7 +26,8 @@
android:gravity="center_vertical|end" android:gravity="center_vertical|end"
android:paddingEnd="5dp" android:paddingEnd="5dp"
android:paddingStart="10dp" android:paddingStart="10dp"
android:text="{fa-clock-o}" /> android:text="{fa-clock-o}"
tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/date" android:id="@+id/date"
@ -34,7 +35,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="10dp" android:paddingStart="10dp"
android:text="1.1.2000 18:00" android:text="1.1.2000 18:00"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/name" android:id="@+id/name"
@ -43,7 +45,8 @@
android:layout_weight="1" android:layout_weight="1"
android:paddingStart="10dp" android:paddingStart="10dp"
android:text="Name" android:text="Name"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText,RtlSymmetry" />
</LinearLayout> </LinearLayout>
@ -60,7 +63,8 @@
android:layout_weight="1" android:layout_weight="1"
android:paddingStart="10dp" android:paddingStart="10dp"
android:text="60 min" android:text="60 min"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/invalid" android:id="@+id/invalid"
@ -69,7 +73,8 @@
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:text="@string/invalid" android:text="@string/invalid"
android:textAlignment="viewEnd" android:textAlignment="viewEnd"
android:textColor="@android:color/holo_red_light" /> android:textColor="@android:color/holo_red_light"
tools:ignore="RtlSymmetry" />
<TextView <TextView
android:id="@+id/ph" android:id="@+id/ph"
@ -78,7 +83,8 @@
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:text="PH" android:text="PH"
android:textAlignment="viewEnd" android:textAlignment="viewEnd"
android:textColor="@color/colorSetTempButton" /> android:textColor="@color/colorSetTempButton"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/ns" android:id="@+id/ns"
@ -86,7 +92,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingEnd="10dp" android:paddingEnd="10dp"
android:text="NS" android:text="NS"
android:textColor="@color/colorSetTempButton" /> android:textColor="@color/colorSetTempButton"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/clone" android:id="@+id/clone"

View file

@ -35,8 +35,6 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerview" android:id="@+id/recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent" />
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout> </LinearLayout>

View file

@ -1,28 +1,22 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
tools:context="info.nightscout.androidaps.plugins.treatments.fragments.TreatmentsTempTargetFragment"> tools:context="info.nightscout.androidaps.plugins.treatments.fragments.TreatmentsTempTargetFragment">
<LinearLayout <info.nightscout.androidaps.utils.ui.SingleClickButton
android:layout_width="match_parent" android:id="@+id/refresh_from_nightscout"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/temptargetrange_refreshfromnightscout"
style="?android:attr/buttonStyle" style="?android:attr/buttonStyle"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:drawableStart="@drawable/ic_refresh"
android:text="@string/refresheventsfromnightscout" /> android:text="@string/refresheventsfromnightscout" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/temptargetrange_recyclerview" android:id="@+id/recyclerview"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent" />
</androidx.recyclerview.widget.RecyclerView> </LinearLayout>
</LinearLayout>
</FrameLayout>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/temptargetrange_cardview" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
@ -23,72 +23,80 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:gravity="center_vertical|right" android:gravity="center"
android:paddingLeft="10dp" android:paddingStart="10dp"
android:paddingRight="5dp" android:paddingEnd="5dp"
android:text="{fa-clock-o}" /> android:text="{fa-clock-o}"
tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/temptargetrange_date" android:id="@+id/date"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="10dp" android:paddingStart="10dp"
android:text="1.1.2000 18:00" android:text="1.1.2000 18:00"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/temptargetrange_low" android:id="@+id/low"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="10dp" android:paddingStart="10dp"
android:text="80" android:text="80"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="5dp" android:paddingStart="5dp"
android:text="-" android:text="-"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/temptargetrange_high" android:id="@+id/high"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="5dp" android:paddingStart="5dp"
android:text="100" android:text="100"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/temptargetrange_duration" android:id="@+id/duration"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="10dp" android:paddingStart="10dp"
android:text="30 min" android:text="30 min"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginEnd="10dp"
android:layout_weight="1" android:layout_weight="1"
android:text="" /> android:text="" />
<TextView <TextView
android:id="@+id/pump_sign" android:id="@+id/ph"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginEnd="10dp"
android:text="PH" android:text="PH"
android:textColor="@color/colorSetTempButton" /> android:textColor="@color/colorSetTempButton"
tools:ignore="HardcodedText" />
<TextView <TextView
android:id="@+id/ns_sign" android:id="@+id/ns"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginEnd="10dp"
android:text="NS" android:text="NS"
android:textColor="@color/colorSetTempButton" /> android:textColor="@color/colorSetTempButton"
tools:ignore="HardcodedText" />
</LinearLayout> </LinearLayout>
@ -98,36 +106,39 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/temptargetrange_reason_label" android:id="@+id/reason_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="top" android:layout_gravity="top"
android:paddingLeft="10dp" android:paddingStart="10dp"
android:text="@string/reason" android:text="@string/reason"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall"
tools:ignore="RtlSymmetry" />
<TextView <TextView
android:id="@+id/temptargetrange_reason_colon" android:id="@+id/reason_colon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingRight="5dp" android:paddingEnd="5dp"
android:text=":" /> android:text=":"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/temptargetrange_reason" android:id="@+id/reason"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="1" android:layout_weight="1"
android:paddingRight="10dp" android:paddingEnd="10dp"
android:text="Activity" android:text="Activity"
android:textStyle="bold" /> android:textStyle="bold"
tools:ignore="HardcodedText,RtlSymmetry" />
<TextView <TextView
android:id="@+id/temptargetrange_remove" android:id="@+id/remove"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="10dp" android:layout_marginEnd="10dp"
android:text="@string/overview_quickwizard_item_remove_button" android:text="@string/overview_quickwizard_item_remove_button"
android:textAlignment="viewEnd" android:textAlignment="viewEnd"
android:textColor="@android:color/holo_orange_light" /> android:textColor="@android:color/holo_orange_light" />
@ -137,7 +148,6 @@
<View <View
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="2dip" android:layout_height="2dip"
android:layout_alignParentBottom="true"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"