Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />

<!-- Location permission required for BLE scanning -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<!-- Notification permissions -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<!-- Haptic feedback permission -->
<uses-permission android:name="android.permission.VIBRATE" />

<!-- Battery optimization permission -->
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

<!-- Hardware features -->
<uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
<uses-feature android:name="android.hardware.bluetooth" android:required="true" />
Expand All @@ -36,7 +36,7 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.BitchatAndroid"
tools:targetApi="31">
android:localeConfig="@xml/locales_config" tools:targetApi="33">
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private fun BatteryOptimizationEnabledContent(
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = "bitchat",
text = stringResource(R.string.app_name),
style = MaterialTheme.typography.headlineLarge.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold,
Expand Down Expand Up @@ -214,7 +214,7 @@ private fun BatteryOptimizationCheckingContent(
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = "bitchat",
text = stringResource(R.string.app_name),
style = MaterialTheme.typography.headlineLarge.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold,
Expand Down Expand Up @@ -271,7 +271,7 @@ private fun BatteryOptimizationNotSupportedContent(
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = "bitchat",
text = stringResource(R.string.app_name),
style = MaterialTheme.typography.headlineLarge.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.bitchat.android.R

/**
* Screen shown when checking Bluetooth status or requesting Bluetooth enable
Expand Down Expand Up @@ -71,13 +73,13 @@ private fun BluetoothDisabledContent(
// Bluetooth icon - using Bluetooth outlined icon in app's green color
Icon(
imageVector = Icons.Outlined.Bluetooth,
contentDescription = "Bluetooth",
contentDescription = stringResource(R.string.bluetooth_icon_description),
modifier = Modifier.size(64.dp),
tint = Color(0xFF00C851) // App's main green color
)

Text(
text = "Bluetooth Required",
text = stringResource(R.string.bluetooth_required_title),
style = MaterialTheme.typography.headlineSmall.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold,
Expand All @@ -98,7 +100,7 @@ private fun BluetoothDisabledContent(
verticalArrangement = Arrangement.spacedBy(8.dp)
) {
Text(
text = "bitchat needs Bluetooth to:",
text = stringResource(R.string.bluetooth_required_message),
style = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Medium,
color = colorScheme.onSurface
Expand All @@ -108,10 +110,7 @@ private fun BluetoothDisabledContent(
)

Text(
text = "• Discover nearby users\n" +
"• Create mesh network connections\n" +
"• Send and receive messages\n" +
"• Work without internet or servers",
text = stringResource(R.string.bluetooth_required_details),
style = MaterialTheme.typography.bodySmall.copy(
fontFamily = FontFamily.Monospace,
color = colorScheme.onSurface.copy(alpha = 0.8f)
Expand All @@ -135,7 +134,7 @@ private fun BluetoothDisabledContent(
)
) {
Text(
text = "Enable Bluetooth",
text = stringResource(R.string.enable_bluetooth),
style = MaterialTheme.typography.bodyMedium.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold
Expand All @@ -144,6 +143,18 @@ private fun BluetoothDisabledContent(
)
}

OutlinedButton(
onClick = onRetry,
modifier = Modifier.fillMaxWidth()
) {
Text(
text = stringResource(R.string.check_again),
style = MaterialTheme.typography.bodyMedium.copy(
fontFamily = FontFamily.Monospace
),
modifier = Modifier.padding(vertical = 4.dp)
)
}
//Since we are automatically checking bluetooth state -- commented

// OutlinedButton(
Expand Down Expand Up @@ -186,7 +197,7 @@ private fun BluetoothNotSupportedContent(
}

Text(
text = "Bluetooth Not Supported",
text = stringResource(R.string.bluetooth_not_supported_title),
style = MaterialTheme.typography.headlineSmall.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold,
Expand All @@ -203,7 +214,7 @@ private fun BluetoothNotSupportedContent(
elevation = CardDefaults.cardElevation(defaultElevation = 2.dp)
) {
Text(
text = "This device doesn't support Bluetooth Low Energy (BLE), which is required for bitchat to function.\n\nbitchat needs BLE to create mesh networks and communicate with nearby devices without internet.",
text = stringResource(R.string.bluetooth_not_supported_message),
style = MaterialTheme.typography.bodyMedium.copy(
fontFamily = FontFamily.Monospace,
color = colorScheme.onSurface
Expand All @@ -224,7 +235,7 @@ private fun BluetoothCheckingContent(
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = "bitchat",
text = stringResource(R.string.app_name),
style = MaterialTheme.typography.headlineLarge.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold,
Expand All @@ -236,7 +247,7 @@ private fun BluetoothCheckingContent(
BluetoothLoadingIndicator()

Text(
text = "Checking Bluetooth status...",
text = stringResource(R.string.checking_bluetooth_status),
style = MaterialTheme.typography.bodyLarge.copy(
fontFamily = FontFamily.Monospace,
color = colorScheme.onSurface.copy(alpha = 0.7f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.bitchat.android.R

/**
* Loading screen shown during app initialization after permissions are granted
Expand Down Expand Up @@ -61,7 +63,7 @@ fun InitializingScreen() {
) {
// App title
Text(
text = "bitchat",
text = stringResource(R.string.app_name),
style = MaterialTheme.typography.headlineLarge.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold,
Expand Down Expand Up @@ -90,7 +92,7 @@ fun InitializingScreen() {
horizontalArrangement = Arrangement.Center
) {
Text(
text = "Initializing mesh network",
text = stringResource(R.string.initializing_mesh_network),
style = MaterialTheme.typography.bodyLarge.copy(
fontFamily = FontFamily.Monospace,
color = colorScheme.onSurface.copy(alpha = 0.7f)
Expand Down Expand Up @@ -125,7 +127,7 @@ fun InitializingScreen() {
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = "Setting up Bluetooth mesh networking...",
text = stringResource(R.string.setting_up_bluetooth_mesh),
style = MaterialTheme.typography.bodyMedium.copy(
fontFamily = FontFamily.Monospace,
color = colorScheme.onSurface.copy(alpha = 0.8f)
Expand All @@ -134,7 +136,7 @@ fun InitializingScreen() {
)

Text(
text = "This should only take a few seconds",
text = stringResource(R.string.setup_duration),
style = MaterialTheme.typography.bodySmall.copy(
fontFamily = FontFamily.Monospace,
color = colorScheme.onSurface.copy(alpha = 0.6f)
Expand Down Expand Up @@ -183,7 +185,7 @@ fun InitializationErrorScreen(
}

Text(
text = "Setup Not Complete",
text = stringResource(R.string.setup_not_complete),
style = MaterialTheme.typography.headlineSmall.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold,
Expand Down Expand Up @@ -219,7 +221,7 @@ fun InitializationErrorScreen(
modifier = Modifier.fillMaxWidth()
) {
Text(
text = "Try Again",
text = stringResource(R.string.try_again),
style = MaterialTheme.typography.bodyMedium.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold
Expand All @@ -233,7 +235,7 @@ fun InitializationErrorScreen(
modifier = Modifier.fillMaxWidth()
) {
Text(
text = "Open Settings",
text = stringResource(R.string.open_settings),
style = MaterialTheme.typography.bodyMedium.copy(
fontFamily = FontFamily.Monospace
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.bitchat.android.R

/**
* Screen shown when checking location services status or requesting location services enable
Expand Down Expand Up @@ -71,13 +73,13 @@ private fun LocationDisabledContent(
// Location icon - using LocationOn outlined icon in app's green color
Icon(
imageVector = Icons.Outlined.LocationOn,
contentDescription = "Location Services",
contentDescription = stringResource(R.string.location_services_description),
modifier = Modifier.size(64.dp),
tint = Color(0xFF00C851) // App's main green color
)

Text(
text = "Location Services Required",
text = stringResource(R.string.location_services_required),
style = MaterialTheme.typography.headlineSmall.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold,
Expand All @@ -104,13 +106,13 @@ private fun LocationDisabledContent(
) {
Icon(
imageVector = Icons.Filled.Security,
contentDescription = "Privacy",
contentDescription = stringResource(R.string.privacy_description),
tint = Color(0xFF4CAF50),
modifier = Modifier.size(20.dp)
)
Spacer(modifier = Modifier.width(8.dp))
Text(
text = "Privacy First",
text = stringResource(R.string.privacy_first),
style = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Bold,
color = colorScheme.onSurface
Expand All @@ -119,7 +121,7 @@ private fun LocationDisabledContent(
}

Text(
text = "bitchat does NOT track your location or use GPS.\n\nLocation services are required by Android for Bluetooth scanning to work properly. This is an Android system requirement.",
text = stringResource(R.string.location_privacy_assurance),
style = MaterialTheme.typography.bodySmall.copy(
fontFamily = FontFamily.Monospace,
color = colorScheme.onSurface.copy(alpha = 0.8f)
Expand All @@ -129,7 +131,7 @@ private fun LocationDisabledContent(
Spacer(modifier = Modifier.height(4.dp))

Text(
text = "bitchat needs location services for:",
text = stringResource(R.string.location_services_needed_for),
style = MaterialTheme.typography.bodyMedium.copy(
fontWeight = FontWeight.Medium,
color = colorScheme.onSurface
Expand All @@ -139,10 +141,7 @@ private fun LocationDisabledContent(
)

Text(
text = "• Bluetooth device scanning (Android requirement)\n" +
"• Discovering nearby users on mesh network\n" +
"• Creating connections without internet\n" +
"• No GPS tracking or location collection",
text = stringResource(R.string.location_services_features),
style = MaterialTheme.typography.bodySmall.copy(
fontFamily = FontFamily.Monospace,
color = colorScheme.onSurface.copy(alpha = 0.8f)
Expand All @@ -166,7 +165,7 @@ private fun LocationDisabledContent(
)
) {
Text(
text = "Open Location Settings",
text = stringResource(R.string.open_location_settings),
style = MaterialTheme.typography.bodyMedium.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold
Expand All @@ -180,7 +179,7 @@ private fun LocationDisabledContent(
modifier = Modifier.fillMaxWidth()
) {
Text(
text = "Check Again",
text = stringResource(R.string.battery_optimization_check_again),
style = MaterialTheme.typography.bodyMedium.copy(
fontFamily = FontFamily.Monospace
),
Expand All @@ -203,13 +202,13 @@ private fun LocationNotAvailableContent(
// Error icon
Icon(
imageVector = Icons.Filled.ErrorOutline,
contentDescription = "Error",
contentDescription = stringResource(R.string.error_description),
modifier = Modifier.size(64.dp),
tint = colorScheme.error
)

Text(
text = "Location Services Unavailable",
text = stringResource(R.string.location_services_unavailable),
style = MaterialTheme.typography.headlineSmall.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold,
Expand All @@ -226,7 +225,7 @@ private fun LocationNotAvailableContent(
elevation = CardDefaults.cardElevation(defaultElevation = 2.dp)
) {
Text(
text = "Location services are not available on this device. This is unusual as location services are standard on Android devices.\n\nbitchat needs location services for Bluetooth scanning to work properly (Android requirement). Without this, the app cannot discover nearby users.",
text = stringResource(R.string.location_services_unavailable_message),
style = MaterialTheme.typography.bodyMedium.copy(
fontFamily = FontFamily.Monospace,
color = colorScheme.onSurface
Expand All @@ -247,7 +246,7 @@ private fun LocationCheckingContent(
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = "bitchat",
text = stringResource(R.string.app_name),
style = MaterialTheme.typography.headlineLarge.copy(
fontFamily = FontFamily.Monospace,
fontWeight = FontWeight.Bold,
Expand All @@ -259,7 +258,7 @@ private fun LocationCheckingContent(
LocationLoadingIndicator()

Text(
text = "Checking location services...",
text = stringResource(R.string.checking_location_services),
style = MaterialTheme.typography.bodyLarge.copy(
fontFamily = FontFamily.Monospace,
color = colorScheme.onSurface.copy(alpha = 0.7f)
Expand Down
Loading