|
@@ -48,6 +48,7 @@ import com.vpn.fastestvpnservice.R
|
|
|
import com.vpn.fastestvpnservice.beans.Server
|
|
|
import com.vpn.fastestvpnservice.beans.favListServer
|
|
|
import com.vpn.fastestvpnservice.beans.toChangeServer
|
|
|
+import com.vpn.fastestvpnservice.constants.AppEnum
|
|
|
import com.vpn.fastestvpnservice.constants.smartConnect
|
|
|
import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
|
|
|
import com.vpn.fastestvpnservice.screens.bottomNavBarScreens.onServer
|
|
@@ -99,6 +100,14 @@ fun ServerItem(server: Server, navHostController: NavHostController, serverPing:
|
|
|
// else Utils.getDrawableGray(context, server.iso)
|
|
|
|
|
|
val icon = Utils.getDrawable(context, server.iso)
|
|
|
+ var isFreeAccount: Boolean = false
|
|
|
+ basePreferenceHelper.getProduct()?.identifier?.let {
|
|
|
+ if (it == AppEnum.FREE.key) {
|
|
|
+ isFreeAccount = true
|
|
|
+ } else {
|
|
|
+ isFreeAccount = false
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
Box(
|
|
|
// verticalAlignment = Alignment.Top,
|
|
@@ -111,7 +120,7 @@ fun ServerItem(server: Server, navHostController: NavHostController, serverPing:
|
|
|
indication = null,
|
|
|
interactionSource = remember { MutableInteractionSource() }
|
|
|
) {
|
|
|
- if (server.enable == 1) {
|
|
|
+ if (!isFreeAccount) {
|
|
|
if (toChangeServer.value) {
|
|
|
basePreferenceHelper.saveSmartList(smartConnect[2])
|
|
|
basePreferenceHelper.setSmartServerObject(server)
|
|
@@ -289,6 +298,14 @@ fun FavoriteServerItem(
|
|
|
// else Utils.getDrawableGray(context, server.iso)
|
|
|
|
|
|
val icon = Utils.getDrawable(context, server.iso)
|
|
|
+ var isFreeAccount: Boolean = false
|
|
|
+ basePreferenceHelper.getProduct()?.identifier?.let {
|
|
|
+ if (it == AppEnum.FREE.key) {
|
|
|
+ isFreeAccount = true
|
|
|
+ } else {
|
|
|
+ isFreeAccount = false
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
Box(
|
|
|
// verticalAlignment = Alignment.Top,
|
|
@@ -300,7 +317,7 @@ fun FavoriteServerItem(
|
|
|
indication = null,
|
|
|
interactionSource = remember { MutableInteractionSource() }
|
|
|
) {
|
|
|
- if (server.enable == 1) {
|
|
|
+ if (!isFreeAccount) {
|
|
|
isFavServerClicked = true
|
|
|
} else {
|
|
|
basePreferenceHelper.setSubscriptionServerObject(server)
|
|
@@ -478,6 +495,14 @@ fun ServerSearchItem(
|
|
|
// else Utils.getDrawableGray(context, server.iso)
|
|
|
|
|
|
val icon = Utils.getDrawable(context, server.iso)
|
|
|
+ var isFreeAccount: Boolean = false
|
|
|
+ basePreferenceHelper.getProduct()?.identifier?.let {
|
|
|
+ if (it == AppEnum.FREE.key) {
|
|
|
+ isFreeAccount = true
|
|
|
+ } else {
|
|
|
+ isFreeAccount = false
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
Box(
|
|
|
// verticalAlignment = Alignment.Top,
|
|
@@ -489,7 +514,7 @@ fun ServerSearchItem(
|
|
|
indication = null,
|
|
|
interactionSource = remember { MutableInteractionSource() }
|
|
|
) {
|
|
|
- if (server.enable == 1) {
|
|
|
+ if (!isFreeAccount) {
|
|
|
if (toChangeServer.value) {
|
|
|
basePreferenceHelper.saveSmartList(smartConnect[2])
|
|
|
basePreferenceHelper.setSmartServerObject(server)
|
|
@@ -652,6 +677,14 @@ fun ServerSpecificItem(
|
|
|
// else Utils.getDrawableGray(context, server.iso)
|
|
|
|
|
|
val icon = Utils.getDrawable(context, server.iso)
|
|
|
+ var isFreeAccount: Boolean = false
|
|
|
+ basePreferenceHelper.getProduct()?.identifier?.let {
|
|
|
+ if (it == AppEnum.FREE.key) {
|
|
|
+ isFreeAccount = true
|
|
|
+ } else {
|
|
|
+ isFreeAccount = false
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
Row(
|
|
|
verticalAlignment = Alignment.Top,
|
|
@@ -663,7 +696,7 @@ fun ServerSpecificItem(
|
|
|
indication = null,
|
|
|
interactionSource = remember { MutableInteractionSource() }
|
|
|
) {
|
|
|
- if (server.enable == 1) {
|
|
|
+ if (!isFreeAccount) {
|
|
|
// MainActivity.isSelectedServersShown = true
|
|
|
// basePreferenceHelper.setServerObject(server)
|
|
|
basePreferenceHelper.saveSmartList(smartConnect[2])
|