Skip to content

Commit

Permalink
add: Disclaimer and Privacy Notice
Browse files Browse the repository at this point in the history
  • Loading branch information
rhenwinch committed Feb 16, 2024
1 parent 8549712 commit 7131794
Show file tree
Hide file tree
Showing 15 changed files with 395 additions and 28 deletions.
2 changes: 1 addition & 1 deletion app/src/main/kotlin/com/flixclusive/crash/CrashActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import com.flixclusive.core.theme.FlixclusiveTheme
import com.flixclusive.core.util.android.isTvMode
import com.flixclusive.feature.mobile.crash.CrashMobileScreen
import com.flixclusive.mobile.MobileActivity
import com.flixclusive.util.isTvMode
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject

Expand Down
11 changes: 0 additions & 11 deletions app/src/main/kotlin/com/flixclusive/util/TvModeHelper.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.flixclusive.core.util.android

import android.app.Activity
import android.app.UiModeManager
import android.content.Context
import android.content.ContextWrapper
import android.content.res.Configuration
import androidx.activity.ComponentActivity
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
Expand All @@ -28,4 +31,9 @@ inline fun <reified Activity : ComponentActivity> Context.getActivity(): Activit
}

return activity
}

fun Activity.isTvMode(): Boolean {
val uiModeManager = getSystemService(ComponentActivity.UI_MODE_SERVICE) as UiModeManager
return uiModeManager.currentModeType == Configuration.UI_MODE_TYPE_TELEVISION
}
32 changes: 27 additions & 5 deletions core/util/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<string name="watchlist">Watchlist</string>

<!-- About the app information -->
<string name="app_description">A modern streaming service app that provides users with a convenient way to play and watch the latest movies and TV shows available on the internet. With a user-friendly interface and a vast collection of content, it aims to deliver an exceptional streaming experience to its users.\n\n</string>
<string name="app_description">A modern streaming service app that provides users with a convenient way to play and watch the latest movies and TV shows available on the internet. With a user-friendly interface and a vast collection of content, it aims to deliver an exceptional streaming experience to its users.</string>
<string name="app_features">App Features:</string>
<string name="extensive_library">Extensive Library</string>
<string name="high_quality_streaming">High-Quality Streaming</string>
Expand Down Expand Up @@ -64,9 +64,12 @@
<string name="add_own_subtitle">Add subs</string>
<string name="add_sync_offset_message">Add if subs are delayed.</string>
<string name="add_to_watchlist">Add to Watchlist</string>
<string name="allow">Allow</string>
<string name="audio">Audio</string>
<string name="audio_and_subtitle">Audio &amp; Subtitle</string>
<string name="auto_option">Auto</string>
<string name="automatic_crash_report">Automatic crash report</string>
<string name="automatic_crash_report_label">Automatically send the crash data to Flixclusive\'s server.</string>
<string name="browse_categories">Browse Categories</string>
<string name="browse_movie_companies">Top Movie Companies</string>
<string name="browse_tv_networks">Top TV Networks</string>
Expand Down Expand Up @@ -107,6 +110,8 @@
<string name="popular">Popular</string>
<string name="preferred_quality">Preferred quality</string>
<string name="preferred_resize_mode">Preferred resize mode</string>
<string name="privacy_notice">Privacy notice</string>
<string name="provider_disclaimer">Providers Disclaimer</string>
<string name="rating">Rating</string>
<string name="release">RELEASE</string>
<string name="release_player">Release player on app minimize</string>
Expand Down Expand Up @@ -135,8 +140,9 @@
<string name="subtitles_language">Subtitle language</string>
<string name="subtitles_size">Font size</string>
<string name="subtract_sync_offset_message">Subtract if subs are early.</string>
<string name="sync_subtitles">Sync Subtitles</string>
<string name="sync">Sync</string>
<string name="sync_subtitles">Sync Subtitles</string>
<string name="understood">Understood</string>
<string name="unknown_language">Unknown language</string>
<string name="unlock_label">Unlock</string>
<string name="update_info">Update information</string>
Expand Down Expand Up @@ -251,10 +257,26 @@
<string name="share_message_subject">Flixclusive download link</string>

<!-- Permission request messages -->
<string name="allow">Allow</string>
<string name="notification_persist_request_message">It seems that you\'ve blocked notification permissions. Please grant this permission.</string>
<string name="notification_request_message">Notification permission is required for this feature to be available. Please grant this permission.</string>
<string name="notification_persist_request_message">It seems that you\'ve blocked notification permissions. Please grant this permission for the app update service.</string>
<string name="notification_request_message">Notification permission is required for the app updater feature to be available. Please grant this permission.</string>
<string name="splash_notice_permissions_header">Allow Permissions</string>
<string name="check_indicator_content_desc">Check indicator for selected sheet item</string>

