Skip to content

Commit

Permalink
Track list: re-added aggregated stats for selections.
Browse files Browse the repository at this point in the history
Removed in 9f1ea4d

Fixes #1623.
  • Loading branch information
dennisguse committed Jun 29, 2023
1 parent 1749c77 commit 7d7ab57
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/de/dennisguse/opentracks/TrackListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
import java.time.Instant;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Arrays;

import de.dennisguse.opentracks.data.models.ActivityType;
import de.dennisguse.opentracks.data.models.Distance;
Expand Down Expand Up @@ -485,6 +487,13 @@ private boolean handleContextItem(int itemId, long... longTrackIds) {
return true;
}

if (itemId == R.id.list_context_menu_aggregated_stats) {
Intent intent = IntentUtils.newIntent(this, AggregatedStatisticsActivity.class)
.putParcelableArrayListExtra(AggregatedStatisticsActivity.EXTRA_TRACK_IDS, new ArrayList<>(Arrays.asList(trackIds)));
startActivity(intent);
return true;
}

if (itemId == R.id.list_context_menu_select_all) {
for (int i = 0; i < viewBinding.trackList.getCount(); i++) {
viewBinding.trackList.setItemChecked(i, true);
Expand Down
5 changes: 5 additions & 0 deletions src/main/res/menu/list_context_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ limitations under the License.
android:icon="@drawable/ic_delete_forever_24dp"
android:title="@string/menu_delete"
app:showAsAction="ifRoom" />
<item
android:id="@+id/list_context_menu_aggregated_stats"
android:icon="@drawable/ic_statistics_24dp"
android:title="@string/menu_aggregated_statistics"
app:showAsAction="ifRoom" />
<item
android:id="@+id/list_context_menu_select_all"
android:icon="@drawable/ic_select_all_24dp"
Expand Down

0 comments on commit 7d7ab57

Please sign in to comment.