Skip to content

Commit b04c378

Browse files
committed
Rewrote Settings
1 parent a7195d6 commit b04c378

File tree

2 files changed

+42
-21
lines changed

2 files changed

+42
-21
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.phikal.regex.Adapters;
2+
3+
import android.content.Context;
4+
import android.support.annotation.NonNull;
5+
import android.support.annotation.Nullable;
6+
import android.view.View;
7+
import android.view.ViewGroup;
8+
import android.widget.ArrayAdapter;
9+
import android.widget.TextView;
10+
11+
import com.phikal.regex.Games.Games;
12+
13+
import java.util.Arrays;
14+
15+
public class GameAdaptor extends ArrayAdapter<Games> {
16+
17+
public GameAdaptor(@NonNull Context context) {
18+
super(context, 0, Arrays.asList(Games.values()));
19+
}
20+
21+
@NonNull
22+
@Override
23+
public View getView(int pos, @Nullable View v, @NonNull ViewGroup p) {
24+
if (v != null)
25+
return v;
26+
27+
TextView tv = new TextView(getContext());
28+
tv.setText(getItem(pos).getName());
29+
return tv;
30+
}
31+
}

app/src/main/res/layout/activity_settings.xml

+11-21
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
android:layout_width="match_parent"
44
android:layout_height="match_parent"
55
android:background="@color/dark_comment"
6-
android:minWidth="@dimen/minstd">
6+
android:minWidth="@dimen/std">
77

88
<LinearLayout
99
android:layout_width="match_parent"
@@ -26,19 +26,6 @@
2626

2727
</LinearLayout>
2828

29-
30-
<LinearLayout style="@style/OptionItem">
31-
32-
<TextView
33-
style="@style/OptionName"
34-
android:text="@string/score" />
35-
36-
<TextView
37-
android:id="@+id/score"
38-
style="@style/OptionValue" />
39-
40-
</LinearLayout>
41-
4229
<LinearLayout style="@style/OptionItem">
4330

4431
<TextView
@@ -58,14 +45,15 @@
5845
<LinearLayout style="@style/OptionItem">
5946

6047
<Button
61-
android:id="@+id/clear"
48+
android:id="@+id/reset"
6249
style="@style/OptionButton"
6350
android:text="@string/clear" />
6451

6552
</LinearLayout>
6653

6754
<LinearLayout style="@style/OptionItem">
6855

56+
<!-- text programmatically set -->
6957
<Button
7058
android:id="@+id/charm"
7159
style="@style/OptionButton" />
@@ -74,24 +62,26 @@
7462

7563
<LinearLayout style="@style/OptionItem">
7664

65+
<!-- text programmatically set -->
7766
<Button
7867
android:id="@+id/notif"
7968
style="@style/OptionButton" />
8069

8170
</LinearLayout>
8271

8372
<LinearLayout style="@style/OptionItem">
73+
<TextView
74+
style="@style/OptionName"
75+
android:text="@string/set_mode" />
8476

85-
<Button
86-
android:id="@+id/mode"
87-
style="@style/OptionButton"
88-
android:text="@string/mode" />
89-
77+
<Spinner
78+
style="@style/OptionName"
79+
android:id="@+id/mode_selector" />
9080
</LinearLayout>
9181

9282
<Button
93-
android:id="@+id/footer"
9483
style="@style/Header"
84+
android:id="@+id/footer"
9585
android:text="@string/footer"
9686
android:textAllCaps="false" />
9787
</LinearLayout>

0 commit comments

Comments
 (0)