<!-- Disclaimer/Privacy Notice messages -->
<string name="privacy_notice_crash_log_sender">
<![CDATA[
The app collects crash data, including stacktrace and device model/brand (SDK), solely to diagnose and fix software issues. Your data\'s security is paramount, and Flixclusive employs industry-standard measures to protect it. You can opt out of automatic crash logs sender in app settings.\n\n
Flixclusive prioritizes access to a wider range of content providers by foregoing SSL verification, which can restrict access to some providers. While this decision enhances accessibility, users should be aware of potential security risks and exercise caution when accessing content.
]]>
</string>
<string name="disclaimer_provider_message">
<![CDATA[
The app utilizes the services of movie/TV show providers obtained from the internet. It does not host these providers; instead, it utilizes their services. The app assumes no responsibility for the content displayed. Legal issues pertaining to the movies/TV shows should be addressed directly with the respective third-party providers.\n\n
Please note that while some of the providers will be trusted, others may not be. Users are advised to exercise caution.
]]>
</string>
<string name="privacy_notice_opt_in">Opt-in to crash data collection</string>
</resources>

Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,65 @@ internal fun BodyContent() {
) {
withStyle(style = SpanStyle(fontSize = fontSize)) {
append(UiText.StringResource(UtilR.string.app_description).asString(context))
append("\n")
}
}

withStyle(
style = ParagraphStyle(
lineHeight = 10.sp
)
) {
withStyle(
style = SpanStyle(
fontSize = fontSize,
fontWeight = FontWeight.Bold
)
) {
append(UiText.StringResource(UtilR.string.privacy_notice).asString(context))
append("\n")
}
}

withStyle(
style = ParagraphStyle(
lineBreak = LineBreak.Paragraph,
textAlign = TextAlign.Justify,
textIndent = TextIndent(firstLine = 15.sp),
)
) {
withStyle(style = SpanStyle(fontSize = fontSize)) {
append(UiText.StringResource(UtilR.string.privacy_notice_crash_log_sender).asString(context))
append("\n")
}
}

withStyle(
style = ParagraphStyle(
lineHeight = 10.sp
)
) {
withStyle(
style = SpanStyle(
fontSize = fontSize,
fontWeight = FontWeight.Bold
)
) {
append(UiText.StringResource(UtilR.string.provider_disclaimer).asString(context))
append("\n")
}
}

