Skip to content

Commit 8a43ff3

Browse files
Fix Daily Puzzle Mode layout and animation reappearances.
- Anchored status bar at the bottom and fixed view_switcher height in game.xml. - Enforced maximum height for FoundTriplesView to prevent screen takeover. - Removed delayed updateBounds() in animateTripleFound to keep cards in the status bar. - Explicitly reset board state in DailyGameActivity after animation completes. - Compacted status bar text and moved date/hints to a single row. Co-authored-by: amorris13 <4523811+amorris13@users.noreply.github.com>
1 parent f49c909 commit 8a43ff3

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

app/src/main/java/com/antsapps/triples/DailyGameActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public void onTripleFound(Set<Card> triple) {
139139
// Delay updating the FoundTriplesView until animation is finished
140140
findViewById(R.id.status_bar).postDelayed(() -> {
141141
updateFoundTriplesView();
142+
cardsView.updateBounds();
142143
}, 1000);
143144
}
144145

app/src/main/java/com/antsapps/triples/FoundTriplesView.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ public class FoundTriplesView extends View {
3131
private static final int STACK_OVERLAP_DP = 16;
3232
private static final int STACK_WIDTH_REDUCTION_DP = 10;
3333
private static final int HIGHLIGHT_DURATION_MS = 1000;
34+
private static final int MAX_HEIGHT_DP = 120;
3435

3536
private final Paint mPlaceholderPaint;
3637
private final Paint mBackgroundPaint;
3738
private final Paint mHighlightPaint;
3839
private final int mPadding;
3940
private final int mOverlap;
4041
private final int mWidthReduction;
42+
private final int mMaxHeight;
4143

4244
private List<Set<Card>> mAllTriples = Lists.newArrayList();
4345
private List<Set<Card>> mFoundTriples = Lists.newArrayList();
@@ -56,6 +58,7 @@ public FoundTriplesView(Context context, AttributeSet attrs) {
5658
mPadding = (int) (PADDING_DP * density);
5759
mOverlap = (int) (STACK_OVERLAP_DP * density);
5860
mWidthReduction = (int) (STACK_WIDTH_REDUCTION_DP * density);
61+
mMaxHeight = (int) (MAX_HEIGHT_DP * density);
5962

6063
mPlaceholderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
6164
mPlaceholderPaint.setStyle(Paint.Style.STROKE);
@@ -149,6 +152,10 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
149152
int rows = (int) Math.ceil((double) mAllTriples.size() / COLUMNS);
150153
int height = rows * (stackHeight + mPadding) + mPadding;
151154

155+
if (height > mMaxHeight) {
156+
height = mMaxHeight;
157+
}
158+
152159
setMeasuredDimension(width, height);
153160
}
154161

app/src/main/res/layout/game.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
android:layout_width="fill_parent"
55
android:layout_height="fill_parent"
6+
android:clipChildren="false"
7+
android:clipToPadding="false"
68
android:background="?attr/colorSurface">
79

810
<ViewStub
@@ -22,11 +24,13 @@
2224
<ViewAnimator
2325
android:id="@+id/view_switcher"
2426
android:layout_width="fill_parent"
25-
android:layout_height="fill_parent"
27+
android:layout_height="0dp"
2628
android:inAnimation="@android:anim/fade_in"
2729
android:outAnimation="@android:anim/fade_out"
2830
android:layout_above="@id/bottom_separator"
2931
android:layout_alignParentTop="true"
32+
android:clipChildren="false"
33+
android:clipToPadding="false"
3034
android:measureAllChildren="false">
3135

3236
<include

0 commit comments

Comments
 (0)