Project

General

Profile

« Previous | Next » 

Revision 2456eaa0

Added by Leszek Koltunski 7 months ago

Improve the spinners; more themes.

View differences:

src/main/java/org/distorted/helpers/BaseActivity.java
30 30
public class BaseActivity extends AppCompatActivity
31 31
{
32 32
    protected static final int THEME_GREY  = 0;
33
    protected static final int THEME_WHITE = 1;
33
    protected static final int THEME_BLUE  = 1;
34 34
    protected static final int THEME_GREEN = 2;
35
    protected static final int THEME_PINK  = 3;
36
    protected static final int THEME_ORANGE= 4;
35 37

  
36 38
    public static final float RATIO_BAR = 0.080f;
37 39
    public static final int FLAGS =  View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
......
61 63

  
62 64
      switch(mCurrentTheme)
63 65
        {
64
        case THEME_WHITE : setTheme(R.style.WhiteTheme);
65
                           mVeryDarkC= R.color.veryDarkWhite;
66
                           mDarkC    = R.color.darkWhite;
67
                           mNormalC  = R.color.normalWhite;
68
                           mMediumC  = R.color.mediumWhite;
69
                           mLightC   = R.color.lightWhite;
70
                           mPassedC  = R.color.passedWhite;
71
                           mDarkT    = R.color.transDWhite;
72
                           mLightT   = R.color.transLWhite;
73
                           mSelectC  = R.color.selectWhite;
66
        case THEME_BLUE  : setTheme(R.style.BlueTheme);
67
                           mVeryDarkC= R.color.veryDarkBlue;
68
                           mDarkC    = R.color.darkBlue;
69
                           mNormalC  = R.color.normalBlue;
70
                           mMediumC  = R.color.mediumBlue;
71
                           mLightC   = R.color.lightBlue;
72
                           mPassedC  = R.color.passedBlue;
73
                           mDarkT    = R.color.transDBlue;
74
                           mLightT   = R.color.transLBlue;
75
                           mSelectC  = R.color.selectBlue;
74 76
                           break;
75 77
        case THEME_GREEN : setTheme(R.style.GreenTheme);
76 78
                           mVeryDarkC= R.color.veryDarkGreen;
......
83 85
                           mLightT   = R.color.transLGreen;
84 86
                           mSelectC  = R.color.selectGreen;
85 87
                           break;
86
        default          : setTheme(R.style.GreyTheme);
88
        case THEME_GREY  : setTheme(R.style.GreyTheme);
87 89
                           mVeryDarkC= R.color.veryDarkGrey;
88 90
                           mDarkC    = R.color.darkGrey;
89 91
                           mNormalC  = R.color.normalGrey;
......
93 95
                           mDarkT    = R.color.transDGrey;
94 96
                           mLightT   = R.color.transLGrey;
95 97
                           mSelectC  = R.color.selectGrey;
96
            break;
98
                           break;
99
        case THEME_PINK  : setTheme(R.style.PinkTheme);
100
                           mVeryDarkC= R.color.veryDarkPink;
101
                           mDarkC    = R.color.darkPink;
102
                           mNormalC  = R.color.normalPink;
103
                           mMediumC  = R.color.mediumPink;
104
                           mLightC   = R.color.lightPink;
105
                           mPassedC  = R.color.passedPink;
106
                           mDarkT    = R.color.transDPink;
107
                           mLightT   = R.color.transLPink;
108
                           mSelectC  = R.color.selectPink;
109
                           break;
110
        case THEME_ORANGE: setTheme(R.style.OrangeTheme);
111
                           mVeryDarkC= R.color.veryDarkOrange;
112
                           mDarkC    = R.color.darkOrange;
113
                           mNormalC  = R.color.normalOrange;
114
                           mMediumC  = R.color.mediumOrange;
115
                           mLightC   = R.color.lightOrange;
116
                           mPassedC  = R.color.passedOrange;
117
                           mDarkT    = R.color.transDOrange;
118
                           mLightT   = R.color.transLOrange;
119
                           mSelectC  = R.color.selectOrange;
120
                           break;
121
        default          : android.util.Log.e("D", "UNSUPPORTED THEME!");
97 122
        }
98 123

  
99 124
      super.onCreate(savedState);
src/main/java/org/distorted/main/MainSettingsPopup.java
154 154
  private void buildThemeOptions(MainActivity act)
155 155
    {
156 156
    Resources res = act.getResources();
157
    mThemeNames = new String[3];
157
    mThemeNames = new String[5];
158 158

  
159 159
    mThemeNames[0] = res.getString(R.string.theme_grey);
160
    mThemeNames[1] = res.getString(R.string.theme_white);
160
    mThemeNames[1] = res.getString(R.string.theme_blue);
161 161
    mThemeNames[2] = res.getString(R.string.theme_green);
162
    mThemeNames[3] = res.getString(R.string.theme_pink);
163
    mThemeNames[4] = res.getString(R.string.theme_orange);
162 164
    }
163 165

  
164 166
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/res/drawable/ui_spinner.xml
1 1
<?xml version="1.0" encoding="utf-8"?>
2
<selector xmlns:android="http://schemas.android.com/apk/res/android">
2
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3 3
    <item>
4
        <shape android:shape="rectangle">
5
            <solid android:color="?darkC"/>
6
            <corners android:radius="0dp" />
7
        </shape>
8
    </item>
9
    <item android:gravity="center_vertical|right" android:right="8dp">
4 10
        <layer-list>
5
            <item>
11
            <item android:width="12dp" android:height="12dp"  android:gravity="center" android:bottom="10dp">
12
                <rotate
13
                    android:fromDegrees="45"
14
                    android:toDegrees="45">
15
                    <shape android:shape="rectangle">
16
                        <solid android:color="#ffffff" />
17
                        <stroke android:color="#ffffff" android:width="1dp"/>
18
                    </shape>
19
                </rotate>
20
            </item>
21
            <item android:width="20dp" android:height="10dp" android:bottom="21dp" android:gravity="center">
6 22
                <shape android:shape="rectangle">
7
                    <solid android:color="?lightC" />
8
                    <corners android:radius="6dp" />
9
                    <stroke
10
                        android:color="?normalC"
11
                        android:width="2dp"/>
23
                    <solid android:color="?darkC"/>
12 24
                </shape>
13 25
            </item>
14
            <item >
15
                <bitmap android:gravity="center_vertical|right" android:src="@drawable/ui_down"/>
16
            </item>
17 26
        </layer-list>
18 27
    </item>
19
</selector>
28
</layer-list>
src/main/res/layout/bandaged.xml
52 52
               android:layout_width="0dp"
53 53
               android:layout_height="match_parent"
54 54
               android:layout_weight="1.0"
55
               android:textAlignment="center"/>
55
               android:background="@drawable/ui_spinner"
56
               android:popupBackground="?darkC"/>
56 57
           <Spinner
57 58
               android:id="@+id/bandagedCreatorY"
58 59
               android:layout_width="0dp"
59 60
               android:layout_height="match_parent"
60 61
               android:layout_weight="1.0"
61
               android:textAlignment="center"/>
62
               android:background="@drawable/ui_spinner"
63
               android:popupBackground="?darkC"/>
62 64
           <Spinner
63 65
               android:id="@+id/bandagedCreatorZ"
64 66
               android:layout_width="0dp"
65 67
               android:layout_height="match_parent"
66 68
               android:layout_weight="1.0"
67
               android:textAlignment="center"/>
69
               android:background="@drawable/ui_spinner"
70
               android:popupBackground="?darkC"/>
68 71
       </LinearLayout>
69 72

  
70 73
       <LinearLayout
src/main/res/layout/settings_popup.xml
40 40
            android:layout_marginEnd="10dp"
41 41
            android:layout_marginTop="10dp"
42 42
            android:layout_marginBottom="10dp"
43
            android:gravity="start|center_vertical"/>
43
            android:popupBackground="?darkC"/>
44 44

  
45 45
        <TextView
46 46
            android:id="@+id/themeText"
......
62 62
            android:layout_marginEnd="10dp"
63 63
            android:layout_marginTop="10dp"
64 64
            android:layout_marginBottom="10dp"
65
            android:gravity="start|center_vertical"/>
65
            android:popupBackground="?darkC"/>
66 66

  
67 67
   </GridLayout>
68 68
</LinearLayout>
src/main/res/layout/spinner_item.xml
5 5
    android:layout_width="match_parent"
6 6
    android:layout_height="wrap_content"
7 7
    android:textSize="30sp"
8
    android:gravity="center"
8
    android:gravity="start"
9 9
    android:textColor="@color/white"
10
    android:background="?veryDarkC"
11 10
    android:padding="5dp"
12 11
    />
src/main/res/values-de/strings.xml
95 95
    <string name="solver_message">Richte eine verschlüsselte Position ein, indem du die Sticker berührst.</string>
96 96

  
97 97
    <string name="theme">Thema</string>
98
    <string name="theme_white">Weiß</string>
98
    <string name="theme_blue">Blau</string>
99 99
    <string name="theme_grey">Grau</string>
100 100
    <string name="theme_green">Grün</string>
101
    <string name="theme_pink">Rosa</string>
102
    <string name="theme_orange">Orange</string>
101 103

  
102 104
    <string name="sort_classic">Klassisch</string>
103 105
    <string name="sort_shape">Form</string>
src/main/res/values-es/strings.xml
95 95
    <string name="solver_message">Establece la posición de revuelto tocando las pegatinas.</string>
96 96

  
97 97
    <string name="theme">Tema</string>
98
    <string name="theme_white">Blanco</string>
98
    <string name="theme_blue">Azul</string>
99 99
    <string name="theme_grey">Gris</string>
100 100
    <string name="theme_green">Verde</string>
101
    <string name="theme_pink">Rosa</string>
102
    <string name="theme_orange">Naranja</string>
101 103

  
102 104
    <string name="sort_classic">Clásico</string>
103 105
    <string name="sort_shape">Forma</string>
src/main/res/values-fr/strings.xml
95 95
    <string name="solver_message">Mettre en place une position brouillée en touchant les autocollants.</string>
96 96

  
97 97
    <string name="theme">Thème</string>
98
    <string name="theme_white">Blanc</string>
98
    <string name="theme_blue">Bleu</string>
99 99
    <string name="theme_grey">Gris</string>
100 100
    <string name="theme_green">Vert</string>
101
    <string name="theme_pink">Rose</string>
102
    <string name="theme_orange">Orange</string>
101 103

  
102 104
    <string name="sort_classic">Classique</string>
103 105
    <string name="sort_shape">Forme</string>
src/main/res/values-ja/strings.xml
95 95
    <string name="solver_message">シールをタッチして、スクランブルポジションを設定します。</string>
96 96

  
97 97
    <string name="theme">テーマ</string>
98
    <string name="theme_white">ホワイト</string>
98
    <string name="theme_blue">ブルー</string>
99 99
    <string name="theme_grey">グレー</string>
100 100
    <string name="theme_green">グリーン</string>
101
    <string name="theme_pink">ピンク</string>
102
    <string name="theme_orange">オレンジ</string>
101 103

  
102 104
    <string name="sort_classic">古典学</string>
103 105
    <string name="sort_shape">形</string>
src/main/res/values-ko/strings.xml
95 95
    <string name="solver_message">스티커를 터치하여 스크램블 위치를 설정합니다.</string>
96 96

  
97 97
    <string name="theme">테마</string>
98
    <string name="theme_white">흰색</string>
98
    <string name="theme_blue">파란색</string>
99 99
    <string name="theme_grey">회색</string>
100 100
    <string name="theme_green">녹색</string>
101
    <string name="theme_pink">분홍색</string>
102
    <string name="theme_orange">주황색</string>
101 103

  
102 104
    <string name="sort_classic">전통적인</string>
103 105
    <string name="sort_shape">모양</string>
src/main/res/values-pl/strings.xml
95 95
    <string name="solver_message">Dotknij naklejki żeby zmienić jej kolor i tym samym ustawić pozycję początkową.</string>
96 96

  
97 97
    <string name="theme">Styl</string>
98
    <string name="theme_white">Bialy</string>
98
    <string name="theme_blue">Niebieski</string>
99 99
    <string name="theme_grey">Szary</string>
100 100
    <string name="theme_green">Zielony</string>
101
    <string name="theme_pink">Różowy</string>
102
    <string name="theme_orange">Żółty</string>
101 103

  
102 104
    <string name="sort_classic">Klasycznie</string>
103 105
    <string name="sort_shape">Kształt</string>
src/main/res/values-ru/strings.xml
95 95
    <string name="solver_message">Установите скремблированную позицию, касаясь наклеек.</string>
96 96

  
97 97
    <string name="theme">Тема</string>
98
    <string name="theme_white">Белый</string>
98
    <string name="theme_blue">Синий</string>
99 99
    <string name="theme_grey">Серый</string>
100 100
    <string name="theme_green">Зеленый</string>
101
    <string name="theme_pink">Розовый</string>
102
    <string name="theme_orange">Апельсин</string>
101 103

  
102 104
    <string name="sort_classic">Классик</string>
103 105
    <string name="sort_shape">Форма</string>
src/main/res/values-zh-rCN/strings.xml
95 95
    <string name="solver_message">通过触摸贴纸来设置拼图位置。</string>
96 96

  
97 97
    <string name="theme">主题</string>
98
    <string name="theme_white">白色</string>
98
    <string name="theme_blue">蓝色</string>
99 99
    <string name="theme_grey">灰色</string>
100 100
    <string name="theme_green">绿色</string>
101
    <string name="theme_pink">粉色</string>
102
    <string name="theme_orange">橙色</string>
101 103

  
102 104
    <string name="sort_classic">經典的</string>
103 105
    <string name="sort_shape">形狀</string>
src/main/res/values-zh-rTW/strings.xml
95 95
    <string name="solver_message">透過觸控貼紙設定打亂位置。</string>
96 96

  
97 97
    <string name="theme">主題</string>
98
    <string name="theme_white">白色的</string>
98
    <string name="theme_blue">藍色的</string>
99 99
    <string name="theme_grey">灰色的</string>
100 100
    <string name="theme_green">綠色的</string>
101
    <string name="theme_pink">粉紅色的</string>
102
    <string name="theme_orange">橘色的</string>
101 103

  
102 104
    <string name="sort_classic">经典的</string>
103 105
    <string name="sort_shape">形状</string>
src/main/res/values/colors.xml
23 23
    <color name="transDGrey">#cc202020</color>
24 24
    <color name="selectGrey">#ffff0000</color>
25 25

  
26
    <color name="veryDarkWhite">#ff080808</color>
27
    <color name="darkWhite">#ffa0a0a0</color>
28
    <color name="normalWhite">#ffc0c0c0</color>
29
    <color name="mediumWhite">#ffe0e0e0</color>
30
    <color name="lightWhite">#ffffffff</color>
31
    <color name="passedWhite">#ff00a000</color>
32
    <color name="transLWhite">#ccffffff</color>
33
    <color name="transDWhite">#cca0a0a0</color>
34
    <color name="selectWhite">#ffff0000</color>
26
    <color name="veryDarkBlue">#ff000030</color>
27
    <color name="darkBlue">#ff000055</color>
28
    <color name="normalBlue">#ff000090</color>
29
    <color name="mediumBlue">#ff0000a5</color>
30
    <color name="lightBlue">#ff0000ff</color>
31
    <color name="passedBlue">#ff00a000</color>
32
    <color name="transLBlue">#cc000080</color>
33
    <color name="transDBlue">#cc000055</color>
34
    <color name="selectBlue">#ffff0000</color>
35

  
36
    <color name="veryDarkPink">#ffff1111</color>
37
    <color name="darkPink">#ffff4444</color>
38
    <color name="normalPink">#ffff6666</color>
39
    <color name="mediumPink">#ffff8888</color>
40
    <color name="lightPink">#ffffaaaa</color>
41
    <color name="passedPink">#ff00a000</color>
42
    <color name="transLPink">#ccff5555</color>
43
    <color name="transDPink">#ccff4444</color>
44
    <color name="selectPink">#ffff0000</color>
45

  
46
    <color name="veryDarkOrange">#ffff2008</color>
47
    <color name="darkOrange">#ffff5015</color>
48
    <color name="normalOrange">#ffff8025</color>
49
    <color name="mediumOrange">#ffffa040</color>
50
    <color name="lightOrange">#ffffd050</color>
51
    <color name="passedOrange">#ff00a000</color>
52
    <color name="transLOrange">#ccff6020</color>
53
    <color name="transDOrange">#ccff5015</color>
54
    <color name="selectOrange">#ffff0000</color>
35 55
</resources>
src/main/res/values/strings.xml
117 117
    <string name="solver_message">Set up scrambled position by touching the stickers.</string>
118 118

  
119 119
    <string name="theme">Theme</string>
120
    <string name="theme_white">White</string>
120
    <string name="theme_blue">Blue</string>
121 121
    <string name="theme_grey">Grey</string>
122 122
    <string name="theme_green">Green</string>
123
    <string name="theme_pink">Pink</string>
124
    <string name="theme_orange">Orange</string>
123 125

  
124 126
    <string name="sort_by">Sort by</string>
125 127
    <string name="settings_title">Settings</string>
src/main/res/values/styles.xml
22 22
        <item name="selectC">@color/selectGrey</item>
23 23
   </style>
24 24

  
25
   <style name="WhiteTheme" parent="@style/BaseMaterialThemeNoActionBar">
26
        <item name="veryDarkC">@color/veryDarkWhite</item>
27
        <item name="darkC">@color/darkWhite</item>
28
        <item name="normalC">@color/normalWhite</item>
29
        <item name="mediumC">@color/mediumWhite</item>
30
        <item name="lightC">@color/lightWhite</item>
31
        <item name="passedC">@color/passedWhite</item>
32
        <item name="selectC">@color/selectWhite</item>
25
   <style name="BlueTheme" parent="@style/BaseMaterialThemeNoActionBar">
26
        <item name="veryDarkC">@color/veryDarkBlue</item>
27
        <item name="darkC">@color/darkBlue</item>
28
        <item name="normalC">@color/normalBlue</item>
29
        <item name="mediumC">@color/mediumBlue</item>
30
        <item name="lightC">@color/lightBlue</item>
31
        <item name="passedC">@color/passedBlue</item>
32
        <item name="selectC">@color/selectBlue</item>
33 33
   </style>
34 34

  
35 35
   <style name="GreenTheme" parent="@style/BaseMaterialThemeNoActionBar">
......
42 42
        <item name="selectC">@color/selectGreen</item>
43 43
   </style>
44 44

  
45
   <style name="PinkTheme" parent="@style/BaseMaterialThemeNoActionBar">
46
        <item name="veryDarkC">@color/veryDarkPink</item>
47
        <item name="darkC">@color/darkPink</item>
48
        <item name="normalC">@color/normalPink</item>
49
        <item name="mediumC">@color/mediumPink</item>
50
        <item name="lightC">@color/lightPink</item>
51
        <item name="passedC">@color/passedPink</item>
52
        <item name="selectC">@color/selectPink</item>
53
   </style>
54

  
55
   <style name="OrangeTheme" parent="@style/BaseMaterialThemeNoActionBar">
56
        <item name="veryDarkC">@color/veryDarkOrange</item>
57
        <item name="darkC">@color/darkOrange</item>
58
        <item name="normalC">@color/normalOrange</item>
59
        <item name="mediumC">@color/mediumOrange</item>
60
        <item name="lightC">@color/lightOrange</item>
61
        <item name="passedC">@color/passedOrange</item>
62
        <item name="selectC">@color/selectOrange</item>
63
   </style>
64

  
45 65
   <style name="NegativeButtonStyle" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
46 66
      <item name="android:textColor">@color/white</item>
47 67
   </style>
......
51 71
   </style>
52 72

  
53 73
   <style name="ButtonStyleTextColor">
54
      <item name="colorOnPrimary">@color/normalWhite</item>
74
      <item name="colorOnPrimary">@color/white</item>
55 75
      <item name="colorOnSecondary">@color/darkGrey</item>
56 76
      <item name="colorOnSurface">@color/lightGrey</item>
57 77
   </style>

Also available in: Unified diff