|
@@ -1,17 +1,13 @@
|
|
package com.vpn.fastestvpnservice.screensTV
|
|
package com.vpn.fastestvpnservice.screensTV
|
|
|
|
|
|
import android.content.Context
|
|
import android.content.Context
|
|
-import android.content.Intent
|
|
|
|
import android.util.Log
|
|
import android.util.Log
|
|
-import android.widget.Toast
|
|
|
|
-import androidx.activity.compose.BackHandler
|
|
|
|
import androidx.compose.foundation.BorderStroke
|
|
import androidx.compose.foundation.BorderStroke
|
|
import androidx.compose.foundation.Image
|
|
import androidx.compose.foundation.Image
|
|
import androidx.compose.foundation.background
|
|
import androidx.compose.foundation.background
|
|
import androidx.compose.foundation.border
|
|
import androidx.compose.foundation.border
|
|
import androidx.compose.foundation.clickable
|
|
import androidx.compose.foundation.clickable
|
|
import androidx.compose.foundation.focusable
|
|
import androidx.compose.foundation.focusable
|
|
-import androidx.compose.foundation.gestures.detectTapGestures
|
|
|
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
import androidx.compose.foundation.layout.Arrangement
|
|
import androidx.compose.foundation.layout.Box
|
|
import androidx.compose.foundation.layout.Box
|
|
@@ -59,7 +55,6 @@ import androidx.compose.ui.input.key.KeyEventType
|
|
import androidx.compose.ui.input.key.key
|
|
import androidx.compose.ui.input.key.key
|
|
import androidx.compose.ui.input.key.onKeyEvent
|
|
import androidx.compose.ui.input.key.onKeyEvent
|
|
import androidx.compose.ui.input.key.type
|
|
import androidx.compose.ui.input.key.type
|
|
-import androidx.compose.ui.input.pointer.pointerInput
|
|
|
|
import androidx.compose.ui.layout.ContentScale
|
|
import androidx.compose.ui.layout.ContentScale
|
|
import androidx.compose.ui.platform.LocalContext
|
|
import androidx.compose.ui.platform.LocalContext
|
|
import androidx.compose.ui.res.colorResource
|
|
import androidx.compose.ui.res.colorResource
|
|
@@ -73,27 +68,16 @@ import androidx.lifecycle.viewmodel.compose.viewModel
|
|
import androidx.navigation.NavHostController
|
|
import androidx.navigation.NavHostController
|
|
import com.vpn.fastestvpnservice.R
|
|
import com.vpn.fastestvpnservice.R
|
|
import com.vpn.fastestvpnservice.beans.isDarkTheme
|
|
import com.vpn.fastestvpnservice.beans.isDarkTheme
|
|
-import com.vpn.fastestvpnservice.beans.toChangeServer
|
|
|
|
-import com.vpn.fastestvpnservice.constants.AppEnum
|
|
|
|
import com.vpn.fastestvpnservice.constants.smartConnect
|
|
import com.vpn.fastestvpnservice.constants.smartConnect
|
|
import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
|
|
import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
|
|
-import com.vpn.fastestvpnservice.navigation.customNavigation
|
|
|
|
import com.vpn.fastestvpnservice.navigation.isFirstItemPressed
|
|
import com.vpn.fastestvpnservice.navigation.isFirstItemPressed
|
|
import com.vpn.fastestvpnservice.navigation.isHomeScreenPressed
|
|
import com.vpn.fastestvpnservice.navigation.isHomeScreenPressed
|
|
-import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.AddRowSelectServer
|
|
|
|
import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.AddText
|
|
import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.AddText
|
|
import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.ColumnText
|
|
import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.ColumnText
|
|
-import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.blueBackground
|
|
|
|
-import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.isServerDialog
|
|
|
|
-import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.serverObj
|
|
|
|
-import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.vpnConnectionsUtil
|
|
|
|
-import com.vpn.fastestvpnservice.sealedClass.BottomBarScreen
|
|
|
|
-import com.vpn.fastestvpnservice.sealedClass.Screen
|
|
|
|
import com.vpn.fastestvpnservice.ui.theme.customTypography
|
|
import com.vpn.fastestvpnservice.ui.theme.customTypography
|
|
import com.vpn.fastestvpnservice.utils.Utils
|
|
import com.vpn.fastestvpnservice.utils.Utils
|
|
import com.vpn.fastestvpnservice.utils.isTablet
|
|
import com.vpn.fastestvpnservice.utils.isTablet
|
|
import com.vpn.fastestvpnservice.viewmodels.HomeViewModel
|
|
import com.vpn.fastestvpnservice.viewmodels.HomeViewModel
|
|
-import com.vpn.fastestvpnservice.widgets.SimpleAppWidget
|
|
|
|
import de.blinkt.openvpn.core.App
|
|
import de.blinkt.openvpn.core.App
|
|
|
|
|
|
@Composable
|
|
@Composable
|
|
@@ -300,9 +284,9 @@ fun HomeTV(navHostController: NavHostController) {
|
|
|
|
|
|
IconButton(
|
|
IconButton(
|
|
onClick = {
|
|
onClick = {
|
|
- Toast.makeText(
|
|
|
|
- context, "Connect onClick{}", Toast.LENGTH_SHORT
|
|
|
|
- ).show()
|
|
|
|
|
|
+// Toast.makeText(
|
|
|
|
+// context, "Connect onClick{}", Toast.LENGTH_SHORT
|
|
|
|
+// ).show()
|
|
// val connectedServer = basePreferenceHelper.getConnectedServer()
|
|
// val connectedServer = basePreferenceHelper.getConnectedServer()
|
|
// val serverObject = basePreferenceHelper.getServerObject()
|
|
// val serverObject = basePreferenceHelper.getServerObject()
|
|
// Log.d(
|
|
// Log.d(
|
|
@@ -360,17 +344,17 @@ fun HomeTV(navHostController: NavHostController) {
|
|
when (it.key) {
|
|
when (it.key) {
|
|
Key.DirectionDown -> {
|
|
Key.DirectionDown -> {
|
|
Log.d("test_settings_keys", "DirectionDown")
|
|
Log.d("test_settings_keys", "DirectionDown")
|
|
- Toast
|
|
|
|
- .makeText(
|
|
|
|
- context, "DirectionDown", Toast.LENGTH_SHORT
|
|
|
|
- )
|
|
|
|
- .show()
|
|
|
|
|
|
+// Toast
|
|
|
|
+// .makeText(
|
|
|
|
+// context, "DirectionDown", Toast.LENGTH_SHORT
|
|
|
|
+// )
|
|
|
|
+// .show()
|
|
if (it.type == KeyEventType.KeyDown) {
|
|
if (it.type == KeyEventType.KeyDown) {
|
|
- Toast
|
|
|
|
- .makeText(
|
|
|
|
- context, "KeyDown", Toast.LENGTH_SHORT
|
|
|
|
- )
|
|
|
|
- .show()
|
|
|
|
|
|
+// Toast
|
|
|
|
+// .makeText(
|
|
|
|
+// context, "KeyDown", Toast.LENGTH_SHORT
|
|
|
|
+// )
|
|
|
|
+// .show()
|
|
focusRequester2.requestFocus()
|
|
focusRequester2.requestFocus()
|
|
}
|
|
}
|
|
true
|
|
true
|
|
@@ -473,9 +457,9 @@ fun HomeTV(navHostController: NavHostController) {
|
|
}
|
|
}
|
|
Button(
|
|
Button(
|
|
onClick = {
|
|
onClick = {
|
|
- Toast.makeText(
|
|
|
|
- context, "Smart onClick{}", Toast.LENGTH_SHORT
|
|
|
|
- ).show()
|
|
|
|
|
|
+// Toast.makeText(
|
|
|
|
+// context, "Smart onClick{}", Toast.LENGTH_SHORT
|
|
|
|
+// ).show()
|
|
// Log.d("test_button", "onClick Smart Connect ${smartServer?.server_name}")
|
|
// Log.d("test_button", "onClick Smart Connect ${smartServer?.server_name}")
|
|
// basePreferenceHelper.setSmartServerObject(smartServer)
|
|
// basePreferenceHelper.setSmartServerObject(smartServer)
|
|
// if (isConnect == App.CONNECTED) {
|
|
// if (isConnect == App.CONNECTED) {
|
|
@@ -560,11 +544,11 @@ fun HomeTV(navHostController: NavHostController) {
|
|
.height(60.dp)
|
|
.height(60.dp)
|
|
.onKeyEvent {
|
|
.onKeyEvent {
|
|
if (it.type == KeyEventType.KeyDown && it.key == Key.DirectionDown) {
|
|
if (it.type == KeyEventType.KeyDown && it.key == Key.DirectionDown) {
|
|
- Toast
|
|
|
|
- .makeText(
|
|
|
|
- context, "KeyDown & DirectionDown", Toast.LENGTH_SHORT
|
|
|
|
- )
|
|
|
|
- .show()
|
|
|
|
|
|
+// Toast
|
|
|
|
+// .makeText(
|
|
|
|
+// context, "KeyDown & DirectionDown", Toast.LENGTH_SHORT
|
|
|
|
+// )
|
|
|
|
+// .show()
|
|
isFirstItemPressed.value = true
|
|
isFirstItemPressed.value = true
|
|
true
|
|
true
|
|
} else { false }
|
|
} else { false }
|
|
@@ -578,9 +562,9 @@ fun HomeTV(navHostController: NavHostController) {
|
|
indication = null,
|
|
indication = null,
|
|
interactionSource = remember { MutableInteractionSource() }
|
|
interactionSource = remember { MutableInteractionSource() }
|
|
) {
|
|
) {
|
|
- Toast
|
|
|
|
- .makeText(context, "See All Pressed", Toast.LENGTH_SHORT)
|
|
|
|
- .show()
|
|
|
|
|
|
+// Toast
|
|
|
|
+// .makeText(context, "See All Pressed", Toast.LENGTH_SHORT)
|
|
|
|
+// .show()
|
|
}
|
|
}
|
|
.border(
|
|
.border(
|
|
border = BorderStroke(2.dp, color),
|
|
border = BorderStroke(2.dp, color),
|
|
@@ -707,9 +691,9 @@ fun BoxScope.AddRowSmartTV(
|
|
.onKeyEvent {
|
|
.onKeyEvent {
|
|
when (it.key) {
|
|
when (it.key) {
|
|
Key.DirectionLeft -> {
|
|
Key.DirectionLeft -> {
|
|
- Toast.makeText(
|
|
|
|
- context, "DirectionLeft Change", Toast.LENGTH_SHORT
|
|
|
|
- ).show()
|
|
|
|
|
|
+// Toast.makeText(
|
|
|
|
+// context, "DirectionLeft Change", Toast.LENGTH_SHORT
|
|
|
|
+// ).show()
|
|
true
|
|
true
|
|
}
|
|
}
|
|
else -> { false }
|
|
else -> { false }
|
|
@@ -720,11 +704,11 @@ fun BoxScope.AddRowSmartTV(
|
|
isButtonFocused = it.isFocused
|
|
isButtonFocused = it.isFocused
|
|
}
|
|
}
|
|
.clickable {
|
|
.clickable {
|
|
- Toast
|
|
|
|
- .makeText(
|
|
|
|
- context, "Change Pressed()", Toast.LENGTH_SHORT
|
|
|
|
- )
|
|
|
|
- .show()
|
|
|
|
|
|
+// Toast
|
|
|
|
+// .makeText(
|
|
|
|
+// context, "Change Pressed()", Toast.LENGTH_SHORT
|
|
|
|
+// )
|
|
|
|
+// .show()
|
|
}
|
|
}
|
|
.focusable()
|
|
.focusable()
|
|
,
|
|
,
|
|
@@ -735,9 +719,9 @@ fun BoxScope.AddRowSmartTV(
|
|
fontSize = if (isTablet()) 20.sp else 14.sp
|
|
fontSize = if (isTablet()) 20.sp else 14.sp
|
|
),
|
|
),
|
|
onClick = {
|
|
onClick = {
|
|
- Toast.makeText(
|
|
|
|
- context, "Change Clicked()", Toast.LENGTH_SHORT
|
|
|
|
- ).show()
|
|
|
|
|
|
+// Toast.makeText(
|
|
|
|
+// context, "Change Clicked()", Toast.LENGTH_SHORT
|
|
|
|
+// ).show()
|
|
// toChangeServer.value = true
|
|
// toChangeServer.value = true
|
|
// navHostController.navigate(
|
|
// navHostController.navigate(
|
|
// Screen.ServerList.route
|
|
// Screen.ServerList.route
|