diff --git a/app/src/main/java/org/thoughtcrime/securesms/onboarding/LandingActivity.kt b/app/src/main/java/org/thoughtcrime/securesms/onboarding/LandingActivity.kt index 1cc51f8182..d0f073516e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/onboarding/LandingActivity.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/onboarding/LandingActivity.kt @@ -1,5 +1,7 @@ package org.thoughtcrime.securesms.onboarding +import android.content.Intent +import android.net.Uri import android.os.Bundle import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column @@ -21,11 +23,13 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import network.loki.messenger.R import org.session.libsession.utilities.TextSecurePreferences import org.thoughtcrime.securesms.BaseActionBarActivity import org.thoughtcrime.securesms.crypto.IdentityKeyUtil import org.thoughtcrime.securesms.onboarding.pickname.startPickDisplayNameActivity import org.thoughtcrime.securesms.service.KeyCachingService +import org.thoughtcrime.securesms.showSessionDialog import org.thoughtcrime.securesms.ui.AppTheme import org.thoughtcrime.securesms.ui.BorderlessButton import org.thoughtcrime.securesms.ui.FilledButton @@ -82,12 +86,25 @@ class LandingActivity : BaseActionBarActivity() { .align(Alignment.CenterHorizontally), fontSize = 11.sp, lineHeight = 13.sp - ) { } + ) { openDialog() } Spacer(modifier = Modifier.height(8.dp)) } } } + private fun openDialog() { + showSessionDialog { + title(R.string.activity_landing_open_url_title) + text(R.string.activity_landing_open_url_explanation) + button(R.string.activity_landing_terms_of_service) { open("https://getsession.org/terms-of-service") } + button(R.string.activity_landing_privacy_policy) { open("https://getsession.org/privacy-policy") } + } + } + + private fun open(url: String) { + Intent(Intent.ACTION_VIEW, Uri.parse(url)).let(::startActivity) + } + @Composable private fun IncomingText(text: String) { ChatText( diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/Components.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/Components.kt index 560375a39f..e3f75fa355 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/Components.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/Components.kt @@ -37,6 +37,7 @@ import androidx.compose.ui.graphics.RectangleShape import androidx.compose.ui.graphics.StrokeCap import androidx.compose.ui.graphics.drawscope.Stroke import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.dp @@ -97,8 +98,10 @@ fun BorderlessButton( ) { Text( text = text, + textAlign = TextAlign.Center, fontSize = fontSize, - lineHeight = lineHeight + lineHeight = lineHeight, + modifier = Modifier.padding(horizontal = 2.dp) ) } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index afc37191f7..de7b169fdd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -719,6 +719,10 @@ Your Session begins here... Create Session ID Continue Your Session + Open URL + This will open in your browser. + Terms of Service + Privacy Policy What\'s Session? It\'s a decentralized, encrypted messaging app So it doesn\'t collect my personal information or my conversation metadata? How does it work?