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/.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 fbb68289f4..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
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/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) {
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 f4a404da88..4af029b558 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;
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/DanaRKoreanPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanPlugin.java
index da995d71d6..5c12ab3000 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;
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));
}
});
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 71c6c52d5d..4620a633ed 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..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;
@@ -73,11 +75,8 @@ 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));
- if (Build.VERSION.SDK_INT < 23)
- textlabel.setTextAppearance(context, android.R.style.TextAppearance_Medium);
- else
- textlabel.setTextAppearance(android.R.style.TextAppearance_Medium);
+ textlabel.setBackgroundColor(ContextCompat.getColor(MainApp.instance(), R.color.linearBlockBackground));
+ TextViewCompat.setTextAppearance(textlabel, android.R.style.TextAppearance_Medium);
layout.addView(textlabel);
for (int i = 0; i < itemsCount(); i++) {
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/
diff --git a/wear/wear.iml b/wear/wear.iml
deleted file mode 100644
index 610fad9b6a..0000000000
--- a/wear/wear.iml
+++ /dev/null
@@ -1,161 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- generateFullDebugSources
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file