Skip to content

Commit 3fdbdb3

Browse files
committed
Add about page with privacy policy link
1 parent 0403e0d commit 3fdbdb3

File tree

4 files changed

+64
-0
lines changed

4 files changed

+64
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.simongellis.vvb.menu
2+
3+
import android.widget.TextView
4+
import androidx.fragment.app.Fragment
5+
import com.simongellis.vvb.BuildConfig
6+
import com.simongellis.vvb.R
7+
8+
class AboutMenuFragment: Fragment(R.layout.about_view) {
9+
override fun onResume() {
10+
super.onResume()
11+
requireActivity().setTitle(R.string.main_menu_about)
12+
val version = view?.findViewById<TextView>(R.id.app_version) ?: return
13+
version.text = BuildConfig.VERSION_NAME
14+
}
15+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:theme="@style/AppTheme"
6+
android:orientation="vertical">
7+
<LinearLayout
8+
android:layout_width="match_parent"
9+
android:layout_height="wrap_content"
10+
android:orientation="vertical"
11+
android:layout_marginHorizontal="20dp"
12+
android:layout_marginTop="20dp">
13+
<TextView
14+
android:layout_width="match_parent"
15+
android:layout_height="wrap_content"
16+
android:textStyle="bold"
17+
android:text="@string/about_app_version"/>
18+
<TextView
19+
android:id="@+id/app_version"
20+
android:layout_width="match_parent"
21+
android:layout_height="wrap_content"/>
22+
</LinearLayout>
23+
<LinearLayout
24+
android:layout_width="match_parent"
25+
android:layout_height="wrap_content"
26+
android:orientation="vertical"
27+
android:layout_marginHorizontal="20dp"
28+
android:layout_marginTop="20dp">
29+
<TextView
30+
android:layout_width="match_parent"
31+
android:layout_height="wrap_content"
32+
android:textStyle="bold"
33+
android:text="@string/about_privacy_policy"/>
34+
<TextView
35+
android:layout_width="match_parent"
36+
android:layout_height="wrap_content"
37+
android:autoLink="web"
38+
android:text="@string/about_privacy_policy_link"/>
39+
</LinearLayout>
40+
</LinearLayout>

app/src/main/res/values/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<string name="main_menu_video_setup" translatable="false">Video Setup</string>
99
<string name="main_menu_audio_setup" translatable="false">Audio Setup</string>
1010
<string name="main_menu_general_setup" translatable="false">General Setup</string>
11+
<string name="main_menu_about" translatable="false">About</string>
1112
<string name="load_game_from_file">Load From File</string>
1213
<string name="load_game_from_file_explanation">You can download ROMs of Virtual Boy games, and load them here to play them.\nYou can find free ROMs from Planet Virtual Boy, at https://virtual-boy.com/homebrew/.</string>
1314
<string name="load_game_from_file_explanation_button" translatable="false">OK</string>
@@ -95,6 +96,9 @@
9596
<string name="audio_menu_volume">Volume</string>
9697
<string name="audio_menu_buffer_size">Buffer Size (in frames)</string>
9798
<string name="audio_menu_buffer_size_description">Lowering this will reduce audio delay, but may cause crackling sounds.</string>
99+
<string name="about_app_version">App Version</string>
100+
<string name="about_privacy_policy">Privacy Policy</string>
101+
<string name="about_privacy_policy_link">https://www.simongellis.com/privacy/vvb.html</string>
98102
<string name="application_crashed">Sorry, the application crashed. A report will be sent to the developer.</string>
99103
<string name="error_file_not_found">That file could not be found. Maybe it was moved?</string>
100104
<string name="error_not_power_of_two">That\'s not a Virtual Boy game! The file size should be a power of two.</string>

app/src/main/res/xml/preferences.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,9 @@
3737
app:title="@string/main_menu_general_setup"
3838
app:fragment="com.simongellis.vvb.menu.GeneralMenuFragment"
3939
tools:context=".menu.GeneralMenuFragment"/>
40+
<Preference
41+
app:key="about"
42+
app:title="@string/main_menu_about"
43+
app:fragment="com.simongellis.vvb.menu.AboutMenuFragment"
44+
tools:context=".menu.AboutMenuFragment" />
4045
</PreferenceScreen>

0 commit comments

Comments
 (0)