Merge branch 'master' of https://github.com/MilosKozak/AndroidAPS
This commit is contained in:
commit
8637e99afe
2 changed files with 12 additions and 0 deletions
|
@ -352,6 +352,12 @@ public class CircadianPercentageProfileFragment extends Fragment implements Frag
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
|
|
||||||
|
if (basalEditDialog != null && basalEditDialog.isVisible()) {
|
||||||
|
basalEditDialog.dismiss();
|
||||||
|
}
|
||||||
|
basalEditDialog = null;
|
||||||
|
|
||||||
MainApp.bus().unregister(this);
|
MainApp.bus().unregister(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,23 +84,29 @@ public class TimeListEdit {
|
||||||
|
|
||||||
for (int i = 0; i < itemsCount(); i++) {
|
for (int i = 0; i < itemsCount(); i++) {
|
||||||
View childview = inflater.inflate(R.layout.timelistedit_element, layout, false);
|
View childview = inflater.inflate(R.layout.timelistedit_element, layout, false);
|
||||||
|
childview.setId(View.generateViewId());
|
||||||
final Spinner timeSpinner = (Spinner) childview.findViewById(R.id.timelistedit_time);
|
final Spinner timeSpinner = (Spinner) childview.findViewById(R.id.timelistedit_time);
|
||||||
|
timeSpinner.setId(View.generateViewId());
|
||||||
int previous = i == 0 ? -1 * ONEHOURINSECONDS : secondFromMidnight(i - 1);
|
int previous = i == 0 ? -1 * ONEHOURINSECONDS : secondFromMidnight(i - 1);
|
||||||
int next = i == itemsCount() - 1 ? 24 * ONEHOURINSECONDS : secondFromMidnight(i + 1);
|
int next = i == itemsCount() - 1 ? 24 * ONEHOURINSECONDS : secondFromMidnight(i + 1);
|
||||||
if (i == 0) next = ONEHOURINSECONDS;
|
if (i == 0) next = ONEHOURINSECONDS;
|
||||||
fillSpinner(timeSpinner, secondFromMidnight(i), previous, next);
|
fillSpinner(timeSpinner, secondFromMidnight(i), previous, next);
|
||||||
|
|
||||||
final EditText editText1 = (EditText) childview.findViewById(R.id.timelistedit_edit1);
|
final EditText editText1 = (EditText) childview.findViewById(R.id.timelistedit_edit1);
|
||||||
|
editText1.setId(View.generateViewId());
|
||||||
fillNumber(editText1, value1(i));
|
fillNumber(editText1, value1(i));
|
||||||
final EditText editText2 = ((EditText) childview.findViewById(R.id.timelistedit_edit2));
|
final EditText editText2 = ((EditText) childview.findViewById(R.id.timelistedit_edit2));
|
||||||
fillNumber(editText2, value2(i));
|
fillNumber(editText2, value2(i));
|
||||||
|
editText2.setId(View.generateViewId());
|
||||||
if (data2 == null) {
|
if (data2 == null) {
|
||||||
editText2.setVisibility(View.GONE);
|
editText2.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ImageView addbutton = (ImageView) childview.findViewById(R.id.timelistedit_add);
|
ImageView addbutton = (ImageView) childview.findViewById(R.id.timelistedit_add);
|
||||||
|
addbutton.setId(View.generateViewId());
|
||||||
ImageView removebutton = (ImageView) childview.findViewById(R.id.timelistedit_remove);
|
ImageView removebutton = (ImageView) childview.findViewById(R.id.timelistedit_remove);
|
||||||
|
removebutton.setId(View.generateViewId());
|
||||||
|
|
||||||
if (itemsCount() == 1 && i == 0) {
|
if (itemsCount() == 1 && i == 0) {
|
||||||
removebutton.setVisibility(View.GONE);
|
removebutton.setVisibility(View.GONE);
|
||||||
|
|
Loading…
Reference in a new issue