From f648e0ec88f69c7e39be46ec568cfe59f77a36c8 Mon Sep 17 00:00:00 2001 From: uykek Date: Mon, 24 Aug 2020 17:00:30 +0200 Subject: [PATCH] Label each custom sudoku displayed in the LoadGameActivity as such --- .../ui/DailySudokuActivity.java | 2 + .../ui/LoadGameActivity.java | 5 + app/src/main/res/layout/list_entry_layout.xml | 95 ++++++++++++------- 3 files changed, 68 insertions(+), 34 deletions(-) diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/DailySudokuActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/DailySudokuActivity.java index d143430..bc5d695 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/DailySudokuActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/DailySudokuActivity.java @@ -260,6 +260,7 @@ public class DailySudokuActivity extends AppCompatActivity { TextView playedTime = (TextView)convertView.findViewById(R.id.loadgame_listentry_timeplayed); TextView lastTimePlayed = (TextView)convertView.findViewById(R.id.loadgame_listentry_lasttimeplayed); ImageView image = (ImageView)convertView.findViewById(R.id.loadgame_listentry_gametypeimage); + ImageView customImage = (ImageView)convertView.findViewById(R.id.loadgame_listentry_custom_label); image.setImageResource(R.drawable.icon_default_9x9); @@ -269,6 +270,7 @@ public class DailySudokuActivity extends AppCompatActivity { difficultyBar.setNumStars(GameDifficulty.getValidDifficultyList().size()); difficultyBar.setMax(GameDifficulty.getValidDifficultyList().size()); difficultyBar.setRating(GameDifficulty.getValidDifficultyList().indexOf(sudoku.getDifficulty())+1); + customImage.setVisibility(View.INVISIBLE); Calendar currentDate = Calendar.getInstance(); diff --git a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/LoadGameActivity.java b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/LoadGameActivity.java index 717f132..33935d4 100644 --- a/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/LoadGameActivity.java +++ b/app/src/main/java/org/secuso/privacyfriendlysudoku/ui/LoadGameActivity.java @@ -229,6 +229,7 @@ public class LoadGameActivity extends BaseActivity implements IDeleteDialogFragm TextView playedTime = (TextView)convertView.findViewById(R.id.loadgame_listentry_timeplayed); TextView lastTimePlayed = (TextView)convertView.findViewById(R.id.loadgame_listentry_lasttimeplayed); ImageView image = (ImageView)convertView.findViewById(R.id.loadgame_listentry_gametypeimage); + ImageView customImage = (ImageView)convertView.findViewById(R.id.loadgame_listentry_custom_label); switch(gic.getGameType()) { case Default_6x6: @@ -249,6 +250,10 @@ public class LoadGameActivity extends BaseActivity implements IDeleteDialogFragm difficultyBar.setMax(GameDifficulty.getValidDifficultyList().size()); difficultyBar.setRating(GameDifficulty.getValidDifficultyList().indexOf(gic.getDifficulty())+1); + if(!gic.isCustom()) { + customImage.setVisibility(View.INVISIBLE); + } + int time = gic.getTimePlayed(); int seconds = time % 60; int minutes = ((time -seconds)/60)%60 ; diff --git a/app/src/main/res/layout/list_entry_layout.xml b/app/src/main/res/layout/list_entry_layout.xml index 800e726..a098bf0 100644 --- a/app/src/main/res/layout/list_entry_layout.xml +++ b/app/src/main/res/layout/list_entry_layout.xml @@ -1,53 +1,80 @@ + android:weightSum="10"> + android:src="@drawable/icon_default_9x9" /> - + android:layout_height="wrap_content"> + + + android:layout_height="wrap_content" + android:text="GameType" + app:layout_constraintBottom_toTopOf="@+id/loadgame_listentry_difficultybar" + app:layout_constraintEnd_toEndOf="@+id/loadgame_listentry_difficultytext" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="@+id/loadgame_listentry_difficultybar" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="1.0" /> - + android:clickable="false" + android:numStars="3" + android:rating="3" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.0" /> - + - - - + + android:gravity="end" + android:text="00:00" + android:textStyle="bold" /> + android:layout_height="wrap_content" + android:layout_below="@+id/loadgame_listentry_timeplayed" + android:gravity="end" + android:text="1 second ago" />