From 61f1acdcb06cf70853f45e965235e5ffa17c7735 Mon Sep 17 00:00:00 2001 From: warstar2187 Date: Fri, 10 Feb 2017 20:59:06 +0900 Subject: [PATCH 1/9] Update DanaRPlugin.java --- .../info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java index 60ea9ff4e5..3e90b419ff 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/DanaRPlugin.java @@ -85,7 +85,7 @@ public class DanaRPlugin implements PluginBase, PumpInterface, ConstraintsInterf pumpDescription.bolusStep = 0.05d; pumpDescription.isExtendedBolusCapable = true; - pumpDescription.extendedBolusStep = 0.1d; + pumpDescription.extendedBolusStep = 0.05d; pumpDescription.isTempBasalCapable = true; pumpDescription.lowTempBasalStyle = PumpDescription.PERCENT; From 9458e0effa7e188a691184a637e7914d40868333 Mon Sep 17 00:00:00 2001 From: warstar2187 Date: Fri, 10 Feb 2017 20:59:44 +0900 Subject: [PATCH 2/9] Update DanaRKoreanPlugin.java --- .../androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java index 3d7975fef5..02c86d16a0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java @@ -85,7 +85,7 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, Constraints pumpDescription.bolusStep = 0.1d; pumpDescription.isExtendedBolusCapable = true; - pumpDescription.extendedBolusStep = 0.1d; + pumpDescription.extendedBolusStep = 0.05d; pumpDescription.isTempBasalCapable = true; pumpDescription.lowTempBasalStyle = PumpDescription.PERCENT; From 3176f33a9edc94cc5a7d05ec5f6dfaf2ff1a65bd Mon Sep 17 00:00:00 2001 From: viktoria Date: Sat, 11 Feb 2017 01:50:25 +0100 Subject: [PATCH 3/9] fix gitignore --- .gitignore | 5 +---- wear/.gitignore | 5 +++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b80e6aff48..79927b784d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,9 @@ *.iml -wear/wear.iml .gradle /local.properties -/.idea/workspace.xml -/.idea/libraries .DS_Store /build /captures *.apk build/ -**/*.iml +.idea/ diff --git a/wear/.gitignore b/wear/.gitignore index 796b96d1c4..b8b317ddfe 100644 --- a/wear/.gitignore +++ b/wear/.gitignore @@ -1 +1,6 @@ +*.iml +.gradle /build +*.apk +build/ +.idea/ From 5915503ac58e445f4ea1a50935d40873a3872acc Mon Sep 17 00:00:00 2001 From: viktoria Date: Sat, 11 Feb 2017 01:50:51 +0100 Subject: [PATCH 4/9] delete wear.iml --- wear/wear.iml | 161 -------------------------------------------------- 1 file changed, 161 deletions(-) delete mode 100644 wear/wear.iml diff --git a/wear/wear.iml b/wear/wear.iml deleted file mode 100644 index 02e7cacb1f..0000000000 --- a/wear/wear.iml +++ /dev/null @@ -1,161 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From c6c6bc4f40d423bee5b2456414cce3817fd4af55 Mon Sep 17 00:00:00 2001 From: viktoria Date: Sat, 11 Feb 2017 01:51:15 +0100 Subject: [PATCH 5/9] delete .idea --- .idea/.name | 1 - .idea/compiler.xml | 22 --------- .idea/copyright/profiles_settings.xml | 3 -- .idea/encodings.xml | 6 --- .idea/gradle.xml | 20 -------- .idea/inspectionProfiles/Project_Default.xml | 13 ------ .../inspectionProfiles/profiles_settings.xml | 7 --- .idea/misc.xml | 46 ------------------- .idea/modules.xml | 10 ---- .idea/runConfigurations.xml | 12 ----- .idea/vcs.xml | 6 --- 11 files changed, 146 deletions(-) delete mode 100644 .idea/.name delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/copyright/profiles_settings.xml delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/gradle.xml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/runConfigurations.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index b53cf7e34f..0000000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -AndroidAPS \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 96cc43efa6..0000000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf3377..0000000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba454..0000000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 2cb270bcda..0000000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 491c025e3d..0000000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 3b312839bf..0000000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 5d19981032..0000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index beeeadee79..0000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460d8b..0000000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f4c..0000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 1217c22b43bbbf15618a37694aee1b81fde838d0 Mon Sep 17 00:00:00 2001 From: viktoria Date: Sat, 11 Feb 2017 03:46:44 +0100 Subject: [PATCH 6/9] Deprecation DanaR Stats --- .../DanaR/History/DanaRStatsActivity.java | 24 +++++++++---------- .../History/DanaRStatsActivity.java | 24 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/History/DanaRStatsActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/History/DanaRStatsActivity.java index 1ded51f982..674213d66f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/History/DanaRStatsActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/History/DanaRStatsActivity.java @@ -186,7 +186,7 @@ public class DanaRStatsActivity extends Activity { TableRow tr_head = new TableRow(this); tr_head.setBackgroundColor(Color.DKGRAY); tr_head.setLayoutParams(new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); TextView label_date = new TextView(this); @@ -216,7 +216,7 @@ public class DanaRStatsActivity extends Activity { // add stats headers to tables tl.addView(tr_head, new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); // cumulative table @@ -224,7 +224,7 @@ public class DanaRStatsActivity extends Activity { TableRow ctr_head = new TableRow(this); ctr_head.setBackgroundColor(Color.DKGRAY); ctr_head.setLayoutParams(new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); TextView label_cum_amount_days = new TextView(this); @@ -244,7 +244,7 @@ public class DanaRStatsActivity extends Activity { // add cummulative headers to tables ctl.addView(ctr_head, new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); // expontial table @@ -252,7 +252,7 @@ public class DanaRStatsActivity extends Activity { TableRow etr_head = new TableRow(this); etr_head.setBackgroundColor(Color.DKGRAY); etr_head.setLayoutParams(new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); TextView label_exp_weight = new TextView(this); @@ -272,7 +272,7 @@ public class DanaRStatsActivity extends Activity { // add expontial headers to tables etl.addView(etr_head, new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); reloadButton.setOnClickListener(new View.OnClickListener() { @@ -387,7 +387,7 @@ public class DanaRStatsActivity extends Activity { if(i%2!=0) tr.setBackgroundColor(Color.DKGRAY); tr.setId(100+i); tr.setLayoutParams(new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); // Here create the TextView dynamically @@ -423,7 +423,7 @@ public class DanaRStatsActivity extends Activity { // add stats rows to tables tl.addView(tr, new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); sum = sum + tdd; @@ -434,7 +434,7 @@ public class DanaRStatsActivity extends Activity { if(i%2==0) ctr.setBackgroundColor(Color.DKGRAY); ctr.setId(700+i); ctr.setLayoutParams(new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); // Here create the TextView dynamically @@ -458,7 +458,7 @@ public class DanaRStatsActivity extends Activity { // add cummulative rows to tables ctl.addView(ctr, new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); } @@ -494,7 +494,7 @@ public class DanaRStatsActivity extends Activity { if(i%2!=0) etr.setBackgroundColor(Color.DKGRAY); etr.setId(1100+i); etr.setLayoutParams(new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); // Here create the TextView dynamically @@ -522,7 +522,7 @@ public class DanaRStatsActivity extends Activity { // add exponentail rows to tables etl.addView(etr, new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); } }); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/History/DanaRStatsActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/History/DanaRStatsActivity.java index 995924b9c7..d8b5390fbd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/History/DanaRStatsActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/History/DanaRStatsActivity.java @@ -186,7 +186,7 @@ public class DanaRStatsActivity extends Activity { TableRow tr_head = new TableRow(this); tr_head.setBackgroundColor(Color.DKGRAY); tr_head.setLayoutParams(new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); TextView label_date = new TextView(this); @@ -216,7 +216,7 @@ public class DanaRStatsActivity extends Activity { // add stats headers to tables tl.addView(tr_head, new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); // cumulative table @@ -224,7 +224,7 @@ public class DanaRStatsActivity extends Activity { TableRow ctr_head = new TableRow(this); ctr_head.setBackgroundColor(Color.DKGRAY); ctr_head.setLayoutParams(new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); TextView label_cum_amount_days = new TextView(this); @@ -244,7 +244,7 @@ public class DanaRStatsActivity extends Activity { // add cummulative headers to tables ctl.addView(ctr_head, new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); // expontial table @@ -252,7 +252,7 @@ public class DanaRStatsActivity extends Activity { TableRow etr_head = new TableRow(this); etr_head.setBackgroundColor(Color.DKGRAY); etr_head.setLayoutParams(new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); TextView label_exp_weight = new TextView(this); @@ -272,7 +272,7 @@ public class DanaRStatsActivity extends Activity { // add expontial headers to tables etl.addView(etr_head, new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); reloadButton.setOnClickListener(new View.OnClickListener() { @@ -387,7 +387,7 @@ public class DanaRStatsActivity extends Activity { if(i%2!=0) tr.setBackgroundColor(Color.DKGRAY); tr.setId(100+i); tr.setLayoutParams(new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); // Here create the TextView dynamically @@ -423,7 +423,7 @@ public class DanaRStatsActivity extends Activity { // add stats rows to tables tl.addView(tr, new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); sum = sum + tdd; @@ -434,7 +434,7 @@ public class DanaRStatsActivity extends Activity { if(i%2==0) ctr.setBackgroundColor(Color.DKGRAY); ctr.setId(700+i); ctr.setLayoutParams(new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); // Here create the TextView dynamically @@ -458,7 +458,7 @@ public class DanaRStatsActivity extends Activity { // add cummulative rows to tables ctl.addView(ctr, new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); } @@ -494,7 +494,7 @@ public class DanaRStatsActivity extends Activity { if(i%2!=0) etr.setBackgroundColor(Color.DKGRAY); etr.setId(1100+i); etr.setLayoutParams(new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); // Here create the TextView dynamically @@ -522,7 +522,7 @@ public class DanaRStatsActivity extends Activity { // add exponentail rows to tables etl.addView(etr, new TableLayout.LayoutParams( - TableLayout.LayoutParams.FILL_PARENT, + TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT)); } }); From a4591af392d06fba2f3c0fa525bfc0fad9101efa Mon Sep 17 00:00:00 2001 From: viktoria Date: Sat, 11 Feb 2017 14:00:44 +0100 Subject: [PATCH 7/9] Deprecation colors --- .../androidaps/plugins/Overview/OverviewFragment.java | 11 ++++++----- .../plugins/TempBasals/TempBasalsFragment.java | 9 +++++---- .../TempTargetRange/TempTargetRangeFragment.java | 5 +++-- .../plugins/Treatments/TreatmentsFragment.java | 5 +++-- .../main/java/info/nightscout/utils/TimeListEdit.java | 2 +- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index a2f0bfe2b6..ef15ac04c1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -13,6 +13,7 @@ import android.os.HandlerThread; import android.preference.PreferenceManager; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; +import android.support.v4.content.ContextCompat; import android.support.v7.app.AlertDialog; import android.support.v7.widget.CardView; import android.support.v7.widget.LinearLayoutManager; @@ -931,7 +932,7 @@ public class OverviewFragment extends Fragment { bgGraph.getSecondScale().addSeries(basalsLineSeries); bgGraph.getSecondScale().setMinY(0); bgGraph.getSecondScale().setMaxY(maxBgValue / lowLine * maxBasalValueFound * 1.2d); - bgGraph.getGridLabelRenderer().setVerticalLabelsSecondScaleColor(MainApp.instance().getResources().getColor(R.color.background_material_dark)); // same color as backround = hide + bgGraph.getGridLabelRenderer().setVerticalLabelsSecondScaleColor(ContextCompat.getColor(MainApp.instance(), R.color.background_material_dark)); // same color as backround = hide } // Pump not initialized message @@ -973,13 +974,13 @@ public class OverviewFragment extends Fragment { holder.text.setText(notification.text); holder.time.setText(DateUtil.timeString(notification.date)); if (notification.level == Notification.URGENT) - holder.cv.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.notificationUrgent)); + holder.cv.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.notificationUrgent)); else if (notification.level == Notification.NORMAL) - holder.cv.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.notificationNormal)); + holder.cv.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.notificationNormal)); else if (notification.level == Notification.LOW) - holder.cv.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.notificationLow)); + holder.cv.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.notificationLow)); else if (notification.level == Notification.INFO) - holder.cv.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.notificationInfo)); + holder.cv.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.notificationInfo)); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/TempBasals/TempBasalsFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/TempBasals/TempBasalsFragment.java index c0d5a2d354..8317623fd2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/TempBasals/TempBasalsFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/TempBasals/TempBasalsFragment.java @@ -3,6 +3,7 @@ package info.nightscout.androidaps.plugins.TempBasals; import android.app.Activity; import android.os.Bundle; import android.support.v4.app.Fragment; +import android.support.v4.content.ContextCompat; import android.support.v7.widget.CardView; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; @@ -82,13 +83,13 @@ public class TempBasalsFragment extends Fragment implements FragmentBase { holder.netRatio.setText(DecimalFormatter.to2Decimal(iob.netRatio) + " U/h"); holder.extendedFlag.setVisibility(tempBasal.isExtended ? View.VISIBLE : View.GONE); if (tempBasal.isInProgress()) - holder.dateLinearLayout.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.colorInProgress)); + holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.colorInProgress)); else if (tempBasal.timeEnd == null) - holder.dateLinearLayout.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.colorNotEnded)); + holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.colorNotEnded)); else if (tempBasal.iobCalc(new Date()).basaliob != 0) - holder.dateLinearLayout.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.colorAffectingIOB)); + holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.colorAffectingIOB)); else - holder.dateLinearLayout.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.cardColorBackground)); + holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.cardColorBackground)); } @Override diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/TempTargetRange/TempTargetRangeFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/TempTargetRange/TempTargetRangeFragment.java index 4fbe7a56d7..4bfe4ca74e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/TempTargetRange/TempTargetRangeFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/TempTargetRange/TempTargetRangeFragment.java @@ -9,6 +9,7 @@ import android.graphics.Paint; import android.os.Bundle; import android.preference.PreferenceManager; 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; @@ -92,9 +93,9 @@ public class TempTargetRangeFragment extends Fragment implements View.OnClickLis holder.reasonColon.setText(""); } if (tempTarget.isInProgress()) - holder.dateLinearLayout.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.colorInProgress)); + holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.colorInProgress)); else - holder.dateLinearLayout.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.cardColorBackground)); + holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.cardColorBackground)); holder.remove.setTag(tempTarget); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsFragment.java index 7257207e74..fed1191f38 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsFragment.java @@ -7,6 +7,7 @@ import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; 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; @@ -84,9 +85,9 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener holder.activity.setText(DecimalFormatter.to3Decimal(iob.activityContrib) + " U"); holder.mealOrCorrection.setText(treatments.get(position).mealBolus ? MainApp.sResources.getString(R.string.mealbolus) : MainApp.sResources.getString(R.string.correctionbous)); if (iob.iobContrib != 0) - holder.dateLinearLayout.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.colorAffectingIOB)); + holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.colorAffectingIOB)); else - holder.dateLinearLayout.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.cardColorBackground)); + holder.dateLinearLayout.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.cardColorBackground)); } @Override diff --git a/app/src/main/java/info/nightscout/utils/TimeListEdit.java b/app/src/main/java/info/nightscout/utils/TimeListEdit.java index 811bec61fe..06f6b9747f 100644 --- a/app/src/main/java/info/nightscout/utils/TimeListEdit.java +++ b/app/src/main/java/info/nightscout/utils/TimeListEdit.java @@ -73,7 +73,7 @@ public class TimeListEdit { LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); llp.setMargins(10, 0, 0, 0); // llp.setMargins(left, top, right, bottom); textlabel.setLayoutParams(llp); - textlabel.setBackgroundColor(MainApp.sResources.getColor(R.color.linearBlockBackground)); + textlabel.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.linearBlockBackground)); if (Build.VERSION.SDK_INT < 23) textlabel.setTextAppearance(context, android.R.style.TextAppearance_Medium); else From 0ffddcdefadb6968fcd8c33a53e127af653ef533 Mon Sep 17 00:00:00 2001 From: viktoria Date: Sat, 11 Feb 2017 14:01:37 +0100 Subject: [PATCH 8/9] Deprecation TimeListEdit - add design support libraries --- app/build.gradle | 2 ++ app/src/main/java/info/nightscout/utils/TimeListEdit.java | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 4993962079..85a6e5deab 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -126,6 +126,8 @@ dependencies { compile 'com.android.support:cardview-v7:23.4.0' compile 'com.android.support:recyclerview-v7:23.4.0' compile 'com.android.support:gridlayout-v7:23.4.0' + compile "com.android.support:design:23.4.0" + compile "com.android.support:percent:23.4.0" compile 'com.wdullaer:materialdatetimepicker:2.3.0' compile 'com.squareup:otto:1.3.7' compile 'com.j256.ormlite:ormlite-core:4.46' diff --git a/app/src/main/java/info/nightscout/utils/TimeListEdit.java b/app/src/main/java/info/nightscout/utils/TimeListEdit.java index 06f6b9747f..1c4f5d4edd 100644 --- a/app/src/main/java/info/nightscout/utils/TimeListEdit.java +++ b/app/src/main/java/info/nightscout/utils/TimeListEdit.java @@ -2,6 +2,8 @@ package info.nightscout.utils; import android.content.Context; import android.os.Build; +import android.support.v4.content.ContextCompat; +import android.support.v4.widget.TextViewCompat; import android.text.Editable; import android.text.Layout; import android.text.TextWatcher; @@ -74,10 +76,7 @@ public class TimeListEdit { llp.setMargins(10, 0, 0, 0); // llp.setMargins(left, top, right, bottom); textlabel.setLayoutParams(llp); textlabel.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.linearBlockBackground)); - if (Build.VERSION.SDK_INT < 23) - textlabel.setTextAppearance(context, android.R.style.TextAppearance_Medium); - else - textlabel.setTextAppearance(android.R.style.TextAppearance_Medium); + TextViewCompat.setTextAppearance(textlabel, android.R.style.TextAppearance_Medium); layout.addView(textlabel); for (int i = 0; i < itemsCount(); i++) { From 56f15a3cf7969e6f5200a26740fe72071225380b Mon Sep 17 00:00:00 2001 From: viktoria Date: Sat, 11 Feb 2017 12:35:08 +0100 Subject: [PATCH 9/9] Deprecation DataBaseHelper - use Long for .limit --- .../java/info/nightscout/androidaps/db/DatabaseHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java index abaf1da7c3..e2ace23845 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java +++ b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java @@ -257,7 +257,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { QueryBuilder queryBuilder = daoTreatments.queryBuilder(); Where where = queryBuilder.where(); where.eq("_id", _id); - queryBuilder.limit(10); + queryBuilder.limit(10L); PreparedQuery preparedQuery = queryBuilder.prepare(); List trList = daoTreatments.query(preparedQuery); if (trList.size() != 1) { @@ -281,7 +281,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper { QueryBuilder queryBuilder = daoTreatments.queryBuilder(); Where where = queryBuilder.where(); where.eq("timeIndex", timeIndex); - queryBuilder.limit(10); + queryBuilder.limit(10L); PreparedQuery preparedQuery = queryBuilder.prepare(); List trList = daoTreatments.query(preparedQuery); if (trList.size() != 1) {