Jelajahi Sumber

Added new dark connect image on both home screens

Khubaib 9 bulan lalu
induk
melakukan
4c6aebccbe

+ 1 - 1
app/src/main/java/com/vpn/fastestvpnservice/screens/bottomNavBarScreens/HomeScreen.kt

@@ -609,7 +609,7 @@ fun Home(
                 {
                     if (isConnect == App.CONNECTED) {
                         Image(
-                            painter = if (isDarkTheme.value) painterResource(id = R.drawable.iv_connect_dark)
+                            painter = if (isDarkTheme.value) painterResource(id = R.drawable.iv_connect_dark2)
                             else painterResource(id = R.drawable.iv_connect),
                             contentDescription = "Home Map",
                             contentScale = ContentScale.FillBounds,

+ 9 - 65
app/src/main/java/com/vpn/fastestvpnservice/screensTV/HomeScreenTV.kt

@@ -23,6 +23,7 @@ import androidx.compose.foundation.layout.ColumnScope
 import androidx.compose.foundation.layout.Row
 import androidx.compose.foundation.layout.RowScope
 import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.aspectRatio
 import androidx.compose.foundation.layout.fillMaxHeight
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.fillMaxWidth
@@ -30,6 +31,7 @@ import androidx.compose.foundation.layout.height
 import androidx.compose.foundation.layout.padding
 import androidx.compose.foundation.layout.size
 import androidx.compose.foundation.layout.wrapContentHeight
+import androidx.compose.foundation.layout.wrapContentSize
 import androidx.compose.foundation.shape.CircleShape
 import androidx.compose.foundation.shape.RoundedCornerShape
 import androidx.compose.foundation.text.ClickableText
@@ -127,7 +129,6 @@ import de.blinkt.openvpn.core.App
 import kotlinx.coroutines.delay
 import java.util.Locale
 
-lateinit var vpnConnectionsUtil: VPNConnectionsUtil
 var isProtocolDialog: MutableState<Boolean> = mutableStateOf(false)
 
 var isLocationsEnabled: MutableState<Boolean> = mutableStateOf(false)
@@ -575,60 +576,7 @@ fun HomeTV(
                 else if (isButtonFocused) colorResource(id = R.color.maroon_text)
                 else colorResource(id = R.color.transparent)
                 IconButton(
-                    onClick = {
-//                              Toast.makeText(
-//                                  context, "Connect onClick{}", Toast.LENGTH_SHORT
-//                              ).show()
-//                        val connectedServer = basePreferenceHelper.getConnectedServer()
-//                        val serverObject = basePreferenceHelper.getServerObject()
-//                        Log.d(
-//                            "test_conn_ser_obj",
-//                            "cs = ${connectedServer?.server_name} so = ${serverObject?.server_name}"
-//                        )
-//                        Log.d("isConnect_State", "onClick{} -> $isConnect")
-//                        Log.d("isConnect_State_vpn", "onClick{} -> $isConnect")
-//                        prefHelper.getProduct()?.identifier.let {
-//                            val identifier = it
-//
-//                            if (identifier == AppEnum.FREE.key) {
-//                                Log.d("isConnect_State", "identifier -> $identifier")
-//                                Screen.Subscription.isTrue = true
-//                                navHostController.navigate(
-//                                    Screen.Subscription.route
-//                                )
-//
-//                            } else {
-//
-//                                prefHelper.getServerObject()?.let {
-//                                    prefHelper.setConnectedServer(it)
-//                                }
-//                                Log.d("isConnect_State", "identifier -> $identifier")
-//                                if (isConnect == App.CONNECTED || isConnect == App.CONNECTING) {
-//                                    Log.d("isConnect_State_vpn", "stopVPN")
-//                                    vpnConnectionsUtil.stopVpn()
-//                                    homeViewModel.getIp()
-//                                } else {
-//                                    Log.d("isConnect_State_vpn", "startVPN")
-//
-//                                    if (basePreferenceHelper.getServerObject() != null) {
-//                                        vpnConnectionsUtil.startVpn()
-//                                    } else {
-//                                        toChangeServer.value = false
-//                                        navHostController.navigate(
-//                                            Screen.ServerList.route
-//                                        )
-//                                        Screen.ServerList.isTrue = true
-//                                        Log.d("button_click_change", "Pressed")
-//                                    }
-//                                }
-//
-//
-//                                val widgetIntent = Intent(context, SimpleAppWidget::class.java)
-//                                widgetIntent.action = SimpleAppWidget.ACTION_CHANGE_SERVER
-//                                context.sendBroadcast(widgetIntent)
-//                            }
-//                        }
-                    },
+                    onClick = {},
                     modifier = Modifier
                         .padding(bottom = 0.dp)
                         .size(150.dp)
@@ -641,7 +589,6 @@ fun HomeTV(
                                     }
                                     true
                                 }
-
                                 else -> {
                                     true
                                 }
@@ -688,20 +635,16 @@ fun HomeTV(
                                     }
                                 }
                             }
-
-//                            if (isConnect == App.DISCONNECTED) homeViewModel.setConnectState(App.CONNECTED)
-//                            else if (isConnect == App.CONNECTED) homeViewModel.setConnectState(App.DISCONNECTED)
                         }
-                        .focusable()
-                      ,
+                        .focusable(),
                 )
                 {
                     if (isConnect == App.CONNECTED) {
                         Image(
-                            painter = if (isDarkTheme.value) painterResource(id = R.drawable.iv_connect_dark)
+                            painter = if (isDarkTheme.value) painterResource(id = R.drawable.iv_connect_dark2)
                             else painterResource(id = R.drawable.iv_connect),
 //                            painter = painterResource(id = R.drawable.iv_connect),
-                            contentDescription = "Home Map",
+                            contentDescription = "iv_connect",
                             contentScale = ContentScale.FillBounds,
                             modifier = Modifier
                                 .size(150.dp)
@@ -711,12 +654,13 @@ fun HomeTV(
                                     ), shape = CircleShape
                                 )
                         )
-                    } else {
+                    }
+                    else {
                         Image(
                             painter = if (isDarkTheme.value) painterResource(id = R.drawable.iv_disconnect_dark)
                             else painterResource(id = R.drawable.iv_disconnect),
 //                            painter = painterResource(id = R.drawable.iv_disconnect),
-                            contentDescription = "Home Map",
+                            contentDescription = "iv_disconnect",
                             contentScale = ContentScale.FillBounds,
                             modifier = Modifier
                                 .size(150.dp)

TEMPAT SAMPAH
app/src/main/res/drawable/iv_connect_dark2.png