fix bugs & design tweaking
This commit is contained in:
parent
6ca4811e8e
commit
d365fcd6a4
21 changed files with 380 additions and 52 deletions
|
@ -77,15 +77,16 @@ public class ProfileIntervals<T extends Interval> {
|
|||
final int mid = (lo + hi) >>> 1;
|
||||
final Interval midVal = rawData.valueAt(mid);
|
||||
|
||||
if (midVal.before(value)) {
|
||||
if (midVal.match(value)) {
|
||||
return mid; // value found
|
||||
} else if (midVal.before(value)) {
|
||||
lo = mid + 1;
|
||||
} else if (midVal.after(value)) {
|
||||
hi = mid - 1;
|
||||
} else if (midVal.match(value)) {
|
||||
return mid; // value found
|
||||
}
|
||||
}
|
||||
// not found, try nearest older with duration 0
|
||||
lo = lo - 1;
|
||||
while (lo >= 0 && lo < rawData.size()) {
|
||||
if (rawData.valueAt(lo).isEndingEvent())
|
||||
return lo;
|
||||
|
|
|
@ -998,6 +998,7 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
|
|||
return getProfile(new Date().getTime());
|
||||
}
|
||||
public Profile getProfile(long time) {
|
||||
//log.debug("Profile for: " + new Date(time).toLocaleString() + " : " + getProfileName(time));
|
||||
ProfileSwitch profileSwitch = getProfileSwitchFromHistory(time);
|
||||
if (profileSwitch != null) {
|
||||
if (profileSwitch.profileJson != null) {
|
||||
|
|
|
@ -25,6 +25,7 @@ import android.view.LayoutInflater;
|
|||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
|
@ -268,6 +269,19 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
llm = new LinearLayoutManager(view.getContext());
|
||||
notificationsView.setLayoutManager(llm);
|
||||
|
||||
final LinearLayout graphs = (LinearLayout)view.findViewById(R.id.overview_graphs_layout);
|
||||
ViewTreeObserver observer = graphs.getViewTreeObserver();
|
||||
observer.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
log.debug("Height: " + graphs.getHeight());
|
||||
graphs.getViewTreeObserver().removeGlobalOnLayoutListener(
|
||||
this);
|
||||
int heightNeeded = Math.max(320, graphs.getHeight() - 200);
|
||||
if (heightNeeded != bgGraph.getHeight())
|
||||
bgGraph.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, heightNeeded));
|
||||
}
|
||||
});
|
||||
|
||||
bgGraph.getGridLabelRenderer().setGridColor(Color.rgb(0x75, 0x75, 0x75));
|
||||
bgGraph.getGridLabelRenderer().reloadStyles();
|
||||
|
@ -1441,7 +1455,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
|
|||
|
||||
for (int tx = 0; tx < profileSwitches.size(); tx++) {
|
||||
ProfileSwitch t = profileSwitches.get(tx);
|
||||
if (t.date < fromTime || t.date > now) continue;
|
||||
if (t.date < fromTime || t.date > endTime) continue;
|
||||
filteredProfileSwitches.add(t);
|
||||
}
|
||||
ProfileSwitch[] profileSwitchArray = new ProfileSwitch[filteredProfileSwitches.size()];
|
||||
|
|
|
@ -237,12 +237,12 @@ public class VerticalTextsGraphSeries<E extends DataPointWithLabelInterface> ext
|
|||
Rect bounds = new Rect();
|
||||
mPaint.getTextBounds(value.getLabel(), 0, value.getLabel().length(), bounds);
|
||||
mPaint.setStyle(Paint.Style.STROKE);
|
||||
float px = endX;
|
||||
float py = (float) (graphHeight * ratY + bounds.height() + 80);
|
||||
float px = endX + bounds.height() / 2;
|
||||
float py = (float) (graphHeight * ratY + bounds.width() + 10);
|
||||
canvas.save();
|
||||
canvas.rotate(-90, px, py);
|
||||
canvas.drawText(value.getLabel(), px, py, mPaint);
|
||||
canvas.drawRect(bounds.left + px - 3, bounds.top + py - 3, bounds.right + px + 3, bounds.bottom + py + 3, mPaint);
|
||||
canvas.drawRect(px - 3, bounds.top + py - 3, bounds.right + px + 3, bounds.bottom + py + 3, mPaint);
|
||||
canvas.restore();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ import info.nightscout.androidaps.MainApp;
|
|||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.plugins.Treatments.fragments.TreatmentsBolusFragment;
|
||||
import info.nightscout.androidaps.plugins.Treatments.fragments.TreatmentsExtendedBolusesFragment;
|
||||
import info.nightscout.androidaps.plugins.Treatments.fragments.TreatmentsProfileSwitchFragment;
|
||||
import info.nightscout.androidaps.plugins.Treatments.fragments.TreatmentsTempTargetFragment;
|
||||
import info.nightscout.androidaps.plugins.Treatments.fragments.TreatmentsTemporaryBasalsFragment;
|
||||
|
||||
|
@ -28,11 +29,11 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
|
|||
return treatmentsPlugin;
|
||||
}
|
||||
|
||||
Context context;
|
||||
TextView treatmentsTab;
|
||||
TextView extendedBolusesTab;
|
||||
TextView tempBasalsTab;
|
||||
TextView tempTargetTab;
|
||||
TextView profileSwitchTab;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
|
@ -43,11 +44,12 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
|
|||
extendedBolusesTab = (TextView) view.findViewById(R.id.treatments_extendedboluses);
|
||||
tempBasalsTab = (TextView) view.findViewById(R.id.treatments_tempbasals);
|
||||
tempTargetTab = (TextView) view.findViewById(R.id.treatments_temptargets);
|
||||
profileSwitchTab = (TextView) view.findViewById(R.id.treatments_profileswitches);
|
||||
treatmentsTab.setOnClickListener(this);
|
||||
extendedBolusesTab.setOnClickListener(this);
|
||||
tempBasalsTab.setOnClickListener(this);
|
||||
tempTargetTab.setOnClickListener(this);
|
||||
context = getContext();
|
||||
profileSwitchTab.setOnClickListener(this);
|
||||
|
||||
setFragment(new TreatmentsBolusFragment());
|
||||
setBackgroundColorOnSelected(treatmentsTab);
|
||||
|
@ -75,6 +77,10 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
|
|||
setFragment(new TreatmentsTempTargetFragment());
|
||||
setBackgroundColorOnSelected(tempTargetTab);
|
||||
break;
|
||||
case R.id.treatments_profileswitches:
|
||||
setFragment(new TreatmentsProfileSwitchFragment());
|
||||
setBackgroundColorOnSelected(profileSwitchTab);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,6 +97,7 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
|
|||
extendedBolusesTab.setBackgroundColor(MainApp.sResources.getColor(R.color.defaultbackground));
|
||||
tempBasalsTab.setBackgroundColor(MainApp.sResources.getColor(R.color.defaultbackground));
|
||||
tempTargetTab.setBackgroundColor(MainApp.sResources.getColor(R.color.defaultbackground));
|
||||
profileSwitchTab.setBackgroundColor(MainApp.sResources.getColor(R.color.defaultbackground));
|
||||
selected.setBackgroundColor(MainApp.sResources.getColor(R.color.tabBgColorSelected));
|
||||
}
|
||||
}
|
|
@ -183,7 +183,7 @@ public class TreatmentsBolusFragment extends Fragment implements View.OnClickLis
|
|||
case R.id.treatments_reshreshfromnightscout:
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this.getContext());
|
||||
builder.setTitle(this.getContext().getString(R.string.confirmation));
|
||||
builder.setMessage(this.getContext().getString(R.string.refreshtreatmentsfromnightscout));
|
||||
builder.setMessage(this.getContext().getString(R.string.refresheventsfromnightscout) + "?");
|
||||
builder.setPositiveButton(this.getContext().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
MainApp.getDbHelper().resetTreatments();
|
||||
|
|
|
@ -0,0 +1,203 @@
|
|||
package info.nightscout.androidaps.plugins.Treatments.fragments;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Paint;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.squareup.otto.Subscribe;
|
||||
|
||||
import info.nightscout.androidaps.MainApp;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.Services.Intents;
|
||||
import info.nightscout.androidaps.data.Profile;
|
||||
import info.nightscout.androidaps.data.ProfileIntervals;
|
||||
import info.nightscout.androidaps.db.ProfileSwitch;
|
||||
import info.nightscout.androidaps.db.TempTarget;
|
||||
import info.nightscout.androidaps.events.EventProfileSwitchChange;
|
||||
import info.nightscout.androidaps.events.EventTempTargetChange;
|
||||
import info.nightscout.utils.DateUtil;
|
||||
import info.nightscout.utils.DecimalFormatter;
|
||||
import info.nightscout.utils.NSUpload;
|
||||
import info.nightscout.utils.OKDialog;
|
||||
import info.nightscout.utils.SP;
|
||||
|
||||
/**
|
||||
* Created by mike on 13/01/17.
|
||||
*/
|
||||
|
||||
public class TreatmentsProfileSwitchFragment extends Fragment implements View.OnClickListener {
|
||||
|
||||
RecyclerView recyclerView;
|
||||
LinearLayoutManager llm;
|
||||
Button refreshFromNS;
|
||||
|
||||
Context context;
|
||||
|
||||
public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.ProfileSwitchViewHolder> {
|
||||
|
||||
ProfileIntervals<ProfileSwitch> profileSwitchList;
|
||||
|
||||
RecyclerViewAdapter(ProfileIntervals<ProfileSwitch> profileSwitchList) {
|
||||
this.profileSwitchList = profileSwitchList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProfileSwitchViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
|
||||
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.treatments_profileswitch_item, viewGroup, false);
|
||||
ProfileSwitchViewHolder ProfileSwitchViewHolder = new ProfileSwitchViewHolder(v);
|
||||
return ProfileSwitchViewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ProfileSwitchViewHolder holder, int position) {
|
||||
Profile profile = MainApp.getConfigBuilder().getProfile();
|
||||
if (profile == null) return;
|
||||
ProfileSwitch profileSwitch = profileSwitchList.getReversed(position);
|
||||
|
||||
holder.date.setText(DateUtil.dateAndTimeString(profileSwitch.date));
|
||||
if (!profileSwitch.isEndingEvent()) {
|
||||
holder.duration.setText(DecimalFormatter.to0Decimal(profileSwitch.durationInMinutes) + " min");
|
||||
} else {
|
||||
holder.duration.setText("");
|
||||
}
|
||||
holder.name.setText(profileSwitch.profileName);
|
||||
if (profileSwitch.isInProgress())
|
||||
holder.date.setTextColor(ContextCompat.getColor(MainApp.instance(), R.color.colorActive));
|
||||
else
|
||||
holder.date.setTextColor(holder.duration.getCurrentTextColor());
|
||||
holder.remove.setTag(profileSwitch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return profileSwitchList.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
|
||||
super.onAttachedToRecyclerView(recyclerView);
|
||||
}
|
||||
|
||||
public class ProfileSwitchViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
CardView cv;
|
||||
TextView date;
|
||||
TextView duration;
|
||||
TextView name;
|
||||
TextView remove;
|
||||
|
||||
ProfileSwitchViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
cv = (CardView) itemView.findViewById(R.id.profileswitch_cardview);
|
||||
date = (TextView) itemView.findViewById(R.id.profileswitch_date);
|
||||
duration = (TextView) itemView.findViewById(R.id.profileswitch_duration);
|
||||
name = (TextView) itemView.findViewById(R.id.profileswitch_name);
|
||||
remove = (TextView) itemView.findViewById(R.id.profileswitch_remove);
|
||||
remove.setOnClickListener(this);
|
||||
remove.setPaintFlags(remove.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final ProfileSwitch profileSwitch = (ProfileSwitch) v.getTag();
|
||||
switch (v.getId()) {
|
||||
case R.id.profileswitch_remove:
|
||||
OKDialog.show(getActivity(), MainApp.sResources.getString(R.string.confirmation), MainApp.sResources.getString(R.string.removerecord) + "\n" + DateUtil.dateAndTimeString(profileSwitch.date), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final String _id = profileSwitch._id;
|
||||
if (_id != null && !_id.equals("")) {
|
||||
NSUpload.removeCareportalEntryFromNS(_id);
|
||||
}
|
||||
MainApp.getDbHelper().delete(profileSwitch);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.treatments_profileswitch_fragment, container, false);
|
||||
|
||||
recyclerView = (RecyclerView) view.findViewById(R.id.profileswitch_recyclerview);
|
||||
recyclerView.setHasFixedSize(true);
|
||||
llm = new LinearLayoutManager(view.getContext());
|
||||
recyclerView.setLayoutManager(llm);
|
||||
|
||||
RecyclerViewAdapter adapter = new RecyclerViewAdapter(MainApp.getConfigBuilder().getProfileSwitchesFromHistory());
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
refreshFromNS = (Button) view.findViewById(R.id.profileswitch_refreshfromnightscout);
|
||||
refreshFromNS.setOnClickListener(this);
|
||||
|
||||
context = getContext();
|
||||
|
||||
boolean nsUploadOnly = SP.getBoolean(R.string.key_ns_upload_only, false);
|
||||
if (nsUploadOnly)
|
||||
refreshFromNS.setVisibility(View.GONE);
|
||||
|
||||
updateGUI();
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.profileswitch_refreshfromnightscout:
|
||||
OKDialog.show(getActivity(), MainApp.sResources.getString(R.string.confirmation), MainApp.sResources.getString(R.string.refresheventsfromnightscout) + "?", new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
MainApp.getDbHelper().resetProfileSwitch();
|
||||
Intent restartNSClient = new Intent(Intents.ACTION_RESTART);
|
||||
MainApp.instance().getApplicationContext().sendBroadcast(restartNSClient);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
MainApp.bus().unregister(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
MainApp.bus().register(this);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onStatusEvent(final EventProfileSwitchChange ev) {
|
||||
updateGUI();
|
||||
}
|
||||
|
||||
void updateGUI() {
|
||||
Activity activity = getActivity();
|
||||
if (activity != null)
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
recyclerView.swapAdapter(new RecyclerViewAdapter(MainApp.getConfigBuilder().getProfileSwitchesFromHistory()), false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -65,7 +65,7 @@ public class TreatmentsTempTargetFragment extends Fragment implements View.OnCli
|
|||
if (profile == null) return;
|
||||
TempTarget tempTarget = tempTargetList.getReversed(position);
|
||||
if (!tempTarget.isEndingEvent()) {
|
||||
holder.date.setText(DateUtil.dateAndTimeString(tempTarget.date) + " - " + DateUtil.timeString(tempTargetList.get(position).originalEnd()));
|
||||
holder.date.setText(DateUtil.dateAndTimeString(tempTarget.date) + " - " + DateUtil.timeString(tempTarget.originalEnd()));
|
||||
holder.duration.setText(DecimalFormatter.to0Decimal(tempTarget.durationInMinutes) + " min");
|
||||
holder.low.setText(tempTarget.lowValueToUnitsToString(profile.getUnits()));
|
||||
holder.high.setText(tempTarget.highValueToUnitsToString(profile.getUnits()));
|
||||
|
@ -180,7 +180,7 @@ public class TreatmentsTempTargetFragment extends Fragment implements View.OnCli
|
|||
case R.id.temptargetrange_refreshfromnightscout:
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this.getContext());
|
||||
builder.setTitle(this.getContext().getString(R.string.confirmation));
|
||||
builder.setMessage(this.getContext().getString(R.string.refreshtemptargetsfromnightscout));
|
||||
builder.setMessage(this.getContext().getString(R.string.refresheventsfromnightscout) + " ?");
|
||||
builder.setPositiveButton(this.getContext().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
MainApp.getDbHelper().resetTempTargets();
|
||||
|
|
|
@ -12,11 +12,12 @@
|
|||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:layout_above="@+id/overview_buttons">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
|
@ -29,7 +30,7 @@
|
|||
<LinearLayout
|
||||
android:id="@+id/overview_looplayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="2dp">
|
||||
|
||||
|
@ -71,14 +72,14 @@
|
|||
<LinearLayout
|
||||
android:id="@+id/overview_pumpstatuslayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="2dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/overview_pumpstatus"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
|
@ -125,7 +126,7 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.5"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
@ -162,7 +163,7 @@
|
|||
<LinearLayout
|
||||
android:id="@+id/overview_basallayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
@ -289,15 +290,17 @@
|
|||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/overview_graphs_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.jjoe64.graphview.GraphView
|
||||
android:id="@+id/overview_bggraph"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="160dip" />
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<com.jjoe64.graphview.GraphView
|
||||
android:id="@+id/overview_iobgraph"
|
||||
|
|
|
@ -13,40 +13,49 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/treatments_treatments"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:text="@string/bolus" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/treatments_extendedboluses"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:text="@string/extendedbolus" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/treatments_tempbasals"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:text="@string/tempbasal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/treatments_temptargets"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:text="@string/temptarget" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/treatments_profileswitches"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:text="@string/profileswitch" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="info.nightscout.androidaps.plugins.Treatments.fragments.TreatmentsProfileSwitchFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/profileswitch_refreshfromnightscout"
|
||||
style="?android:attr/buttonStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/refresheventsfromnightscout" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/profileswitch_recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</android.support.v7.widget.RecyclerView>
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
81
app/src/main/res/layout/treatments_profileswitch_item.xml
Normal file
81
app/src/main/res/layout/treatments_profileswitch_item.xml
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/profileswitch_cardview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
card_view:cardBackgroundColor="?android:colorBackground">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="true"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<com.joanzapata.iconify.widget.IconTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center_vertical|right"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="5dp"
|
||||
android:text="{fa-clock-o}" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileswitch_date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:text="1.1.2000 18:00"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileswitch_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:text="Name"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileswitch_duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:paddingLeft="5dp"
|
||||
android:text="60 min"
|
||||
android:textAlignment="viewEnd"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/profileswitch_remove"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="5dp"
|
||||
android:text="@string/overview_quickwizard_item_remove_button"
|
||||
android:textAlignment="viewEnd"
|
||||
android:textColor="@android:color/holo_orange_light" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="2dip"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@color/listdelimiter" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
|
@ -15,7 +15,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="@string/temptargetrange_refreshfromnightscout" />
|
||||
android:text="@string/refresheventsfromnightscout" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/temptargetrange_recyclerview"
|
||||
|
|
|
@ -123,7 +123,6 @@
|
|||
<string name="objectives_pumpstatusavailableinns">Статус на помпа в NS</string>
|
||||
<string name="rate">Стойност</string>
|
||||
<string name="reason">Основание</string>
|
||||
<string name="refreshtreatmentsfromnightscout">Искате ли да обновите treatments от Nightscout</string>
|
||||
<string name="safety">Безопасност</string>
|
||||
<string name="setextendedbolusquestion">Задай нов удължен болусs:</string>
|
||||
<string name="setbasalquestion">Приложи нов временен базал:</string>
|
||||
|
@ -413,12 +412,10 @@
|
|||
<string name="ongoingnotificaction">Текущи известия</string>
|
||||
<string name="openapsma_scriptdebugdata_label">Script debug</string>
|
||||
<string name="openapsma_valuelimitedto" formatted="false">%.2f ограничено до %.2f</string>
|
||||
<string name="refreshtemptargetsfromnightscout">Искате ли да обновите временните цели от Найтскаут</string>
|
||||
<string name="removerecord">Премахни запис:</string>
|
||||
<string name="short_avgdelta">Краткоср. Δ:</string>
|
||||
<string name="short_tabtitles">Къси имена</string>
|
||||
<string name="smscommunicator_bolusdelivered" formatted="false">Bolus %.2fU delivered successfully</string>
|
||||
<string name="temptargetrange_refreshfromnightscout">Обнови временни цели от NS</string>
|
||||
<string name="danar_stats_expweight">Експоненциално претеглена TDD</string>
|
||||
<string name="danar_stats_cumulative_tdd">Комулативна TDD</string>
|
||||
<string name="danar_stats_weight">Тегло</string>
|
||||
|
|
|
@ -123,7 +123,6 @@
|
|||
<string name="objectives_pumpstatusavailableinns">Stav pumpy dostupný v NS</string>
|
||||
<string name="rate">Hodnota</string>
|
||||
<string name="reason">Zdůvodnění</string>
|
||||
<string name="refreshtreatmentsfromnightscout">Opravdu aktualizovat ošetření z NS</string>
|
||||
<string name="safety">Bezpečnost</string>
|
||||
<string name="danar_useextended_title">Použít kombo bolusy pro >200%</string>
|
||||
<string name="setextendedbolusquestion">Spustit nový kombo bolus:</string>
|
||||
|
@ -388,10 +387,9 @@
|
|||
<string name="openapsma_autosensdata_label">Data detekce senzitivity</string>
|
||||
<string name="openapsma_scriptdebugdata_label">Ladící informace</string>
|
||||
<string name="openapsma_valuelimitedto" formatted="false">%.2f omezeno na %.2f</string>
|
||||
<string name="refreshtemptargetsfromnightscout">Opravdu aktualizovat dočasné cíle z NS</string>
|
||||
<string name="removerecord">Odstranit záznam:</string>
|
||||
<string name="short_avgdelta">Krátkodobý průměr</string>
|
||||
<string name="temptargetrange_refreshfromnightscout">Obnovit dočasné cíle z NS</string>
|
||||
<string name="refresheventsfromnightscout">Obnovit události z NS</string>
|
||||
<string name="actions_shortname">"AKCE"</string>
|
||||
<string name="wear_shortname">"WEAR"</string>
|
||||
<string name="virtualpump_shortname">VPUM</string>
|
||||
|
|
|
@ -118,7 +118,6 @@
|
|||
<string name="setextendedbolusquestion">Setze neuen extended Bolus:</string>
|
||||
<string name="setbasalquestion">Akzeptiere neue temp Basalrate:</string>
|
||||
<string name="danar_useextended_title">Benutze extended Bolus für hohe temps (\>200%)></string>
|
||||
<string name="refreshtreatmentsfromnightscout">Möchtest du die Treatments von Nightscout abrufen</string>
|
||||
<string name="objectives_pumpstatusavailableinns">Pumpen Status verfügbar in NS</string>
|
||||
<string name="overview_newtempbasal_percent_label">% (100% = current)</string>
|
||||
<string name="overview_newtempbasal_basal_label">Basal Wert</string>
|
||||
|
|
|
@ -101,7 +101,6 @@
|
|||
<string name="loop_constraintsprocessed_label">Tras procesar limitaciones</string>
|
||||
<string name="loop_setbypump_label">Definido por la bomba</string>
|
||||
<string name="openapsma_lastenact_label">Última aceptada</string>
|
||||
<string name="refreshtreatmentsfromnightscout">¿Quieres actualizar tratamientos de Nightscout?</string>
|
||||
<string name="ok">OK</string>
|
||||
<string name="cancel">Cancelar</string>
|
||||
<string name="noapsselected">NO APS Seleccionado</string>
|
||||
|
@ -384,7 +383,6 @@
|
|||
<string name="pumpNotInitializedProfileNotSet">Bomba no iniciada, ¡perfil no ajustado!</string>
|
||||
<string name="pumperror">Error en bomba</string>
|
||||
<string name="pumpshutdown">Apagando Bomba</string>
|
||||
<string name="refreshtemptargetsfromnightscout">¿Quiere actualizar objetivo temporal desde Nightscout?</string>
|
||||
<string name="removerecord">Eliminar registro:</string>
|
||||
<string name="resend_all_data">Enviar todos los datos</string>
|
||||
<string name="send_to_pump">ENVIAR A BOMBA</string>
|
||||
|
@ -394,7 +392,6 @@
|
|||
<string name="sms_minago">%dmin antes</string>
|
||||
<string name="smscommunicator_bolusdelivered">Bolo %.2fU enviado correctamente</string>
|
||||
<string name="target_range">Rango Objetivo:</string>
|
||||
<string name="temptargetrange_refreshfromnightscout">Actualizar objetivo temporal desde NS</string>
|
||||
<string name="timeshift_hint"></string>
|
||||
<string name="units">Unidades:</string>
|
||||
<string name="error_only_numeric_digits_allowed">Sólo se permiten caracteres numéricos</string>
|
||||
|
|
|
@ -330,8 +330,6 @@
|
|||
<string name="pumpshutdown">Arresto Micro</string>
|
||||
<string name="pumpsuspended">Sospensione Micro</string>
|
||||
<string name="pumpsuspendedclicktorefresh">Micro sospeso. Clicca per aggiornare</string>
|
||||
<string name="refreshtemptargetsfromnightscout">Vuoi aggiornare i target di tempo da Nightscout</string>
|
||||
<string name="refreshtreatmentsfromnightscout">Vuoi aggiornare i trattamenti da Nightscout</string>
|
||||
<string name="reloadprofile">Aggiorna Profilo</string>
|
||||
<string name="removerecord">Eliminare campo:</string>
|
||||
<string name="restart">Riavvio</string>
|
||||
|
@ -411,7 +409,6 @@
|
|||
<string name="openapsma_mealdata_label">Data Pranzo</string>
|
||||
<string name="overview_bolusprogress_stoped">Stoppato</string>
|
||||
<string name="tempbasals_netratio_label_string">rapporto:</string>
|
||||
<string name="temptargetrange_refreshfromnightscout">Aggiornare i target di temp da NS</string>
|
||||
<string name="treatmentdeliveryerror">Errore di erogazione del bolo</string>
|
||||
<string name="treatments_activity_string">attività</string>
|
||||
<string name="treatments_carbs_label_string">Carboidrati:</string>
|
||||
|
|
|
@ -100,8 +100,6 @@
|
|||
<string name="loop_constraintsprocessed_label">After processed constraints</string>
|
||||
<string name="loop_setbypump_label">Set by pump</string>
|
||||
<string name="openapsma_lastenact_label">최근 주입</string>
|
||||
<string name="refreshtreatmentsfromnightscout">나이트스카우트에서 Treatments를 새로고치시겠습니까</string>
|
||||
<string name="refreshtemptargetsfromnightscout">나이트스카우트에서 Temp Target을 새로고치시겠습니까</string>
|
||||
<string name="ok">OK</string>
|
||||
<string name="cancel">취소</string>
|
||||
<string name="noapsselected">NO APS SELECTED OR PROVIDED RESULT</string>
|
||||
|
@ -399,7 +397,6 @@
|
|||
<string name="openapsma_autosensdata_label">Autosens data</string>
|
||||
<string name="openapsma_scriptdebugdata_label">Script debug</string>
|
||||
<string name="openapsama_useautosens">AMA autosens 기능 사용하기</string>
|
||||
<string name="temptargetrange_refreshfromnightscout">Refresh temp targets from NS</string>
|
||||
<string name="eatingsoon">Eating Soon</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="removerecord">Remove record:</string>
|
||||
|
|
|
@ -424,8 +424,6 @@
|
|||
<string name="quickwizardsettings">БыстрыйБолюс настройки</string>
|
||||
<string name="rate">значение</string>
|
||||
<string name="reason">основание</string>
|
||||
<string name="refreshtemptargetsfromnightscout">хотите обновить врем цели из Nightscout?</string>
|
||||
<string name="refreshtreatmentsfromnightscout">хотите обновить назначения из Nightscout?</string>
|
||||
<string name="reloadprofile">обновить профиль</string>
|
||||
<string name="removerecord">удалить запись</string>
|
||||
<string name="resend_all_data">повторить отправку всех данных</string>
|
||||
|
@ -508,7 +506,6 @@
|
|||
<string name="tempbasals_netratio_label_string">соотношение:</string>
|
||||
<string name="tempbasals_realduration_label_string">длит:</string>
|
||||
<string name="tempbasals_shortname">ВремБаз</string>
|
||||
<string name="temptargetrange_refreshfromnightscout">обновить врем цели из NS</string>
|
||||
<string name="temptargetrange_shortname">ВремЦель</string>
|
||||
<string name="timeshift_hint">Время в часах к которому профиль перейдет на след сутки</string>
|
||||
<string name="treatmentdeliveryerror">ошибка доставки болюса</string>
|
||||
|
|
|
@ -106,8 +106,6 @@
|
|||
<string name="loop_constraintsprocessed_label">After processed constraints</string>
|
||||
<string name="loop_setbypump_label">Set by pump</string>
|
||||
<string name="openapsma_lastenact_label">Last enacted</string>
|
||||
<string name="refreshtreatmentsfromnightscout">Do you want to refresh treatments from Nightscout</string>
|
||||
<string name="refreshtemptargetsfromnightscout">Do you want to refresh temp targets from Nightscout</string>
|
||||
<string name="ok">OK</string>
|
||||
<string name="cancel">Cancel</string>
|
||||
<string name="noapsselected">NO APS SELECTED OR PROVIDED RESULT</string>
|
||||
|
@ -415,7 +413,7 @@
|
|||
<string name="openapsma_autosensdata_label">Autosens data</string>
|
||||
<string name="openapsma_scriptdebugdata_label">Script debug</string>
|
||||
<string name="openapsama_useautosens">Use AMA autosens feature</string>
|
||||
<string name="temptargetrange_refreshfromnightscout">Refresh temp targets from NS</string>
|
||||
<string name="refresheventsfromnightscout">Refresh events from NS</string>
|
||||
<string name="eatingsoon">Eating Soon</string>
|
||||
<string name="activity">Activity</string>
|
||||
<string name="removerecord">Remove record:</string>
|
||||
|
@ -625,4 +623,5 @@
|
|||
<string name="basalmissing">Basal missing in profile. Using default.</string>
|
||||
<string name="targetmissing">Target missing in profile. Using default.</string>
|
||||
<string name="invalidprofile">Invalid profile !!!</string>
|
||||
<string name="profileswitch">ProfileSwitch</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue