forked from upstream-mirrors/OpenTracks
@@ -85,13 +85,9 @@ limitations under the License.
|
|||||||
android:resource="@xml/searchable" />
|
android:resource="@xml/searchable" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity android:name=".TrackRecordedActivity" />
|
||||||
android:name=".TrackRecordedActivity"
|
|
||||||
android:screenOrientation="userPortrait" />
|
|
||||||
|
|
||||||
<activity
|
<activity android:name=".TrackRecordingActivity" />
|
||||||
android:name=".TrackRecordingActivity"
|
|
||||||
android:screenOrientation="userPortrait" />
|
|
||||||
|
|
||||||
<activity android:name=".TrackEditActivity" />
|
<activity android:name=".TrackEditActivity" />
|
||||||
|
|
||||||
@@ -105,10 +101,7 @@ limitations under the License.
|
|||||||
android:value=".SearchListActivity" />
|
android:value=".SearchListActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity android:name=".AggregatedStatisticsActivity" />
|
||||||
android:name=".AggregatedStatisticsActivity"
|
|
||||||
android:screenOrientation="userPortrait"
|
|
||||||
android:label="@string/menu_aggregated_statistics"/>
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".io.file.exporter.ExportActivity"
|
android:name=".io.file.exporter.ExportActivity"
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ public class TrackController {
|
|||||||
private boolean isPaused;
|
private boolean isPaused;
|
||||||
private long totalTime = 0;
|
private long totalTime = 0;
|
||||||
|
|
||||||
// the timestamp for the toal time
|
|
||||||
private long totalTimeTimestamp = 0;
|
private long totalTimeTimestamp = 0;
|
||||||
|
|
||||||
private boolean isResumed = false;
|
private boolean isResumed = false;
|
||||||
|
|||||||
@@ -57,10 +57,11 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
|
|||||||
private ViewPager pager;
|
private ViewPager pager;
|
||||||
private TrackController trackController;
|
private TrackController trackController;
|
||||||
|
|
||||||
// From intent
|
// Initialized from Intent; if a new track recording is started new TrackId will be provided by TrackRecordingService
|
||||||
private long trackId;
|
private long trackId;
|
||||||
|
|
||||||
// Preferences
|
// Preferences
|
||||||
|
@Deprecated //TODO Do we really need two trackIds here?
|
||||||
private long recordingTrackId = PreferencesUtils.RECORDING_TRACK_ID_DEFAULT;
|
private long recordingTrackId = PreferencesUtils.RECORDING_TRACK_ID_DEFAULT;
|
||||||
private boolean recordingTrackPaused;
|
private boolean recordingTrackPaused;
|
||||||
|
|
||||||
@@ -208,8 +209,9 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
|
|||||||
return getString(R.string.settings_chart_by_time);
|
return getString(R.string.settings_chart_by_time);
|
||||||
case 2:
|
case 2:
|
||||||
return getString(R.string.settings_chart_by_distance);
|
return getString(R.string.settings_chart_by_distance);
|
||||||
|
default:
|
||||||
|
throw new RuntimeException("There isn't Fragment associated with the position: " + position);
|
||||||
}
|
}
|
||||||
return "Unknown Tab";
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
pager = findViewById(R.id.track_detail_activity_view_pager);
|
pager = findViewById(R.id.track_detail_activity_view_pager);
|
||||||
@@ -272,12 +274,23 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
|
|||||||
// Update UI
|
// Update UI
|
||||||
this.invalidateOptionsMenu();
|
this.invalidateOptionsMenu();
|
||||||
|
|
||||||
|
//TODO Temporary fix, so that the TrackController is initialized properly after rotation when a new recording was started.
|
||||||
|
if (trackId == -1L && trackId != recordingTrackId) {
|
||||||
|
trackId = recordingTrackId;
|
||||||
|
}
|
||||||
|
|
||||||
if (trackId != -1L) {
|
if (trackId != -1L) {
|
||||||
trackDataHub.loadTrack(trackId);
|
trackDataHub.loadTrack(trackId);
|
||||||
trackController.onResume(true, recordingTrackPaused);
|
trackController.onResume(true, recordingTrackPaused);
|
||||||
}
|
}
|
||||||
|
|
||||||
startRecording();
|
/*
|
||||||
|
* If the binding has happened, then invoke the callback to start a new recording.
|
||||||
|
* If the binding hasn't happened, then invoking the callback will have no effect.
|
||||||
|
* But when the binding occurs, the callback will get invoked.
|
||||||
|
*/
|
||||||
|
trackRecordingServiceConnection.startAndBind(this);
|
||||||
|
bindChangedCallback.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -403,15 +416,4 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
|
|||||||
String category = getString(TrackIconUtils.getIconActivityType(iconValue));
|
String category = getString(TrackIconUtils.getIconActivityType(iconValue));
|
||||||
TrackUtils.updateTrack(this, track, null, category, null, contentProviderUtils);
|
TrackUtils.updateTrack(this, track, null, category, null, contentProviderUtils);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startRecording() {
|
|
||||||
trackRecordingServiceConnection.startAndBind(this);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If the binding has happened, then invoke the callback to start a new recording.
|
|
||||||
* If the binding hasn't happened, then invoking the callback will have no effect.
|
|
||||||
* But when the binding occurs, the callback will get invoked.
|
|
||||||
*/
|
|
||||||
bindChangedCallback.run();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include layout="@layout/toolbar" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<include layout="@layout/track_controller" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.google.android.material.tabs.TabLayout
|
||||||
|
android:id="@+id/track_detail_activity_tablayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:tabIndicatorColor="@color/holo_orange_dark" />
|
||||||
|
|
||||||
|
<androidx.viewpager.widget.ViewPager
|
||||||
|
android:id="@+id/track_detail_activity_view_pager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
Reference in New Issue
Block a user