Merge remote-tracking branch 'refs/remotes/MilosKozak/dev'

Conflicts:
	app/build.gradle
This commit is contained in:
viktoria 2017-02-11 16:06:37 +01:00
commit 06ee59b42c
25 changed files with 57 additions and 358 deletions

5
.gitignore vendored
View file

@ -1,12 +1,9 @@
*.iml
wear/wear.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
*.apk
build/
**/*.iml
.idea/

View file

@ -1 +0,0 @@
AndroidAPS

View file

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

View file

@ -1,3 +0,0 @@
<component name="CopyrightManager">
<settings default="" />
</component>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="C:\Program Files\Android\Android Studio\gradle\gradle-2.14.1" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/wear" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>

View file

@ -1,13 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AndroidLintLabelFor" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintRtlHardcoded" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintUselessParent" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="AndroidLintValidFragment" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
</profile>
</component>

View file

@ -1,7 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>

View file

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/AndroidAPS.iml" filepath="$PROJECT_DIR$/AndroidAPS.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/wear/wear.iml" filepath="$PROJECT_DIR$/wear/wear.iml" />
</modules>
</component>
</project>

View file

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View file

@ -126,7 +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: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'

View file

@ -257,7 +257,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
QueryBuilder<Treatment, Long> queryBuilder = daoTreatments.queryBuilder();
Where where = queryBuilder.where();
where.eq("_id", _id);
queryBuilder.limit(10);
queryBuilder.limit(10L);
PreparedQuery<Treatment> preparedQuery = queryBuilder.prepare();
List<Treatment> trList = daoTreatments.query(preparedQuery);
if (trList.size() != 1) {
@ -281,7 +281,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
QueryBuilder<Treatment, Long> queryBuilder = daoTreatments.queryBuilder();
Where where = queryBuilder.where();
where.eq("timeIndex", timeIndex);
queryBuilder.limit(10);
queryBuilder.limit(10L);
PreparedQuery<Treatment> preparedQuery = queryBuilder.prepare();
List<Treatment> trList = daoTreatments.query(preparedQuery);
if (trList.size() != 1) {

View file

@ -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;

View file

@ -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));
}
});

View file

@ -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;

View file

@ -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));
}
});

View file

@ -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

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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++) {

5
wear/.gitignore vendored
View file

@ -1 +1,6 @@
*.iml
.gradle
/build
*.apk
build/
.idea/

View file

@ -1,161 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":wear" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":wear" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="fullDebug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleFullDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileFullDebugSources" />
<afterSyncTasks>
<task>generateFullDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/full/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/full/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/full/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/full/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/full/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/full/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/full/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/full/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/full/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/fullDebug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/fullDebug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/fullDebug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/fullDebug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/fullDebug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/fullDebug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/fullDebug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/fullDebug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFullDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/full/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/full/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/full/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/full/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/full/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/full/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/full/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/full/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/full/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/full/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/full/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/full/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/full/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/full/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/full/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTestFull/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFull/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFull/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFull/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testFull/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFull/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFull/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFull/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testFull/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-base/7.3.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.gms/play-services-wearable/7.3.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.google.android.support/wearable/1.4.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/me.denley.wearpreferenceactivity/wearpreferenceactivity/0.5.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/ustwo-clockwise-debug/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-safeguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="ustwo-clockwise-debug-" level="project" />
<orderEntry type="library" exported="" name="hellocharts-library-1.5.5" level="project" />
<orderEntry type="library" exported="" name="play-services-wearable-7.3.0" level="project" />
<orderEntry type="library" exported="" name="wearpreferenceactivity-0.5.0" level="project" />
<orderEntry type="library" exported="" name="wearable-1.4.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="play-services-base-7.3.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
</component>
</module>