1
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2
|
// Copyright 2020 Leszek Koltunski //
|
3
|
// //
|
4
|
// This file is part of Magic Cube. //
|
5
|
// //
|
6
|
// Magic Cube is proprietary software licensed under an EULA which you should have received //
|
7
|
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html //
|
8
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9
|
|
10
|
package org.distorted.config;
|
11
|
|
12
|
import static org.distorted.objects.RubikObjectCategories.DIFF_IDS;
|
13
|
import static org.distorted.objects.RubikObjectCategories.DIFF_IMAGES;
|
14
|
|
15
|
import android.graphics.PorterDuff;
|
16
|
import android.util.TypedValue;
|
17
|
import android.widget.ImageView;
|
18
|
import android.widget.LinearLayout;
|
19
|
import android.widget.TextView;
|
20
|
|
21
|
import org.distorted.main.R;
|
22
|
import org.distorted.objectlib.json.JsonReader;
|
23
|
import org.distorted.objects.RubikObject;
|
24
|
import org.distorted.objects.RubikObjectList;
|
25
|
|
26
|
import java.io.InputStream;
|
27
|
|
28
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
29
|
// TODO
|
30
|
|
31
|
public class ConfigScreenPane
|
32
|
{
|
33
|
private static final int NUM_IDS = DIFF_IDS.length;
|
34
|
private static final float PADDING_RATIO = 0.016f;
|
35
|
private static final float TEXT_RATIO = 0.025f;
|
36
|
|
37
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
38
|
|
39
|
void updatePane(ConfigActivity act, int objectOrdinal)
|
40
|
{
|
41
|
|
42
|
}
|
43
|
|
44
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
45
|
|
46
|
ConfigScreenPane(final ConfigActivity act, int objectOrdinal)
|
47
|
{
|
48
|
int height = act.getScreenHeightInPixels();
|
49
|
float textSize = height*TEXT_RATIO;
|
50
|
int padding = (int)(height*PADDING_RATIO);
|
51
|
|
52
|
LinearLayout configLayout = act.findViewById(R.id.configLayout);
|
53
|
configLayout.setPadding(padding,padding,padding,padding);
|
54
|
|
55
|
LinearLayout.LayoutParams paramsLayout = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 1.00f);
|
56
|
paramsLayout.bottomMargin = padding;
|
57
|
paramsLayout.topMargin = 0;
|
58
|
paramsLayout.leftMargin = padding;
|
59
|
paramsLayout.rightMargin = padding;
|
60
|
|
61
|
configLayout.setLayoutParams(paramsLayout);
|
62
|
|
63
|
TextView textStickers = configLayout.findViewById(R.id.configTextStickers);
|
64
|
textStickers.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
65
|
}
|
66
|
}
|