Skip to content
Merged
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
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ android {
}

dependencies {
implementation 'com.contentsquare.android:library:4.41.1'
implementation 'com.contentsquare.android:compose:4.41.1'
implementation 'com.contentsquare.android:library:4.44.1'
implementation 'com.contentsquare.android:compose:4.44.1'

implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,15 @@ class GdprActivity : AppCompatActivity() {
}

fun optIn(view: View) {
Analytics.optIn(this)
Analytics.optIn()
Toast.makeText(applicationContext, "User has Opted In", Toast.LENGTH_SHORT).show()
}

fun optOut(view: View) {
Analytics.optOut(this)
Analytics.optOut()
Toast.makeText(applicationContext, "User has Opted Out", Toast.LENGTH_SHORT).show()
}

fun forgetMe(view: View) {
Analytics.forgetMe()
Toast.makeText(applicationContext, "Forget Me chosen", Toast.LENGTH_SHORT).show()
}

fun stopTracking(view: View) {
Analytics.stopTracking()
Toast.makeText(applicationContext, "CS tracking has been paused.", Toast.LENGTH_SHORT)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.androidsampleapp.analytics

import android.content.Context
import android.util.Log
import com.contentsquare.android.Contentsquare
import com.contentsquare.android.api.model.Transaction
Expand Down Expand Up @@ -32,16 +31,12 @@ object Analytics {
Contentsquare.resumeTracking()
}

fun forgetMe() {
Contentsquare.forgetMe()
fun optIn() {
Contentsquare.optIn()
}

fun optIn(context: Context) {
Contentsquare.optIn(context)
}

fun optOut(context: Context) {
Contentsquare.optOut(context)
fun optOut() {
Contentsquare.optOut()
}

fun provideUserId(): String {
Expand Down
16 changes: 2 additions & 14 deletions app/src/main/res/layout/content_gdpr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,6 @@
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/userid_refresh_button" />

<Button
android:id="@+id/forgetme_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:onClick="forgetMe"
android:text="@string/forget_me_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/optin_button" />

<Button
android:id="@+id/stop_tracking_button"
android:layout_width="0dp"
Expand All @@ -100,7 +88,7 @@
android:text="@string/stop_tracking_label"
app:layout_constraintEnd_toStartOf="@+id/guideline2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/forgetme_button" />
app:layout_constraintTop_toBottomOf="@+id/optin_button" />

<Button
android:id="@+id/resume_tracking_button"
Expand All @@ -112,7 +100,7 @@
android:text="@string/resume_tracking_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/guideline2"
app:layout_constraintTop_toBottomOf="@+id/forgetme_button" />
app:layout_constraintTop_toBottomOf="@+id/optin_button" />

<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline2"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<string name="text_simple_activity">Simple Activity</string>
<string name="opt_in_label">Opt-In</string>
<string name="opt_out_label">Opt-Out</string>
<string name="forget_me_label">Forget Me</string>
<string name="stop_tracking_label">Stop Tracking</string>
<string name="resume_tracking_label">Resume Tracking</string>
<string name="privacy_option">Privacy options</string>
Expand Down
Loading