diff --git a/app/assets/changes.html b/app/assets/changes.html
index 9ffe1d4df..98b7c4658 100644
--- a/app/assets/changes.html
+++ b/app/assets/changes.html
@@ -5,13 +5,15 @@
What's new
-v2.2.3.0
+v2.2.3.2/h2>
- - #963 Exception for download activities
+ - #964 Exception for download activities
- Ukranian translation, nl update
+ - #965 Do not present 0 HR in graph
+ - Do not restore spinner state to avoid exceptions
-h2>v2.2.2.4
+v2.2.2.4
- #961 Resource ids must be unique
diff --git a/app/src/main/org/runnerup/util/GraphWrapper.java b/app/src/main/org/runnerup/util/GraphWrapper.java
index 6bfe324de..51e3dd8fd 100644
--- a/app/src/main/org/runnerup/util/GraphWrapper.java
+++ b/app/src/main/org/runnerup/util/GraphWrapper.java
@@ -229,12 +229,16 @@ void emit(double tot_distance) {
if (first) {
if(tot_distance > 0) {
velocityList.add(new DataPoint(0, velocity));
- hrList.add(new DataPoint(0, Math.round(avg_hr)));
+ if (avg_hr > 0) {
+ hrList.add(new DataPoint(0, Math.round(avg_hr)));
+ }
}
first = false;
}
velocityList.add(new DataPoint(tot_distance, velocity));
- hrList.add(new DataPoint(tot_distance, Math.round(avg_hr)));
+ if (avg_hr > 0) {
+ hrList.add(new DataPoint(tot_distance, Math.round(avg_hr)));
+ }
acc_time = 0;
tot_avg_hr += avg_hr;
diff --git a/app/src/main/org/runnerup/view/MainLayout.java b/app/src/main/org/runnerup/view/MainLayout.java
index 2e553bbab..0637f2a75 100644
--- a/app/src/main/org/runnerup/view/MainLayout.java
+++ b/app/src/main/org/runnerup/view/MainLayout.java
@@ -61,9 +61,10 @@ public class MainLayout extends TabActivity {
private View getTabView(CharSequence label, int iconResource) {
@SuppressLint("InflateParams")View tabView = getLayoutInflater().inflate(R.layout.bottom_tab_indicator, null);
- tabView.findViewById(R.id.icon).setContentDescription(label);
+ ImageView iconView = tabView.findViewById(R.id.icon);
+ iconView.setContentDescription(label);
Drawable icon = AppCompatResources.getDrawable(this, iconResource);
- ((ImageView)tabView.findViewById(R.id.icon)).setImageDrawable(icon);
+ iconView.setImageDrawable(icon);
return tabView;
}
diff --git a/app/src/main/org/runnerup/view/RunActivity.java b/app/src/main/org/runnerup/view/RunActivity.java
index 2247f4e50..2f3a91f74 100644
--- a/app/src/main/org/runnerup/view/RunActivity.java
+++ b/app/src/main/org/runnerup/view/RunActivity.java
@@ -480,9 +480,8 @@ private void bindGpsTracker() {
// class name because we want a specific service implementation that
// we know will be running in our own process (and thus won't be
// supporting component replacement by other applications).
- getApplicationContext().bindService(new Intent(this, Tracker.class),
+ mIsBound = getApplicationContext().bindService(new Intent(this, Tracker.class),
mConnection, Context.BIND_AUTO_CREATE);
- mIsBound = true;
}
private void unbindGpsTracker() {
diff --git a/app/src/main/org/runnerup/view/StartActivity.java b/app/src/main/org/runnerup/view/StartActivity.java
index 85ef666de..0e42ed7bb 100644
--- a/app/src/main/org/runnerup/view/StartActivity.java
+++ b/app/src/main/org/runnerup/view/StartActivity.java
@@ -1029,9 +1029,8 @@ private void bindGpsTracker() {
// class name because we want a specific service implementation that
// we know will be running in our own process (and thus won't be
// supporting component replacement by other applications).
- getApplicationContext().bindService(new Intent(this, Tracker.class),
+ mIsBound = getApplicationContext().bindService(new Intent(this, Tracker.class),
mConnection, Context.BIND_AUTO_CREATE);
- mIsBound = true;
}
private void unbindGpsTracker() {
diff --git a/app/src/main/org/runnerup/widget/DistancePicker.java b/app/src/main/org/runnerup/widget/DistancePicker.java
index de37f8543..c6223fd75 100644
--- a/app/src/main/org/runnerup/widget/DistancePicker.java
+++ b/app/src/main/org/runnerup/widget/DistancePicker.java
@@ -38,11 +38,11 @@ public DistancePicker(Context context, AttributeSet attrs) {
super(context, attrs);
unitMeters = new NumberPicker(context, attrs);
- LinearLayout unitStringLayout = new LinearLayout(context, attrs);
+ LinearLayout unitStringLayout = new LinearLayout(context);
unitStringLayout.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL);
unitStringLayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.MATCH_PARENT));
- unitString = new TextView(context, attrs);
+ unitString = new TextView(context);
unitString.setTextSize(25);
unitString.setMinimumHeight(48);
unitString.setMinimumWidth(48);
diff --git a/app/src/main/org/runnerup/widget/SpinnerPresenter.java b/app/src/main/org/runnerup/widget/SpinnerPresenter.java
index 2ab2b393c..2cb2380cd 100644
--- a/app/src/main/org/runnerup/widget/SpinnerPresenter.java
+++ b/app/src/main/org/runnerup/widget/SpinnerPresenter.java
@@ -74,7 +74,7 @@ private enum Type {
private long mCurrValue = -1;
private final CharSequence mLabel;
- SpinnerPresenter(Context context, AttributeSet attrs, SpinnerInterface spinnerInterface) { //todo duration + other pickers don't appear to work
+ SpinnerPresenter(Context context, AttributeSet attrs, SpinnerInterface spinnerInterface) {
mContext = context;
mSpin = spinnerInterface;
diff --git a/app/src/main/org/runnerup/widget/TitleSpinner.java b/app/src/main/org/runnerup/widget/TitleSpinner.java
index d69d8381a..6c6e10b71 100644
--- a/app/src/main/org/runnerup/widget/TitleSpinner.java
+++ b/app/src/main/org/runnerup/widget/TitleSpinner.java
@@ -46,6 +46,7 @@ public TitleSpinner(Context context, AttributeSet attrs) {
mLabel = findViewById(R.id.title);
mValue = findViewById(R.id.value);
mSpinner = findViewById(R.id.spinner);
+ mSpinner.setSaveEnabled(false);
mPresenter = new SpinnerPresenter(context, attrs, this);
}
diff --git a/build.gradle b/build.gradle
index a6d233bea..3556781f5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -31,8 +31,8 @@ project.ext {
mockitoVersion = '2.3.7'
//The Git tag for the release must be identical for F-Droid
- versionName = '2.2.3.0'
- versionCode = 270
+ versionName = '2.2.3.2'
+ versionCode = 272
latestBaseVersionCode = 15000000
travisBuild = System.getenv("TRAVIS") == "true"
diff --git a/wear/src/main/java/org/runnerup/view/MainActivity.java b/wear/src/main/java/org/runnerup/view/MainActivity.java
index b45a7125c..3ed2429d5 100644
--- a/wear/src/main/java/org/runnerup/view/MainActivity.java
+++ b/wear/src/main/java/org/runnerup/view/MainActivity.java
@@ -50,6 +50,7 @@ public class MainActivity extends Activity implements Constants, ValueModel.Chan
private boolean pauseStep = false;
private int scroll = 0;
private boolean postScrollRightRunning = false;
+ private boolean mIsBound;
private static final int RUN_INFO_ROW = 0;
private static final int PAUSE_RESUME_ROW = 1;
@@ -77,7 +78,7 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
protected void onResume() {
super.onResume();
- getApplicationContext().bindService(new Intent(this, StateService.class),
+ mIsBound = getApplicationContext().bindService(new Intent(this, StateService.class),
mStateServiceConnection, Context.BIND_AUTO_CREATE);
}
@@ -88,7 +89,10 @@ protected void onPause() {
mStateService.unregisterTrackerStateListener(this);
mStateService.unregisterHeadersListener(this);
}
- getApplicationContext().unbindService(mStateServiceConnection);
+ if (mIsBound) {
+ getApplicationContext().unbindService(mStateServiceConnection);
+ mIsBound = false;
+ }
mStateService = null;
}