Skip to content

Commit 2dd0ff4

Browse files
authored
Merge pull request #47 from GameFaceChat/improve-settings
add more options in Settings + better animations
2 parents ab009d8 + ac3f71e commit 2dd0ff4

File tree

7 files changed

+60
-6
lines changed

7 files changed

+60
-6
lines changed

app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ android {
4646
dependencies {
4747
implementation 'androidx.preference:preference:1.1.1'
4848
def lifecycle_version = "2.2.0"
49-
def navigation_version = "2.3.0-rc01"
49+
def navigation_version = "2.3.0"
5050
def ktor_version = "1.3.2"
51-
def camerax_version = "1.0.0-beta05"
51+
def camerax_version = "1.0.0-beta06"
5252

5353
implementation fileTree(dir: 'libs', include: ['*.jar'])
5454
implementation group: 'org.webrtc', name: 'google-webrtc', version: '1.0.30039'
@@ -69,7 +69,7 @@ dependencies {
6969
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
7070
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
7171
implementation 'com.google.firebase:firebase-common-ktx:19.3.0'
72-
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0-alpha04"
72+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0-alpha05"
7373
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.1.1'
7474

7575
testImplementation 'junit:junit:4.13'
@@ -89,7 +89,7 @@ dependencies {
8989
implementation "androidx.camera:camera-camera2:${camerax_version}"
9090
// If you want to additionally use the CameraX Lifecycle library
9191
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
92-
implementation "androidx.camera:camera-view:1.0.0-alpha12"
92+
implementation "androidx.camera:camera-view:1.0.0-alpha13"
9393

9494
implementation 'com.github.takusemba:cropme:2.0.5'
9595

app/src/main/java/com/magnitudestudios/GameFace/ui/SettingsFragment.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77

88
package com.magnitudestudios.GameFace.ui
99

10+
import android.content.Intent
11+
import android.net.Uri
1012
import android.os.Bundle
1113
import android.view.LayoutInflater
1214
import android.view.View
1315
import android.view.ViewGroup
1416
import android.widget.LinearLayout
17+
import androidx.core.content.ContextCompat
1518
import androidx.lifecycle.ViewModelProvider
1619
import androidx.navigation.fragment.findNavController
1720
import androidx.preference.Preference
@@ -30,12 +33,27 @@ class SettingsFragment : PreferenceFragmentCompat() {
3033
mainViewModel.signOutUser()
3134
return@setOnPreferenceClickListener true
3235
}
36+
37+
findPreference<Preference>("termsAndConditions")?.setOnPreferenceClickListener {
38+
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.termsAndConditionsLink))))
39+
return@setOnPreferenceClickListener true
40+
}
41+
42+
findPreference<Preference>("privacyPolicy")?.setOnPreferenceClickListener {
43+
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.privacyPolicyLink))))
44+
return@setOnPreferenceClickListener true
45+
}
46+
findPreference<Preference>("aboutUs")?.setOnPreferenceClickListener {
47+
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.aboutUs))))
48+
return@setOnPreferenceClickListener true
49+
}
3350
}
3451

3552
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
3653
mainViewModel = activity?.run { ViewModelProvider(this).get(MainViewModel::class.java) }!!
3754
val layout = super.onCreateView(inflater, container, savedInstanceState)
3855
val viewWithToolbar = LinearLayout(context)
56+
viewWithToolbar.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.white))
3957
viewWithToolbar.orientation = LinearLayout.VERTICAL
4058
toolbar = ToolbarBackBinding.inflate(inflater, container, false)
4159
toolbar.title.text = TITLE

app/src/main/res/anim/none.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (c) 2020 - Magnitude Studios - All Rights Reserved
4+
~ Unauthorized copying of this file, via any medium is prohibited
5+
~ All software is proprietary and confidential
6+
~
7+
-->
8+
9+
<set xmlns:android="http://schemas.android.com/apk/res/android"
10+
android:shareInterpolator="false">
11+
<translate
12+
android:fromXDelta="0%" android:toXDelta="0%"
13+
android:fromYDelta="0%" android:toYDelta="0%p"
14+
android:duration="@android:integer/config_mediumAnimTime"/>
15+
</set>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
android:layout_width="match_parent"
1111
android:layout_height="match_parent"
1212
android:orientation="vertical"
13+
android:background="@color/white"
1314
xmlns:tools="http://schemas.android.com/tools">
1415

1516
<include

app/src/main/res/navigation/main_nav_graph.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
android:id="@+id/action_bottomContainerFragment_to_addFriendsFragment"
5858
app:destination="@id/addFriendsFragment"
5959
app:enterAnim="@anim/slide_from_bottom"
60+
app:exitAnim="@anim/none"
61+
app:popEnterAnim="@anim/none"
6062
app:popExitAnim="@anim/slide_out_bottom" />
6163
<action
6264
android:id="@+id/action_bottomContainerFragment_to_cameraFragment"
@@ -66,8 +68,10 @@
6668
<action
6769
android:id="@+id/action_bottomContainerFragment_to_settingsFragment"
6870
app:destination="@id/settingsFragment"
69-
app:enterAnim="@anim/slide_from_bottom"
70-
app:popExitAnim="@anim/slide_out_bottom" />
71+
app:enterAnim="@anim/slide_in_from_left"
72+
app:exitAnim="@anim/none"
73+
app:popEnterAnim="@anim/none"
74+
app:popExitAnim="@anim/slide_out_to_right" />
7175
</fragment>
7276
<fragment
7377
android:id="@+id/cropPhotoFragment"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
<string name="termsAndConditionsLink">https://www.gamefacechat.com/terms-and-conditions</string>
77
<string name="privacyPolicyLink">https://www.gamefacechat.com/privacy-policy</string>
8+
<string name="website">https://www.gamefacechat.com/</string>
9+
<string name="aboutUs">https://www.gamefacechat.com/about-us</string>
810

911

1012
<string name="app_name">GameFace</string>

app/src/main/res/xml/root_preferences.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,19 @@
1818

1919
</PreferenceCategory>
2020

21+
<PreferenceCategory app:title="About">
22+
<Preference
23+
app:key="termsAndConditions"
24+
app:title="Terms and Conditions" />
25+
26+
<Preference
27+
app:key="privacyPolicy"
28+
app:title="Privacy Policy" />
29+
30+
<Preference
31+
app:key="aboutUs"
32+
app:title="About Us" />
33+
</PreferenceCategory>
34+
2135

2236
</PreferenceScreen>

0 commit comments

Comments
 (0)