Revision 5de2c572
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/dialogs/RubikDialogPatternListAdapter.java | ||
---|---|---|
20 | 20 |
package org.distorted.dialogs; |
21 | 21 |
|
22 | 22 |
import android.content.Context; |
23 |
import android.util.TypedValue; |
|
23 | 24 |
import android.view.LayoutInflater; |
24 | 25 |
import android.view.View; |
25 | 26 |
import android.view.ViewGroup; |
... | ... | |
80 | 81 |
|
81 | 82 |
TextView childItem = view.findViewById(R.id.child); |
82 | 83 |
childItem.setText(childName); |
83 |
childItem.setTextSize(size); |
|
84 |
childItem.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
|
|
84 | 85 |
|
85 | 86 |
return view; |
86 | 87 |
} |
... | ... | |
137 | 138 |
|
138 | 139 |
TextView heading = view.findViewById(R.id.heading); |
139 | 140 |
heading.setText(groupName); |
140 |
heading.setTextSize(size); |
|
141 |
heading.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
|
|
141 | 142 |
|
142 | 143 |
RubikPattern pattern = RubikPattern.getInstance(); |
143 | 144 |
int numPatterns = pattern.getNumPatterns(mTab,groupPosition); |
144 | 145 |
TextView counter = view.findViewById(R.id.counter); |
145 | 146 |
counter.setText(String.format("%d", numPatterns)); |
146 |
counter.setTextSize(size); |
|
147 |
counter.setTextSize(TypedValue.COMPLEX_UNIT_PX, size);
|
|
147 | 148 |
|
148 | 149 |
return view; |
149 | 150 |
} |
src/main/java/org/distorted/main/RubikActivity.java | ||
---|---|---|
50 | 50 |
public static final float TITLE_TEXT_SIZE = 0.06f; |
51 | 51 |
public static final float BITMAP_TEXT_SIZE = 0.09f; |
52 | 52 |
public static final float MENU_ITEM_SIZE = 0.12f; |
53 |
public static final float PATTERN_GROUP_TEXT = 0.012f;
|
|
54 |
public static final float PATTERN_CHILD_TEXT = 0.008f;
|
|
53 |
public static final float PATTERN_GROUP_TEXT = 0.03f;
|
|
54 |
public static final float PATTERN_CHILD_TEXT = 0.02f;
|
|
55 | 55 |
|
56 | 56 |
public static final float MENU_BIG_TEXT_SIZE = 0.05f; |
57 | 57 |
public static final float MENU_MEDIUM_TEXT_SIZE= 0.04f; |
src/main/res/layout/dialog_pattern_child_item.xml | ||
---|---|---|
10 | 10 |
android:layout_height="wrap_content" |
11 | 11 |
android:layout_marginTop="5sp" |
12 | 12 |
android:layout_marginBottom="5sp" |
13 |
android:paddingLeft="35sp"/> |
|
13 |
android:paddingLeft="35sp" |
|
14 |
android:paddingRight="10sp" |
|
15 |
/> |
|
14 | 16 |
|
15 | 17 |
</LinearLayout> |
Also available in: Unified diff
Reinvent the Pattern Dialog (Part 3)