@@ -24,7 +24,6 @@ import androidx.activity.compose.BackHandler
2424import androidx.activity.compose.rememberLauncherForActivityResult
2525import androidx.activity.result.contract.ActivityResultContracts
2626import androidx.compose.foundation.Canvas
27- import androidx.compose.foundation.LocalOverscrollFactory
2827import androidx.compose.foundation.background
2928import androidx.compose.foundation.clickable
3029import androidx.compose.foundation.interaction.MutableInteractionSource
@@ -140,6 +139,7 @@ import com.theveloper.pixelplay.ui.theme.GoogleSansRounded
140139import racra.compose.smooth_corner_rect_library.AbsoluteSmoothCornerShape
141140import android.content.pm.PackageManager
142141import androidx.compose.animation.animateColorAsState
142+ import androidx.compose.foundation.LocalOverscrollFactory
143143import androidx.compose.foundation.gestures.detectVerticalDragGestures
144144import androidx.compose.foundation.layout.navigationBars
145145import androidx.compose.foundation.layout.navigationBarsPadding
@@ -862,14 +862,7 @@ private fun CastDevicesTabContent(
862862 }
863863 }
864864
865- if (allConnectivityOff) {
866- item(key = " wifiOff" ) {
867- WifiOffIllustration (
868- onTurnOnWifi = onTurnOnWifi,
869- onOpenBluetoothSettings = onOpenBluetoothSettings
870- )
871- }
872- } else if (state.isScanning && state.devices.isEmpty()) {
865+ if (state.isScanning && state.devices.isEmpty()) {
873866 item(key = " scanningPlaceholder" ) {
874867 ScanningPlaceholderList ()
875868 }
@@ -1876,87 +1869,6 @@ private fun QuickSettingTile(
18761869 }
18771870}
18781871
1879- @Composable
1880- private fun WifiOffIllustration (
1881- onTurnOnWifi : () -> Unit ,
1882- onOpenBluetoothSettings : () -> Unit
1883- ) {
1884- val shape = AbsoluteSmoothCornerShape (
1885- cornerRadiusTL = 38 .dp,
1886- cornerRadiusTR = 20 .dp,
1887- cornerRadiusBL = 20 .dp,
1888- cornerRadiusBR = 38 .dp,
1889- smoothnessAsPercentTL = 70 ,
1890- smoothnessAsPercentTR = 70 ,
1891- smoothnessAsPercentBL = 70 ,
1892- smoothnessAsPercentBR = 70
1893- )
1894- Card (
1895- modifier = Modifier .fillMaxWidth(),
1896- shape = shape,
1897- colors = CardDefaults .cardColors(containerColor = MaterialTheme .colorScheme.surfaceContainerHigh),
1898- elevation = CardDefaults .cardElevation(defaultElevation = 4 .dp)
1899- ) {
1900- Column (
1901- modifier = Modifier
1902- .fillMaxWidth()
1903- .padding(24 .dp),
1904- verticalArrangement = Arrangement .spacedBy(16 .dp),
1905- horizontalAlignment = Alignment .CenterHorizontally
1906- ) {
1907- val prim1 = MaterialTheme .colorScheme.primary.copy(alpha = 0.15f )
1908- val prim2 = MaterialTheme .colorScheme.primary.copy(alpha = 0.35f )
1909- val prim3 = MaterialTheme .colorScheme.primary
1910- Canvas (modifier = Modifier .size(120 .dp)) {
1911- drawCircle(color = prim1, radius = size.minDimension / 2 )
1912- drawCircle(
1913- color = prim2,
1914- radius = size.minDimension / 3 ,
1915- style = Stroke (width = 10 .dp.toPx())
1916- )
1917- drawCircle(color = prim3, radius = size.minDimension / 6 )
1918- }
1919- Text (
1920- text = stringResource(R .string.presentation_batch_g_cast_connections_off_title),
1921- style = MaterialTheme .typography.titleLarge.copy(fontWeight = FontWeight .Bold )
1922- )
1923- Text (
1924- text = stringResource(R .string.presentation_batch_g_cast_connections_off_body),
1925- style = MaterialTheme .typography.bodyMedium,
1926- textAlign = TextAlign .Center ,
1927- color = MaterialTheme .colorScheme.onSurfaceVariant,
1928- lineHeight = 20 .sp
1929- )
1930- Column (
1931- verticalArrangement = Arrangement .spacedBy(8 .dp),
1932- horizontalAlignment = Alignment .CenterHorizontally
1933- ) {
1934- Button (
1935- onClick = onTurnOnWifi,
1936- shape = RoundedCornerShape (50 ),
1937- colors = ButtonDefaults .buttonColors(
1938- containerColor = MaterialTheme .colorScheme.primary,
1939- contentColor = MaterialTheme .colorScheme.onPrimary
1940- )
1941- ) {
1942- Text (stringResource(R .string.presentation_batch_g_cast_turn_on_wifi))
1943- }
1944-
1945- Button (
1946- onClick = onOpenBluetoothSettings,
1947- shape = RoundedCornerShape (50 ),
1948- colors = ButtonDefaults .buttonColors(
1949- containerColor = MaterialTheme .colorScheme.secondaryContainer,
1950- contentColor = MaterialTheme .colorScheme.onSecondaryContainer
1951- )
1952- ) {
1953- Text (stringResource(R .string.presentation_batch_g_cast_open_bluetooth))
1954- }
1955- }
1956- }
1957- }
1958- }
1959-
19601872@Composable
19611873private fun ScanningPlaceholderList () {
19621874 Column (verticalArrangement = Arrangement .spacedBy(12 .dp)) {
0 commit comments