Skip to content

Commit 7eed881

Browse files
DPigeonDPigeon
DPigeon
authored and
DPigeon
committed
#29: Settings Activity
1 parent d5d2674 commit 7eed881

File tree

5 files changed

+136
-6
lines changed

5 files changed

+136
-6
lines changed

app/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
android:roundIcon="@mipmap/ic_launcher_round"
1717
android:supportsRtl="true"
1818
android:theme="@style/AppTheme">
19+
<activity android:name=".activities.profile.SettingsActivity"></activity>
1920

2021
<meta-data
2122
android:name="fritz_api_key"

app/src/main/java/com/seetext/activities/profile/AbstractProfileActivity.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ protected void onCreate(Bundle savedInstanceState) {
3838
super.onCreate(savedInstanceState);
3939
Intent intent = getIntent();
4040
String firstTime = intent.getStringExtra("firstTime");
41-
if (firstTime.equals("no")) {
42-
setBackArrow(true);
43-
} else {
44-
setBackArrow(false); // If first time on the app, do not show back arrow
41+
if (firstTime != null) {
42+
if (firstTime.equals("no")) {
43+
setBackArrow(true);
44+
} else {
45+
setBackArrow(false); // If first time on the app, do not show back arrow
46+
}
4547
}
46-
getSupportActionBar().setTitle("Profile");
48+
Objects.requireNonNull(getSupportActionBar()).setTitle("Profile");
4749

4850
sharedPreferenceHelper = new SharedPreferenceHelper(this.getSharedPreferences("ProfilePreference", Context.MODE_PRIVATE));
4951
setupUI();

app/src/main/java/com/seetext/activities/profile/ProfileActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private void goToActivity() { // Function that goes from the main activity to an
120120
Intent intent = getIntent();
121121
String firstTime = intent.getStringExtra("firstTime");
122122
Intent mainIntent = new Intent(ProfileActivity.this, MainActivity.class);
123-
if (firstTime.equals("yes")) {
123+
if (firstTime != null && firstTime.equals("yes")) {
124124
mainIntent.putExtra("tutorial", "start");
125125
}
126126
startActivity(mainIntent);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.seetext.activities.profile;
2+
3+
import android.os.Bundle;
4+
5+
import com.seetext.R;
6+
import com.seetext.activities.AbstractActivity;
7+
8+
public class SettingsActivity extends AbstractActivity {
9+
10+
@Override
11+
protected void onCreate(Bundle savedInstanceState) {
12+
super.onCreate(savedInstanceState);
13+
}
14+
15+
@Override
16+
protected int getLayoutResourceId() {
17+
return R.layout.activity_settings;
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
tools:context=".activities.profile.SettingsActivity">
8+
9+
<TextView
10+
android:id="@+id/rectangleColorTextView"
11+
android:layout_width="wrap_content"
12+
android:layout_height="wrap_content"
13+
android:text="Object Detection Rectangle Color"
14+
android:textColor="#000000"
15+
android:textStyle="bold"
16+
tools:layout_editor_absoluteX="16dp"
17+
tools:layout_editor_absoluteY="71dp" />
18+
19+
<SeekBar
20+
android:id="@+id/colorSeekBar"
21+
android:layout_width="256dp"
22+
android:layout_height="39dp"
23+
tools:layout_editor_absoluteX="16dp"
24+
tools:layout_editor_absoluteY="112dp" />
25+
26+
<View
27+
android:id="@+id/divider"
28+
android:layout_width="409dp"
29+
android:layout_height="1dp"
30+
android:background="?android:attr/listDivider"
31+
tools:layout_editor_absoluteX="1dp"
32+
tools:layout_editor_absoluteY="168dp" />
33+
34+
<TextView
35+
android:id="@+id/fastSwapTextView"
36+
android:layout_width="wrap_content"
37+
android:layout_height="wrap_content"
38+
android:text="Fast Swap"
39+
android:textColor="#000000"
40+
android:textStyle="bold"
41+
tools:layout_editor_absoluteX="16dp"
42+
tools:layout_editor_absoluteY="195dp" />
43+
44+
<Switch
45+
android:id="@+id/fastSwapSwitch"
46+
android:layout_width="48dp"
47+
android:layout_height="47dp"
48+
tools:layout_editor_absoluteX="347dp"
49+
tools:layout_editor_absoluteY="177dp" />
50+
51+
<View
52+
android:id="@+id/divider2"
53+
android:layout_width="409dp"
54+
android:layout_height="1dp"
55+
android:background="?android:attr/listDivider"
56+
tools:layout_editor_absoluteX="1dp"
57+
tools:layout_editor_absoluteY="233dp" />
58+
59+
<TextView
60+
android:id="@+id/faceCheckAnimationTextView"
61+
android:layout_width="wrap_content"
62+
android:layout_height="wrap_content"
63+
android:text="Face Check Animation"
64+
android:textColor="#000000"
65+
android:textStyle="bold"
66+
tools:layout_editor_absoluteX="16dp"
67+
tools:layout_editor_absoluteY="262dp" />
68+
69+
<Switch
70+
android:id="@+id/faceAnimationSwitch"
71+
android:layout_width="48dp"
72+
android:layout_height="47dp"
73+
tools:layout_editor_absoluteX="347dp"
74+
tools:layout_editor_absoluteY="243dp" />
75+
76+
<View
77+
android:id="@+id/divider3"
78+
android:layout_width="409dp"
79+
android:layout_height="1dp"
80+
android:background="?android:attr/listDivider"
81+
tools:layout_editor_absoluteX="1dp"
82+
tools:layout_editor_absoluteY="302dp" />
83+
84+
<TextView
85+
android:id="@+id/audioTTSTextView"
86+
android:layout_width="wrap_content"
87+
android:layout_height="wrap_content"
88+
android:text="Audio Speech"
89+
android:textColor="#000000"
90+
android:textStyle="bold"
91+
tools:layout_editor_absoluteX="16dp"
92+
tools:layout_editor_absoluteY="328dp" />
93+
94+
<Switch
95+
android:id="@+id/audioTTSSwitch"
96+
android:layout_width="48dp"
97+
android:layout_height="47dp"
98+
tools:layout_editor_absoluteX="347dp"
99+
tools:layout_editor_absoluteY="312dp" />
100+
101+
<View
102+
android:id="@+id/divider4"
103+
android:layout_width="409dp"
104+
android:layout_height="1dp"
105+
android:background="?android:attr/listDivider"
106+
tools:layout_editor_absoluteX="1dp"
107+
tools:layout_editor_absoluteY="365dp" />
108+
</androidx.constraintlayout.widget.ConstraintLayout>

0 commit comments

Comments
 (0)