From 43210ef0df9a23d4314da80c00a252486c4e2e4c Mon Sep 17 00:00:00 2001 From: Zachary Date: Mon, 25 Mar 2024 18:11:18 -0400 Subject: [PATCH 01/76] Mock season data page created A mockup for the season data page has been created. All the data is static, but it each page represents each individual season. --- .../opentracks/SeasonalActivity.java | 9 +- .../opentracks/SeasonalActivityPerSeason.java | 20 +-- .../activity_season_aggrgated_list_item.xml | 125 ++++++++++++++++ src/main/res/layout/activity_seasonal.xml | 32 ++-- .../layout/activity_seasonal_per_season.xml | 137 ++++++++++++++++-- .../res/layout/aggregated_stats_list_item.xml | 2 +- 6 files changed, 285 insertions(+), 40 deletions(-) create mode 100644 src/main/res/layout/activity_season_aggrgated_list_item.xml diff --git a/src/main/java/de/dennisguse/opentracks/SeasonalActivity.java b/src/main/java/de/dennisguse/opentracks/SeasonalActivity.java index 49d83a9e4..eeff40b52 100644 --- a/src/main/java/de/dennisguse/opentracks/SeasonalActivity.java +++ b/src/main/java/de/dennisguse/opentracks/SeasonalActivity.java @@ -2,8 +2,6 @@ import static android.app.PendingIntent.getActivity; -import android.app.AlertDialog; -import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.view.View; @@ -30,9 +28,10 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { setTitle("Seasonal Activity!"); seasonsRecyclerView = findViewById(R.id.seasons_recyclerView); - GoToIndividualSite(findViewById(R.id.activity_game_answer1_btn)); - GoToIndividualSite(findViewById(R.id.activity_game_answer2_btn)); - GoToIndividualSite(findViewById(R.id.activity_game_answer3_btn)); + GoToIndividualSite(findViewById(R.id.LifeTime_button)); + GoToIndividualSite(findViewById(R.id.Winter2024_Button)); + GoToIndividualSite(findViewById(R.id.Winter2023_Button)); + GoToIndividualSite(findViewById(R.id.Winter2022_Button)); setSupportActionBar(viewBinding.bottomAppBarLayout.bottomAppBar); } diff --git a/src/main/java/de/dennisguse/opentracks/SeasonalActivityPerSeason.java b/src/main/java/de/dennisguse/opentracks/SeasonalActivityPerSeason.java index 18decc822..5b7a797e1 100644 --- a/src/main/java/de/dennisguse/opentracks/SeasonalActivityPerSeason.java +++ b/src/main/java/de/dennisguse/opentracks/SeasonalActivityPerSeason.java @@ -6,6 +6,7 @@ import android.view.View; import android.widget.Button; import android.widget.TextView; +import android.widget.Toolbar; import androidx.activity.EdgeToEdge; import androidx.appcompat.app.AppCompatActivity; @@ -13,6 +14,8 @@ import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; +import com.google.android.material.appbar.MaterialToolbar; + import de.dennisguse.opentracks.databinding.ActivitySeasonalBinding; import de.dennisguse.opentracks.databinding.ActivitySeasonalPerSeasonBinding; @@ -24,19 +27,13 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - EdgeToEdge.enable(this); - setContentView(R.layout.activity_seasonal_per_season); - ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> { - Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()); - v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom); - return insets; - }); - Bundle data = getIntent().getExtras(); if (data != null) { changeTitle(data.getString("seasonTitle")); } + + setSupportActionBar(viewBinding.bottomAppBarLayout.bottomAppBar); } private void MakeYesNoButton(Button button) { @@ -49,11 +46,8 @@ private void MakeYesNoButton(Button button) } private void changeTitle(String newTitle) { - newTitle = newTitle.replaceAll("_", " "); - setContentView(R.layout.activity_seasonal_per_season); - TextView tv = (TextView)findViewById(R.id.pageTitle); - tv.setText(newTitle); - tv.setTextSize(32); + MaterialToolbar materialToolbar = (MaterialToolbar)findViewById(R.id.season_materialtoolbar); + materialToolbar.setTitle(newTitle); } @Override diff --git a/src/main/res/layout/activity_season_aggrgated_list_item.xml b/src/main/res/layout/activity_season_aggrgated_list_item.xml new file mode 100644 index 000000000..b176a606c --- /dev/null +++ b/src/main/res/layout/activity_season_aggrgated_list_item.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/res/layout/activity_seasonal.xml b/src/main/res/layout/activity_seasonal.xml index 050edfe2a..552f91734 100644 --- a/src/main/res/layout/activity_seasonal.xml +++ b/src/main/res/layout/activity_seasonal.xml @@ -21,7 +21,7 @@ android:layout_height="wrap_content"> + android:layout_height="wrap_content" > + +