Revision 94ff5962
Added by Leszek Koltunski 2 months ago
src/main/java/org/distorted/config/ConfigScreenPane.java | ||
---|---|---|
26 | 26 |
public static final float[] BORDER_STEPS = { 0.50f, 0.75f, 1.00f, 1.50f, 2.00f }; |
27 | 27 |
public static final float[] CORNER_STEPS = { 0.00f, 0.50f, 1.00f, 1.50f, 2.00f }; |
28 | 28 |
|
29 |
private static final float PADDING_RATIO = 0.016f;
|
|
29 |
private static final float PADDING_RATIO = 0.010f;
|
|
30 | 30 |
private static final float TEXT_RATIO = 0.025f; |
31 | 31 |
|
32 | 32 |
private final SeekBar mSeekBarBorders, mSeekBarCorners; |
... | ... | |
55 | 55 |
float textSize = height*TEXT_RATIO; |
56 | 56 |
int padding = (int)(height*PADDING_RATIO); |
57 | 57 |
|
58 |
LinearLayout configLayout = act.findViewById(R.id.configLayout); |
|
59 |
configLayout.setPadding(padding,padding,padding,padding); |
|
58 |
///// UPPER LAYOUT ///////////////////////////////// |
|
59 |
LinearLayout configLayoutU = act.findViewById(R.id.configLayoutUpper); |
|
60 |
configLayoutU.setPadding(padding,padding,padding,padding); |
|
60 | 61 |
|
61 |
LinearLayout.LayoutParams paramsLayout = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0, 1.00f);
|
|
62 |
paramsLayout.bottomMargin = padding; |
|
63 |
paramsLayout.topMargin = 0; |
|
64 |
paramsLayout.leftMargin = padding; |
|
65 |
paramsLayout.rightMargin = padding; |
|
62 |
LinearLayout.LayoutParams paramsLayoutU = (LinearLayout.LayoutParams)configLayoutU.getLayoutParams();
|
|
63 |
paramsLayoutU.bottomMargin = padding;
|
|
64 |
paramsLayoutU.topMargin = 0;
|
|
65 |
paramsLayoutU.leftMargin = padding;
|
|
66 |
paramsLayoutU.rightMargin = padding;
|
|
66 | 67 |
|
67 |
configLayout.setLayoutParams(paramsLayout);
|
|
68 |
configLayoutU.setLayoutParams(paramsLayoutU);
|
|
68 | 69 |
|
69 |
TextView textStickers = configLayout.findViewById(R.id.configTextStickers); |
|
70 |
textStickers.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); |
|
71 |
TextView textBorder = configLayout.findViewById(R.id.configTextBorder); |
|
70 |
TextView textBorder = configLayoutU.findViewById(R.id.configTextBorder); |
|
72 | 71 |
textBorder.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); |
73 |
TextView textCorner = configLayout.findViewById(R.id.configTextCorner); |
|
72 |
TextView textCorner = configLayoutU.findViewById(R.id.configTextCorner);
|
|
74 | 73 |
textCorner.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); |
75 | 74 |
|
76 |
mSeekBarBorders = configLayout.findViewById(R.id.configSeekBarBorder); |
|
75 |
mSeekBarBorders = configLayoutU.findViewById(R.id.configSeekBarBorder);
|
|
77 | 76 |
mCurrentBorders = mSeekBarBorders.getProgress(); |
78 | 77 |
|
79 | 78 |
mSeekBarBorders.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() |
... | ... | |
94 | 93 |
} |
95 | 94 |
}); |
96 | 95 |
|
97 |
mSeekBarCorners = configLayout.findViewById(R.id.configSeekBarCorner); |
|
96 |
mSeekBarCorners = configLayoutU.findViewById(R.id.configSeekBarCorner);
|
|
98 | 97 |
mCurrentCorners = mSeekBarCorners.getProgress(); |
99 | 98 |
|
100 | 99 |
mSeekBarCorners.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() |
... | ... | |
113 | 112 |
act.recreateStickers(mCurrentBorders,mCurrentCorners); |
114 | 113 |
} |
115 | 114 |
}); |
115 |
|
|
116 |
///// LOWER LAYOUT ///////////////////////////////// |
|
117 |
LinearLayout configLayoutL = act.findViewById(R.id.configLayoutLower); |
|
118 |
configLayoutL.setPadding(padding,padding,padding,padding); |
|
119 |
|
|
120 |
LinearLayout.LayoutParams paramsLayoutL = (LinearLayout.LayoutParams)configLayoutL.getLayoutParams(); |
|
121 |
paramsLayoutL.bottomMargin = padding; |
|
122 |
paramsLayoutL.topMargin = 0; |
|
123 |
paramsLayoutL.leftMargin = padding; |
|
124 |
paramsLayoutL.rightMargin = padding; |
|
125 |
|
|
126 |
configLayoutL.setLayoutParams(paramsLayoutL); |
|
116 | 127 |
} |
117 | 128 |
} |
Also available in: Unified diff
progress with configurable stickers