Project

General

Profile

« Previous | Next » 

Revision 0094886e

Added by Leszek Koltunski about 5 years ago

Rubk App: changes in the UI

View differences:

src/main/java/org/distorted/examples/rubik/RubikActivity.java
75 75
      android.util.Log.e("rubik", "scrambling...");
76 76
      }
77 77

  
78
///////////////////////////////////////////////////////////////////////////////////////////////////
79

  
80
    public void Credits(View v)
81
      {
82
      android.util.Log.e("rubik", "credits...");
83
      }
84

  
78 85
///////////////////////////////////////////////////////////////////////////////////////////////////
79 86

  
80 87
    public void setSize(View v)
81 88
      {
82
      android.util.Log.e("rubik", "setting size...");
89
      int size=0,id = v.getId();
90

  
91
      switch(id)
92
        {
93
        case R.id.rubikSize2: size=2; break;
94
        case R.id.rubikSize3: size=3; break;
95
        case R.id.rubikSize4: size=4; break;
96
        }
97

  
98
      android.util.Log.e("rubik", "setting size to "+size);
83 99
      }
84 100
}
src/main/res/layout/rubiklayout.xml
8 8
        android:id="@+id/linearLayout"
9 9
        android:layout_width="fill_parent"
10 10
        android:layout_height="wrap_content"
11
        android:gravity="center|fill_horizontal"
12
        android:paddingBottom="10dp"
13
        android:paddingTop="10dp" >
11
        android:gravity="center|fill_horizontal" >
12

  
13
         <Button
14
            android:id="@+id/rubikCredits"
15
            android:layout_width="wrap_content"
16
            android:layout_height="64dp"
17
            android:layout_weight="0.5"
18
            android:onClick="Credits"
19
            android:paddingLeft="5dp"
20
            android:paddingRight="5dp"
21
            android:text="@string/credits" />
14 22

  
15 23
        <ImageButton
16 24
            android:id="@+id/rubikSize2"
17
            android:layout_width="wrap_content"
25
            android:layout_width="64dp"
18 26
            android:layout_height="wrap_content"
19
            android:layout_marginLeft="2dp"
20
            android:layout_marginRight="2dp"
21
            android:layout_weight="0.17"
22 27
            android:onClick="setSize"
23 28
            android:paddingLeft="5dp"
24 29
            android:paddingRight="5dp"
25
            android:src="@drawable/button_rubik2"/>
30
            android:src="@raw/button_rubik2"/>
26 31

  
27 32
        <ImageButton
28 33
            android:id="@+id/rubikSize3"
29
            android:layout_width="wrap_content"
34
            android:layout_width="64dp"
30 35
            android:layout_height="wrap_content"
31
            android:layout_marginLeft="2dp"
32
            android:layout_marginRight="2dp"
33
            android:layout_weight="0.17"
34 36
            android:onClick="setSize"
35 37
            android:paddingLeft="5dp"
36 38
            android:paddingRight="5dp"
37
            android:src="@drawable/button_rubik3"/>
39
            android:src="@raw/button_rubik3"/>
38 40

  
39 41
        <ImageButton
40 42
            android:id="@+id/rubikSize4"
41
            android:layout_width="54dp"
43
            android:layout_width="64dp"
42 44
            android:layout_height="wrap_content"
43
            android:layout_marginLeft="2dp"
44
            android:layout_marginRight="2dp"
45
            android:layout_weight="0.17"
46 45
            android:onClick="setSize"
47 46
            android:paddingLeft="5dp"
48 47
            android:paddingRight="5dp"
49
            android:src="@drawable/button_rubik4"/>
48
            android:src="@raw/button_rubik4"/>
50 49

  
51 50
        <Button
52 51
            android:id="@+id/rubikScramble"
53 52
            android:layout_width="wrap_content"
54
            android:layout_height="wrap_content"
55
            android:layout_marginLeft="2dp"
56
            android:layout_marginRight="2dp"
57
            android:layout_weight="0.17"
53
            android:layout_height="64dp"
54
            android:layout_weight="0.5"
58 55
            android:onClick="Scramble"
59 56
            android:paddingLeft="5dp"
60 57
            android:paddingRight="5dp"
src/main/res/values/strings.xml
81 81
    <string name="effect_live">LIVE </string>
82 82
    <string name="effect_finished">FINISHED </string>
83 83
    <string name="scramble">Scramble</string>
84
    <string name="credits">Credits</string>
84 85

  
85 86
    <string name="quality0">Highest</string>
86 87
    <string name="quality1">High</string>

Also available in: Unified diff