Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce privacy policy page. #79

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/src/main/java/com/example/nextgen/privacy/PrivacyActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package com.example.nextgen.privacy
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.widget.Button
import android.widget.CheckBox
import com.example.model.Profile
import com.example.nextgen.Activity.ActivityComponent
import com.example.nextgen.Activity.BaseActivity
Expand All @@ -14,11 +16,21 @@ class PrivacyActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_privacy)

val agreeButton = findViewById<Button>(R.id.accept_button)
val readCheckBox = findViewById<CheckBox>(R.id.read_checkbox)

agreeButton.isEnabled = false

val profile =
intent.getProtoExtra(PRIVACYACTIVITY_INTENT_EXTRAS_KEY, Profile.getDefaultInstance())!!
supportFragmentManager.beginTransaction()
.replace(R.id.frame_layout, PrivacyFragment.newInstance(profile))
.commit()

readCheckBox.setOnCheckedChangeListener { _, isChecked ->
agreeButton.isEnabled = isChecked
}
}

override fun injectDependencies(activityComponent: ActivityComponent) {
Expand Down
58 changes: 53 additions & 5 deletions app/src/main/res/layout/fragment_privacy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,64 @@
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="50dp">

<androidx.appcompat.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="match_parent"
app:title="Privacy" />
app:title="Privacy"
app:titleTextColor="@color/black"/>
</com.google.android.material.appbar.AppBarLayout>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/privacy_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- Scrollable TextView for Privacy Content -->

<ScrollView
android:id="@+id/privacy_scrollview"
android:layout_width="381dp"
android:layout_height="513dp"
android:layout_margin="16dp"
app:layout_constraintBottom_toTopOf="@id/accept_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.484"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/privacy_title">

<TextView
android:id="@+id/privacy_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/privacy_policy_content"
android:textColor="@color/black"
android:textSize="16sp" />

</ScrollView>

<CheckBox
android:id="@+id/read_checkbox"
android:layout_width="411dp"
android:layout_height="48dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="4dp"
android:layout_marginRight="10dp"
android:text="Have you read all the the terms and conditions of privacy policy agreement carefully?"
app:layout_constraintBottom_toTopOf="@+id/accept_button"
app:layout_constraintEnd_toEndOf="@+id/privacy_scrollview"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@+id/privacy_scrollview"
app:layout_constraintTop_toBottomOf="@id/privacy_scrollview"
app:layout_constraintVertical_bias="0.0" />

<Button
android:id="@+id/accept_button"
android:layout_width="372dp"
android:layout_height="48dp"
android:layout_margin="16dp"
android:enabled="false"
android:text="I Agree"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/privacy_scrollview" />

</LinearLayout>
</layout>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="nextgen">neXtGen</string>
<string name="privacy_policy_content">At NextGen, we are committed to protecting the privacy and security of our users. This Privacy Policy outlines how we collect, use, and safeguard your personal information when you use our mobile application - NextGen. By using our App, you consent to the practices described in this policy.\n\nWe collect personal information to provide and improve the services offered by the App. This information may include, but is not limited to, your name, email address, phone number, and any other details you voluntarily provide when registering or using the App’s features. Additionally, we may collect certain non-personal information automatically, such as your device\'s unique identifiers, IP address, operating system, browser type, and usage patterns. This data is essential for optimizing the functionality of the App and enhancing your user experience.\n\nThe information collected is used to deliver the services you have requested, personalize your experience, and improve the App’s overall performance. For example, your personal information allows us to authenticate your identity, manage your account, and communicate with you about updates, promotions, or any changes to our terms of service. Non-personal information is typically used for diagnostic purposes, to analyze app usage trends, and to prevent fraud or security issues.\n\nWe take reasonable precautions to ensure the security of your personal data. We implement industry-standard measures to protect your information from unauthorized access, loss, misuse, or alteration. However, while we strive to keep your data secure, no system or electronic transmission is completely infallible, and therefore, we cannot guarantee absolute security.\n\nWe do not share or sell your personal information to third parties, except as necessary to provide the services or as required by law. In certain circumstances, we may share your data with trusted third-party service providers who perform essential functions on our behalf, such as payment processing, hosting services, or data analytics. These third parties are bound by confidentiality agreements and are only permitted to use your data as necessary to perform their duties.\n\nFrom time to time, the App may contain links to third-party websites or services that are not operated by us. Please be aware that we are not responsible for the privacy practices of such third parties. We encourage you to review their privacy policies before sharing any personal information, as their policies may differ from ours.\n\nWe may update this Privacy Policy periodically to reflect changes in our practices or for other operational, legal, or regulatory reasons. When we make changes, we will notify you by updating the \"Effective Date\" at the top of this page. We encourage you to review this policy regularly to stay informed about how we protect your information.\n\nBy continuing to use the App after any changes to this Privacy Policy, you acknowledge and agree to the updated terms. If you have any questions or concerns regarding this policy, please contact us at [Insert Contact Information].</string>


</resources>