diff --git a/src/main/java/de/dennisguse/opentracks/TrackListActivity.java b/src/main/java/de/dennisguse/opentracks/TrackListActivity.java index 5fc60abb7..69abfc400 100644 --- a/src/main/java/de/dennisguse/opentracks/TrackListActivity.java +++ b/src/main/java/de/dennisguse/opentracks/TrackListActivity.java @@ -107,7 +107,7 @@ public void onPrepare(Menu menu, int[] positions, long[] trackIds, boolean showS boolean isSingleSelection = trackIds.length == 1; viewBinding.bottomAppBar.performHide(true); - viewBinding.trackListFabAction.setVisibility(View.INVISIBLE); + viewBinding.button.setVisibility(View.INVISIBLE); menu.findItem(R.id.list_context_menu_edit).setVisible(isSingleSelection); menu.findItem(R.id.list_context_menu_select_all).setVisible(showSelectAll); @@ -120,7 +120,7 @@ public boolean onClick(int itemId, int[] positions, long[] trackIds) { @Override public void onDestroy() { - viewBinding.trackListFabAction.setVisibility(View.VISIBLE); + viewBinding.button.setVisibility(View.VISIBLE); viewBinding.bottomAppBar.performShow(true); } }; @@ -238,7 +238,7 @@ public void bindView(View view, Context context, Cursor cursor) { viewBinding.trackList.setAdapter(resourceCursorAdapter); ActivityUtils.configureListViewContextualMenu(viewBinding.trackList, contextualActionModeCallback); - viewBinding.trackListFabAction.setOnClickListener((view) -> { + viewBinding.button.setOnClickListener((view) -> { if (recordingStatus.isRecording()) { Toast.makeText(TrackListActivity.this, getString(R.string.hold_to_stop), Toast.LENGTH_LONG).show(); return; @@ -256,7 +256,7 @@ public void bindView(View view, Context context, Cursor cursor) { connection.unbind(this); }).startAndBind(this, true); }); - viewBinding.trackListFabAction.setOnLongClickListener((view) -> { + viewBinding.button.setOnLongClickListener((view) -> { if (!recordingStatus.isRecording()) { return false; } @@ -265,8 +265,8 @@ public void bindView(View view, Context context, Cursor cursor) { ActivityUtils.vibrate(this, 1000); updateGpsMenuItem(false, false); trackRecordingServiceConnection.stopRecording(TrackListActivity.this); - viewBinding.trackListFabAction.setImageResource(R.drawable.ic_baseline_record_24); - viewBinding.trackListFabAction.setBackgroundTintList(ContextCompat.getColorStateList(this, R.color.red_dark)); + // viewBinding.button.setImageResource(R.drawable.ic_baseline_record_24); + viewBinding.button.setBackgroundTintList(ContextCompat.getColorStateList(this, R.color.red_dark)); return true; }); @@ -553,13 +553,13 @@ public void onGpsStatusChanged(GpsStatusValue newStatus) { updateGpsMenuItem(true, recordingStatus.isRecording()); } - private void setFloatButton() { - viewBinding.trackListFabAction.setImageResource(recordingStatus.isRecording() ? R.drawable.ic_baseline_stop_24 : R.drawable.ic_baseline_record_24); - viewBinding.trackListFabAction.setBackgroundTintList(ContextCompat.getColorStateList(this, recordingStatus.isRecording() ? R.color.opentracks : R.color.red_dark)); - } + // private void setFloatButton() { + // viewBinding.button.setImageResource(recordingStatus.isRecording() ? R.drawable.ic_baseline_stop_24 : R.drawable.ic_baseline_record_24); + // viewBinding.button.setBackgroundTintList(ContextCompat.getColorStateList(this, recordingStatus.isRecording() ? R.color.opentracks : R.color.red_dark)); + // } private void onRecordingStatusChanged(RecordingStatus status) { recordingStatus = status; - setFloatButton(); + // setFloatButton(); } -} +} \ No newline at end of file diff --git a/src/main/java/de/dennisguse/opentracks/TrackRecordingActivity.java b/src/main/java/de/dennisguse/opentracks/TrackRecordingActivity.java index d6e686008..e3ce00f1b 100644 --- a/src/main/java/de/dennisguse/opentracks/TrackRecordingActivity.java +++ b/src/main/java/de/dennisguse/opentracks/TrackRecordingActivity.java @@ -132,10 +132,10 @@ protected void onCreate(Bundle savedInstanceState) { viewBinding.trackDetailActivityViewPager.setCurrentItem(savedInstanceState.getInt(CURRENT_TAB_TAG_KEY)); } - viewBinding.trackRecordingFabAction.setImageResource(R.drawable.ic_baseline_stop_24); - viewBinding.trackRecordingFabAction.setBackgroundTintList(ContextCompat.getColorStateList(this, R.color.opentracks)); - viewBinding.trackRecordingFabAction.setBackgroundColor(ContextCompat.getColor(this, R.color.opentracks)); - viewBinding.trackRecordingFabAction.setOnLongClickListener((view) -> { + // viewBinding.holdToStopButton.setImageResource(R.drawable.ic_baseline_stop_24); + // viewBinding.holdToStopButton.setBackgroundTintList(ContextCompat.getColorStateList(this, R.color.opentracks)); + // viewBinding.holdToStopButton.setBackgroundColor(ContextCompat.getColor(this, R.color.opentracks)); + viewBinding.holdToStopButton.setOnLongClickListener((view) -> { ActivityUtils.vibrate(this, 1000); trackRecordingServiceConnection.stopRecording(TrackRecordingActivity.this); Intent newIntent = IntentUtils.newIntent(TrackRecordingActivity.this, TrackStoppedActivity.class) @@ -145,7 +145,7 @@ protected void onCreate(Bundle savedInstanceState) { finish(); return true; }); - viewBinding.trackRecordingFabAction.setOnClickListener((view) -> Toast.makeText(TrackRecordingActivity.this, getString(R.string.hold_to_stop), Toast.LENGTH_LONG).show()); + viewBinding.holdToStopButton.setOnClickListener((view) -> Toast.makeText(TrackRecordingActivity.this, getString(R.string.hold_to_pause), Toast.LENGTH_LONG).show()); viewBinding.bottomAppBar.setNavigationIcon(R.drawable.ic_baseline_arrow_back_24); setSupportActionBar(viewBinding.bottomAppBar); diff --git a/src/main/res/layout/track_list.xml b/src/main/res/layout/track_list.xml index 91e315454..060cbae0a 100644 --- a/src/main/res/layout/track_list.xml +++ b/src/main/res/layout/track_list.xml @@ -32,6 +32,7 @@ limitations under the License. - - - \ No newline at end of file + android:layout_weight="1" + android:backgroundTint="#0B0A0A" + android:fontFamily="monospace" + android:text="START WORKOUT" + android:textStyle="bold" + app:layout_anchor="@+id/bottom_app_bar" + app:layout_anchorGravity="center" /> + + diff --git a/src/main/res/layout/track_recording.xml b/src/main/res/layout/track_recording.xml index 360a056dc..95931a43b 100644 --- a/src/main/res/layout/track_recording.xml +++ b/src/main/res/layout/track_recording.xml @@ -6,6 +6,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> - - - \ No newline at end of file + android:backgroundTint="#020202" + android:fontFamily="monospace" + android:text="HOLD TO PAUSE" + android:textStyle="bold" + android:translationX="-20dp" + app:layout_anchor="@+id/bottom_app_bar" + app:layout_anchorGravity="end|center" /> + + diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 4db8181a7..12e86597d 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -678,6 +678,8 @@ limitations under the License. I think you might be interested in this image. Hold to stop + Hold to Pause + Export track to storage after recording is finished Instant post-workout export