Skip to content

Commit

Permalink
Include built-in terms of service (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashinch committed Jun 16, 2022
1 parent 5b22b46 commit 056f641
Show file tree
Hide file tree
Showing 7 changed files with 752 additions and 52 deletions.
88 changes: 64 additions & 24 deletions app/src/main/java/me/ash/reader/ui/page/startup/StartupPage.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package me.ash.reader.ui.page.startup

import android.content.Intent
import android.net.Uri
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Balance
import androidx.compose.material.icons.rounded.CheckCircleOutline
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
Expand All @@ -19,10 +21,7 @@ import androidx.navigation.NavHostController
import com.ireward.htmlcompose.HtmlText
import kotlinx.coroutines.launch
import me.ash.reader.R
import me.ash.reader.ui.component.base.DisplayText
import me.ash.reader.ui.component.base.DynamicSVGImage
import me.ash.reader.ui.component.base.RYScaffold
import me.ash.reader.ui.component.base.Tips
import me.ash.reader.ui.component.base.*
import me.ash.reader.ui.ext.DataStoreKeys
import me.ash.reader.ui.ext.dataStore
import me.ash.reader.ui.ext.put
Expand All @@ -36,10 +35,13 @@ fun StartupPage(
) {
val context = LocalContext.current
val scope = rememberCoroutineScope()
var tosVisible by remember { mutableStateOf(false) }

RYScaffold(
content = {
LazyColumn {
LazyColumn(
modifier = Modifier.navigationBarsPadding(),
) {
item {
Spacer(modifier = Modifier.height(64.dp))
DisplayText(text = stringResource(R.string.welcome), desc = "")
Expand All @@ -55,25 +57,16 @@ fun StartupPage(
item {
Tips(
modifier = Modifier.padding(top = 40.dp),
text = stringResource(R.string.agree_terms),
text = stringResource(R.string.tos_tips),
)
}
item {
TextButton(
modifier = Modifier.padding(horizontal = 12.dp),
onClick = {
context.let {
it.startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse(it.getString(R.string.terms_link))
)
)
}
}
onClick = { tosVisible = true }
) {
HtmlText(
text = stringResource(R.string.view_terms),
text = stringResource(R.string.browse_tos_tips),
style = MaterialTheme.typography.bodySmall.copy(
color = MaterialTheme.colorScheme.outline,
),
Expand All @@ -86,6 +79,7 @@ fun StartupPage(
bottomBar = null,
floatingActionButton = {
ExtendedFloatingActionButton(
modifier = Modifier.navigationBarsPadding(),
onClick = {
navController.navigate(RouteName.FEEDS) {
launchSingleTop = true
Expand All @@ -97,11 +91,57 @@ fun StartupPage(
icon = {
Icon(
Icons.Rounded.CheckCircleOutline,
stringResource(R.string.agree_and_continue)
stringResource(R.string.agree)
)
},
text = { Text(text = stringResource(R.string.agree_and_continue)) },
text = { Text(text = stringResource(R.string.agree)) },
)
}
)
}

RYDialog(
visible = tosVisible,
onDismissRequest = { tosVisible = false },
icon = {
Icon(
imageVector = Icons.Rounded.Balance,
contentDescription = stringResource(R.string.change_log),
)
},
title = {
Text(text = stringResource(R.string.terms_of_service))
},
text = {
SelectionContainer {
HtmlText(
modifier = Modifier.verticalScroll(rememberScrollState()),
text = stringResource(R.string.tos_content),
style = MaterialTheme.typography.bodySmall.copy(
color = MaterialTheme.colorScheme.onSurfaceVariant,
),
)
}
},
confirmButton = {
TextButton(
onClick = {
navController.navigate(RouteName.FEEDS) {
launchSingleTop = true
}
scope.launch {
context.dataStore.put(DataStoreKeys.IsFirstLaunch, false)
}
}
) {
Text(text = stringResource(R.string.agree))
}
},
dismissButton = {
TextButton(
onClick = { tosVisible = false }
) {
Text(text = stringResource(R.string.cancel))
}
}
)
}
118 changes: 114 additions & 4 deletions app/src/main/res/values-cs-rCZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,120 @@
<string name="tips_and_support">Tipy a podpora</string>
<string name="tips_and_support_desc">O aplikaci, open source</string>
<string name="welcome">Vítejte</string>
<string name="agree_terms">Než budete moci pokračovat, musíte souhlasit s podmínkami služby a zásadami ochrany osobních údajů aplikace Read You.</string>
<string name="view_terms">Podívejte se na &lt;i&gt;&lt;u&gt;podmínky služby a zásady ochrany osobních údajů&lt;/u&gt;&lt;/i&gt;</string>
<string name="terms_link">https://github.com/Ashinch/ReadYou/blob/main/TERMS_OF_SERVICE_AND_PRIVACY_POLICY.md</string>
<string name="agree_and_continue">Souhlasím</string>
<string name="tos_tips">Než budete moci pokračovat, musíte souhlasit s podmínkami služby a zásadami ochrany osobních údajů aplikace Read You.</string>
<string name="browse_tos_tips">Podívejte se na &lt;i&gt;&lt;u&gt;podmínky služby a zásady ochrany osobních údajů&lt;/u&gt;&lt;/i&gt;</string>
<string name="terms_of_service">Podmínky služby</string>
<string name="tos_content">
&lt;h5&gt;

Privacy Policy

&lt;/h5&gt;
&lt;br/&gt;
&lt;p&gt;

I take your privacy very seriously.

&lt;/p&gt;
&lt;br/&gt;
&lt;p&gt;
&lt;b&gt;Read You&lt;/b&gt;

does not collect any user data, and all sensitive information (passwords and other account information) is
securely stored in the local application database on your device.

&lt;/p&gt;
&lt;br/&gt;
&lt;p&gt;
&lt;b&gt;Read You&lt;/b&gt;

will use the following permissions to provide you with the service.

&lt;/p&gt;
&lt;br/&gt;
&lt;p&gt;

- Access Network permission (for accessing online content as you specify)

&lt;/p&gt;
&lt;p&gt;

- Get network status permission (for getting whether the device currently has available network conditions)

&lt;/p&gt;
&lt;p&gt;

- Background service permission (to automatically sync your favorites for you on a regular
basis)

&lt;/p&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;h5&gt;

Third Party Services

&lt;/h5&gt;
&lt;br/&gt;
&lt;p&gt;

This policy does not apply to third-party services that you use with &lt;b&gt;Read You&lt;/b&gt;. You can review
the privacy policies of the third-party services you use on their websites

&lt;/p&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;h5&gt;

Disclaimers

&lt;/h5&gt;
&lt;br/&gt;
&lt;p&gt;
&lt;b&gt;Read You&lt;/b&gt;

is a content collection tool only. Your use of &lt;b&gt;Read You&lt;/b&gt; is subject to the laws and
regulations of your country and region, and any liability arising from your actions will be borne by you
personally.

&lt;/p&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;h5&gt;

Open Source License

&lt;/h5&gt;
&lt;br/&gt;
&lt;p&gt;
&lt;b&gt;Read You&lt;/b&gt;

is an open source project under the GNU GPL 3.0 Open Source License[1], which allows you to use, reference, and
modify the source code of &lt;b&gt;Read You&lt;/b&gt; for free, but does not allow the
modified and derived code to be distributed and sold as closed-source commercial software. For details, please
see the full GNU GPL 3.0 Open Source License[2].

&lt;/p&gt;
&lt;br/&gt;
&lt;br/&gt;
&lt;h5&gt;

Appendix

&lt;/h5&gt;
&lt;br/&gt;
&lt;p&gt;

- [1] https://github.com/Ashinch/ReadYou

&lt;/p&gt;
&lt;p&gt;

- [2] https://www.gnu.org/licenses/gpl-3.0.html

&lt;/p&gt;
</string>
<string name="agree">Souhlasím</string>
<string name="wallpaper_colors">Barvy pozadí</string>
<string name="no_palettes">Žádné palety</string>
<string name="only_android_8.1_plus">Pouze Android 8.1+</string>
Expand Down
Loading

0 comments on commit 056f641

Please sign in to comment.