|
1 | | -import { ScrollView, View, StyleSheet, Linking, Pressable } from 'react-native'; |
| 1 | +import { ScrollView, View, StyleSheet, Linking, Pressable, Platform } from 'react-native'; |
2 | 2 | import { SafeAreaView } from 'react-native-safe-area-context'; |
3 | 3 | import { Stack, useRouter } from 'expo-router'; |
4 | 4 | import { Ionicons } from '@expo/vector-icons'; |
5 | 5 | import { Text, Heading, MonoText } from '@/components/ui/Text'; |
6 | 6 | import { colors, spacing, borderRadius } from '@/theme/tokens'; |
7 | 7 |
|
| 8 | +const ANDROID_APK_URL = |
| 9 | + 'https://github.com/ContextLab/dream-stream/releases/download/v1.0.0/dream-stream-v1.0.0.apk'; |
| 10 | +const isWeb = Platform.OS === 'web'; |
| 11 | + |
8 | 12 | export default function AboutScreen() { |
9 | 13 | const router = useRouter(); |
10 | 14 |
|
@@ -164,6 +168,70 @@ export default function AboutScreen() { |
164 | 168 | </View> |
165 | 169 | </View> |
166 | 170 |
|
| 171 | + {isWeb && ( |
| 172 | + <View style={styles.section}> |
| 173 | + <Heading variant="h3" color="primary" style={styles.sectionTitle}> |
| 174 | + <View style={styles.sectionTitleRow}> |
| 175 | + <Ionicons name="logo-android" size={24} color={colors.primary[400]} /> |
| 176 | + <Text style={styles.sectionTitleText}>Download for Android</Text> |
| 177 | + </View> |
| 178 | + </Heading> |
| 179 | + <Text variant="body" color="secondary" style={styles.paragraph}> |
| 180 | + Get the full dream_stream experience on your Android device with sleep tracking and |
| 181 | + REM-triggered playback. |
| 182 | + </Text> |
| 183 | + <Pressable style={styles.downloadButton} onPress={() => openLink(ANDROID_APK_URL)}> |
| 184 | + <Ionicons name="download-outline" size={20} color={colors.gray[950]} /> |
| 185 | + <Text variant="body" weight="semibold" style={styles.downloadButtonText}> |
| 186 | + Download APK (v1.0.0) |
| 187 | + </Text> |
| 188 | + </Pressable> |
| 189 | + <View style={styles.installInstructions}> |
| 190 | + <Text |
| 191 | + variant="bodySmall" |
| 192 | + weight="semibold" |
| 193 | + color="primary" |
| 194 | + style={styles.instructionsTitle} |
| 195 | + > |
| 196 | + Installation Instructions |
| 197 | + </Text> |
| 198 | + <View style={styles.instructionStep}> |
| 199 | + <Text variant="bodySmall" color="muted" style={styles.instructionNumber}> |
| 200 | + 1. |
| 201 | + </Text> |
| 202 | + <Text variant="bodySmall" color="secondary" style={styles.instructionText}> |
| 203 | + Download the APK file to your Android device |
| 204 | + </Text> |
| 205 | + </View> |
| 206 | + <View style={styles.instructionStep}> |
| 207 | + <Text variant="bodySmall" color="muted" style={styles.instructionNumber}> |
| 208 | + 2. |
| 209 | + </Text> |
| 210 | + <Text variant="bodySmall" color="secondary" style={styles.instructionText}> |
| 211 | + Open Settings → Security (or Privacy) → Enable "Install unknown apps" for your |
| 212 | + browser |
| 213 | + </Text> |
| 214 | + </View> |
| 215 | + <View style={styles.instructionStep}> |
| 216 | + <Text variant="bodySmall" color="muted" style={styles.instructionNumber}> |
| 217 | + 3. |
| 218 | + </Text> |
| 219 | + <Text variant="bodySmall" color="secondary" style={styles.instructionText}> |
| 220 | + Open the downloaded APK and tap "Install" |
| 221 | + </Text> |
| 222 | + </View> |
| 223 | + <View style={styles.instructionStep}> |
| 224 | + <Text variant="bodySmall" color="muted" style={styles.instructionNumber}> |
| 225 | + 4. |
| 226 | + </Text> |
| 227 | + <Text variant="bodySmall" color="secondary" style={styles.instructionText}> |
| 228 | + Grant permissions for Health Connect (optional, for improved sleep detection) |
| 229 | + </Text> |
| 230 | + </View> |
| 231 | + </View> |
| 232 | + </View> |
| 233 | + )} |
| 234 | + |
167 | 235 | <View style={styles.section}> |
168 | 236 | <Heading variant="h3" color="primary" style={styles.sectionTitle}> |
169 | 237 | Credits |
@@ -279,6 +347,53 @@ const styles = StyleSheet.create({ |
279 | 347 | linkText: { |
280 | 348 | flex: 1, |
281 | 349 | }, |
| 350 | + sectionTitleRow: { |
| 351 | + flexDirection: 'row', |
| 352 | + alignItems: 'center', |
| 353 | + gap: spacing.sm, |
| 354 | + }, |
| 355 | + sectionTitleText: { |
| 356 | + fontSize: 18, |
| 357 | + fontWeight: '600', |
| 358 | + color: colors.primary[400], |
| 359 | + }, |
| 360 | + downloadButton: { |
| 361 | + flexDirection: 'row', |
| 362 | + alignItems: 'center', |
| 363 | + justifyContent: 'center', |
| 364 | + gap: spacing.sm, |
| 365 | + padding: spacing.md, |
| 366 | + backgroundColor: colors.primary[500], |
| 367 | + borderRadius: borderRadius.lg, |
| 368 | + marginTop: spacing.sm, |
| 369 | + }, |
| 370 | + downloadButtonText: { |
| 371 | + color: colors.gray[950], |
| 372 | + }, |
| 373 | + installInstructions: { |
| 374 | + marginTop: spacing.lg, |
| 375 | + padding: spacing.md, |
| 376 | + backgroundColor: colors.gray[900], |
| 377 | + borderRadius: borderRadius.lg, |
| 378 | + borderWidth: 1, |
| 379 | + borderColor: colors.gray[800], |
| 380 | + }, |
| 381 | + instructionsTitle: { |
| 382 | + marginBottom: spacing.sm, |
| 383 | + }, |
| 384 | + instructionStep: { |
| 385 | + flexDirection: 'row', |
| 386 | + alignItems: 'flex-start', |
| 387 | + gap: spacing.sm, |
| 388 | + marginTop: spacing.xs, |
| 389 | + }, |
| 390 | + instructionNumber: { |
| 391 | + width: 16, |
| 392 | + }, |
| 393 | + instructionText: { |
| 394 | + flex: 1, |
| 395 | + lineHeight: 20, |
| 396 | + }, |
282 | 397 | footer: { |
283 | 398 | alignItems: 'center', |
284 | 399 | paddingTop: spacing.xl, |
|
0 commit comments