feat(#3409): Add analytics notice to welcome screen (#3410)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich
2025-10-08 20:04:34 -05:00
committed by GitHub
parent 82b9c2e979
commit f2c9d05968
6 changed files with 103 additions and 6 deletions

View File

@@ -929,4 +929,12 @@
<string name="error_no_app_to_handle_link">No application available to handle link.</string>
<string name="system_settings">System Settings</string>
<string name="no_local_stats">No Stats Available</string>
<string name="analytics_notice">Analytics are collected to help us improve the Android app (thank you), we will receive anonymized information about user behavior. This includes crash reports, screens used in the app, etc.</string>
<string name="analytics_platforms">"Analytics platforms: "</string>
<string name="firebase_link" translatable="false">Firebase https://firebase.google.com/</string>
<string name="datadog_link" translatable="false">Datadog https://www.datadoghq.com/</string>
<string name="for_more_information_see_our_privacy_policy">For more information, see our privacy policy.</string>
<string name="privacy_url" translatable="false">" https://meshtastic.org/docs/legal/privacy/"</string>
</resources>

View File

@@ -82,9 +82,3 @@ private fun Spannable.toAnnotatedString(linkStyles: TextLinkStyles): AnnotatedSt
private fun AutoLinkTextPreview() {
AutoLinkText("A text containing a link https://example.com")
}
@Preview(showBackground = true)
@Composable
private fun AutoLinkTextPreview2() {
AutoLinkText("<script>alert(0);Android users can't see this</script>")
}

View File

@@ -26,6 +26,7 @@ android { namespace = "org.meshtastic.feature.intro" }
dependencies {
implementation(projects.core.strings)
googleImplementation(projects.core.ui)
implementation(libs.accompanist.permissions)
implementation(libs.androidx.compose.material.iconsExtended)

View File

@@ -0,0 +1,25 @@
/*
* Copyright (c) 2025 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.meshtastic.feature.intro
import androidx.compose.runtime.Composable
@Composable
fun AnalyticsIntro() {
// no-op for fdroid
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright (c) 2025 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.meshtastic.feature.intro
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.meshtastic.core.strings.R
import org.meshtastic.core.ui.component.AutoLinkText
@Composable
fun AnalyticsIntro(modifier: Modifier = Modifier) {
Column(
modifier = modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(8.dp),
) {
val textModifier = Modifier.fillMaxWidth().align(Alignment.CenterHorizontally)
Text(modifier = textModifier, textAlign = TextAlign.Center, text = stringResource(R.string.analytics_notice))
Text(modifier = textModifier, textAlign = TextAlign.Center, text = stringResource(R.string.analytics_platforms))
AutoLinkText(stringResource(R.string.firebase_link))
AutoLinkText(stringResource(R.string.datadog_link))
Text(
modifier = textModifier,
textAlign = TextAlign.Center,
text = stringResource(R.string.for_more_information_see_our_privacy_policy),
)
AutoLinkText(text = stringResource(R.string.privacy_url))
}
}
@Preview(showBackground = true)
@Composable
private fun AnalyticsIntroPreview() {
AnalyticsIntro()
}

View File

@@ -38,6 +38,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.meshtastic.core.strings.R
@@ -99,6 +100,14 @@ internal fun WelcomeScreen(onGetStarted: () -> Unit) {
FeatureRow(feature = feature)
Spacer(modifier = Modifier.height(16.dp))
}
Spacer(modifier = Modifier.weight(1f))
AnalyticsIntro()
}
}
}
@Preview
@Composable
private fun WelcomeScreenPreview() {
WelcomeScreen(onGetStarted = {})
}