Revision 7bb30586
Added by Leszek Koltunski 7 months ago
src/main/java/org/distorted/dialogs/RubikDialogPatternListAdapter.java | ||
---|---|---|
1 | 1 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
2 |
// Copyright 2020 Leszek Koltunski //
|
|
2 |
// Copyright 2023 Leszek Koltunski //
|
|
3 | 3 |
// // |
4 | 4 |
// This file is part of Magic Cube. // |
5 | 5 |
// // |
6 | 6 |
// Magic Cube is proprietary software licensed under an EULA which you should have received // |
7 | 7 |
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html // |
8 |
|
|
8 | 9 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
9 | 10 |
|
10 | 11 |
package org.distorted.dialogs; |
... | ... | |
16 | 17 |
import android.view.ViewGroup; |
17 | 18 |
import android.widget.BaseExpandableListAdapter; |
18 | 19 |
import android.widget.TextView; |
19 |
|
|
20 | 20 |
import org.distorted.objectlib.patterns.RubikPattern; |
21 | 21 |
import org.distorted.main.R; |
22 | 22 |
|
... | ... | |
26 | 26 |
{ |
27 | 27 |
private static final float PATTERN_CHILD_TEXT = 0.038f; |
28 | 28 |
private static final float PATTERN_GROUP_TEXT = 0.060f; |
29 |
|
|
30 | 29 |
private final Context mContext; |
31 | 30 |
private final int mTab, mWidth; |
32 | 31 |
|
... | ... | |
70 | 69 |
} |
71 | 70 |
|
72 | 71 |
int size = (int)(mWidth*PATTERN_CHILD_TEXT); |
73 |
|
|
74 | 72 |
TextView childItem = view.findViewById(R.id.child); |
75 | 73 |
childItem.setText(childName); |
76 | 74 |
childItem.setTextSize(TypedValue.COMPLEX_UNIT_PX, size); |
77 |
|
|
78 | 75 |
return view; |
79 | 76 |
} |
80 | 77 |
|
... | ... | |
127 | 124 |
} |
128 | 125 |
|
129 | 126 |
int size = (int)(mWidth*PATTERN_GROUP_TEXT); |
130 |
|
|
131 | 127 |
TextView heading = view.findViewById(R.id.heading); |
132 | 128 |
heading.setText(groupName); |
133 | 129 |
heading.setTextSize(TypedValue.COMPLEX_UNIT_PX, size); |
134 |
|
|
135 | 130 |
RubikPattern pattern = RubikPattern.getInstance(); |
136 | 131 |
int numPatterns = pattern.getNumPatterns(mTab,groupPosition); |
137 | 132 |
TextView counter = view.findViewById(R.id.counter); |
138 | 133 |
counter.setText(String.format("%d", numPatterns)); |
139 | 134 |
counter.setTextSize(TypedValue.COMPLEX_UNIT_PX, size); |
140 |
|
|
141 | 135 |
return view; |
142 | 136 |
} |
143 | 137 |
|
Also available in: Unified diff
Remove all old UI 1.0 classes