withStyle(
style = ParagraphStyle(
lineBreak = LineBreak.Paragraph,
textAlign = TextAlign.Justify,
textIndent = TextIndent(firstLine = 15.sp),
)
) {
withStyle(style = SpanStyle(fontSize = fontSize)) {
append(UiText.StringResource(UtilR.string.disclaimer_provider_message).asString(context))
append("\n")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import com.flixclusive.core.ui.common.R as UiCommonR
import com.flixclusive.core.util.R as UtilR

interface SearchScreenNavigator {

fun openSearchExpandedScreen()

fun openSeeAllScreen(item: CategoryItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.flixclusive.core.theme.lightGrayElevated
import com.flixclusive.core.ui.common.FilmCover
import com.flixclusive.core.ui.common.util.ifElse
import com.flixclusive.core.ui.common.util.placeholderEffect
import com.flixclusive.core.ui.common.util.onMediumEmphasis
import com.flixclusive.core.ui.common.util.placeholderEffect


@Composable
Expand All @@ -45,6 +46,7 @@ fun SearchItemCard(
imagePath = posterPath,
imageSize = if (label != null) "w500" else "w500_filter(negate,000,666)",
contentDescription = label,
contentScale = if (label != null) ContentScale.FillBounds else ContentScale.Fit,
modifier = Modifier
.align(Alignment.Center)
.ifElse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ import com.flixclusive.core.util.exception.safeCall
import com.flixclusive.feature.mobile.settings.component.SettingsGroup
import com.flixclusive.feature.mobile.settings.component.dialog.advanced.AdvancedDialogWrapper
import com.flixclusive.feature.mobile.settings.component.dialog.player.PlayerDialogWrapper
import com.flixclusive.feature.mobile.settings.component.dialog.subtitles.BorderedText
import com.flixclusive.feature.mobile.settings.component.dialog.subtitles.SubtitleDialogWrapper
import com.flixclusive.feature.mobile.settings.component.dialog.subtitles.SubtitlePreview
import com.flixclusive.feature.mobile.settings.component.dialog.subtitles.BorderedText
import com.flixclusive.feature.mobile.settings.util.ColorPickerHelper.BoxWithColor
import com.flixclusive.model.datastore.player.CaptionEdgeTypePreference
import com.flixclusive.model.datastore.player.CaptionStylePreference
Expand Down Expand Up @@ -111,6 +111,22 @@ fun SettingsScreen(
)
},
),
SettingsItem(
title = stringResource(UtilR.string.automatic_crash_report),
description = stringResource(UtilR.string.automatic_crash_report_label),
onClick = {
viewModel.onChangeSettings(appSettings.copy(isSendingCrashLogsAutomatically = !appSettings.isSendingCrashLogsAutomatically))
},
previewContent = {
Switch(
checked = appSettings.isSendingCrashLogsAutomatically,
onCheckedChange = {
viewModel.onChangeSettings(appSettings.copy(isSendingCrashLogsAutomatically = it))
},
modifier = Modifier.scale(0.7F)
)
},
),
)

val currentSubtitlesSettings = listOf(
Expand Down
1 change: 1 addition & 0 deletions feature/splash-screen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ android {
dependencies {
implementation(projects.core.ui.common)
implementation(projects.core.ui.setup)
implementation(projects.core.ui.tv)
implementation(projects.domain.home)

implementation(libs.accompanist.permissions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ package com.flixclusive.feature.splashScreen

import android.os.Build
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.graphics.ExperimentalAnimationGraphicsApi
import androidx.compose.animation.graphics.res.animatedVectorResource
import androidx.compose.animation.graphics.res.rememberAnimatedVectorPainter
import androidx.compose.animation.graphics.vector.AnimatedImageVector
import androidx.compose.animation.scaleIn
import androidx.compose.animation.scaleOut
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -44,6 +48,8 @@ import com.flixclusive.core.util.android.hasAllPermissionGranted
import com.flixclusive.core.util.common.resource.Resource
import com.flixclusive.data.configuration.UpdateStatus
import com.flixclusive.feature.splashScreen.component.ErrorDialog
import com.flixclusive.feature.splashScreen.component.PrivacyNotice
import com.flixclusive.feature.splashScreen.component.ProvidersDisclaimer
import com.google.accompanist.permissions.ExperimentalPermissionsApi
import com.google.accompanist.permissions.isGranted
import com.google.accompanist.permissions.rememberPermissionState
Expand All @@ -67,13 +73,15 @@ fun SplashScreen(
val splashScreenViewModel: SplashScreenViewModel = hiltViewModel()
val setupViewModel: SetupScreensViewModel = hiltViewModel()

val appSettings by splashScreenViewModel.appSettings.collectAsStateWithLifecycle()
val uiState by splashScreenViewModel.uiState.collectAsStateWithLifecycle()
val updateStatus by setupViewModel.updateStatus.collectAsStateWithLifecycle(UpdateStatus.Fetching)
val configurationStatus by setupViewModel.configurationStatus.collectAsStateWithLifecycle(Resource.Loading)

var areAllPermissionsGranted by remember { mutableStateOf(context.hasAllPermissionGranted()) }
var isDoneAnimating by rememberSaveable { mutableStateOf(false) }
var showLoadingCircle by rememberSaveable { mutableStateOf(false) }
var showLoadingContent by rememberSaveable { mutableStateOf(false) }
var showDisclaimer by rememberSaveable { mutableStateOf(false) }

val image = AnimatedImageVector.animatedVectorResource(id = UiCommonR.drawable.flixclusive_animated_tag)
var atEnd by rememberSaveable { mutableStateOf(false) }
Expand All @@ -94,11 +102,18 @@ fun SplashScreen(
contentAlignment = Alignment.Center
) {
Column(
modifier = Modifier.height(300.dp),
horizontalAlignment = Alignment.CenterHorizontally
modifier = Modifier
.heightIn(min = 300.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
val paddingBottom by animateDpAsState(
targetValue = if (!appSettings.isFirstTimeUserLaunch_) 10.dp else 50.dp,
label = ""
)

Box(
modifier = Modifier.padding(bottom = 50.dp)
modifier = Modifier.padding(bottom = paddingBottom)
) {
Image(
painter = rememberAnimatedVectorPainter(image, atEnd),
Expand All @@ -117,7 +132,7 @@ fun SplashScreen(
}

AnimatedVisibility(
visible = showLoadingCircle,
visible = showLoadingContent && !appSettings.isFirstTimeUserLaunch_,
enter = scaleIn(),
exit = scaleOut()
) {
Expand All @@ -128,14 +143,48 @@ fun SplashScreen(
)
)
}

Box(
contentAlignment = Alignment.Center
) {
this@Column.AnimatedVisibility(
visible = showLoadingContent && !showDisclaimer && appSettings.isFirstTimeUserLaunch_,
enter = fadeIn(),
exit = fadeOut()
) {
PrivacyNotice(
nextStep = {
splashScreenViewModel.updateSettings(
appSettings.copy(isSendingCrashLogsAutomatically = it)
)

showDisclaimer = true
}
)
}

this@Column.AnimatedVisibility(
visible = showDisclaimer && appSettings.isFirstTimeUserLaunch_,
enter = fadeIn(),
exit = fadeOut()
) {
ProvidersDisclaimer(
understood = {
splashScreenViewModel.updateSettings(
appSettings.copy(isFirstTimeUserLaunch_ = false)
)
}
)
}
}
}
}

LaunchedEffect(isDoneAnimating) {
if(!isDoneAnimating) {
atEnd = true
delay(4000) // Wait for animated tag to finish
showLoadingCircle = true
showLoadingContent = true
isDoneAnimating = true
}
}
Expand Down Expand Up @@ -167,7 +216,7 @@ fun SplashScreen(
}
else areAllPermissionsGranted = true

if(areAllPermissionsGranted && isDoneAnimating) {
if(areAllPermissionsGranted && isDoneAnimating && !appSettings.isFirstTimeUserLaunch_) {
if (updateStatus == UpdateStatus.Outdated) {
navigator.openUpdateScreen(
newVersion = setupViewModel.newVersion!!,
Expand Down
Loading

0 comments on commit 7131794

Please sign in to comment.