Revision 3717a94e
Added by Leszek Koltunski about 5 years ago
| src/main/java/org/distorted/objects/RubikObject.java | ||
|---|---|---|
| 429 | 429 |
|
| 430 | 430 |
public void recomputeScaleFactor(int scrWidth, int scrHeight) |
| 431 | 431 |
{
|
| 432 |
float factor = Math.min(scrWidth,scrHeight); |
|
| 433 |
mNodeScale.set(factor,NODE_RATIO*factor,factor); |
|
| 432 |
mNodeScale.set(scrWidth,NODE_RATIO*scrWidth,scrWidth); |
|
| 434 | 433 |
} |
| 435 | 434 |
|
| 436 | 435 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/res/layout/main.xml | ||
|---|---|---|
| 10 | 10 |
android:layout_height="0dp" |
| 11 | 11 |
android:layout_weight="0.12" |
| 12 | 12 |
android:gravity="center" |
| 13 |
android:orientation="horizontal"> |
|
| 13 |
android:orientation="horizontal" |
|
| 14 |
android:background="@android:color/transparent"> |
|
| 14 | 15 |
</LinearLayout> |
| 15 | 16 |
|
| 16 | 17 |
<org.distorted.main.RubikSurfaceView |
| ... | ... | |
| 24 | 25 |
android:layout_width="match_parent" |
| 25 | 26 |
android:layout_height="0dp" |
| 26 | 27 |
android:layout_weight="0.12" |
| 27 |
android:orientation="horizontal"> |
|
| 28 |
android:orientation="horizontal" |
|
| 29 |
android:background="@android:color/transparent"> |
|
| 28 | 30 |
</LinearLayout> |
| 29 | 31 |
|
| 30 | 32 |
</LinearLayout> |
Also available in: Unified diff
Slight correction for devices which have scrWidth>scrHeight ( Huawei Mate Xs! )