Skip to content

Commit

Permalink
v1.0.1 (Privacy Policy Update)
Browse files Browse the repository at this point in the history
  • Loading branch information
radusalagean committed Aug 5, 2019
1 parent 9d05541 commit 0741641
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 10 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ android {
"\"" + openLiveTriviaFirebaseServerClientId + "\"")
buildConfigField("String", "APP_PROJECT_LINK",
"\"https://github.com/radusalagean/open-live-trivia-app-android\"")
buildConfigField("String", "APP_PRIVACY_POLICY_LINK",
"\"https://releasetracker.app/open_live_trivia_privacy_policy.html\"")
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.busytrack.openlivetrivia.screen.authentication

interface AuthenticationContract {
fun onLoginPressed()
fun onPrivacyPolicyLinkPressed()
fun onRegisterPressed(username: String)
fun onUsernameChanged(username: String)
fun onChangeAccountPressed()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.content.res.ResourcesCompat
import com.busytrack.openlivetrivia.BuildConfig

import com.busytrack.openlivetrivia.R
import com.busytrack.openlivetrivia.auth.AuthorizationManager
import com.busytrack.openlivetrivia.dialog.DialogManager
import com.busytrack.openlivetrivia.extension.setVisibleSoft
import com.busytrack.openlivetrivia.generic.activity.ActivityContract
import com.busytrack.openlivetrivia.generic.activity.BaseActivity
import com.busytrack.openlivetrivia.generic.fragment.BaseFragment
import com.busytrack.openlivetrivia.generic.mvp.BaseMvp
Expand All @@ -29,6 +31,9 @@ class AuthenticationFragment : BaseFragment(), AuthenticationMvp.View, Authentic
@Inject
lateinit var dialogManager: DialogManager

@Inject
lateinit var activityContract: ActivityContract

private val pagerAdapter = AuthenticationAdapter(this)

// Lifecycle callbacks
Expand Down Expand Up @@ -130,6 +135,10 @@ class AuthenticationFragment : BaseFragment(), AuthenticationMvp.View, Authentic
}
}

override fun onPrivacyPolicyLinkPressed() {
activityContract.openLinkInBrowser(BuildConfig.APP_PRIVACY_POLICY_LINK)
}

override fun onRegisterPressed(username: String) {
dialogManager.showAlertDialog(
R.string.dialog_title_register_disclaimer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ class AuthenticationLoginViewHolder(
) : RecyclerView.ViewHolder(view) {

fun bind() {
itemView.button_log_in.setOnClickListener {
contract.onLoginPressed()
with(itemView) {
button_log_in.setOnClickListener {
contract.onLoginPressed()
}
privacy_policy_link.setOnClickListener {
contract.onPrivacyPolicyLinkPressed()
}
}
}

fun recycle() {
itemView.setOnLongClickListener(null)
with(itemView) {
button_log_in.setOnLongClickListener(null)
privacy_policy_link.setOnClickListener(null)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class MainMenuFragment : BaseFragment(), MainMenuMvp.View {
// Thus, there won't be any need for progress bars (silent operation)
updateAccountInfo(it)
}
text_view_version.text = "v${BuildConfig.VERSION_NAME}"
}

override fun disposeViews() {
Expand All @@ -95,6 +96,9 @@ class MainMenuFragment : BaseFragment(), MainMenuMvp.View {
button_log_out.setOnClickListener {
authenticationManager.signOut()
}
privacy_policy_link.setOnClickListener {
activityContract.openLinkInBrowser(BuildConfig.APP_PRIVACY_POLICY_LINK)
}
}

override fun unregisterListeners() {
Expand All @@ -104,6 +108,7 @@ class MainMenuFragment : BaseFragment(), MainMenuMvp.View {
button_moderate_reports.setOnClickListener(null)
button_settings.setOnClickListener(null)
button_log_out.setOnClickListener(null)
privacy_policy_link.setOnClickListener(null)
}

override fun loadData() {
Expand Down
21 changes: 20 additions & 1 deletion app/src/main/res/layout/fragment_main_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
android:paddingStart="@dimen/screen_horizontal_padding"
android:paddingEnd="@dimen/screen_horizontal_padding"
android:clipToPadding="false"
tools:context=".screen.mainmenu.MainMenuFragment">
tools:context=".screen.mainmenu.MainMenuFragment"
tools:ignore="MissingPrefix">

<ImageView
android:layout_width="32dp"
Expand Down Expand Up @@ -136,4 +137,22 @@
app:layout_constraintTop_toBottomOf="@id/button_settings"
android:layout_marginTop="12dp"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/privacy_policy_link"
android:text="@string/privacy_policy"
fontPath="fonts/NunitoSans-LightItalic.ttf"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text_view_version"
tools:text="v1.0.1"
fontPath="fonts/NunitoSans-Light.ttf"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>
8 changes: 5 additions & 3 deletions app/src/main/res/layout/layout_log_in.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,17 @@
app:layout_constraintVertical_bias="0.6"/>

<TextView
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/log_in_hint"
android:id="@+id/privacy_policy_link"
android:text="@string/privacy_policy"
fontPath="fonts/NunitoSans-LightItalic.ttf"
app:layout_constraintTop_toBottomOf="@+id/button_log_in"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="24dp"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="24dp"
android:layout_marginTop="24dp"/>
android:layout_marginTop="24dp"
android:gravity="center"/>

</androidx.constraintlayout.widget.ConstraintLayout>
4 changes: 3 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

<!--Authentication-->
<string name="log_in_button">Log in</string>
<string name="log_in_hint">Your personal Google account information won\'t be accessed by the app. You will be able to customize your in-game identity with a display name of your choice, when registering a new account.</string>
<string name="register_button">Register</string>
<string name="register_select_another_account"><u>Wrong account?\nSelect a different Google account.</u></string>
<string name="username_hint">Username</string>
Expand Down Expand Up @@ -126,4 +125,7 @@ Hint: you can disable this dialog in the Settings screen</string>
<!--Preference keys-->
<string name="pref_key_delete_account" translatable="false">pref_delete_account</string>

<!--Privacy Policy-->
<string name="privacy_policy"><u>Privacy Policy</u></string>

</resources>
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ ext {
compileSdkVersion = 28

// App versioning
versionCode = 1
versionName = '1.0.0'
versionCode = 2
versionName = '1.0.1'

// App dependencies
appCompatVersion = '1.0.2'
Expand Down

0 comments on commit 0741641

Please sign in to comment.