Compare commits

..

8 Commits

Author SHA1 Message Date
Dennis Guse 1feb5cbb65 Release v3.8.1 2020-08-03 08:03:13 +02:00
Dennis Guse 1d2fde6e69 DashboardAPI: report if track is recording and start Dashboard on same task.
Necessary for Picture-in-Picture mode.
2020-08-03 07:59:17 +02:00
Dennis Guse 20423121ee Dashboard API: only forward fullscreen setting, when recording. 2020-08-03 07:59:17 +02:00
Dennis Guse ebf7b0a0c3 TrackRecordingActivity: added setting for fullscreen.
Fixes #342.
2020-08-03 07:59:17 +02:00
Dennis Guse 1189a07794 TrackController: center time. 2020-08-02 16:36:03 +02:00
Román 63e9041922 Orientation change when edit marker has to update photo uri in waypoint for delete button update (hide/show). 2020-07-31 20:29:56 +02:00
Dennis Guse 699be450b0 Fixed too optimistic intent-filter for imports.
Fixes #340.
2020-07-29 23:19:32 +02:00
Dennis Guse 66b175c56c Updated dependencies. 2020-07-26 17:39:30 +02:00
14 changed files with 65 additions and 58 deletions
+4 -9
View File
@@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:4.0.1'
}
}
@@ -50,8 +50,8 @@ android {
applicationName: "@string/app_name"
]
versionCode 3466
versionName "v3.8.0"
versionCode 3474
versionName "v3.8.1"
buildConfigField "String", "VERSION_NAME_FULL", "\"${getVersionName()}\""
@@ -96,13 +96,8 @@ dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
androidTestImplementation 'androidx.test:core:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'org.mockito:mockito-android:3.0.0'
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'org.mockito:mockito-core:3.0.0'
androidTestImplementation 'org.mockito:mockito-android:3.4.4'
}
@@ -0,0 +1,8 @@
v3.8.1: OpenTracks
Changes:
- While recording: add option for fullscreen
- Dashboard is started on the same task
Bugfixes:
- Intent filters for importing files were far too optimistic
+6 -15
View File
@@ -76,12 +76,9 @@ limitations under the License.
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/vnd.google-earth.kmz" />
<data
android:host="*"
android:mimeType="application/vnd.google-earth.kmz" />
<data
android:host="*"
android:mimeType="*/*"
android:scheme="content"
android:pathPattern="*kmz" />
</intent-filter>
@@ -89,12 +86,9 @@ limitations under the License.
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/vnd.google-earth.kml+xml" />
<data
android:host="*"
android:mimeType="application/vnd.google-earth.kml+xml" />
<data
android:host="*"
android:mimeType="*/*"
android:scheme="content"
android:pathPattern="*kml" />
</intent-filter>
@@ -102,12 +96,9 @@ limitations under the License.
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/gpx+xml" />
<data
android:host="*"
android:mimeType="application/gpx+xml" />
<data
android:host="*"
android:mimeType="*/*"
android:scheme="content"
android:pathPattern="*gpx" />
</intent-filter>
@@ -151,6 +151,7 @@ public class MarkerEditActivity extends AbstractActivity {
if (savedInstanceState != null) {
photoUri = savedInstanceState.getParcelable(BUNDLE_PHOTO_URI);
waypoint.setPhotoUrl(photoUri != null ? photoUri.toString() : null);
}
if (photoUri != null) {
setWaypointImageView(photoUri);
@@ -458,7 +458,7 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
Intent intent;
switch (itemId) {
case R.id.list_context_menu_show_on_map:
IntentDashboardUtils.startDashboard(this, trackIds);
IntentDashboardUtils.startDashboard(this, trackIds, false);
return true;
case R.id.list_context_menu_share:
intent = IntentUtils.newShareFileIntent(this, trackIds);
@@ -187,7 +187,7 @@ public class TrackRecordedActivity extends AbstractListActivity implements Choos
startActivity(intent);
return true;
case R.id.track_detail_menu_show_on_map:
IntentDashboardUtils.startDashboard(this, trackId);
IntentDashboardUtils.startDashboard(this, new long[]{trackId}, false);
return true;
case R.id.track_detail_markers:
intent = IntentUtils.newIntent(this, MarkerListActivity.class)
@@ -110,6 +110,9 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
if (PreferencesUtils.isKey(TrackRecordingActivity.this, R.string.stats_keep_screen_on_while_recording_key, key)) {
setScreenOnPolicy();
}
if (PreferencesUtils.isKey(TrackRecordingActivity.this, R.string.stats_fullscreen_while_recording_key, key)) {
setFullscreenPolicy();
}
if (key == null) return;
@@ -190,12 +193,12 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
public void onAttachedToWindow() {
setLockscreenPolicy();
setScreenOnPolicy();
setFullscreenPolicy();
super.onAttachedToWindow();
}
private void setLockscreenPolicy() {
boolean showOnLockScreen = PreferencesUtils.shouldShowStatsOnLockscreen(TrackRecordingActivity.this)
&& PreferencesUtils.isRecording(this);
boolean showOnLockScreen = PreferencesUtils.shouldShowStatsOnLockscreen(TrackRecordingActivity.this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
setShowWhenLocked(showOnLockScreen);
@@ -207,8 +210,7 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
}
private void setScreenOnPolicy() {
boolean keepScreenOn = PreferencesUtils.shouldKeepScreenOn(TrackRecordingActivity.this)
&& PreferencesUtils.isRecording(this);
boolean keepScreenOn = PreferencesUtils.shouldKeepScreenOn(TrackRecordingActivity.this);
if (keepScreenOn) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
@@ -217,6 +219,16 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
}
}
private void setFullscreenPolicy() {
boolean keepScreenOn = PreferencesUtils.shouldUseFullscreen(TrackRecordingActivity.this);
if (keepScreenOn) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}
@Override
protected void onStart() {
super.onStart();
@@ -302,7 +314,7 @@ public class TrackRecordingActivity extends AbstractActivity implements ChooseAc
startActivity(intent);
return true;
case R.id.track_detail_menu_show_on_map:
IntentDashboardUtils.startDashboard(this, trackId);
IntentDashboardUtils.startDashboard(this, new long[]{trackId}, true);
return true;
case R.id.track_detail_markers:
intent = IntentUtils.newIntent(this, MarkerListActivity.class)
@@ -24,8 +24,10 @@ public class IntentDashboardUtils {
private static final String ACTION_DASHBOARD_PAYLOAD = ACTION_DASHBOARD + ".Payload";
private static final String EXTRAS_OPENTRACKS_IS_RECORDING_THIS_TRACK = "EXTRAS_OPENTRACKS_IS_RECORDING_THIS_TRACK";
private static final String EXTRAS_SHOULD_KEEP_SCREEN_ON = "EXTRAS_SHOULD_KEEP_SCREEN_ON";
private static final String EXTRAS_SHOW_WHEN_LOCKED = "EXTRAS_SHOULD_KEEP_SCREEN_ON";
private static final String EXTRAS_SHOW_FULLSCREEN = "EXTRAS_SHOULD_FULLSCREEN";
private static final int TRACK_URI_INDEX = 0;
private static final int TRACKPOINTS_URI_INDEX = 1;
@@ -40,7 +42,7 @@ public class IntentDashboardUtils {
* @param context the context
* @param trackIds the track ids
*/
public static void startDashboard(Context context, long[] trackIds) {
public static void startDashboard(Context context, long[] trackIds, boolean isRecording) {
if (trackIds.length == 0) {
return;
}
@@ -55,9 +57,12 @@ public class IntentDashboardUtils {
Intent intent = new Intent(ACTION_DASHBOARD);
intent.putParcelableArrayListExtra(ACTION_DASHBOARD_PAYLOAD, uris);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(EXTRAS_SHOULD_KEEP_SCREEN_ON, PreferencesUtils.shouldKeepScreenOn(context));
intent.putExtra(EXTRAS_SHOW_WHEN_LOCKED, PreferencesUtils.shouldShowStatsOnLockscreen(context));
intent.putExtra(EXTRAS_OPENTRACKS_IS_RECORDING_THIS_TRACK, isRecording);
if (isRecording) {
intent.putExtra(EXTRAS_SHOW_FULLSCREEN, PreferencesUtils.shouldUseFullscreen(context));
}
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
ClipData clipData = ClipData.newRawUri(null, uris.get(TRACK_URI_INDEX));
@@ -68,10 +73,6 @@ public class IntentDashboardUtils {
context.startActivity(intent);
}
public static void startDashboard(Context context, long trackId) {
startDashboard(context, new long[]{trackId});
}
public static long[] extractTrackIdsFromIntent(@NonNull Intent intent) {
final ArrayList<Uri> uris = intent.getParcelableArrayListExtra(ACTION_DASHBOARD_PAYLOAD);
final Uri tracksUri = uris.get(TRACK_URI_INDEX);
@@ -275,6 +275,11 @@ public class PreferencesUtils {
return getBoolean(context, R.string.stats_keep_screen_on_while_recording_key, DEFAULT);
}
public static boolean shouldUseFullscreen(Context context) {
final boolean DEFAULT = context.getResources().getBoolean(R.bool.stats_fullscreen_while_recording_default);
return getBoolean(context, R.string.stats_fullscreen_while_recording_key, DEFAULT);
}
public static boolean isShowStatsElevation(Context context) {
final boolean STATS_SHOW_ELEVATION = context.getResources().getBoolean(R.bool.stats_show_elevation_default);
return getBoolean(context, R.string.stats_show_grade_elevation_key, STATS_SHOW_ELEVATION);
@@ -24,11 +24,6 @@ limitations under the License.
android:paddingLeft="8dp"
android:paddingRight="8dp">
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<ImageButton
android:id="@+id/track_controller_record"
android:layout_width="wrap_content"
@@ -69,9 +64,5 @@ limitations under the License.
android:contentDescription="@string/image_stop"
android:src="@drawable/ic_button_stop_disabled" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
</merge>
+5 -12
View File
@@ -23,11 +23,6 @@ limitations under the License.
android:paddingTop="8dp"
android:paddingBottom="8dp">
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
<ImageButton
android:id="@+id/track_controller_record"
android:layout_width="0dp"
@@ -39,14 +34,16 @@ limitations under the License.
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="6">
android:layout_weight="6"
android:gravity="center"
android:layout_gravity="center">
<TextView
android:id="@+id/track_controller_total_time"
style="@style/TextSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:textColor="@android:color/white" />
@@ -56,7 +53,7 @@ limitations under the License.
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/track_controller_total_time"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:singleLine="true" />
</RelativeLayout>
@@ -69,9 +66,5 @@ limitations under the License.
android:contentDescription="@string/image_stop"
android:src="@drawable/ic_button_stop_disabled" />
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
</LinearLayout>
</merge>
+3
View File
@@ -13,6 +13,9 @@
<string name="stats_keep_screen_on_while_recording_key" translatable="false">trackdetail_keep_screen_on_while_recording</string>
<bool name="stats_keep_screen_on_while_recording_default" translatable="false">false</bool>
<string name="stats_fullscreen_while_recording_key" translatable="false">trackdetail_fullscreen_while_recording</string>
<bool name="stats_fullscreen_while_recording_default" translatable="false">false</bool>
<string name="settings_reset_key" translatable="false">settingsReset</string>
<string name="settings_sensor_bluetooth_heart_rate_key" translatable="false">bluetoothSensor</string>
+2
View File
@@ -349,6 +349,8 @@ limitations under the License.
<string name="settings_recording_show_on_lockscreen_while_recording_summary">While recording, show statistics without unlocking the device.</string>
<string name="settings_recording_keep_screen_on_while_recording_title">Keep screen on</string>
<string name="settings_recording_keep_screen_on_while_recording_summary">While recording, keep the screen on.</string>
<string name="settings_recording_fullscreen_on_while_recording_title">Fullscreen</string>
<string name="settings_recording_fullscreen_on_while_recording_summary">While recording, present in fullscreen.</string>
<string name="settings_recording">Recording</string>
<string name="settings_recording_auto_resume_track_timeout_always_summary">Always resume a recording after reboot</string>
<string name="settings_recording_auto_resume_track_timeout_never_summary">Never resume a recording after reboot</string>
+5
View File
@@ -67,6 +67,11 @@ limitations under the License.
android:key="@string/stats_keep_screen_on_while_recording_key"
android:summary="@string/settings_recording_keep_screen_on_while_recording_summary"
android:title="@string/settings_recording_keep_screen_on_while_recording_title" />
<SwitchPreferenceCompat
android:defaultValue="@bool/stats_fullscreen_while_recording_default"
android:key="@string/stats_fullscreen_while_recording_key"
android:summary="@string/settings_recording_fullscreen_on_while_recording_summary"
android:title="@string/settings_recording_fullscreen_on_while_recording_title" />
<ListPreference
android:defaultValue="@string/voice_frequency_default"
android:entryValues="@array/frequency_values"