Project

General

Profile

« Previous | Next » 

Revision 42803ba0

Added by Leszek Koltunski over 4 years ago

Introduce three sizes of UI images: small, medium, large.

View differences:

src/main/java/org/distorted/dialogs/RubikDialogEffects.java
177 177
    Spinner spinner = new Spinner(act);
178 178
    spinner.setLayoutParams(spinnerLayoutParams);
179 179
    spinner.setPadding(spinnerPadding,0,spinnerPadding,0);
180
    spinner.setBackgroundResource(R.drawable.spinner);
180
    spinner.setBackgroundResource(R.drawable.ui_small_spinner);
181 181
    spinner.setTextAlignment(View.TEXT_ALIGNMENT_TEXT_START);
182 182
    spinner.setId(index+BaseEffect.Type.LENGTH);
183 183
    innerLayout2.addView(spinner);
src/main/java/org/distorted/objects/RubikCube.java
105 105
    }
106 106

  
107 107
///////////////////////////////////////////////////////////////////////////////////////////////////
108
// paint the square with upper-right cornder at (left,top) and side length 'side' with texture
108
// paint the square with upper-right corner at (left,top) and side length 'side' with texture
109 109
// for face 'face'.
110 110

  
111 111
  void createFaceTexture(Canvas canvas, Paint paint, int face, int left, int top, int side)
