Skip to content
Snippets Groups Projects
Commit 81efbf55 authored by Lennart Goedhart's avatar Lennart Goedhart
Browse files

Update okhttp version to match with AppUpdater version to fix crashing.

Add “Check for App Update” menu item.
Don’t render trend arrows using HTML - use Unicode instead.
Rename app from “NS 600 Series Uploader” to “600 Series Uploader”.
Experiment with adding status tiles.
parent 2ec69ed6
No related branches found
No related tags found
No related merge requests found
...@@ -150,6 +150,8 @@ dependencies { ...@@ -150,6 +150,8 @@ dependencies {
compile 'com.android.support:support-v13:25.3.1' compile 'com.android.support:support-v13:25.3.1'
compile 'com.android.support:design:25.3.1' compile 'com.android.support:design:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'org.apache.commons:commons-lang3:3.4' compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.mikepenz:google-material-typeface:2.2.0.1.original@aar' compile 'com.mikepenz:google-material-typeface:2.2.0.1.original@aar'
compile 'uk.co.chrisjenx:calligraphy:2.2.0' compile 'uk.co.chrisjenx:calligraphy:2.2.0'
...@@ -158,12 +160,16 @@ dependencies { ...@@ -158,12 +160,16 @@ dependencies {
compile 'com.google.code.gson:gson:2.7' compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit2:retrofit:2.1.0' compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0' compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.3.1' // The version of okhttp3 *must* be the same as the version in AppUpdater
compile 'com.squareup.okhttp3:okhttp:3.6.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') { compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
transitive = true; transitive = true;
} }
compile('com.mikepenz:materialdrawer:5.2.9@aar') { compile('com.mikepenz:materialdrawer:5.2.9@aar') {
transitive = true transitive = true
} }
compile 'com.github.javiersantos:AppUpdater:2.6.1'
} }
\ No newline at end of file
...@@ -29,7 +29,6 @@ import android.support.v7.app.AppCompatActivity; ...@@ -29,7 +29,6 @@ import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.NotificationCompat; import android.support.v7.app.NotificationCompat;
import android.support.v7.view.menu.ActionMenuItemView; import android.support.v7.view.menu.ActionMenuItemView;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.text.format.DateUtils; import android.text.format.DateUtils;
import android.util.Log; import android.util.Log;
import android.view.Menu; import android.view.Menu;
...@@ -40,6 +39,8 @@ import android.widget.TextView; ...@@ -40,6 +39,8 @@ import android.widget.TextView;
import android.widget.TextView.BufferType; import android.widget.TextView.BufferType;
import android.widget.Toast; import android.widget.Toast;
import com.github.javiersantos.appupdater.AppUpdater;
import com.github.javiersantos.appupdater.enums.UpdateFrom;
import com.jjoe64.graphview.DefaultLabelFormatter; import com.jjoe64.graphview.DefaultLabelFormatter;
import com.jjoe64.graphview.GraphView; import com.jjoe64.graphview.GraphView;
import com.jjoe64.graphview.Viewport; import com.jjoe64.graphview.Viewport;
...@@ -74,7 +75,6 @@ import info.nightscout.android.medtronic.service.MedtronicCnlIntentService; ...@@ -74,7 +75,6 @@ import info.nightscout.android.medtronic.service.MedtronicCnlIntentService;
import info.nightscout.android.model.medtronicNg.PumpInfo; import info.nightscout.android.model.medtronicNg.PumpInfo;
import info.nightscout.android.model.medtronicNg.PumpStatusEvent; import info.nightscout.android.model.medtronicNg.PumpStatusEvent;
import info.nightscout.android.settings.SettingsActivity; import info.nightscout.android.settings.SettingsActivity;
import info.nightscout.android.upload.nightscout.NightscoutUploadIntentService;
import info.nightscout.android.utils.ConfigurationStore; import info.nightscout.android.utils.ConfigurationStore;
import info.nightscout.android.utils.DataStore; import info.nightscout.android.utils.DataStore;
import io.realm.Realm; import io.realm.Realm;
...@@ -99,7 +99,6 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -99,7 +99,6 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
private PumpInfo mActivePump; private PumpInfo mActivePump;
private TextView mTextViewLog; // This will eventually move to a status page. private TextView mTextViewLog; // This will eventually move to a status page.
private GraphView mChart; private GraphView mChart;
private Intent mNightscoutUploadService;
private Handler mUiRefreshHandler = new Handler(); private Handler mUiRefreshHandler = new Handler();
private Runnable mUiRefreshRunnable = new RefreshDisplayRunnable(); private Runnable mUiRefreshRunnable = new RefreshDisplayRunnable();
private Realm mRealm; private Realm mRealm;
...@@ -113,7 +112,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -113,7 +112,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
* @return timestamp * @return timestamp
*/ */
public static long getNextPoll(PumpStatusEvent pumpStatusData) { public static long getNextPoll(PumpStatusEvent pumpStatusData) {
long nextPoll = pumpStatusData.getEventDate().getTime() + pumpStatusData.getPumpTimeOffset(), long nextPoll = pumpStatusData.getSgvDate().getTime() + pumpStatusData.getPumpTimeOffset(),
now = System.currentTimeMillis(), now = System.currentTimeMillis(),
pollInterval = ConfigurationStore.getInstance().getPollInterval(); pollInterval = ConfigurationStore.getInstance().getPollInterval();
...@@ -137,21 +136,6 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -137,21 +136,6 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
return nextPoll; return nextPoll;
} }
public static String strFormatSGV(float sgvValue) {
ConfigurationStore configurationStore = ConfigurationStore.getInstance();
if (configurationStore.isMmolxl()) {
NumberFormat sgvFormatter;
if (configurationStore.isMmolxlDecimals()) {
sgvFormatter = new DecimalFormat("0.00");
} else {
sgvFormatter = new DecimalFormat("0.0");
}
return sgvFormatter.format(sgvValue / MMOLXLFACTOR);
} else {
return String.valueOf(sgvValue);
}
}
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
Log.i(TAG, "onCreate called"); Log.i(TAG, "onCreate called");
...@@ -164,8 +148,6 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -164,8 +148,6 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
if (data.size() > 0) if (data.size() > 0)
dataStore.setLastPumpStatus(data.first()); dataStore.setLastPumpStatus(data.first());
mNightscoutUploadService = new Intent(this, NightscoutUploadIntentService.class);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
PreferenceManager.getDefaultSharedPreferences(getBaseContext()).registerOnSharedPreferenceChangeListener(this); PreferenceManager.getDefaultSharedPreferences(getBaseContext()).registerOnSharedPreferenceChangeListener(this);
...@@ -257,7 +239,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -257,7 +239,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
.withIcon(GoogleMaterial.Icon.gmd_settings) .withIcon(GoogleMaterial.Icon.gmd_settings)
.withSelectable(false); .withSelectable(false);
final PrimaryDrawerItem itemRegisterUsb = new PrimaryDrawerItem() final PrimaryDrawerItem itemRegisterUsb = new PrimaryDrawerItem()
.withName("Registered Devices") .withName("Registered devices")
.withIcon(GoogleMaterial.Icon.gmd_usb) .withIcon(GoogleMaterial.Icon.gmd_usb)
.withSelectable(false); .withSelectable(false);
final PrimaryDrawerItem itemStopCollecting = new PrimaryDrawerItem() final PrimaryDrawerItem itemStopCollecting = new PrimaryDrawerItem()
...@@ -269,15 +251,15 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -269,15 +251,15 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
.withIcon(GoogleMaterial.Icon.gmd_refresh) .withIcon(GoogleMaterial.Icon.gmd_refresh)
.withSelectable(false); .withSelectable(false);
final PrimaryDrawerItem itemUpdateProfile = new PrimaryDrawerItem() final PrimaryDrawerItem itemUpdateProfile = new PrimaryDrawerItem()
.withName("Update Profile") .withName("Update pump profile")
.withIcon(GoogleMaterial.Icon.gmd_insert_chart) .withIcon(GoogleMaterial.Icon.gmd_insert_chart)
.withSelectable(false); .withSelectable(false);
final PrimaryDrawerItem itemClearLog = new PrimaryDrawerItem() final PrimaryDrawerItem itemClearLog = new PrimaryDrawerItem()
.withName("Clear Log") .withName("Clear log")
.withIcon(GoogleMaterial.Icon.gmd_clear_all) .withIcon(GoogleMaterial.Icon.gmd_clear_all)
.withSelectable(false); .withSelectable(false);
final PrimaryDrawerItem itemCheckForUpdate = new PrimaryDrawerItem() final PrimaryDrawerItem itemCheckForUpdate = new PrimaryDrawerItem()
.withName("Check For Update") .withName("Check for App update")
.withIcon(GoogleMaterial.Icon.gmd_update) .withIcon(GoogleMaterial.Icon.gmd_update)
.withSelectable(false); .withSelectable(false);
...@@ -318,7 +300,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -318,7 +300,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
} else if (drawerItem.equals(itemClearLog)) { } else if (drawerItem.equals(itemClearLog)) {
clearLogText(); clearLogText();
} else if (drawerItem.equals(itemCheckForUpdate)) { } else if (drawerItem.equals(itemCheckForUpdate)) {
checkForUpdate(1); checkForUpdateNow();
} }
return false; return false;
...@@ -372,7 +354,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -372,7 +354,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
if (isValueX) { if (isValueX) {
return mFormat.format(new Date((long) value)); return mFormat.format(new Date((long) value));
} else { } else {
return sgvFormatter.format(value); return MainActivity.strFormatSGV(value);
} }
} }
} }
...@@ -382,7 +364,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -382,7 +364,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
@Override @Override
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
checkForUpdate(5); checkForUpdateBackground(5);
} }
@Override @Override
...@@ -452,17 +434,20 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -452,17 +434,20 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
statusMessageReceiver.clearMessages(); statusMessageReceiver.clearMessages();
} }
private void checkForUpdate(int checkEvery) { private void checkForUpdateNow() {
/* new AppUpdater(this)
.setUpdateFrom(UpdateFrom.JSON)
.setUpdateXML("https://raw.githubusercontent.com/pazaan/600SeriesAndroidUploader/master/app/update.json")
.showAppUpdated(true) // Show a dialog, even if there isn't an update
.start();
}
private void checkForUpdateBackground(int checkEvery) {
new AppUpdater(this) new AppUpdater(this)
.setUpdateFrom(UpdateFrom.JSON) .setUpdateFrom(UpdateFrom.JSON)
.setUpdateXML("https://raw.githubusercontent.com/javiersantos/AppUpdater/master/app/update-changelog.json") .setUpdateXML("https://raw.githubusercontent.com/pazaan/600SeriesAndroidUploader/master/app/update.json")
// .setUpdateXML("https://raw.githubusercontent.com/javiersantos/AppUpdater/master/app/update.json") .showEvery(checkEvery) // Only check for an update every `checkEvery` invocations
.setDisplay(Display.DIALOG)
.showEvery(checkEvery)
.showAppUpdated(true)
.start(); .start();
*/
} }
private void startDisplayRefreshLoop() { private void startDisplayRefreshLoop() {
...@@ -479,7 +464,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -479,7 +464,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
private void startCgmServiceDelayed(long delay) { private void startCgmServiceDelayed(long delay) {
RealmResults<PumpStatusEvent> results = mRealm.where(PumpStatusEvent.class) RealmResults<PumpStatusEvent> results = mRealm.where(PumpStatusEvent.class)
.findAllSorted("eventDate", Sort.DESCENDING); .findAllSorted("sgvDate", Sort.DESCENDING);
if (results.size() > 0) { if (results.size() > 0) {
startCgmService(getNextPoll(results.first()) + delay); startCgmService(getNextPoll(results.first()) + delay);
...@@ -609,27 +594,6 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -609,27 +594,6 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
startActivity(manageCNLIntent); startActivity(manageCNLIntent);
} }
private String renderTrendHtml(PumpStatusEvent.CGM_TREND trend) {
switch (trend) {
case DOUBLE_UP:
return "&#x21c8;";
case SINGLE_UP:
return "&#x2191;";
case FOURTY_FIVE_UP:
return "&#x2197;";
case FLAT:
return "&#x2192;";
case FOURTY_FIVE_DOWN:
return "&#x2198;";
case SINGLE_DOWN:
return "&#x2193;";
case DOUBLE_DOWN:
return "&#x21ca;";
default:
return "&mdash;";
}
}
private PumpInfo getActivePump() { private PumpInfo getActivePump() {
long activePumpMac = dataStore.getActivePumpMac(); long activePumpMac = dataStore.getActivePumpMac();
if (activePumpMac != 0L && (mActivePump == null || !mActivePump.isValid() || mActivePump.getPumpMac() != activePumpMac)) { if (activePumpMac != 0L && (mActivePump == null || !mActivePump.isValid() || mActivePump.getPumpMac() != activePumpMac)) {
...@@ -688,6 +652,44 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -688,6 +652,44 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
return mActivePump; return mActivePump;
} }
public static String strFormatSGV(double sgvValue) {
ConfigurationStore configurationStore = ConfigurationStore.getInstance();
if (configurationStore.isMmolxl()) {
NumberFormat sgvFormatter;
if (configurationStore.isMmolxlDecimals()) {
sgvFormatter = new DecimalFormat("0.00");
} else {
sgvFormatter = new DecimalFormat("0.0");
}
return sgvFormatter.format(sgvValue / MMOLXLFACTOR);
} else {
return String.valueOf(sgvValue);
}
}
public static String renderTrendSymbol(PumpStatusEvent.CGM_TREND trend) {
switch (trend) {
case DOUBLE_UP:
return "\u21c8";
case SINGLE_UP:
return "\u2191";
case FOURTY_FIVE_UP:
return "\u2197";
case FLAT:
return "\u2192";
case FOURTY_FIVE_DOWN:
return "\u2198";
case SINGLE_DOWN:
return "\u2193";
case DOUBLE_DOWN:
return "\u21ca";
default:
return "\u2014";
}
}
private class StatusMessageReceiver extends BroadcastReceiver { private class StatusMessageReceiver extends BroadcastReceiver {
private class StatusMessage { private class StatusMessage {
private long timestamp; private long timestamp;
...@@ -757,32 +759,32 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -757,32 +759,32 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
// Get the most recently written CGM record for the active pump. // Get the most recently written CGM record for the active pump.
PumpStatusEvent pumpStatusData = null; PumpStatusEvent pumpStatusData = null;
// ignoring activePump atm
//PumpInfo pump = getActivePump();
if (dataStore.getLastPumpStatus().getEventDate().getTime() > 0) { if (dataStore.getLastPumpStatus().getEventDate().getTime() > 0) {
pumpStatusData = dataStore.getLastPumpStatus(); pumpStatusData = dataStore.getLastPumpStatus();
} }
updateChart(mRealm.where(PumpStatusEvent.class) updateChart(mRealm.where(PumpStatusEvent.class)
.greaterThan("eventDate", new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24)) .greaterThan("sgvDate", new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24))
.findAllSorted("eventDate", Sort.ASCENDING)); .findAllSorted("sgvDate", Sort.ASCENDING));
if (pumpStatusData != null) { if (pumpStatusData != null) {
String sgvString; String sgvString;
if (configurationStore.isMmolxl()) { if (pumpStatusData.isCgmActive()) {
float fBgValue = (float) pumpStatusData.getSgv(); sgvString = MainActivity.strFormatSGV(pumpStatusData.getSgv());
sgvString = sgvFormatter.format(fBgValue / MMOLXLFACTOR); ;
Log.d(TAG, sgvString + " mmol/L"); if (configurationStore.isMmolxl()) {
Log.d(TAG, sgvString + " mmol/L");
} else {
Log.d(TAG, sgvString + " mg/dL");
}
} else { } else {
sgvString = String.valueOf(pumpStatusData.getSgv()); sgvString = "\u2014"; // &mdash;
Log.d(TAG, sgvString + " mg/dL");
} }
textViewBg.setText(sgvString); textViewBg.setText(sgvString);
textViewBgTime.setText(DateUtils.getRelativeTimeSpanString(pumpStatusData.getEventDate().getTime())); textViewBgTime.setText(DateUtils.getRelativeTimeSpanString(pumpStatusData.getEventDate().getTime()));
textViewTrend.setText(Html.fromHtml(renderTrendHtml(pumpStatusData.getCgmTrend()))); textViewTrend.setText(MainActivity.renderTrendSymbol(pumpStatusData.getCgmTrend()));
textViewIOB.setText(String.format(Locale.getDefault(), "%.2f", pumpStatusData.getActiveInsulin())); textViewIOB.setText(String.format(Locale.getDefault(), "%.2f", pumpStatusData.getActiveInsulin()));
ActionMenuItemView batIcon = ((ActionMenuItemView) findViewById(R.id.status_battery)); ActionMenuItemView batIcon = ((ActionMenuItemView) findViewById(R.id.status_battery));
...@@ -850,11 +852,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -850,11 +852,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
int pos = 0; int pos = 0;
for (PumpStatusEvent pumpStatus : results) { for (PumpStatusEvent pumpStatus : results) {
// turn your data into Entry objects // turn your data into Entry objects
if (configurationStore.isMmolxl()) { entries[pos++] = new DataPoint(pumpStatus.getSgvDate(), (double) pumpStatus.getSgv());
entries[pos++] = new DataPoint(pumpStatus.getEventDate(), (float) pumpStatus.getSgv() / MMOLXLFACTOR);
} else {
entries[pos++] = new DataPoint(pumpStatus.getEventDate(), (float) pumpStatus.getSgv());
}
} }
if (mChart.getSeries().size() == 0) { if (mChart.getSeries().size() == 0) {
...@@ -879,7 +877,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc ...@@ -879,7 +877,7 @@ public class MainActivity extends AppCompatActivity implements OnSharedPreferenc
double sgv = dataPoint.getY(); double sgv = dataPoint.getY();
StringBuilder sb = new StringBuilder(mFormat.format(new Date((long) dataPoint.getX())) + ": "); StringBuilder sb = new StringBuilder(mFormat.format(new Date((long) dataPoint.getX())) + ": ");
sb.append(sgvFormatter.format(sgv)); sb.append(MainActivity.strFormatSGV(sgv));
Toast.makeText(getBaseContext(), sb.toString(), Toast.LENGTH_SHORT).show(); Toast.makeText(getBaseContext(), sb.toString(), Toast.LENGTH_SHORT).show();
} }
}); });
......
package info.nightscout.android.model.medtronicNg; package info.nightscout.android.model.medtronicNg;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Date; import java.util.Date;
import info.nightscout.android.utils.ConfigurationStore;
import io.realm.RealmObject; import io.realm.RealmObject;
import io.realm.annotations.Ignore; import io.realm.annotations.Ignore;
import io.realm.annotations.Index; import io.realm.annotations.Index;
...@@ -81,7 +84,7 @@ public class PumpStatusEvent extends RealmObject { ...@@ -81,7 +84,7 @@ public class PumpStatusEvent extends RealmObject {
} }
public CGM_TREND getCgmTrend() { public CGM_TREND getCgmTrend() {
if (cgmTrend == null) { if (cgmTrend == null || !this.isCgmActive()) {
return CGM_TREND.NOT_SET; return CGM_TREND.NOT_SET;
} else { } else {
return CGM_TREND.valueOf(cgmTrend); return CGM_TREND.valueOf(cgmTrend);
...@@ -341,5 +344,4 @@ public class PumpStatusEvent extends RealmObject { ...@@ -341,5 +344,4 @@ public class PumpStatusEvent extends RealmObject {
} }
} }
} }
} }
...@@ -52,10 +52,11 @@ ...@@ -52,10 +52,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_weight="1" android:layout_weight="1"
android:maxLines="1"
android:text="-" android:text="-"
android:textAlignment="center"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="70sp" android:textSize="70sp" />
android:maxLines="1" />
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
...@@ -70,10 +71,10 @@ ...@@ -70,10 +71,10 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center|top" android:layout_gravity="center|top"
android:maxLines="1"
android:text="-" android:text="-"
android:textAppearance="?android:attr/textAppearanceLarge" android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="40sp" android:textSize="40sp" />
android:maxLines="1" />
<TextView <TextView
android:id="@+id/textview_units" android:id="@+id/textview_units"
......
...@@ -26,40 +26,172 @@ ...@@ -26,40 +26,172 @@
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
<ScrollView <ScrollView
android:id="@+id/status_scroll_view"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:id="@+id/status_scroll_view" android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:fillViewport="true"> android:fillViewport="true">
<LinearLayout <LinearLayout
android:orientation="vertical" android:id="@+id/x"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="vertical">
<TextView <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pump Status"
android:id="@+id/status_pump_text_view" android:id="@+id/status_pump_text_view"
android:maxLines="1" /> style="?android:attr/listSeparatorTextViewStyle"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="Pump Status" />
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
app:cardCornerRadius="4dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="center"
app:srcCompat="@drawable/battery_0" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:text="Units Remaining"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:text="150.250"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Headline" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
app:cardCornerRadius="4dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="center"
app:srcCompat="@drawable/battery_0" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:text="Units Remaining"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:text="150.250"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Headline" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
app:cardCornerRadius="4dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="center"
app:srcCompat="@drawable/battery_0" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:text="Units Remaining"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:text="150.250"
android:textAlignment="center"
android:textAppearance="@style/TextAppearance.AppCompat.Headline" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</GridLayout>
<TextView <TextView
android:layout_width="wrap_content" android:id="@+id/status_uploader_text_view"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Uploader Status" android:text="Uploader Status" />
android:id="@+id/status_uploader_text_view" />
<TextView <TextView
android:layout_width="wrap_content" android:id="@+id/status_cgm_text_view"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="CGM Status" android:text="CGM Status" />
android:id="@+id/status_cgm_text_view" />
<TextView <TextView
android:layout_width="wrap_content" android:id="@+id/status_nightscout_text_view"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Nightscout Status" android:text="Nightscout Status" />
android:id="@+id/status_nightscout_text_view" />
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<resources> <resources>
<string name="hello">---</string> <string name="hello">---</string>
<string name="app_name">NS 600 Series Uploader</string> <string name="app_name">600 Series Uploader</string>
<string name="eula_title">Disclaimer</string> <string name="eula_title">Disclaimer</string>
<string name="eula_accept">Accept</string> <string name="eula_accept">Accept</string>
<string name="eula_refuse">Refuse</string> <string name="eula_refuse">Refuse</string>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment