Merge pull request #374 from jotomo/profile-switch-viewer-polish
Some polish around treatments tab, profile switches
This commit is contained in:
commit
4f54b7ba81
5 changed files with 29 additions and 25 deletions
|
@ -212,6 +212,7 @@ public class Profile {
|
|||
retValue += format.format(o2.getDouble("value"));
|
||||
}
|
||||
retValue += " " + units;
|
||||
if (index + 1 < array.length())
|
||||
retValue += "\n";
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -24,14 +24,14 @@ public class NSProfileFragment extends SubscriberFragment {
|
|||
return nsProfilePlugin;
|
||||
}
|
||||
|
||||
private static TextView noProfile;
|
||||
private static TextView units;
|
||||
private static TextView dia;
|
||||
private static TextView activeProfile;
|
||||
private static TextView ic;
|
||||
private static TextView isf;
|
||||
private static TextView basal;
|
||||
private static TextView target;
|
||||
private TextView noProfile;
|
||||
private TextView units;
|
||||
private TextView dia;
|
||||
private TextView activeProfile;
|
||||
private TextView ic;
|
||||
private TextView isf;
|
||||
private TextView basal;
|
||||
private TextView target;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
|
|
|
@ -130,9 +130,11 @@ public class TreatmentsProfileSwitchFragment extends SubscriberFragment implemen
|
|||
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() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(MainApp.sResources.getString(R.string.confirmation));
|
||||
builder.setMessage(MainApp.sResources.getString(R.string.removerecord) + "\n" + DateUtil.dateAndTimeString(profileSwitch.date));
|
||||
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
final String _id = profileSwitch._id;
|
||||
if (_id != null && !_id.equals("")) {
|
||||
NSUpload.removeCareportalEntryFromNS(_id);
|
||||
|
@ -140,6 +142,8 @@ public class TreatmentsProfileSwitchFragment extends SubscriberFragment implemen
|
|||
MainApp.getDbHelper().delete(profileSwitch);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(MainApp.sResources.getString(R.string.cancel), null);
|
||||
builder.show();
|
||||
break;
|
||||
case R.id.profileswitch_date:
|
||||
case R.id.profileswitch_name:
|
||||
|
|
|
@ -141,7 +141,6 @@ public class TreatmentsTempTargetFragment extends SubscriberFragment implements
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
final TempTarget tempTarget = (TempTarget) v.getTag();
|
||||
final Context finalContext = context;
|
||||
switch (v.getId()) {
|
||||
case R.id.temptargetrange_remove:
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
|
|
Loading…
Reference in a new issue