src/main/java/org/distorted/objects/RubikObjectList.java
35 35
  {
36 36
  CUBE (
37 37
         new int[][] {
38
                       {2 , 12, R.drawable.cube2, R.raw.cube2} ,
39
                       {3 , 16, R.drawable.cube3, R.raw.cube3} ,
40
                       {4 , 20, R.drawable.cube4, R.raw.cube4} ,
41
                       {5 , 24, R.drawable.cube5, R.raw.cube5}
38
                       {2 , 12, R.drawable.ui_small_cube2, R.raw.cube2} ,
39
                       {3 , 16, R.drawable.ui_small_cube3, R.raw.cube3} ,
40
                       {4 , 20, R.drawable.ui_small_cube4, R.raw.cube4} ,
41
                       {5 , 24, R.drawable.ui_small_cube5, R.raw.cube5}
42 42
                     },
43 43
         RubikCube.class,
44 44
         new RubikCubeMovement()
......
46 46

  
47 47
  PYRA (
48 48
         new int[][] {
49
                       {3 , 10, R.drawable.pyra3, R.raw.pyra3} ,
50
                       {4 , 15, R.drawable.pyra4, R.raw.pyra4} ,
51
                       {5 , 20, R.drawable.pyra5, R.raw.pyra5}
49
                       {3 , 10, R.drawable.ui_small_pyra3, R.raw.pyra3} ,
50
                       {4 , 15, R.drawable.ui_small_pyra4, R.raw.pyra4} ,
51
                       {5 , 20, R.drawable.ui_small_pyra5, R.raw.pyra5}
52 52
                     },
53 53
         RubikPyraminx.class,
54 54
         new RubikPyraminxMovement()
src/main/java/org/distorted/states/RubikStatePattern.java
213 213
    mPrevButton = new ImageButton(act);
214 214
    mPrevButton.setLayoutParams(params);
215 215
    mPrevButton.setPadding(padding,0,padding,0);
216
    mPrevButton.setImageResource(R.drawable.left);
216
    mPrevButton.setImageResource(R.drawable.ui_small_left);
217 217

  
218 218
    mPrevButton.setOnClickListener( new View.OnClickListener()
219 219
      {
......
245 245
    mNextButton = new ImageButton(act);
246 246
    mNextButton.setLayoutParams(params);
247 247
    mNextButton.setPadding(padding,0,padding,0);
248
    mNextButton.setImageResource(R.drawable.right);
248
    mNextButton.setImageResource(R.drawable.ui_small_right);
249 249

  
250 250
    mNextButton.setOnClickListener( new View.OnClickListener()
251 251
      {
src/main/java/org/distorted/states/RubikStatePlay.java
163 163
    mObjButton = new ImageButton(act);
164 164
    mObjButton.setLayoutParams(params);
165 165
    mObjButton.setPadding(padding,0,padding,0);
166
    mObjButton.setImageResource(R.drawable.cube_menu);
166
    mObjButton.setImageResource(R.drawable.ui_small_cube_menu);
167 167

  
168 168
    mObjButton.setOnClickListener( new View.OnClickListener()
169 169
      {
......
206 206
    mLevelSpinner = new AppCompatSpinner(act);
207 207
    mLevelSpinner.setLayoutParams(params);
208 208
    mLevelSpinner.setPadding(padding,0,padding,0);
209
    mLevelSpinner.setBackgroundResource(R.drawable.spinner);
209
    mLevelSpinner.setBackgroundResource(R.drawable.ui_small_spinner);
210 210
    mLevelSpinner.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
211 211

  
212 212
    mLevelSpinner.setOnItemSelectedListener(this);
......
281 281
    mMenuButton = new ImageButton(act);
282 282
    mMenuButton.setLayoutParams(params);
283 283
    mMenuButton.setPadding(padding,0,padding,0);
284
    mMenuButton.setImageResource(R.drawable.menu);
284
    mMenuButton.setImageResource(R.drawable.ui_small_menu);
285 285

  
286 286
    final int barHeight = act.getScreenHeightInPixels()/10;
287 287

  
......
315 315
    mSolveButton = new ImageButton(act);
316 316
    mSolveButton.setLayoutParams(params);
317 317
    mSolveButton.setPadding(padding,0,padding,0);
318
    mSolveButton.setImageResource(R.drawable.cube_solve);
318
    mSolveButton.setImageResource(R.drawable.ui_small_cube_solve);
319 319

  
320 320
    mSolveButton.setOnClickListener( new View.OnClickListener()
321 321
      {
......
344 344
    mPrevButton = new ImageButton(act);
345 345
    mPrevButton.setLayoutParams(params);
346 346
    mPrevButton.setPadding(padding,0,padding,0);
347
    mPrevButton.setImageResource(R.drawable.cube_back);
347
    mPrevButton.setImageResource(R.drawable.ui_small_cube_back);
348 348

  
349 349
    mPrevButton.setOnClickListener( new View.OnClickListener()
350 350
      {
......
370 370
    mObjectPopup.setFocusable(true);
371 371
    int margin = (int)(width*RubikActivity.PADDING);
372 372

  
373
    BitmapDrawable bd = (BitmapDrawable) act.getResources().getDrawable(R.drawable.cube2);
373
    BitmapDrawable bd = (BitmapDrawable) act.getResources().getDrawable(R.drawable.ui_small_cube2);
374 374
    int cubeWidth  = bd.getIntrinsicWidth();
375 375
    mObjectLayoutWidth = (int)(cubeWidth + 2*margin + 0.5f);
376 376

  
src/main/java/org/distorted/states/RubikStateReady.java
109 109
    mPrevButton = new ImageButton(act);
110 110
    mPrevButton.setLayoutParams(params);
111 111
    mPrevButton.setPadding(padding,0,padding,0);
112
    mPrevButton.setImageResource(R.drawable.cube_back);
112
    mPrevButton.setImageResource(R.drawable.ui_small_cube_back);
113 113

  
114 114
    mPrevButton.setOnClickListener( new View.OnClickListener()
115 115
      {
src/main/java/org/distorted/states/RubikStateSolution.java
109 109
    mPrevButton = new ImageButton(act);
110 110
    mPrevButton.setLayoutParams(params);
111 111
    mPrevButton.setPadding(padding,0,padding,0);
112
    mPrevButton.setImageResource(R.drawable.left);
112
    mPrevButton.setImageResource(R.drawable.ui_small_left);
113 113

  
114 114
    mPrevButton.setOnClickListener( new View.OnClickListener()
115 115
      {
......
138 138
    mNextButton = new ImageButton(act);
139 139
    mNextButton.setLayoutParams(params);
140 140
    mNextButton.setPadding(padding,0,padding,0);
141
    mNextButton.setImageResource(R.drawable.right);
141
    mNextButton.setImageResource(R.drawable.ui_small_right);
142 142

  
143 143
    mNextButton.setOnClickListener( new View.OnClickListener()
144 144
      {
src/main/java/org/distorted/states/RubikStateSolving.java
160 160
    mPrevButton = new ImageButton(act);
161 161
    mPrevButton.setLayoutParams(params);
162 162
    mPrevButton.setPadding(padding,0,padding,0);
163
    mPrevButton.setImageResource(R.drawable.cube_back);
163
    mPrevButton.setImageResource(R.drawable.ui_small_cube_back);
164 164

  
165 165
    mPrevButton.setOnClickListener( new View.OnClickListener()
166 166
      {
src/main/res/drawable/spinner.xml
1
<?xml version="1.0" encoding="utf-8"?>
2
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3
    <item>
4
        <layer-list>
5
            <item>
6
                <shape android:shape="rectangle">
7
                    <solid android:color="@color/light_grey" />
8
                    <corners android:radius="6dip" />
9
                    <stroke
10
                        android:color="@color/grey"
11
                        android:width="2dp"/>
12
                </shape>
13
            </item>
14
            <item >
15
                <bitmap android:gravity="center_vertical|right" android:src="@drawable/spinner_arrow"/>
16
            </item>
17
        </layer-list>
18
    </item>
19
</selector>
src/main/res/drawable/ui_big_spinner.xml
1
<?xml version="1.0" encoding="utf-8"?>
2
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3
    <item>
4
        <layer-list>
5
            <item>
6
                <shape android:shape="rectangle">
7
                    <solid android:color="@color/light_grey" />
8
                    <corners android:radius="6dip" />
9
                    <stroke
10
                        android:color="@color/grey"
11
                        android:width="2dp"/>
12
                </shape>
13
            </item>
14
            <item >
15
                <bitmap android:gravity="center_vertical|right" android:src="@drawable/ui_big_down"/>
16
            </item>
17
        </layer-list>
18
    </item>
19
</selector>
src/main/res/drawable/ui_medium_spinner.xml
1
<?xml version="1.0" encoding="utf-8"?>
2
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3
    <item>
4
        <layer-list>
5
            <item>
6
                <shape android:shape="rectangle">
7
                    <solid android:color="@color/light_grey" />
8
                    <corners android:radius="6dip" />
9
                    <stroke
10
                        android:color="@color/grey"
11
                        android:width="2dp"/>
12
                </shape>
13
            </item>
14
            <item >
15
                <bitmap android:gravity="center_vertical|right" android:src="@drawable/ui_medium_down"/>
16
            </item>
17
        </layer-list>
18
    </item>
19
</selector>
src/main/res/drawable/ui_small_spinner.xml
1
<?xml version="1.0" encoding="utf-8"?>
2
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3
    <item>
4
        <layer-list>
5
            <item>
6
                <shape android:shape="rectangle">
7
                    <solid android:color="@color/light_grey" />
8
                    <corners android:radius="6dip" />
9
                    <stroke
10
                        android:color="@color/grey"
11
                        android:width="2dp"/>
12
                </shape>
13
            </item>
14
            <item >
15
                <bitmap android:gravity="center_vertical|right" android:src="@drawable/ui_small_down"/>
16
            </item>
17
        </layer-list>
18
    </item>
19
</selector>
src/main/res/layout/dialog_pattern_tab.xml
7 7

  
8 8
    <Spinner
9 9
        android:id="@+id/pattern_category_spinner"
10
        android:background="@drawable/spinner"
10
        android:background="@drawable/ui_small_spinner"
11 11
        android:layout_marginLeft="20dp"
12 12
        android:layout_marginRight="20dp"
13 13
        android:layout_marginTop="10dp"

Also available in: Unified diff