Khubaib 1 anno fa
parent
commit
1273468cbe
29 ha cambiato i file con 4144 aggiunte e 640 eliminazioni
  1. 1 1
      .idea/deploymentTargetDropDown.xml
  2. 7 1
      app/build.gradle.kts
  3. 8 2
      app/src/main/AndroidManifest.xml
  4. 30 29
      app/src/main/java/com/vpn/fastestvpnservice/MainActivity.kt
  5. 4 2
      app/src/main/java/com/vpn/fastestvpnservice/activities/DockActivity.java
  6. 1045 0
      app/src/main/java/com/vpn/fastestvpnservice/activities/GuidedActivity.java
  7. 471 0
      app/src/main/java/com/vpn/fastestvpnservice/activities/HomeActivityTV.kt
  8. 224 0
      app/src/main/java/com/vpn/fastestvpnservice/activities/LoginActivityTV.kt
  9. 29 14
      app/src/main/java/com/vpn/fastestvpnservice/activities/SplashActivity.kt
  10. 167 0
      app/src/main/java/com/vpn/fastestvpnservice/adapters/ServerAdapter.kt
  11. 59 0
      app/src/main/java/com/vpn/fastestvpnservice/adapters/SettingsAdapter.kt
  12. 2 2
      app/src/main/java/com/vpn/fastestvpnservice/fragments/BaseFragment.java
  13. 17 10
      app/src/main/java/com/vpn/fastestvpnservice/fragments/LoginFragment.kt
  14. 432 401
      app/src/main/java/com/vpn/fastestvpnservice/fragments/TvServerListFragment.kt
  15. 6 0
      app/src/main/java/com/vpn/fastestvpnservice/interfaces/OnBackPressedOnTV.kt
  16. 5 0
      app/src/main/java/com/vpn/fastestvpnservice/interfaces/UpdateServersOnProtocol.kt
  17. 16 0
      app/src/main/java/com/vpn/fastestvpnservice/utils/Utils.kt
  18. 6 0
      app/src/main/res/color/btntexthover.xml
  19. 6 0
      app/src/main/res/color/btntexthover2.xml
  20. 385 0
      app/src/main/res/layout-land/activity_home_tv.xml
  21. 208 0
      app/src/main/res/layout-land/activity_login_tv.xml
  22. 6 3
      app/src/main/res/layout-land/fragment_login.xml
  23. 78 0
      app/src/main/res/layout-land/item_server.xml
  24. 366 0
      app/src/main/res/layout/activity_home_tv.xml
  25. 219 0
      app/src/main/res/layout/activity_login_tv.xml
  26. 30 0
      app/src/main/res/layout/activity_main.xml
  27. 73 0
      app/src/main/res/layout/dialogs_exit.xml
  28. 176 175
      app/src/main/res/layout/fragment_login.xml
  29. 68 0
      app/src/main/res/layout/item_settings_tv.xml

+ 1 - 1
.idea/deploymentTargetDropDown.xml

@@ -18,7 +18,7 @@
               </deviceKey>
             </Target>
           </runningDeviceTargetSelectedWithDropDown>
-          <timeTargetWasSelectedWithDropDown value="2024-04-26T19:40:32.507946415Z" />
+          <timeTargetWasSelectedWithDropDown value="2024-04-27T12:27:53.515658773Z" />
         </State>
       </entry>
     </value>

+ 7 - 1
app/build.gradle.kts

@@ -56,7 +56,9 @@ android {
     buildFeatures {
         compose = true
         viewBinding = true
-        dataBinding = true
+    }
+    dataBinding {
+        enable = true
     }
     composeOptions {
         kotlinCompilerExtensionVersion = "1.5.1"
@@ -136,6 +138,10 @@ dependencies {
     implementation("androidx.leanback:leanback:$leanback_version")
     implementation("androidx.leanback:leanback-preference:$leanback_version")
     implementation("com.skyfishjy.ripplebackground:library:1.0.1")
+    implementation("androidx.navigation:navigation-fragment:2.3.0")
+    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.5")
+    implementation("com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.44")
+    implementation("androidx.recyclerview:recyclerview:1.1.0")
 
     testImplementation("junit:junit:4.13.2")
     androidTestImplementation("androidx.test.ext:junit:1.1.5")

+ 8 - 2
app/src/main/AndroidManifest.xml

@@ -41,13 +41,20 @@
         android:usesCleartextTraffic="true"
         tools:targetApi="31">
         <activity
+            android:name=".activities.HomeActivityTV"
+            android:exported="false" />
+        <activity
+            android:name=".activities.LoginActivityTV"
+            android:exported="false" />
+        <activity
             android:name=".activities.SplashActivity2"
             android:exported="false" />
         <activity
             android:name=".MainActivity"
             android:exported="true"
             android:label="@string/app_name"
-            android:theme="@style/Theme.FastestVPN">
+            android:launchMode="singleTop"
+            android:theme="@style/Theme.AppCompat.NoActionBar">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 
@@ -58,7 +65,6 @@
         <activity
             android:name=".activities.SplashActivity"
             android:exported="false" />
-
         <activity
             android:name="org.strongswan.android.ui.VpnProfileControlActivity"
             android:excludeFromRecents="true"

+ 30 - 29
app/src/main/java/com/vpn/fastestvpnservice/MainActivity.kt

@@ -8,9 +8,6 @@ import android.net.Uri
 import android.os.Build
 import android.os.Bundle
 import android.util.Log
-import android.view.View
-import android.view.WindowManager
-import androidx.activity.ComponentActivity
 import androidx.activity.compose.setContent
 import androidx.activity.viewModels
 import androidx.compose.foundation.isSystemInDarkTheme
@@ -21,6 +18,7 @@ import androidx.compose.ui.graphics.toArgb
 import androidx.compose.ui.platform.LocalContext
 import androidx.compose.ui.res.colorResource
 import androidx.core.app.ActivityCompat
+import androidx.fragment.app.FragmentManager
 import androidx.navigation.compose.rememberNavController
 import com.vpn.fastestvpnservice.activities.DockActivity
 import com.vpn.fastestvpnservice.activities.SplashActivity
@@ -28,12 +26,13 @@ import com.vpn.fastestvpnservice.activities.SplashActivity2
 import com.vpn.fastestvpnservice.beans.isDarkTheme
 import com.vpn.fastestvpnservice.beans.themesList
 import com.vpn.fastestvpnservice.broadcasts.ConnectivityReceiver
-import com.vpn.fastestvpnservice.constants.AppConstant
 import com.vpn.fastestvpnservice.constants.AppEnum
 import com.vpn.fastestvpnservice.fragments.LoginFragment
 import com.vpn.fastestvpnservice.fragments.TvHomeFragment
 import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
-import com.vpn.fastestvpnservice.helpers.FragmentNavigator
+import com.vpn.fastestvpnservice.interfaces.CallBacks
+import com.vpn.fastestvpnservice.interfaces.OnBackPressedOnTV
+import com.vpn.fastestvpnservice.interfaces.UpdateServersOnProtocol
 import com.vpn.fastestvpnservice.interfaces.VPNConnectionCallBacks
 import com.vpn.fastestvpnservice.navigation.SetUpNavGraph
 import com.vpn.fastestvpnservice.screens.helpScreensAll.fileChooserCallback
@@ -41,7 +40,6 @@ import com.vpn.fastestvpnservice.ui.theme.FastestVPNTheme
 import com.vpn.fastestvpnservice.utils.StaticMethods
 import com.vpn.fastestvpnservice.viewmodels.LoginViewModel
 import de.blinkt.openvpn.core.App
-import kotlinx.coroutines.delay
 
 open class MainActivity : DockActivity(), ConnectivityReceiver.ConnectivityReceiverListener {
     val loginViewModel: LoginViewModel by viewModels()
@@ -61,6 +59,8 @@ open class MainActivity : DockActivity(), ConnectivityReceiver.ConnectivityRecei
             }
         }
 
+//        setContentView(R.layout.activity_main)
+
         val basePreferenceHelper = BasePreferenceHelper(baseContext)
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
             if (ActivityCompat.checkSelfPermission(
@@ -72,9 +72,10 @@ open class MainActivity : DockActivity(), ConnectivityReceiver.ConnectivityRecei
             }
         }
 
+
         setContent {
                 val context = LocalContext.current
-                val basePreferenceHelper = BasePreferenceHelper(context)
+//                val basePreferenceHelper = BasePreferenceHelper(context)
                 val selectedTheme = basePreferenceHelper.getTheme()
 
                 val isSystemInDarkTheme = isSystemInDarkTheme()
@@ -102,21 +103,24 @@ open class MainActivity : DockActivity(), ConnectivityReceiver.ConnectivityRecei
 
             }
 
-        val bundle = intent.extras
-        bundle.let {
-            it?.getString(AppEnum.SCREEN_NAME.key).let {
-                it?.let {
-                    Log.d("test_nav_tv", "bundle $it")
-                    initFragment(it)
-                }
-            }
+//        val bundle = intent.extras
+//        bundle.let {
+//            it?.getString(AppEnum.SCREEN_NAME.key).let {
+//                it?.let {
+//                    Log.d("test_nav_tv", "bundle $it")
+//                    initFragment(it)
+//                }
+//            }
 //                ?: kotlin.run {
 //                basePreferenceHelper?.getUser()?.let {
 //                    Log.d("test_nav_tv", "kotlin.run")
 //                    initFragment(AppEnum.HOME_SCREEN.key)
 //                }
 //            }
-        }
+//        }
+
+        FragmentManager.enableDebugLogging(true)
+
     }
 
     override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
@@ -133,7 +137,7 @@ open class MainActivity : DockActivity(), ConnectivityReceiver.ConnectivityRecei
     }
 
     override fun getContainerId(): Int {
-        return R.id.activity_main
+        return R.id.mainFrameLayout
     }
 
 //    override fun getContainerId(): Int {
@@ -149,16 +153,18 @@ open class MainActivity : DockActivity(), ConnectivityReceiver.ConnectivityRecei
 
     }
 
-
+    fun getCallingIntent(_context: Context?): Intent {
+        return Intent(_context, MainActivity::class.java)
+    }
 
      fun initFragment(key: String) {
         Log.d("test_nav_tv", "initFragment() => $key")
 //        val fragmentNavigator: FragmentNavigator = FragmentNavigator()
         when (key) {
             AppEnum.LOGIN_SCREEN.key -> {
-                val i = Intent(this, SplashActivity2::class.java)
-                startActivity(i)
-//                fragmentNavigator.replaceFragmentWithBackStack(LoginFragment.newInstance())
+//                val i = Intent(this, SplashActivity2::class.java)
+//                startActivity(i)
+                fragmentNavigator.replaceFragmentWithBackStack(LoginFragment.newInstance())
             }
             AppEnum.HOME_SCREEN.key -> {
 //                fragmentNavigator.clearAllFragments()
@@ -201,14 +207,9 @@ open class MainActivity : DockActivity(), ConnectivityReceiver.ConnectivityRecei
         var isSelectedServersShown: Boolean = false
         var vpnConnectionCallBacks: VPNConnectionCallBacks? = null
         var isStopSubscriptionNavigation: Boolean = true
-
-        fun getCallingIntent(_context: Context?): Intent {
-            return Intent(_context, MainActivity::class.java)
-        }
-
-        fun test() {
-            Log.d("test_nav_tv", "test function")
-        }
+        var updateServersOnProtocol: UpdateServersOnProtocol? = null
+        var callBacks: CallBacks? = null
+        var onBackPressedOnTV: OnBackPressedOnTV? = null
     }
 
     override fun onNetworkConnectionChanged(isConnected: Boolean) {

+ 4 - 2
app/src/main/java/com/vpn/fastestvpnservice/activities/DockActivity.java

@@ -1,16 +1,18 @@
 package com.vpn.fastestvpnservice.activities;
 
 import android.app.Activity;
+import android.content.res.Resources;
 import android.os.Bundle;
 
 import androidx.activity.ComponentActivity;
 import androidx.annotation.IdRes;
 import androidx.appcompat.app.AppCompatActivity;
 
+import com.vpn.fastestvpnservice.R;
 import com.vpn.fastestvpnservice.helpers.FragmentNavigator;
 
 
-public abstract class DockActivity extends ComponentActivity {
+public abstract class DockActivity extends AppCompatActivity {
 
     FragmentNavigator mFragmentNavigator;
 
@@ -28,7 +30,7 @@ public abstract class DockActivity extends ComponentActivity {
     }
 
     private void registerControllers() {
-        mFragmentNavigator.register(getFragmentNavigator().getFragmentManager(), getContainerId());
+        mFragmentNavigator.register(getSupportFragmentManager(), getContainerId());
     }
 
     public FragmentNavigator getFragmentNavigator() {

File diff suppressed because it is too large
+ 1045 - 0
app/src/main/java/com/vpn/fastestvpnservice/activities/GuidedActivity.java


+ 471 - 0
app/src/main/java/com/vpn/fastestvpnservice/activities/HomeActivityTV.kt

@@ -0,0 +1,471 @@
+package com.vpn.fastestvpnservice.activities
+
+import android.app.Activity
+import android.app.Dialog
+import android.content.Intent
+import android.graphics.Color
+import android.graphics.drawable.ColorDrawable
+import android.location.Location
+import android.os.Bundle
+import android.os.Handler
+import android.os.Looper
+import android.view.View
+import android.view.Window
+import android.view.animation.Animation
+import android.view.animation.AnimationUtils
+import android.widget.TextView
+import android.widget.Toast
+import androidx.activity.enableEdgeToEdge
+import androidx.appcompat.app.AppCompatActivity
+import androidx.core.view.ViewCompat
+import androidx.core.view.WindowInsetsCompat
+import androidx.lifecycle.Observer
+import com.google.android.material.snackbar.Snackbar
+import com.vpn.fastestvpnservice.R
+import com.vpn.fastestvpnservice.beans.Protocol
+import com.vpn.fastestvpnservice.beans.Server
+import com.vpn.fastestvpnservice.constants.AppEnum
+import com.vpn.fastestvpnservice.databinding.ActivityHomeTvBinding
+import com.vpn.fastestvpnservice.fragments.LoginFragment
+import com.vpn.fastestvpnservice.fragments.TvHomeFragment
+import com.vpn.fastestvpnservice.fragments.TvServerListFragment
+import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
+import com.vpn.fastestvpnservice.interfaces.CallBacks
+import com.vpn.fastestvpnservice.interfaces.VPNConnectionCallBacks
+import com.vpn.fastestvpnservice.utils.SnackBarUtils
+import com.vpn.fastestvpnservice.utils.StaticMethods
+import com.vpn.fastestvpnservice.utils.Utils
+import com.vpn.fastestvpnservice.utils.VPNConnectionsUtil
+import com.vpn.fastestvpnservice.viewmodels.HomeViewModel
+import com.vpn.fastestvpnservice.viewmodels.ProfileViewModel
+import com.vpn.fastestvpnservice.viewmodels.ServerListViewModel
+import com.wireguard.android.backend.GoBackend
+import de.blinkt.openvpn.core.App
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.MainScope
+
+class HomeActivityTV : AppCompatActivity(), VPNConnectionCallBacks, CallBacks {
+
+    lateinit var tvHomeBinding: ActivityHomeTvBinding
+    lateinit var prefHelper: BasePreferenceHelper
+    lateinit var serverViewModel: ServerListViewModel
+    lateinit var homeViewModel: HomeViewModel
+    lateinit var profileViewModel: ProfileViewModel
+    var serverobj: Server? = null
+    lateinit var vpnConnectionsUtil: VPNConnectionsUtil
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+//        enableEdgeToEdge()
+
+        tvHomeBinding = ActivityHomeTvBinding.inflate(layoutInflater)
+        setContentView(tvHomeBinding.root)
+//        setContentView(R.layout.activity_home_tv)
+//        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
+//            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
+//            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
+//            insets
+//        }
+
+        val scope: CoroutineScope = MainScope()
+        prefHelper = BasePreferenceHelper(baseContext)
+        profileViewModel = ProfileViewModel()
+        serverViewModel = ServerListViewModel(baseContext)
+        homeViewModel = HomeViewModel(baseContext, scope)
+        vpnConnectionsUtil = VPNConnectionsUtil(baseContext, this, homeViewModel)
+
+        if (StaticMethods.isTV(this)) {
+            tvHomeBinding.ivConnect.background = resources.getDrawable(R.drawable.connect_btn_state)
+            tvHomeBinding.tvLogoutTv?.background = resources.getDrawable(R.drawable.button_selector_state)
+            tvHomeBinding.tvNearestServer.background = resources.getDrawable(R.drawable.button_selector_state_tv)
+
+        }
+
+        clickListeners()
+        viewModelObserver()
+        showServers()
+    }
+
+    companion object {
+        var isTvHome: Boolean = true
+        var isFirstStepFragment: Boolean = false
+        var isSecondStepFragment: Boolean = false
+        var isThirdStepFragment: Boolean = false
+        var isFourthStepFragment: Boolean = false
+
+        fun newInstance(): TvHomeFragment {
+            return TvHomeFragment()
+        }
+    }
+
+    fun clickListeners() {
+        tvHomeBinding.ivConnect.setOnClickListener {
+            prefHelper.setServerObject(serverobj)
+//            vpnConnectionsUtil.connectVpn()
+        }
+
+        tvHomeBinding.tvLogoutTv?.setOnClickListener {
+            showExitPopup(this)
+        }
+
+        val serverDataLocation = prefHelper.getServerData().get(0).servers
+        val ipinfodata = prefHelper.getIpinfo()
+
+        val distinctdatanotnull = serverDataLocation?.filter {
+            it.lt != null && it.lg != null
+        }
+
+        val distinctdata = distinctdatanotnull?.distinctBy {
+            it.lt
+        }
+
+        val distinctdataCountry = distinctdata?.distinctBy {
+            it.country
+        }
+
+        val distinctdatanotsame = distinctdataCountry?.filter {
+            ipinfodata?.countryCode != it.iso && ipinfodata?.country != it.country
+        }
+
+        val result = FloatArray(1)
+        val ipinfo = prefHelper.getIpinfo()
+
+        distinctdatanotsame?.forEachIndexed { index, server ->
+            val lat1 = ipinfo?.latitute
+            val lon1 = ipinfo?.longitude
+            val lat2 = server.lt
+            val lon2 = server.lg
+
+            if (lat1 != null && lat2!= null && lon1!= null && lon2!= null)
+            {
+                Location.distanceBetween(lat1, lon1, lat2, lon2, result)
+            }
+
+            val distance: Float = result[0]
+            distinctdatanotsame.get(index).distance = distance
+
+        }
+
+        val sortedDistance = distinctdatanotsame?.sortedBy {
+            it.distance
+        }
+
+        val sortedDistanceFast: MutableList<Server> = ArrayList<Server>()
+
+        for (i in 0..2)
+        {
+            if (sortedDistance != null) {
+                sortedDistanceFast.add(sortedDistance.get(i))
+            }
+        }
+
+        tvHomeBinding.tvNearestServer?.setOnClickListener {
+            if (App.connection_status == App.CONNECTION_STATE_DISCONNECTED || App.connection_status == App.CONNECTION_STATE_DOWN_WG)
+            {
+                val animation: Animation = AnimationUtils.loadAnimation(baseContext, R.anim.fade_in)
+                tvHomeBinding.tvNearestServer?.startAnimation(animation)
+
+                sortedDistanceFast.get(0).let {
+                    onServerSelected(it)
+                }
+            }
+            else if (serverobj?.country != sortedDistanceFast.get(0).country)
+            {
+                val animation: Animation = AnimationUtils.loadAnimation(baseContext, R.anim.fade_in)
+                tvHomeBinding.tvNearestServer?.startAnimation(animation)
+
+                sortedDistanceFast.get(0).let {
+                    onServerSelected(it)
+                }
+            }
+        }
+
+    }
+    fun viewModelObserver() {
+        serverViewModel = ServerListViewModel(baseContext)
+        profileViewModel = ProfileViewModel()
+//        homeViewModel = HomeViewModel()
+
+        var filterServerByConnectionCount = Server()
+        if (prefHelper.getServerObject() != null) {
+            filterServerByConnectionCount = prefHelper.getServerObject()!!
+        } else {
+            filterServerByConnectionCount = serverViewModel.filterServerByConnectionCount(
+                prefHelper.getServerData().get(0).servers!!
+            )
+        }
+
+//        callBacks?.onServerSelected(filterServerByConnectionCount)
+
+        homeViewModel.mutableLiveDataIpInfo.observe(this, Observer {
+
+            it?.let {
+                tvHomeBinding.tvIp?.text = "IP: ${it.query}"
+
+                if (it.country != null)
+                {
+                    tvHomeBinding.tvCountry?.text ="${it.country}"
+                }
+                else if (it.city != null){
+                    tvHomeBinding.tvCountry?.text ="${it.city}, ${it.country}"
+                }
+                tvHomeBinding.cardCountryImg?.visibility = View.VISIBLE
+                tvHomeBinding.ivCountry?.setImageDrawable(
+                    Utils.getCountryFlag(baseContext, it.countryCode?.toLowerCase().toString())
+                )
+            }
+
+        })
+
+        profileViewModel.mutableLiveDataLogoutTv.observe(this, Observer {
+//            if (isVisible)
+//                mainActivity.hideLoading()
+                if (it) {
+                    prefHelper.clearAllData()
+
+                    val i = Intent(this, LoginActivityTV::class.java)
+                    startActivity(i)
+                    finish()
+//                    fragmentNavigator.replaceFragment(LoginFragment.newInstance())
+                }
+                else {
+//                    SnackBarUtils.showSnackBar(view, getString(R.string.something_went_wrong), Snackbar.LENGTH_SHORT)
+                }
+        })
+
+//        homeViewModel.mutableLiveDataValidate.observe(mainActivity, Observer {
+//            it?.let {
+//                it.status.let { status ->
+//                    if (!status) {
+//                        prefHelper.clearAllData()
+//                        fragmentNavigator.replaceFragment(LoginFragment.newInstance())
+//
+//                    }
+//                }
+//            }
+//        })
+
+    }
+    fun showServers() {
+//        requireActivity().supportFragmentManager.beginTransaction()
+
+        try {
+            this.supportFragmentManager.beginTransaction()
+                .replace(
+                    R.id.server_container,
+                    TvServerListFragment.newInstance(),
+                    "TvServerListFragment"
+                )
+                .commit()
+            tvHomeBinding.serverContainer?.visibility = View.VISIBLE
+        }
+        catch (e: Exception) {
+            e.printStackTrace()
+        }
+
+    }
+
+    fun showExitPopup(activity: Activity) {
+        val priceDialog = Dialog(activity)
+        priceDialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
+        priceDialog.setContentView(R.layout.dialogs_exit)
+        priceDialog.window!!.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
+        priceDialog.setCancelable(true)
+        priceDialog.show()
+        val tvYes = priceDialog.findViewById<View>(R.id.tvYes) as TextView
+        val tvNo = priceDialog.findViewById<View>(R.id.tvNo) as TextView
+        tvYes.setOnClickListener {
+            priceDialog.dismiss()
+//            if (isVisible)
+//                mainActivity.showLoading()
+//            if (App.connection_status == App.CONNECTION_STATE_CONNECTED || App.connection_status == App.CONNECTION_STATE_CONNECTED_2) {
+////                vpnConnectionsUtil.connectVpn()
+//                ivConnect.performClick()
+//            }
+
+            if (App.connection_status == App.CONNECTION_STATE_CONNECTED || App.connection_status == App.CONNECTION_STATE_CONNECTED_2 || App.connection_status == App.CONNECTION_STATE_UP_WG) {
+                Handler(Looper.getMainLooper()).postDelayed({
+                    tvHomeBinding.ivConnect?.performClick()
+                }, 500)
+            }
+
+            profileViewModel.logout()
+        }
+        tvNo.setOnClickListener { priceDialog.dismiss() }
+    }
+
+    override fun onChangeProtocol(protocol: Protocol) {
+        prefHelper.saveProtocol(protocol)
+    }
+
+    override fun onServerSelected(server: Server) {
+//        fragmentNavigator?.let {
+//            if (it.topFragment is ServerListFragment) {
+//                fragmentNavigator.popBackStack()
+//            }
+//        }
+
+        serverobj?.let {
+            if (vpnConnectionsUtil.isVPNConnected()) {
+                if (serverobj?.id != server.id) {
+//                    DialogFactory.createDialog(requireActivity(),
+//                        serverobj?.server_name,
+//                        server.server_name,
+//                        object : DialogInterface.OnClickListener {
+//                            override fun onClick(dialog: DialogInterface?, which: Int) {
+//                                setData(server)
+//                                vpnConnectionsUtil.stopVpn()
+//                                Handler().postDelayed(Runnable {
+//                                    tvHomeBinding.ivConnect?.performClick()
+//                                }, 500)
+//                            }
+//                        },
+//                        object : DialogInterface.OnClickListener {
+//                            override fun onClick(dialog: DialogInterface?, which: Int) {
+//                               dialog?.dismiss()
+//                            }
+//                        })
+                } else {
+                    setData(server)
+                }
+            } else {
+
+                setData(server)
+//                ivConnect?.performClick()
+
+                vpnConnectionsUtil.stopVpn()
+                Handler().postDelayed(Runnable {
+                    tvHomeBinding.ivConnect?.performClick()
+                }, 500)
+
+//                if (fragmentNavigator.topFragment is TvHomeFragment) {
+//
+//                }
+
+            }
+
+        } ?: kotlin.run {
+            setData(server)
+        }
+    }
+
+    fun setData(server: Server) {
+        serverobj = server
+
+        tvHomeBinding.tvServer?.text = server.server_name ?: server.name
+        tvHomeBinding.ivCountry?.setImageDrawable(
+            Utils.getCountryFlag(baseContext, server.iso?.toLowerCase().toString())
+        )
+    }
+
+    fun setTitleBar() {
+//        setupUI((mainActivity).titleBar, (mainActivity).bottomBar)
+    }
+
+//    private fun setupUI(titleBar: TitleBar, bottomBar: BottomBar) {
+//        titleBar.hideTitleBar()
+//        bottomBar.hideBottomBar()
+//    }
+
+    override fun onResume() {
+        super.onResume()
+
+        prefHelper.getProduct()?.identifier?.let {
+            if (it == AppEnum.FREE.key) {
+//                SnackBarUtils.showSnackBar(view, getString(R.string.account_not_subscribed), Snackbar.LENGTH_LONG)
+            }
+        }
+
+        try {
+            App.backend?.runningTunnelNames
+        } catch (e: Exception) {
+            val back = GoBackend(baseContext)
+            App.setBackend(back)
+            App.backend = App.getBackend()
+        }
+
+        vpnConnectionsUtil.onResumeCallBack()
+
+        homeViewModel.validatePassword(
+            prefHelper?.getUser()?.userinfo?.email.toString(),
+            prefHelper?.getPassword().toString(),
+            "tv",
+            android.os.Build.VERSION.RELEASE
+        )
+    }
+
+    override fun onPause() {
+        super.onPause()
+
+        vpnConnectionsUtil.onPauseCallBack()
+    }
+
+    override fun onStop() {
+        super.onStop()
+        vpnConnectionsUtil.onStopCallBack()
+    }
+
+    override fun onVpnConnecting() {
+        tvHomeBinding.tvConnectStatus?.let {
+            it.text = resources.getString(R.string.connecting_new)
+        }
+
+    }
+
+    override fun onVpnConnected() {
+        tvHomeBinding.tvConnectStatus?.let {
+            it.text = resources.getString(R.string.connected)
+            it.setTextColor(Color.parseColor("#fdb900"))
+
+            tvHomeBinding.ivConnect.setImageResource(R.drawable.ic_connect_y_new)
+            tvHomeBinding.rootHome.background = resources.getDrawable(R.drawable.gradient_list_button)
+        }
+
+        prefHelper.getServerObject().let { server ->
+            tvHomeBinding.tvIp?.let {
+                it.text = "IP: ${server?.ip}"
+                if (server!!.city == null)
+                {
+                    tvHomeBinding.tvCountry.text ="${server?.country}"
+                }
+                else{
+                    tvHomeBinding.tvCountry.text ="${server.city}, ${server?.country}"
+                }
+                tvHomeBinding.cardCountryImg.visibility = View.VISIBLE
+                tvHomeBinding.ivCountry.setImageDrawable(
+                    Utils.getCountryFlag(baseContext, server?.iso?.toLowerCase().toString())
+                )
+            }
+        }
+    }
+
+    override fun onVpnDisconnected() {
+        tvHomeBinding.tvConnectStatus?.let {
+            it.text = resources.getString(R.string.disconnected)
+            it.setTextColor(resources.getColor(R.color.white_half))
+
+            tvHomeBinding.rootHome.setBackgroundColor(resources.getColor(R.color.connect_button_color))
+            tvHomeBinding.ivConnect.setImageResource(R.drawable.ic_connect_n_new)
+        }
+    }
+
+    override fun onGetIp() {
+        if (App.connection_status != App.CONNECTION_STATE_CONNECTED) {
+            homeViewModel.getIp()
+        }
+    }
+
+    override fun onServerNotResponding() {
+        if (prefHelper.getProtocol().index == 0) {
+//            vpnConnectionsUtil.stopVpn()
+            vpnConnectionsUtil.startTcpUDP()
+        }
+        else{
+            Toast.makeText(
+                this,
+                getString(R.string.server_not_responding),
+                Toast.LENGTH_SHORT
+            ).show()
+        }
+    }
+}

+ 224 - 0
app/src/main/java/com/vpn/fastestvpnservice/activities/LoginActivityTV.kt

@@ -0,0 +1,224 @@
+package com.vpn.fastestvpnservice.activities
+
+import android.content.Intent
+import android.os.Bundle
+import android.text.InputType
+import android.util.Log
+import android.view.View
+import android.widget.Toast
+import androidx.activity.enableEdgeToEdge
+import androidx.appcompat.app.AppCompatActivity
+import androidx.core.view.ViewCompat
+import androidx.core.view.WindowInsetsCompat
+import androidx.lifecycle.Observer
+import com.google.firebase.BuildConfig
+import com.vpn.fastestvpnservice.R
+import com.vpn.fastestvpnservice.beans.DataResponse
+import com.vpn.fastestvpnservice.beans.UserResponse
+import com.vpn.fastestvpnservice.databinding.ActivityLoginTvBinding
+import com.vpn.fastestvpnservice.databinding.FragmentLoginBinding
+import com.vpn.fastestvpnservice.fragments.TvHomeFragment
+import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
+import com.vpn.fastestvpnservice.utils.SnackBarUtils
+import com.vpn.fastestvpnservice.utils.StaticMethods
+import com.vpn.fastestvpnservice.viewmodels.LoginViewModel
+import com.vpn.fastestvpnservice.views.CustomValidation
+import com.vpn.fastestvpnservice.widgets.SimpleAppWidget
+import de.blinkt.openvpn.core.App
+
+class LoginActivityTV : AppCompatActivity() {
+    lateinit var loginViewModel: LoginViewModel
+    var isPasswordVisible = false
+    var isTv = false
+    lateinit var loginBinding: ActivityLoginTvBinding
+    lateinit var prefHelper: BasePreferenceHelper
+    lateinit var customValidation: CustomValidation
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+//        enableEdgeToEdge()
+
+        loginBinding = ActivityLoginTvBinding.inflate(layoutInflater)
+        val view = loginBinding.root
+        setContentView(view)
+//        setContentView(R.layout.activity_login_tv)
+//        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
+//            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
+//            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
+//            insets
+//        }
+
+        prefHelper = BasePreferenceHelper(baseContext)
+        customValidation = CustomValidation()
+
+        if (StaticMethods.isTV(this)) {
+            isTv = true
+            loginBinding.etEmail.background = resources.getDrawable(R.drawable.edittext_selector_state)
+            loginBinding.etPassword.background = resources.getDrawable(R.drawable.edittext_selector_state)
+            loginBinding.tvLogin.background = resources.getDrawable(R.drawable.button_selector_state)
+        }
+
+        loginViewModel = LoginViewModel()
+//        upgradePriceViewModel = UpgradePriceViewModel(requireActivity())
+
+        viewModelObserver()
+        clickListeners()
+    }
+
+    fun clickListeners() {
+
+//        loginBinding.tvSignup.setOnClickListener {
+//            fragmentNavigator.replaceFragmentWithBackStack(SignUpFragment.newInstance())
+//        }
+
+        loginBinding.tvLogin.setOnClickListener {
+            if (customValidation.isValidText(loginBinding.etEmail, "Email") && customValidation.isValidText(
+                    loginBinding.etPassword, "Password"
+                ) && customValidation.isValidPassword(loginBinding.etPassword)
+            ) {
+//                if (isVisible) mainActivity.showLoading()
+                if (isTv)
+                {
+                    Log.d("test_tv_login", "TV login button")
+                    loginViewModel.loginRequest(
+                        loginBinding.etEmail.text.toString(),
+                        loginBinding.etPassword.text.toString(),
+                        "tv",
+                        android.os.Build.VERSION.RELEASE,
+                        BuildConfig.VERSION_NAME
+                    )
+
+                    loginBinding.progressBar?.visibility = View.VISIBLE
+                }
+                else {
+                    Log.d("test_tv_login", "not TV login button")
+                    loginViewModel.loginRequest(
+                        loginBinding.etEmail.text.toString(),
+                        loginBinding.etPassword.text.toString(),
+                        "android",
+                        android.os.Build.VERSION.RELEASE,
+                        BuildConfig.VERSION_NAME
+                    )
+
+                    loginBinding.progressBar?.visibility = View.VISIBLE
+
+                }
+
+            }
+        }
+
+//        loginBinding.tvForgotPassword.setOnClickListener {
+//            fragmentNavigator.replaceFragmentWithBackStack(
+//                .newInstance(
+//                    AppConstant.CHANGE_PASSWORD_URL, getString(R.string.forgot_password)
+//                )
+//            )
+//        }
+
+        loginBinding.ivEye.setOnClickListener(View.OnClickListener {
+            if (isPasswordVisible) {
+                loginBinding.ivEye.setImageResource(R.drawable.ic_hide_password)
+                loginBinding.etPassword.inputType =
+                    InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD
+                loginBinding.etPassword.setSelection(loginBinding.etPassword.text.toString().length)
+            } else {
+                loginBinding.ivEye.setImageResource(R.drawable.ic_show_password)
+                loginBinding.etPassword.inputType = InputType.TYPE_CLASS_TEXT
+                loginBinding.etPassword.setSelection(loginBinding.etPassword.text.toString().length)
+            }
+            isPasswordVisible = !isPasswordVisible
+        })
+
+    }
+
+    fun viewModelObserver() {
+        loginViewModel.mutableLiveDataUserResponse.observe(
+            this,
+            Observer<DataResponse<UserResponse>> {
+                Log.d("test_tv_login", "TV login response: ${it.message}")
+
+//                if (isVisible) mainActivity.hideLoading()
+                it?.let {
+                    loginBinding.progressBar?.visibility = View.GONE
+                    if (it.status) {
+                        it.data?.let {
+
+                            prefHelper.savePassword(loginBinding.etPassword?.text.toString())
+                            prefHelper.saveUser(it)
+                            it.wireguard?.let { it1 -> prefHelper.saveWireGuard(it1) }
+                            it.product?.let { it1 -> prefHelper.saveProduct(it1) }
+                            prefHelper.saveEnabledProtocols(it.enabled_protocols)
+                            prefHelper.saveAvailableProtocols(it.available_protocols)
+                            prefHelper.saveXPlatformToken(it.userinfo?.email + "_" + System.currentTimeMillis())
+                            prefHelper.saveAdBlockState(false)
+
+                            it.servers?.let {
+                                prefHelper.saveServerData(it)
+                            }
+
+                            Log.d("bearer token", it.token.toString())
+
+//                            upgradePriceViewModel.getProducts()
+
+                            prefHelper.getFcmToken().let {
+                                loginViewModel.sendFcmToken(it)
+                                Log.d("fcm token get", prefHelper.getFcmToken())
+                            }
+
+//                            prefHelper.saveRadioBtnSplitPos(0)
+
+                            val widgetIntent = Intent(baseContext, SimpleAppWidget::class.java)
+                            widgetIntent.action = SimpleAppWidget.ACTION_LOGIN
+                            baseContext?.sendBroadcast(widgetIntent)
+
+//                            fragmentNavigator.clearAllFragments()
+
+                            if (App.isAndroidTvBox)
+                            {
+                                /* Android-TV,Box APK */
+//                                fragmentNavigator.replaceFragmentWithBackStackTv(TvHomeFragment.newInstance(), "tv_home")
+                                val i = Intent(this, HomeActivityTV::class.java)
+                                startActivity(i)
+                                finish()
+                            }
+                            else {
+                                /* Normal APK */
+                                if (isTv) {
+//                                    fragmentNavigator.replaceFragmentWithBackStackTv(
+//                                        TvHomeFragment.newInstance(), "tv_home")
+                                    val i = Intent(this, HomeActivityTV::class.java)
+                                    startActivity(i)
+                                    finish()
+                                }
+                                else {
+//                                    fragmentNavigator.replaceFragmentWithBackStack(
+//                                        TvHomeFragment.newInstance()
+//                                    )
+                                    val i = Intent(this, HomeActivityTV::class.java)
+                                    startActivity(i)
+                                    finish()
+                                }
+                            }
+                        }
+                    } else {
+//                        SnackBarUtils.showSnackBar(view, it.message, Toast.LENGTH_SHORT)
+//                        UIHelper.showToast(it.message)
+                    }
+                }
+            })
+
+        loginViewModel.mutableLiveDataUserResponseErrorStatus.observe(this, Observer{
+            if (it) {
+//                if (isVisible) mainActivity.hideLoading()
+//                SnackBarUtils.showSnackBar(view, getString(R.string.something_went_wrong), Toast.LENGTH_SHORT)
+            }
+        })
+
+        loginViewModel.mutableLiveDataFcm.observe(
+            this,
+            Observer {
+                it.message?.let { it1 -> Log.d("msg", "message of fcm" + it1) }
+            }
+        )
+
+    }
+}

+ 29 - 14
app/src/main/java/com/vpn/fastestvpnservice/activities/SplashActivity.kt

@@ -6,7 +6,6 @@ import android.util.Log
 import androidx.activity.ComponentActivity
 import androidx.appcompat.app.AppCompatActivity
 import com.vpn.fastestvpnservice.MainActivity
-import com.vpn.fastestvpnservice.MainActivity.Companion.getCallingIntent
 import com.vpn.fastestvpnservice.R
 import com.vpn.fastestvpnservice.constants.AppEnum
 import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
@@ -68,6 +67,9 @@ class SplashActivity : MainActivity() {
 //        })
         moveToLogin()
 
+//        val i = Intent(this, SplashActivity2::class.java)
+//        startActivity(i)
+
     }
 
     private fun moveToLogin() {
@@ -76,30 +78,40 @@ class SplashActivity : MainActivity() {
             Log.d("test_nav_tv", "getUser() null")
 
             if (App.isAndroidTvBox) {
+                val i = Intent(this, LoginActivityTV::class.java)
+                startActivity(i)
+                finish()
+
                 /* Since this for specific android-tvbox, so only login_fragment*/
-                startActivity(
-                    getCallingIntent(this).putExtra(
-                        AppEnum.SCREEN_NAME.key,
-                        AppEnum.LOGIN_SCREEN.key
-                    )
-                )
+//                startActivity(
+//                    getCallingIntent(this).putExtra(
+//                        AppEnum.SCREEN_NAME.key,
+//                        AppEnum.LOGIN_SCREEN.key
+//                    )
+//                )
             }
             else {
                 if (StaticMethods.isTV(this)) {
                     Log.d("test_nav_tv", "getUser() null : TV")
-                    startActivity(
-                        getCallingIntent(this).putExtra(
-                            AppEnum.SCREEN_NAME.key,
-                            AppEnum.LOGIN_SCREEN.key
-                        )
-                    )
+
+                    val i = Intent(this, LoginActivityTV::class.java)
+                    startActivity(i)
+                    finish()
+
+//                    startActivity(
+//                        getCallingIntent(this).putExtra(
+//                            AppEnum.SCREEN_NAME.key,
+//                            AppEnum.LOGIN_SCREEN.key
+//                        )
+//                    )
+//                    initFragment(AppEnum.LOGIN_SCREEN.key)
                 }
             }
 
         } else {
             Log.d("test_nav_tv", "getUser() =>")
 //            splashViewModel.serverDataApi()
-            initFragment(AppEnum.LOGIN_SCREEN.key)
+//            initFragment(AppEnum.LOGIN_SCREEN.key)
 //            val i = Intent(this, SplashActivity2::class.java)
 //            startActivity(i)
 
@@ -108,6 +120,9 @@ class SplashActivity : MainActivity() {
 //                    AppEnum.SCREEN_NAME.key, AppEnum.LOGIN_SCREEN.key
 //                )
 //            )
+
+            val i = Intent(this, HomeActivityTV::class.java)
+            startActivity(i)
             finish()
         }
     }

+ 167 - 0
app/src/main/java/com/vpn/fastestvpnservice/adapters/ServerAdapter.kt

@@ -0,0 +1,167 @@
+package com.vpn.fastestvpnservice.adapters
+
+import android.content.Context
+import android.graphics.Color
+import android.os.Build
+import android.os.Handler
+import android.os.Looper
+import android.view.View
+import android.widget.ImageView
+import android.widget.TextView
+import androidx.cardview.widget.CardView
+import com.chad.library.adapter.base.BaseQuickAdapter
+import com.chad.library.adapter.base.BaseViewHolder
+import com.stealthcopter.networktools.Ping
+import com.stealthcopter.networktools.ping.PingResult
+import com.stealthcopter.networktools.ping.PingStats
+import com.vpn.fastestvpnservice.R
+import com.vpn.fastestvpnservice.beans.Server
+import com.vpn.fastestvpnservice.utils.Utils
+import java.util.*
+
+class ServerAdapter : BaseQuickAdapter<Server, BaseViewHolder> {
+
+    var context: Context
+    var selectedPosition = 0
+
+    constructor(context: Context, layoutResId: Int, data: MutableList<Server>?) : super(
+        layoutResId, data
+    ) {
+        this.context = context
+    }
+
+    override fun convert(helper: BaseViewHolder?, item: Server?) {
+
+        var ivCountry = helper?.getView<ImageView>(R.id.ivCountry)
+        var vpn_name = helper?.getView<TextView>(R.id.vpn_name)
+        var tvPing = helper?.getView<TextView>(R.id.textView12)
+        var card_bg = helper?.getView<CardView>(R.id.card_bg)
+
+        helper?.itemView?.isFocusable = true
+        helper?.itemView?.isFocusableInTouchMode = false
+
+        if (selectedPosition in 1..10) {
+
+                vpn_name?.text = item?.server_name ?: item?.name
+                Ping.onAddress(item?.ip as String).setTimeOutMillis(1000)
+                    .doPing(object : Ping.PingListener {
+                        override fun onResult(pingResult: PingResult) {
+                            Handler(Looper.getMainLooper()).post { //do stuff like remove view etc
+                                tvPing?.text = "${(pingResult.timeTaken).toInt()} ms"
+                            }
+                        }
+
+                        override fun onFinished(pingStats: PingStats?) {}
+                        override fun onError(e: Exception?) {}
+                    })
+
+                item.iso?.let {
+                    if (context.resources.getIdentifier(
+                            item.iso.toLowerCase(Locale.getDefault()), "drawable", context.packageName
+                        ) != 0
+                    ) {
+                        ivCountry?.setImageDrawable(
+                            if (item.enable == 1) Utils.getCountryFlag(
+                                context,
+                                item.iso.toLowerCase().toString()
+                            ) else
+                                Utils.getCountryFlagGray(context, item.iso.toLowerCase().toString())
+                        )
+                    }
+                }
+        }   // Non-Country Servers
+        else if (selectedPosition == 0) {
+            vpn_name?.text = item?.country
+            tvPing?.text = "${item?.totalServers} Locations"
+
+            item?.iso?.let {
+                if (context.resources.getIdentifier(
+                        item.iso.toLowerCase(Locale.getDefault()), "drawable", context.packageName
+                    ) != 0
+                ) {
+                    ivCountry?.setImageDrawable(
+                        if (item.enableServers == 1) Utils.getCountryFlag(
+                            context,
+                            item.iso.toLowerCase().toString()
+                        ) else
+                            Utils.getCountryFlagGray(context, item.iso.toLowerCase().toString())
+                    )
+                }
+            }
+        }   // Country Servers
+        else if (selectedPosition == 55) {
+            if (item?.enable == 1)
+            {
+                vpn_name?.text = item.server_name ?: item.name
+                Ping.onAddress(item.ip as String).setTimeOutMillis(1000)
+                    .doPing(object : Ping.PingListener {
+                        override fun onResult(pingResult: PingResult) {
+                            Handler(Looper.getMainLooper()).post { //do stuff like remove view etc
+                                tvPing?.text = "${(pingResult.timeTaken).toInt()} ms"
+                            }
+                        }
+
+                        override fun onFinished(pingStats: PingStats?) {}
+                        override fun onError(e: Exception?) {}
+                    })
+
+                item.iso?.let {
+                    if (context.resources.getIdentifier(
+                            item.iso.toLowerCase(Locale.getDefault()), "drawable", context.packageName
+                        ) != 0
+                    ) {
+                        ivCountry?.setImageDrawable(
+                            if (item.enable == 1) Utils.getCountryFlag(
+                                context,
+                                item.iso.toLowerCase().toString()
+                            ) else
+                                Utils.getCountryFlagGray(context, item.iso.toLowerCase().toString())
+                        )
+                    }
+                }
+            }
+            else {
+                card_bg?.visibility = View.GONE
+            }
+        }    // TV Servers
+        if (selectedPosition == 65) {
+
+            vpn_name?.text = item?.server_name ?: item?.name
+
+            item?.iso?.let {
+                if (context.resources.getIdentifier(
+                        item.iso.toLowerCase(Locale.getDefault()), "drawable", context.packageName
+                    ) != 0
+                ) {
+                    ivCountry?.setImageDrawable(
+                        if (item.enable == 1) Utils.getCountryFlag(
+                            context,
+                            item.iso.toLowerCase().toString()
+                        ) else
+                            Utils.getCountryFlagGray(context, item.iso.toLowerCase().toString())
+                    )
+                }
+            }
+        }   // Search List
+
+        helper?.itemView?.onFocusChangeListener = View.OnFocusChangeListener { view, b ->
+            if (b) {
+                card_bg?.background =
+                    context.resources.getDrawable(R.drawable.itemserver_background_tv)
+
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+                    vpn_name?.setTextColor(context.getColor(R.color.app_blue_color))
+                    tvPing?.setTextColor(context.getColor(R.color.app_blue_color))
+                }
+            } else {
+                card_bg?.setBackgroundColor(Color.parseColor("#06143B"))
+
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+                    vpn_name?.setTextColor(context.getColor(R.color.white))
+                    tvPing?.setTextColor(context.getColor(R.color.grayitem))
+                }
+            }
+        }   // Focus on Servers in TV
+
+    }
+}

+ 59 - 0
app/src/main/java/com/vpn/fastestvpnservice/adapters/SettingsAdapter.kt

@@ -0,0 +1,59 @@
+package com.vpn.fastestvpnservice.adapters
+
+import android.content.Context
+import android.graphics.Color
+import android.os.Build
+import android.view.View
+import android.widget.ImageView
+import android.widget.TextView
+import androidx.cardview.widget.CardView
+import com.chad.library.adapter.base.BaseQuickAdapter
+import com.chad.library.adapter.base.BaseViewHolder
+import com.vpn.fastestvpnservice.R
+import com.vpn.fastestvpnservice.beans.Server
+import com.vpn.fastestvpnservice.beans.SettingsData
+import com.vpn.fastestvpnservice.utils.Utils
+
+class SettingsAdapter: BaseQuickAdapter<SettingsData, BaseViewHolder> {
+
+    var context: Context
+
+    constructor(context: Context, layoutResId: Int, data: ArrayList<SettingsData>?) : super(
+        layoutResId, data
+    ) {
+        this.context = context
+    }
+
+    override fun convert(helper: BaseViewHolder?, item: SettingsData?) {
+        var ivIcon = helper?.getView<ImageView>(R.id.ivIconItem)
+        var tvName = helper?.getView<TextView>(R.id.item_name)
+        var card_bg = helper?.getView<CardView>(R.id.card_bg)
+
+        helper?.itemView?.isFocusable = true
+        helper?.itemView?.isFocusableInTouchMode = false
+
+        ivIcon?.setImageDrawable(
+            Utils.getCountryFlag(context, item?.iconItem.toString())
+        )
+
+        tvName?.text = item?.iconName
+
+        helper?.itemView?.onFocusChangeListener = View.OnFocusChangeListener { view, b ->
+            if (b) {
+                card_bg?.background =
+                    context.resources.getDrawable(R.drawable.itemserver_background_tv)
+
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+                    tvName?.setTextColor(context.getColor(R.color.app_blue_color))
+                }
+            } else {
+                card_bg?.setBackgroundColor(Color.parseColor("#06143B"))
+
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+                    tvName?.setTextColor(context.getColor(R.color.white))
+                }
+            }
+        }
+    }
+
+}

+ 2 - 2
app/src/main/java/com/vpn/fastestvpnservice/fragments/BaseFragment.java

@@ -42,7 +42,7 @@ public abstract class BaseFragment extends Fragment {
     }
 
     protected MainActivity getMainActivity() {
-        return (MainActivity) getMainActivity();
+        return (MainActivity) getActivity();
     }
 
     @Nullable
@@ -67,7 +67,7 @@ public abstract class BaseFragment extends Fragment {
     public void onActivityCreated(@Nullable Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);
 
-        dockActivity = (DockActivity) getMainActivity();
+        dockActivity = (DockActivity) getActivity();
         mFragmentNavigator = dockActivity.getFragmentNavigator();
 
         setListeners();

+ 17 - 10
app/src/main/java/com/vpn/fastestvpnservice/fragments/LoginFragment.kt

@@ -12,6 +12,7 @@ import android.widget.Toast
 import androidx.lifecycle.Observer
 import com.google.firebase.BuildConfig
 import com.vpn.fastestvpnservice.R
+import com.vpn.fastestvpnservice.activities.HomeActivityTV
 import com.vpn.fastestvpnservice.beans.DataResponse
 import com.vpn.fastestvpnservice.beans.UserResponse
 import com.vpn.fastestvpnservice.constants.AppConstant
@@ -35,7 +36,7 @@ class LoginFragment : BaseFragment() {
     override fun onCreateView(
         inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
     ): View? {
-        loginBinding = FragmentLoginBinding.inflate(inflater)
+        loginBinding = FragmentLoginBinding.inflate(inflater, container, false)
         return loginBinding.root
 //        return inflater.inflate(R.layout.fragment_login, container, false)
     }
@@ -62,8 +63,8 @@ class LoginFragment : BaseFragment() {
         loginViewModel = LoginViewModel()
 //        upgradePriceViewModel = UpgradePriceViewModel(requireActivity())
 
-//        viewModelObserver()
-//        clickListeners()
+        viewModelObserver()
+        clickListeners()
     }
 
     fun clickListeners() {
@@ -164,23 +165,29 @@ class LoginFragment : BaseFragment() {
                             widgetIntent.action = SimpleAppWidget.ACTION_LOGIN
                             context?.sendBroadcast(widgetIntent)
 
-                            fragmentNavigator.clearAllFragments()
+//                            fragmentNavigator.clearAllFragments()
 
                             if (App.isAndroidTvBox)
                             {
                                 /* Android-TV,Box APK */
-                                fragmentNavigator.replaceFragmentWithBackStackTv(TvHomeFragment.newInstance(), "tv_home")
+                                val i = Intent(context, HomeActivityTV::class.java)
+                                startActivity(i)
+//                                fragmentNavigator.replaceFragmentWithBackStackTv(TvHomeFragment.newInstance(), "tv_home")
                             }
                             else {
                                 /* Normal APK */
                                 if (isTv) {
-                                    fragmentNavigator.replaceFragmentWithBackStackTv(
-                                        TvHomeFragment.newInstance(), "tv_home")
+//                                    fragmentNavigator.replaceFragmentWithBackStackTv(
+//                                        TvHomeFragment.newInstance(), "tv_home")
+                                    val i = Intent(context, HomeActivityTV::class.java)
+                                    startActivity(i)
                                 }
                                 else {
-                                    fragmentNavigator.replaceFragmentWithBackStack(
-                                        TvHomeFragment.newInstance()
-                                    )
+//                                    fragmentNavigator.replaceFragmentWithBackStack(
+//                                        TvHomeFragment.newInstance()
+//                                    )
+                                    val i = Intent(context, HomeActivityTV::class.java)
+                                    startActivity(i)
                                 }
                             }
                         }

+ 432 - 401
app/src/main/java/com/vpn/fastestvpnservice/fragments/TvServerListFragment.kt

@@ -1,419 +1,465 @@
 package com.vpn.fastestvpnservice.fragments
 
+import android.content.Context
+import android.content.pm.ApplicationInfo
+import android.content.pm.PackageManager
+import android.graphics.Bitmap
+import android.graphics.drawable.Drawable
+import android.os.Bundle
 import android.view.*
+import androidx.fragment.app.Fragment
+import androidx.leanback.app.GuidedStepSupportFragment
+import androidx.recyclerview.widget.LinearLayoutManager
+import com.vpn.fastestvpnservice.MainActivity
+import com.vpn.fastestvpnservice.R
+import com.vpn.fastestvpnservice.activities.GuidedActivity
+import com.vpn.fastestvpnservice.adapters.ServerAdapter
+import com.vpn.fastestvpnservice.adapters.SettingsAdapter
+import com.vpn.fastestvpnservice.beans.SelectApplicationEntry
+import com.vpn.fastestvpnservice.beans.Server
+import com.vpn.fastestvpnservice.beans.SettingsData
+import com.vpn.fastestvpnservice.databinding.FragmentServerListBinding
+import com.vpn.fastestvpnservice.helpers.BasePreferenceHelper
+import com.vpn.fastestvpnservice.interfaces.UpdateServersOnProtocol
+import com.vpn.fastestvpnservice.viewmodels.ServerListViewModel
 
 
-class TvServerListFragment : BaseFragment()
-//    , UpdateServersOnProtocol
+class TvServerListFragment : Fragment(), UpdateServersOnProtocol
 {
 
-    //    lateinit var serverListViewModel: ServerListViewModel
-//    lateinit var serverAdapter: ServerAdapter
-//    lateinit var dedicatedServerAdapter: ServerAdapter
-//    lateinit var streamingServerAdapter: ServerAdapter
-//    lateinit var dvpnServerAdapter: ServerAdapter
-//    lateinit var p2pServerAdapter: ServerAdapter
+    lateinit var serverListViewModel: ServerListViewModel
+    lateinit var serverAdapter: ServerAdapter
+    lateinit var dedicatedServerAdapter: ServerAdapter
+    lateinit var streamingServerAdapter: ServerAdapter
+    lateinit var dvpnServerAdapter: ServerAdapter
+    lateinit var p2pServerAdapter: ServerAdapter
 //    lateinit var favouritesAdapter: FavouritesAdapter
-//    lateinit var settingsAdapter: SettingsAdapter
-//    var settingsList = ArrayList<SettingsData>()
-//
-//    var isServersEnabled: Boolean = false
-//    var isDedicatedEnabled: Boolean = false
-//    var isStreamingEnabled: Boolean = false
-//    var isDvpnEnabled: Boolean = false
-//    var isP2PEnabled: Boolean = false
-//
-//    override fun onCreateView(
-//        inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
-//    ): View? {
+    lateinit var settingsAdapter: SettingsAdapter
+    var settingsList = ArrayList<SettingsData>()
+    lateinit var prefHelper: BasePreferenceHelper
+    lateinit var tvServerListBinding: FragmentServerListBinding
+
+    var isServersEnabled: Boolean = false
+    var isDedicatedEnabled: Boolean = false
+    var isStreamingEnabled: Boolean = false
+    var isDvpnEnabled: Boolean = false
+    var isP2PEnabled: Boolean = false
+//
+    override fun onCreateView(
+        inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
+    ): View? {
+    tvServerListBinding = FragmentServerListBinding.inflate(inflater, container, false)
+    return tvServerListBinding.root
 //        return inflater.inflate(R.layout.fragment_server_list, container, false)
-//    }
-//
-//    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
-//        super.onViewCreated(view, savedInstanceState)
-////        GuidedStepSupportFragment.addAsRoot(requireActivity(), FirstStepFragment(), android.R.id.content)
-////        GuidedStepSupportFragment.add(fragmentManager, FirstStepFragment(), android.R.id.content)
-//
-//        serverListViewModel = ServerListViewModel(mainActivity)
-//        MainActivity.updateServersOnProtocol = this
-//
-//        setAdaptersCallBack()
-//        setAdapters()
-//        clickListeners()
-//    }
-//
-//    fun setAdaptersCallBack() {
-//        val serversData = prefHelper.getServerData()
-//
-//        serversData.forEachIndexed { index, serverData ->
-////            Log.d("servers testing tv 123", "$index,${serverData.name},${serverData.servers?.size}")
-//
-//            if (serverData.name?.equals("Servers") == true)
-//            {
-//                prefHelper.getServerData().get(index).servers?.let { serversList ->
-//                    serverAdapter = ServerAdapter(
-//                        mainActivity,
-//                        R.layout.item_server,
-//                        prefHelper.getServerData().get(index).servers?.let {
-//                            serverListViewModel.filterServersWithTvCountries(
-//                                it
-//                            )
-//                        }
-//                    )
-//
-//                    val data = serverListViewModel.filterServersWithTvCountries(serversList)
-//                    if (data.size > 0)
-//                    {
-////                        tvcountries.text = serverData.name
-//                        tvcountries?.text = "Top Locations"
-//                        isServersEnabled = true
-//                    }
-//                    else {
-//                        tvcountries?.text = ""
-//                        isServersEnabled = false
-//                    }
-//
-//                    serverAdapter.selectedPosition = 55
-//                    rv_servers?.layoutManager =
-//                        LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
-//                    rv_servers?.adapter = serverAdapter
-//                }
-//            }
-//            else if (serverData.name?.equals("Dedicated IP") == true)
-//            {
-//                prefHelper.getServerData().get(index).servers?.let { dedicated ->
-//
-////                    Log.d("ser_test_ded", "Dedicated IP $isDedicatedEnabled")
-//                    dedicatedServerAdapter = ServerAdapter(
-//                        mainActivity,
-//                        R.layout.item_server,
-//                        prefHelper.getServerData().get(index).servers?.let {
-//                            serverListViewModel.filterServersByISOTV(
-//                                it
-//                            )
-//                        }
-//                    )
-//
-//                    val data = serverListViewModel.filterServersByISOTV(dedicated)
-//                    if (data.size > 0)
-//                    {
-////                        Log.d("ser_test_ded", "Dedicated size>0 $isDedicatedEnabled")
-//
-//                        tv_dedicatedip_servers_tv?.text = serverData.name
-//                        isDedicatedEnabled = true
-//                    }
-//                    else {
-//                        tv_dedicatedip_servers_tv?.text = ""
-//                        isDedicatedEnabled = false
-//                    }
-//
-////                    Log.d("ser_test_ded", "Dedicated size=0 $isDedicatedEnabled")
-//                    dedicatedServerAdapter.selectedPosition = 55
-//                    rv_dedicatedip_servers_tv?.layoutManager =
-//                        LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
-//                    rv_dedicatedip_servers_tv?.adapter = dedicatedServerAdapter
-//
-//                }
-//            }
-//            else if (serverData.name?.equals("Streaming") == true)
-//            {
-//                prefHelper.getServerData().get(index).servers?.let { streaming ->
-//                    streamingServerAdapter = ServerAdapter(
-//                        mainActivity,
-//                        R.layout.item_server,
-//                        prefHelper.getServerData().get(index).servers?.let {
-//                            serverListViewModel.filterServersByStreamingServersTV(
-//                                it
-//                            )
-//                        }
-//                    )
-//
-//                    val data = serverListViewModel.filterServersByStreamingServersTV(streaming)
-//                    if (data.size > 0)
-//                    {
-//                        tvstreaming?.text = serverData.name
-//                        isStreamingEnabled = true
-//                    }
-//                    else {
-//                        tvstreaming?.text = ""
-//                        isStreamingEnabled = false
-//                    }
-//
-//                    streamingServerAdapter.selectedPosition = 55
-//                    rv_streaming?.layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
-//                    rv_streaming?.adapter = streamingServerAdapter
-//                }
-//            }
-//            else if (serverData.name?.equals("D-VPN") == true)
-//            {
-//                prefHelper.getServerData().get(index).servers?.let { dvpn ->
-//                    dvpnServerAdapter = ServerAdapter(
-//                        mainActivity,
-//                        R.layout.item_server,
-//                        prefHelper.getServerData().get(index).servers?.let {
-//                            serverListViewModel.filterServersByISOTV(
-//                                it
-//                            )
-//                        }
-//                    )
-//
-//                    val data = serverListViewModel.filterServersByISOTV(dvpn)
-//                    if (data.size > 0)
-//                    {
-//                        tvdvpn?.text = serverData.name
-//                        isDvpnEnabled = true
-//                    }
-//                    else {
-//                        tvdvpn?.text = ""
-//                        isDvpnEnabled = false
-//                    }
-//
-//                    dvpnServerAdapter.selectedPosition = 55
-//                    rv_dvpn?.layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
-//                    rv_dvpn?.adapter = dvpnServerAdapter
-//
-//                }
-//            }
-//            else if (serverData.name?.equals("P2P") == true)
-//            {
-//                prefHelper.getServerData().get(index).servers?.let { p2p ->
-//                    p2pServerAdapter = ServerAdapter(
-//                        mainActivity,
-//                        R.layout.item_server,
-//                        prefHelper.getServerData().get(index).servers?.let {
-//                            serverListViewModel.filterServersByISOTV(
-//                                it
-//                            )
-//                        }
-//                    )
-//
-//                    val data = serverListViewModel.filterServersByISOTV(p2p)
-//                    if (data.size > 0)
-//                    {
-//                        tvp2p?.text = serverData.name
-//                        isP2PEnabled = true
-//                    }
-//                    else {
-//                        tvp2p?.text = ""
-//                        isP2PEnabled = false
-//                    }
-//
-//                    p2pServerAdapter.selectedPosition = 55
-//                    rv_p2p?.layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
-//                    rv_p2p?.adapter = p2pServerAdapter
-//                }
-//            }
-//        }
-//    }
-//    fun setAdapters() {
-//
-//        /*Favourite List*/
+    }
+
+    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+        super.onViewCreated(view, savedInstanceState)
+//        GuidedStepSupportFragment.addAsRoot(requireActivity(), FirstStepFragment(), android.R.id.content)
+//        GuidedStepSupportFragment.add(fragmentManager, FirstStepFragment(), android.R.id.content)
+
+        serverListViewModel = ServerListViewModel(requireContext())
+        MainActivity.updateServersOnProtocol = this
+        prefHelper = BasePreferenceHelper(requireContext())
+
+        setAdaptersCallBack()
+        setAdapters()
+        clickListeners()
+    }
+
+    fun setAdaptersCallBack() {
+        val serversData = prefHelper.getServerData()
+
+        serversData.forEachIndexed { index, serverData ->
+//            Log.d("servers testing tv 123", "$index,${serverData.name},${serverData.servers?.size}")
+
+            if (serverData.name?.equals("Servers") == true)
+            {
+                prefHelper.getServerData().get(index).servers?.let { serversList ->
+                    serverAdapter = ServerAdapter(
+                        requireContext(),
+                        R.layout.item_server,
+                        prefHelper.getServerData().get(index).servers?.let {
+                            serverListViewModel.filterServersWithTvCountries(
+                                it
+                            )
+                        }
+                    )
+
+                    val data = serverListViewModel.filterServersWithTvCountries(serversList)
+                    if (data.size > 0)
+                    {
+//                        tvcountries.text = serverData.name
+                        tvServerListBinding.tvcountries?.text = "Top Locations"
+                        isServersEnabled = true
+                    }
+                    else {
+                        tvServerListBinding.tvcountries?.text = ""
+                        isServersEnabled = false
+                    }
+
+                    serverAdapter.selectedPosition = 55
+                    tvServerListBinding.rvServers?.layoutManager =
+                        LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
+                    tvServerListBinding.rvServers?.adapter = serverAdapter
+                }
+            }
+            else if (serverData.name?.equals("Dedicated IP") == true)
+            {
+                prefHelper.getServerData().get(index).servers?.let { dedicated ->
+
+//                    Log.d("ser_test_ded", "Dedicated IP $isDedicatedEnabled")
+                    dedicatedServerAdapter = ServerAdapter(
+                        requireContext(),
+                        R.layout.item_server,
+                        prefHelper.getServerData().get(index).servers?.let {
+                            serverListViewModel.filterServersByISOTV(
+                                it
+                            )
+                        }
+                    )
+
+                    val data = serverListViewModel.filterServersByISOTV(dedicated)
+                    if (data.size > 0)
+                    {
+//                        Log.d("ser_test_ded", "Dedicated size>0 $isDedicatedEnabled")
+
+                        tvServerListBinding.tvDedicatedipServersTv?.text = serverData.name
+                        isDedicatedEnabled = true
+                    }
+                    else {
+                        tvServerListBinding.tvDedicatedipServersTv?.text = ""
+                        isDedicatedEnabled = false
+                    }
+
+//                    Log.d("ser_test_ded", "Dedicated size=0 $isDedicatedEnabled")
+                    dedicatedServerAdapter.selectedPosition = 55
+                    tvServerListBinding.rvDedicatedipServersTv?.layoutManager =
+                        LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
+                    tvServerListBinding.rvDedicatedipServersTv?.adapter = dedicatedServerAdapter
+
+                }
+            }
+            else if (serverData.name?.equals("Streaming") == true)
+            {
+                prefHelper.getServerData().get(index).servers?.let { streaming ->
+                    streamingServerAdapter = ServerAdapter(
+                        requireContext(),
+                        R.layout.item_server,
+                        prefHelper.getServerData().get(index).servers?.let {
+                            serverListViewModel.filterServersByStreamingServersTV(
+                                it
+                            )
+                        }
+                    )
+
+                    val data = serverListViewModel.filterServersByStreamingServersTV(streaming)
+                    if (data.size > 0)
+                    {
+                        tvServerListBinding.tvstreaming?.text = serverData.name
+                        isStreamingEnabled = true
+                    }
+                    else {
+                        tvServerListBinding.tvstreaming?.text = ""
+                        isStreamingEnabled = false
+                    }
+
+                    streamingServerAdapter.selectedPosition = 55
+                    tvServerListBinding.rvStreaming?.layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
+                    tvServerListBinding.rvStreaming?.adapter = streamingServerAdapter
+                }
+            }
+            else if (serverData.name?.equals("D-VPN") == true)
+            {
+                prefHelper.getServerData().get(index).servers?.let { dvpn ->
+                    dvpnServerAdapter = ServerAdapter(
+                        requireContext(),
+                        R.layout.item_server,
+                        prefHelper.getServerData().get(index).servers?.let {
+                            serverListViewModel.filterServersByISOTV(
+                                it
+                            )
+                        }
+                    )
+
+                    val data = serverListViewModel.filterServersByISOTV(dvpn)
+                    if (data.size > 0)
+                    {
+                        tvServerListBinding.tvdvpn?.text = serverData.name
+                        isDvpnEnabled = true
+                    }
+                    else {
+                        tvServerListBinding.tvdvpn?.text = ""
+                        isDvpnEnabled = false
+                    }
+
+                    dvpnServerAdapter.selectedPosition = 55
+                    tvServerListBinding.rvDvpn?.layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
+                    tvServerListBinding.rvDvpn?.adapter = dvpnServerAdapter
+
+                }
+            }
+            else if (serverData.name?.equals("P2P") == true)
+            {
+                prefHelper.getServerData().get(index).servers?.let { p2p ->
+                    p2pServerAdapter = ServerAdapter(
+                        requireContext(),
+                        R.layout.item_server,
+                        prefHelper.getServerData().get(index).servers?.let {
+                            serverListViewModel.filterServersByISOTV(
+                                it
+                            )
+                        }
+                    )
+
+                    val data = serverListViewModel.filterServersByISOTV(p2p)
+                    if (data.size > 0)
+                    {
+                        tvServerListBinding.tvp2p?.text = serverData.name
+                        isP2PEnabled = true
+                    }
+                    else {
+                        tvServerListBinding.tvp2p?.text = ""
+                        isP2PEnabled = false
+                    }
+
+                    p2pServerAdapter.selectedPosition = 55
+                    tvServerListBinding.rvP2p?.layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
+                    tvServerListBinding.rvP2p?.adapter = p2pServerAdapter
+                }
+            }
+        }
+    }
+
+    fun setAdapters() {
+
+        /*Favourite List*/
 //        favouritesAdapter = FavouritesAdapter(
 //            mainActivity, R.layout.item_favourites, serverListViewModel.getFavList()
 //        )
 //        rvList_favourite.layoutManager =
 //            LinearLayoutManager(mainActivity, LinearLayoutManager.HORIZONTAL, false)
 //        rvList_favourite.adapter = favouritesAdapter
-//
-//        /*Settings List*/
-//
-//        settingsList.add(SettingsData("vpn_key_24", "Protocol"))
-//        settingsList.add(SettingsData("ic_splittunneling", "Split Tunneling"))
-////        settingsList.add(SettingsData("ic_killswitch", "Kill Switch"))
-//
-//        settingsAdapter = SettingsAdapter(
-//            mainActivity, R.layout.item_settings_tv, settingsList
-//        )
-//
-//        rv_settings?.layoutManager =
-//            LinearLayoutManager(mainActivity, LinearLayoutManager.HORIZONTAL, false)
-//        rv_settings?.adapter = settingsAdapter
-//
-//    }
-//
-//    fun clickListeners() {
-//
-//        if (isServersEnabled)
-//        {
-//            serverAdapter.setOnItemClickListener { adapter, view, position ->
-//
-//                serverAdapter.getItem(position)?.let {
-//                    if (it.enable == 1) {
-//                        MainActivity.callBacks?.onServerSelected(it)
-//                    }
-//                }
-//            }
-//        }
-//
-//        if (isDedicatedEnabled)
-//        {
-//            dedicatedServerAdapter.setOnItemClickListener { adapter, view, position ->
-//
-//                dedicatedServerAdapter.getItem(position)?.let {
-//                    if (it.enable == 1) {
-//                        MainActivity.callBacks?.onServerSelected(it)
-//                    }
-//                }
-//            }
-//        }
-//
-//        if (isStreamingEnabled)
-//        {
-//            streamingServerAdapter.setOnItemClickListener { adapter, view, position ->
-//
-//                streamingServerAdapter.getItem(position)?.let {
-//                    if (it.enable == 1)
-//                    {
-//                        MainActivity.callBacks?.onServerSelected(it)
-//                    }
-//                }
-//            }
-//        }
-//
-//        if (isDvpnEnabled)
+
+        /*Settings List*/
+
+        settingsList.add(SettingsData("vpn_key_24", "Protocol"))
+        settingsList.add(SettingsData("ic_splittunneling", "Split Tunneling"))
+//        settingsList.add(SettingsData("ic_killswitch", "Kill Switch"))
+
+        settingsAdapter = SettingsAdapter(
+            requireContext(), R.layout.item_settings_tv, settingsList
+        )
+
+        tvServerListBinding.rvSettings?.layoutManager =
+            LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
+        tvServerListBinding.rvSettings?.adapter = settingsAdapter
+
+    }
+
+    fun clickListeners() {
+
+        if (isServersEnabled)
+        {
+            serverAdapter.setOnItemClickListener { adapter, view, position ->
+
+                serverAdapter.getItem(position)?.let {
+                    if (it.enable == 1) {
+                        MainActivity.callBacks?.onServerSelected(it)
+                    }
+                }
+            }
+        }
+
+        if (isDedicatedEnabled)
+        {
+            dedicatedServerAdapter.setOnItemClickListener { adapter, view, position ->
+
+                dedicatedServerAdapter.getItem(position)?.let {
+                    if (it.enable == 1) {
+                        MainActivity.callBacks?.onServerSelected(it)
+                    }
+                }
+            }
+        }
+
+        if (isStreamingEnabled)
+        {
+            streamingServerAdapter.setOnItemClickListener { adapter, view, position ->
+
+                streamingServerAdapter.getItem(position)?.let {
+                    if (it.enable == 1)
+                    {
+                        MainActivity.callBacks?.onServerSelected(it)
+                    }
+                }
+            }
+        }
+
+        if (isDvpnEnabled)
+        {
+            dvpnServerAdapter.setOnItemClickListener { adapter, view, position ->
+
+                dvpnServerAdapter.getItem(position)?.let {
+                    if (it.enable == 1) {
+                        MainActivity.callBacks?.onServerSelected(it)
+                    }
+                }
+            }
+        }
+
+        if (isP2PEnabled)
+        {
+            p2pServerAdapter.setOnItemClickListener { adapter, view, position ->
+
+                p2pServerAdapter.getItem(position)?.let {
+                    if (it.enable == 1) {
+                        MainActivity.callBacks?.onServerSelected(it)
+                    }
+                }
+            }
+        }
+
+//        if (isRecommendedEnabled)
 //        {
-//            dvpnServerAdapter.setOnItemClickListener { adapter, view, position ->
-//
-//                dvpnServerAdapter.getItem(position)?.let {
-//                    if (it.enable == 1) {
-//                        MainActivity.callBacks?.onServerSelected(it)
-//                    }
-//                }
+//            recommendedAdapter.setOnItemClickListener { adapter, view, position ->
+//                recommendedAdapter.getItem(position)
+//                    ?.let { MainActivity.callBacks?.onServerSelected(it) }
 //            }
 //        }
-//
-//        if (isP2PEnabled)
-//        {
-//            p2pServerAdapter.setOnItemClickListener { adapter, view, position ->
-//
-//                p2pServerAdapter.getItem(position)?.let {
-//                    if (it.enable == 1) {
-//                        MainActivity.callBacks?.onServerSelected(it)
-//                    }
-//                }
+
+//        rv_servers?.setOnFocusChangeListener { views, b ->
+//            if (b) {
+//                card_bg.background = views.resources.getDrawable(R.drawable.itemserver_background_tv)
+//            } else {
+//                card_bg.background = views.resources.getDrawable(R.drawable.itemserver_background_tv)
 //            }
 //        }
-//
-////        if (isRecommendedEnabled)
-////        {
-////            recommendedAdapter.setOnItemClickListener { adapter, view, position ->
-////                recommendedAdapter.getItem(position)
-////                    ?.let { MainActivity.callBacks?.onServerSelected(it) }
-////            }
-////        }
-//
-////        rv_servers?.setOnFocusChangeListener { views, b ->
-////            if (b) {
-////                card_bg.background = views.resources.getDrawable(R.drawable.itemserver_background_tv)
-////            } else {
-////                card_bg.background = views.resources.getDrawable(R.drawable.itemserver_background_tv)
-////            }
-////        }
-//
-//        settingsAdapter.setOnItemClickListener { adapter, view, position ->
-//            if (position == 0)
-//            {
-//
-////                showProtocolPopup(requireActivity())
-//
-//                GuidedStepSupportFragment.add(fragmentManager,
+
+        settingsAdapter.setOnItemClickListener { adapter, view, position ->
+            if (position == 0)
+            {
+
+//                showProtocolPopup(requireActivity())
+
+                GuidedStepSupportFragment.add(fragmentManager,
+                    GuidedActivity.FirstStepFragment(), android.R.id.content)
+
+//                GuidedStepSupportFragment.addAsRoot(requireActivity(),
 //                    FirstStepFragment(), android.R.id.content)
-//
-////                GuidedStepSupportFragment.addAsRoot(requireActivity(),
-////                    FirstStepFragment(), android.R.id.content)
-//
-//            }
-//            else if (position == 1)
-//            {
-//
-//                val appsName: ArrayList<SelectApplicationEntry> = ArrayList()
-//                val appsPackageName: ArrayList<String> = ArrayList()
-//
-//                val mPackageManager: PackageManager = requireContext().packageManager
-//                val context: Context = requireContext()
-//
-//                for (info in mPackageManager.getInstalledApplications(PackageManager.GET_META_DATA))
-//                {
-//
-//                    if (info.flags and ApplicationInfo.FLAG_SYSTEM == 0) { // good
-//
-//                        if (mPackageManager.checkPermission(android.Manifest.permission.INTERNET, info.packageName
-//                            ) == PackageManager.PERMISSION_GRANTED)
-//                        {
-//                            if (info.packageName == context.packageName) continue
-//                            val entry = SelectApplicationEntry(mPackageManager, info)
-//                            appsName.add(entry)
-//                        }
-//                    }
-//
-//                    if (info.flags and ApplicationInfo.FLAG_UPDATED_SYSTEM_APP != 0) { // ok but some different also apps
-//                    if (mPackageManager.checkPermission(android.Manifest.permission.INTERNET, info.packageName
-//                        ) == PackageManager.PERMISSION_GRANTED)
-//                    {
-//                        if (info.packageName == context.packageName) continue
-//                        val entry = SelectApplicationEntry(mPackageManager, info)
-//                        appsName.add(entry)
-//                    }
+
+            }
+            else if (position == 1)
+            {
+
+                val appsName: ArrayList<SelectApplicationEntry> = ArrayList()
+                val appsPackageName: ArrayList<String> = ArrayList()
+
+                val mPackageManager: PackageManager = requireContext().packageManager
+                val context: Context = requireContext()
+
+                for (info in mPackageManager.getInstalledApplications(PackageManager.GET_META_DATA))
+                {
+
+                    if (info.flags and ApplicationInfo.FLAG_SYSTEM == 0) { // good
+
+                        if (mPackageManager.checkPermission(android.Manifest.permission.INTERNET, info.packageName
+                            ) == PackageManager.PERMISSION_GRANTED)
+                        {
+                            if (info.packageName == context.packageName) continue
+                            val entry = SelectApplicationEntry(mPackageManager, info, false)
+                            appsName.add(entry)
+                        }
+                    }
+
+                    if (info.flags and ApplicationInfo.FLAG_UPDATED_SYSTEM_APP != 0) { // ok but some different also apps
+                    if (mPackageManager.checkPermission(android.Manifest.permission.INTERNET, info.packageName
+                        ) == PackageManager.PERMISSION_GRANTED)
+                    {
+                        if (info.packageName == context.packageName) continue
+                        val entry = SelectApplicationEntry(mPackageManager, info, false)
+                        appsName.add(entry)
+                    }
+                    }
+                }
+
+                var tempTvApps = ArrayList<String>()
+                var tempTvIcon = ArrayList<Drawable>()
+                var bitmapList: ArrayList<Bitmap> = ArrayList()
+
+                appsName.forEach {
+                    it.getInfo()?.packageName?.let {
+                            it1 -> appsPackageName.add(it1)
+                    }
+                    tempTvApps.add(it.toString())
+                    it.getIcon()?.let { it1 -> tempTvIcon.add(it1) }
+                }
+
+//                Log.d("apps in tv appsName", appsName.get(0).getIcon().toString() + " " + appsName.get(0))
+//                Log.d("apps in tv appsPackage", appsPackageName.toString() + " " + appsPackageName.size)
+//                Log.d("apps in tv tempTvApps", tempTvApps.toString() + " " + tempTvApps.size)
+//                Log.d("apps in tv tempTvIcon", tempTvIcon.toString() + " " + tempTvIcon.size)
+
+                prefHelper.setSplitTunnelTvAppsName(tempTvApps)
+                prefHelper.setSplitTunnelTvAppsPackageName(appsPackageName)
+
+//                prefHelper.setEnableTvAppsSplit(tempTvApps)
+
+                GuidedStepSupportFragment.add(fragmentManager,
+                    GuidedActivity.SecondStepFragment(tempTvIcon, true), android.R.id.content)
+
+                //        if (info.flags and ApplicationInfo.FLAG_SYSTEM != 0) {   // not ok
+//                        Log.d("apps in tv 2", info.packageName)
 //                    }
-//                }
-//
-//                var tempTvApps = ArrayList<String>()
-//                var tempTvIcon = ArrayList<Drawable>()
-//                var bitmapList: ArrayList<Bitmap> = ArrayList()
-//
-//                appsName.forEach {
-//                    it.getInfo()?.packageName?.let {
-//                            it1 -> appsPackageName.add(it1)
+//                    if (info.flags and ApplicationInfo.FLAG_UPDATED_SYSTEM_APP == 0) {  // not ok
+//                        Log.d("apps in tv 3", info.packageName)
 //                    }
-//                    tempTvApps.add(it.toString())
-//                    it.getIcon()?.let { it1 -> tempTvIcon.add(it1) }
-//                }
-//
-////                Log.d("apps in tv appsName", appsName.get(0).getIcon().toString() + " " + appsName.get(0))
-////                Log.d("apps in tv appsPackage", appsPackageName.toString() + " " + appsPackageName.size)
-////                Log.d("apps in tv tempTvApps", tempTvApps.toString() + " " + tempTvApps.size)
-////                Log.d("apps in tv tempTvIcon", tempTvIcon.toString() + " " + tempTvIcon.size)
-//
-//                prefHelper.setSplitTunnelTvAppsName(tempTvApps)
-//                prefHelper.setSplitTunnelTvAppsPackageName(appsPackageName)
-//
-////                prefHelper.setEnableTvAppsSplit(tempTvApps)
-//
-//                GuidedStepSupportFragment.add(fragmentManager,
-//                    SecondStepFragment(tempTvIcon, true), android.R.id.content)
-//
-//                //        if (info.flags and ApplicationInfo.FLAG_SYSTEM != 0) {   // not ok
-////                        Log.d("apps in tv 2", info.packageName)
-////                    }
-////                    if (info.flags and ApplicationInfo.FLAG_UPDATED_SYSTEM_APP == 0) {  // not ok
-////                        Log.d("apps in tv 3", info.packageName)
-////                    }
-////                GuidedStepSupportFragment.addAsRoot(requireActivity(), FirstStepFragment(), android.R.id.content)
-//            }
-//
-//        }
-//
+//                GuidedStepSupportFragment.addAsRoot(requireActivity(), FirstStepFragment(), android.R.id.content)
+            }
+
+        }
+
 //        favouritesAdapter.setOnItemClickListener { adapter, view, position ->
 //            favouritesAdapter.getItem(position)?.let {
 //                MainActivity.callBacks?.onServerSelected(it)
 //            }
-//        }
-//
+        }
+
 //        favouritesAdapter.setOnItemLongClickListener { adapter, view, position ->
 //            favUnFav(favouritesAdapter.getItem(position)!!)
 //            true
 //        }
-//    }
-//
-//    fun favUnFav(server: Server) {
-//
-//        serverListViewModel.favAndUnFav(server)
-//
+
+    fun favUnFav(server: Server) {
+
+        serverListViewModel.favAndUnFav(server)
+
 //        favouritesAdapter.data.clear()
 //        favouritesAdapter.setNewData(serverListViewModel.getFavList())
 //        favouritesAdapter.notifyDataSetChanged()
-//    }
-//
+    }
+
+    companion object {
+        fun newInstance(): TvServerListFragment {
+            return TvServerListFragment()
+        }
+    }
+
+    override fun updateServersOnCallback() {
+        setAdaptersCallBack()
+        clickListeners()
+    }
+
+}
+
+
+
+
+
+
+
+
+
 //    fun showProtocolPopup(activity: Activity) {
 //        val priceDialog = Dialog(activity)
 //        priceDialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
@@ -464,27 +510,12 @@ class TvServerListFragment : BaseFragment()
 //            MainActivity.callBacks?.onChangeProtocol(Protocol(AppEnum.UDP_PROTOCOL.title, AppEnum.UDP_PROTOCOL.key,4))
 //        }
 //    }
-//
+
 //    override fun setTitleBar() {
-//        setupUI((mainActivity).titleBar, (mainActivity).bottomBar)
+////        setupUI((mainActivity).titleBar, (mainActivity).bottomBar)
 //    }
-//
+
 //    private fun setupUI(titleBar: TitleBar, bottomBar: BottomBar) {
 //        titleBar.hideTitleBar()
 //        bottomBar.hideBottomBar()
-//    }
-//
-//    companion object {
-//        fun newInstance(): TvServerListFragment {
-//            return TvServerListFragment()
-//        }
-//    }
-//
-//    override fun updateServersOnCallback() {
-//        setAdaptersCallBack()
-//        clickListeners()
-//    }
-    override fun setTitleBar() {
-        TODO("Not yet implemented")
-    }
-}
+//    }

+ 6 - 0
app/src/main/java/com/vpn/fastestvpnservice/interfaces/OnBackPressedOnTV.kt

@@ -0,0 +1,6 @@
+package com.vpn.fastestvpnservice.interfaces
+
+interface OnBackPressedOnTV {
+
+    fun onBackPressedCallback()
+}

+ 5 - 0
app/src/main/java/com/vpn/fastestvpnservice/interfaces/UpdateServersOnProtocol.kt

@@ -0,0 +1,5 @@
+package com.vpn.fastestvpnservice.interfaces
+
+interface UpdateServersOnProtocol {
+    fun updateServersOnCallback()
+}

+ 16 - 0
app/src/main/java/com/vpn/fastestvpnservice/utils/Utils.kt

@@ -44,6 +44,22 @@ class Utils {
             return null
         }
 
+        fun getCountryFlagGray(context: Context, countryCode: String): Drawable? {
+            val grayStr = "gray_"
+            try{
+                return AppCompatResources.getDrawable(
+                    context, context.resources.getIdentifier(
+                        context.packageName + ":drawable/" + grayStr + countryCode.toLowerCase(Locale.getDefault()),
+                        null,
+                        null
+                    )
+                )
+            }catch (e:java.lang.Exception){
+
+            }
+            return null
+        }
+
 //        @Composable
 //        fun OnLifecycleEvent(onEvent: (
 //            owner: LifecycleOwner,

+ 6 - 0
app/src/main/res/color/btntexthover.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <!--<item android:color="@color/colorUniqueYellow" android:state_pressed="true"/>-->
+    <item android:color="@color/black" android:state_focused="true"/>
+    <item android:color="@color/white"/>
+</selector>

+ 6 - 0
app/src/main/res/color/btntexthover2.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <!--<item android:color="@color/colorUniqueYellow" android:state_pressed="true"/>-->
+    <item android:color="@color/black" android:state_focused="true"/>
+    <item android:color="@color/app_yellow_color"/>
+</selector>

+ 385 - 0
app/src/main/res/layout-land/activity_home_tv.xml

@@ -0,0 +1,385 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/main"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/bg_app"
+    android:focusable="true"
+    android:clickable="true"
+    android:orientation="vertical">
+
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:fillViewport="false"
+        >
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:padding="5dp"
+            >
+
+
+
+            <ImageView
+                android:id="@+id/imageView6"
+                android:layout_width="0dp"
+                android:layout_height="0dp"
+                android:src="@mipmap/ic_map"
+                android:focusable="true"
+                android:clickable="true"
+                android:focusableInTouchMode="true"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.0"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <TextView
+                android:id="@+id/tvIp"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="20dp"
+                android:fontFamily="@font/outfit_regular"
+                android:maxLines="2"
+                android:text="Finding IP ..."
+                android:textColor="@color/white"
+                android:visibility="visible"
+                android:textSize="18sp"
+                app:layout_constraintEnd_toEndOf="@+id/connectRippleEffect"
+                app:layout_constraintStart_toStartOf="@+id/connectRippleEffect"
+                app:layout_constraintTop_toTopOf="parent"
+                />
+
+            <LinearLayout
+                android:id="@+id/ll_country"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:orientation="horizontal"
+                app:layout_constraintEnd_toEndOf="@+id/tvIp"
+                app:layout_constraintStart_toStartOf="@+id/tvIp"
+                app:layout_constraintTop_toBottomOf="@id/tvIp"
+                android:visibility="visible"
+                >
+
+                <androidx.cardview.widget.CardView
+                    android:id="@+id/card_country_img"
+                    android:layout_width="25dp"
+                    android:layout_height="25dp"
+                    android:layout_marginEnd="7dp"
+                    android:visibility="gone"
+                    app:cardBackgroundColor="@color/transparent"
+                    app:cardCornerRadius="12.5dp">
+
+                    <ImageView
+                        android:id="@+id/iv_country"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:scaleType="centerCrop" />
+                </androidx.cardview.widget.CardView>
+
+                <TextView
+                    android:id="@+id/tvCountry"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:layout_gravity="center"
+                    android:fontFamily="@font/outfit_regular"
+                    android:gravity="center"
+                    android:maxLines="2"
+                    android:text="Searching"
+                    android:textColor="@color/white_half"
+                    android:textSize="16sp" />
+            </LinearLayout>
+
+            <TextView
+                android:id="@+id/tv_connect_status"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:fontFamily="@font/outfit_regular"
+                android:text="YOU ARE NOT CONNECTED"
+                android:textAllCaps="true"
+                android:textColor="@color/white_half"
+                android:textSize="@dimen/x12dp"
+                android:visibility="visible"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toEndOf="@+id/divider2"
+                app:layout_constraintTop_toBottomOf="@id/ll_country"
+                />
+
+            <com.skyfishjy.library.RippleBackground
+                android:id="@+id/connectRippleEffect"
+                android:layout_width="200dp"
+                android:layout_height="200dp"
+                android:layout_marginEnd="24dp"
+                android:layout_marginTop="20dp"
+                android:gravity="center"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/tv_connect_status"
+                app:rb_color="#ffffff"
+                app:rb_duration="1500"
+                app:rb_radius="16dp"
+                app:rb_rippleAmount="4"
+                android:visibility="visible"
+                app:rb_scale="4">
+
+                <!--        android:background="@drawable/gradient_list_button"-->
+
+                <androidx.cardview.widget.CardView
+                    android:id="@+id/cv_ivconnect"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    app:cardCornerRadius="100dp"
+                    android:layout_marginTop="0dp"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintHorizontal_bias="0.50"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent">
+
+                    <requestFocus />
+
+                    <androidx.constraintlayout.widget.ConstraintLayout
+                        android:id="@+id/root_home"
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:background="@color/connect_button_color">
+
+                        <ImageView
+                            android:id="@+id/ivConnect"
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"
+                            android:layout_centerInParent="true"
+                            android:layout_gravity="center"
+                            android:focusableInTouchMode="false"
+                            android:focusable="true"
+                            android:focusedByDefault="true"
+                            android:clickable="true"
+                            app:layout_constraintBottom_toBottomOf="parent"
+                            app:layout_constraintEnd_toEndOf="parent"
+                            app:layout_constraintStart_toStartOf="parent"
+                            app:layout_constraintTop_toTopOf="parent"
+                            app:srcCompat="@drawable/ic_connect_n_new" />
+
+                    </androidx.constraintlayout.widget.ConstraintLayout>
+
+                </androidx.cardview.widget.CardView>
+
+            </com.skyfishjy.library.RippleBackground>
+
+            <LinearLayout
+                android:id="@+id/ll_fastest"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                app:layout_constraintStart_toStartOf="@id/divider2"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/connectRippleEffect"
+                android:orientation="horizontal"
+                android:layout_marginTop="15dp"
+                android:layout_marginStart="0dp"
+                android:layout_marginEnd="0dp"
+                android:gravity="center"
+                android:visibility="visible"
+                >
+
+                <TextView
+                    android:id="@+id/tv_nearest_server"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="Smart Connect"
+                    android:padding="15dp"
+                    android:paddingStart="25dp"
+                    android:paddingEnd="35dp"
+                    android:gravity="center"
+                    android:visibility="visible"
+                    android:clickable="true"
+                    android:focusable="true"
+                    android:layout_gravity="center"
+                    android:fontFamily="@font/outfit_regular"
+                    android:textColor="@color/white"
+                    android:textSize="17sp"
+                    android:background="@drawable/button_selector_state_tv"
+                    android:drawablePadding="5dp"
+                    app:drawableStartCompat="@drawable/flash" />
+
+                <TextView
+                    android:id="@+id/tv_connect_fast_info"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/connect_fast_server_msg"
+                    android:gravity="center"
+                    android:visibility="gone"
+                    android:clickable="true"
+                    android:focusable="true"
+                    android:layout_gravity="center"
+                    android:fontFamily="@font/outfit_regular"
+                    android:textColor="@color/white_half"
+                    android:textSize="13sp"
+                    android:paddingTop="8dp"
+                    android:layout_marginTop="2dp"
+                    android:layout_marginBottom="12dp"
+                    />
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/llServer"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:background="@drawable/round_blue_tvserver"
+                android:gravity="center"
+                android:orientation="horizontal"
+                android:padding="6dp"
+                android:paddingStart="16dp"
+                android:paddingEnd="16dp"
+                android:layout_marginStart="10dp"
+                android:layout_marginEnd="10dp"
+                android:visibility="visible"
+                android:layout_marginTop="10dp"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="@+id/divider2"
+                app:layout_constraintTop_toBottomOf="@id/ll_fastest"
+                app:layout_constraintBottom_toTopOf="@id/tv_logoutTv"
+                >
+
+                <androidx.cardview.widget.CardView
+                    android:id="@+id/card_iv_country"
+                    android:layout_width="30dp"
+                    android:layout_height="30dp"
+                    android:layout_marginEnd="4dp"
+                    android:layout_marginTop="4dp"
+                    android:layout_marginBottom="4dp"
+                    app:cardBackgroundColor="@color/transparent"
+                    app:cardCornerRadius="15dp">
+
+                    <ImageView
+                        android:id="@+id/ivCountry"
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:elevation="0dp"
+                        android:scaleType="fitXY" />
+                </androidx.cardview.widget.CardView>
+
+                <TextView
+                    android:id="@+id/tvServer"
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="8dp"
+                    android:layout_weight="1"
+                    android:fontFamily="@font/outfit_regular"
+                    android:text="Select Server"
+                    android:textColor="@color/white"
+                    android:textSize="16sp" />
+
+                <ImageView
+                    android:layout_width="24dp"
+                    android:layout_height="24dp"
+                    android:layout_marginStart="16dp"
+                    android:layout_marginEnd="7dp"
+                    android:visibility="gone"
+                    android:src="@drawable/ic_arrow_right" />
+
+            </LinearLayout>
+
+            <TextView
+                android:id="@+id/tv_logoutTv"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:layout_marginStart="10dp"
+                android:layout_marginBottom="15dp"
+                android:layout_marginEnd="10dp"
+                android:background="@drawable/button_selector_state"
+                android:text="Logout"
+                android:gravity="center"
+                android:visibility="visible"
+                android:textSize="16sp"
+                android:focusable="true"
+                android:clickable="true"
+                android:focusableInTouchMode="false"
+                android:textColor="@color/app_blue_color"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="@id/divider2"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintTop_toBottomOf="@id/llServer"
+                />
+
+            <Button
+                android:id="@+id/button2"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="80dp"
+                android:text="Button"
+                android:visibility="gone"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.925"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <LinearLayout
+                android:id="@+id/navContainer"
+                android:layout_width="0dp"
+                android:layout_height="0dp"
+                android:gravity="bottom"
+                android:orientation="vertical"
+                android:visibility="gone"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="1.0" />
+
+            <FrameLayout
+                android:id="@+id/server_container"
+                android:layout_width="0dp"
+                android:layout_height="0dp"
+                android:background="@color/transparent"
+                android:clickable="true"
+                android:focusable="true"
+                android:visibility="gone"
+                android:pointerIcon="hand"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toStartOf="@+id/divider2"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintVertical_bias="1.0" />
+
+            <View
+                android:id="@+id/divider2"
+                android:layout_width="0dp"
+                android:layout_height="0dp"
+                android:layout_marginTop="16dp"
+                android:layout_marginEnd="24dp"
+                android:layout_marginBottom="16dp"
+                android:background="?android:attr/listDivider"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toStartOf="@+id/connectRippleEffect"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <TextView
+                android:id="@+id/tv_protocolTv"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="15dp"
+                android:background="@drawable/button_selector_state"
+                android:text="Protocol"
+                android:gravity="center"
+                android:visibility="gone"
+                android:textSize="16sp"
+                android:textColor="@color/app_blue_color"
+                app:layout_constraintEnd_toStartOf="@id/tv_logoutTv"
+                app:layout_constraintStart_toStartOf="@id/connectRippleEffect"
+                app:layout_constraintTop_toBottomOf="@+id/tv_connect_status" />
+
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+    </ScrollView>
+
+
+</androidx.constraintlayout.widget.ConstraintLayout>
+

+ 208 - 0
app/src/main/res/layout-land/activity_login_tv.xml

@@ -0,0 +1,208 @@
+
+
+<!--    <ScrollView-->
+<!--        android:layout_width="match_parent"-->
+<!--        android:layout_height="match_parent"-->
+<!--        android:background="@drawable/bg_app"-->
+<!--        android:fillViewport="false">-->
+<!--        -->
+<!--        -->
+<!--    </ScrollView>-->
+
+<layout
+    android:id="@+id/main"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@drawable/bg_app"
+        android:padding="@dimen/x5dp">
+
+        <LinearLayout
+            android:id="@+id/linearLayout2"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/x30dp"
+            android:layout_marginTop="0dp"
+            android:layout_marginRight="@dimen/x30dp"
+            android:gravity="center"
+            android:orientation="vertical"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            >
+
+            <TextView
+                android:id="@+id/textView6"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="30dp"
+                android:fontFamily="@font/outfit_semibold"
+                android:text="Welcome back!"
+                android:textColor="@color/white"
+                android:layout_gravity="center"
+                android:textSize="20sp" />
+
+            <TextView
+                android:id="@+id/textView7"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="1pt"
+                android:alpha="0.5"
+                android:fontFamily="@font/outfit_regular"
+                android:text="Please login to your account."
+                android:textColor="@color/white"
+                android:textSize="16sp"
+                android:visibility="gone"
+                android:textStyle="normal" />
+
+            <LinearLayout
+                android:id="@+id/llemail"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="16dp"
+                android:background="@drawable/border_round_gray"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:layout_marginStart="0dp"
+                android:layout_marginEnd="0dp"
+                >
+
+                <EditText
+                    android:id="@+id/etEmail"
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="@drawable/border_round_gray"
+                    android:drawablePadding="16dp"
+                    android:fontFamily="@font/outfit_regular"
+                    android:hint="@string/email"
+                    android:inputType="textEmailAddress"
+                    android:padding="18dp"
+                    android:textColor="@color/text_color_white"
+                    android:textColorHint="@color/text_color_white"
+                    android:textSize="16sp"
+                    >
+
+                </EditText>
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/llPassword"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="2pt"
+                android:background="@drawable/border_round_gray"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:layout_marginStart="0dp"
+                android:layout_marginEnd="0dp"
+                >
+
+                <EditText
+                    android:id="@+id/etPassword"
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="#00000000"
+                    android:drawablePadding="16dp"
+                    android:focusable="true"
+                    android:fontFamily="@font/outfit_regular"
+                    android:hint="@string/pass"
+                    android:inputType="textPassword"
+                    android:padding="18dp"
+                    android:textColor="@color/text_color_white"
+                    android:textColorHint="@color/text_color_white"
+                    android:textSize="16sp" />
+
+                <ImageView
+                    android:id="@+id/ivEye"
+                    android:layout_width="32dp"
+                    android:layout_height="32dp"
+                    android:layout_marginStart="8dp"
+                    android:layout_marginEnd="16dp"
+                    android:visibility="gone"
+                    android:src="@drawable/ic_hide_password" />
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/x10dp"
+                android:orientation="horizontal"
+                android:weightSum="2">
+
+                <TextView
+                    android:id="@+id/tv_signup"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:layout_weight="1"
+                    android:clickable="true"
+                    android:focusable="true"
+                    android:fontFamily="@font/outfit_regular"
+                    android:gravity="left"
+                    android:padding="@dimen/x5dp"
+                    android:text="@string/signup"
+                    android:textColor="@color/app_yellow_color"
+                    android:textSize="16dp"
+                    android:visibility="gone"
+                    android:textStyle="bold" />
+
+                <TextView
+                    android:id="@+id/tvForgotPassword"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:layout_weight="1"
+                    android:clickable="true"
+                    android:focusable="true"
+                    android:fontFamily="@font/outfit_regular"
+                    android:gravity="right"
+                    android:padding="@dimen/x5dp"
+                    android:text="@string/forgot_password"
+                    android:textColor="@color/app_yellow_color"
+                    android:textSize="16dp"
+                    android:visibility="gone"
+                    android:textStyle="bold" />
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <Button
+            android:id="@+id/tvLogin"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/x30dp"
+            android:background="@drawable/button_selector_state"
+            android:focusable="true"
+            android:fontFamily="@font/outfit_regular"
+            android:gravity="center"
+            android:letterSpacing="0.1"
+            android:shadowColor="@color/white"
+            android:text="@string/login"
+            android:textAllCaps="false"
+            android:textColor="@color/textviewhover"
+            android:textSize="16sp"
+            android:visibility="visible"
+            android:layout_marginStart="0dp"
+            android:layout_marginEnd="0dp"
+            app:layout_constraintEnd_toEndOf="@+id/linearLayout2"
+            app:layout_constraintStart_toStartOf="@+id/linearLayout2"
+            app:layout_constraintTop_toBottomOf="@id/linearLayout2" />
+
+        <ImageView
+            android:id="@+id/imageView7"
+            android:layout_width="60dp"
+            android:layout_height="60dp"
+            android:layout_marginBottom="@dimen/x30dp"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintBottom_toTopOf="@id/linearLayout2"
+            app:srcCompat="@drawable/ic_logo1" />
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+</layout>

+ 6 - 3
app/src/main/res/layout-land/fragment_login.xml

@@ -1,7 +1,9 @@
+<layout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <ScrollView
 
-<ScrollView
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        xmlns:app="http://schemas.android.com/apk/res-auto"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:background="@drawable/bg_app"
@@ -197,3 +199,4 @@
 
         </androidx.constraintlayout.widget.ConstraintLayout>
     </ScrollView>
+</layout>

+ 78 - 0
app/src/main/res/layout-land/item_server.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    xmlns:tools="http://schemas.android.com/tools"
+    app:cardBackgroundColor="#A9C5C3C3"
+    app:cardCornerRadius="10dp"
+    app:cardUseCompatPadding="true">
+
+    <androidx.cardview.widget.CardView
+        android:id="@+id/card_bg"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_margin="1px"
+        app:cardBackgroundColor="#06143B"
+        app:cardCornerRadius="10dp">
+
+        <LinearLayout
+            android:id="@+id/audio_row"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:gravity="center_vertical"
+            android:orientation="vertical"
+            android:padding="10dp">
+
+            <androidx.cardview.widget.CardView
+                android:layout_width="80dp"
+                android:layout_height="50dp"
+                android:layout_gravity="center"
+                android:layout_marginBottom="1dp"
+                app:cardCornerRadius="10dp"
+                app:cardElevation="0dp">
+
+                <ImageView
+                    android:id="@+id/ivCountry"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_gravity="center"
+                    android:scaleType="centerCrop"
+                    android:src="@drawable/pk"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+            </androidx.cardview.widget.CardView>
+
+            <TextView
+                android:id="@+id/vpn_name"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center"
+                android:layout_marginStart="10dp"
+                android:layout_marginTop="10dp"
+                android:layout_marginEnd="@dimen/x10dp"
+                android:fontFamily="@font/outfit_regular"
+                android:gravity="center"
+                android:text="New York times checking"
+                android:textColor="#ffffff"
+                android:textSize="12dp" />
+
+
+            <TextView
+                android:id="@+id/textView12"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center"
+                android:layout_marginTop="7dp"
+                android:layout_marginBottom="10px"
+                android:fontFamily="@font/outfit_regular"
+                android:gravity="center"
+                tools:text="480 ms"
+                android:textColor="#B1AAAA"
+                android:textSize="12dp" />
+        </LinearLayout>
+    </androidx.cardview.widget.CardView>
+</androidx.cardview.widget.CardView>

+ 366 - 0
app/src/main/res/layout/activity_home_tv.xml

@@ -0,0 +1,366 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/main"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:fitsSystemWindows="true">
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/main2"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@drawable/bg_app"
+        android:orientation="vertical">
+
+        <ImageView
+            android:id="@+id/imageView6"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:src="@mipmap/ic_map"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintHorizontal_bias="0.0"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <TextView
+            android:id="@+id/tvIp"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="15dp"
+            android:fontFamily="@font/outfit_regular"
+            android:maxLines="2"
+            android:text="Finding IP ..."
+            android:textColor="@color/white"
+            android:textSize="18sp"
+            app:layout_constraintBottom_toTopOf="@+id/ll_country"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent" />
+
+        <LinearLayout
+            android:id="@+id/ll_country"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="15dp"
+            android:orientation="horizontal"
+            app:layout_constraintBottom_toTopOf="@+id/tv_connect_status"
+            app:layout_constraintEnd_toEndOf="@+id/tvIp"
+            app:layout_constraintStart_toStartOf="@+id/tvIp">
+
+            <androidx.cardview.widget.CardView
+                android:id="@+id/card_country_img"
+                android:layout_width="25dp"
+                android:layout_height="25dp"
+                android:layout_marginEnd="7dp"
+                android:visibility="gone"
+                app:cardCornerRadius="15dp">
+
+                <ImageView
+                    android:id="@+id/iv_country"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:scaleType="centerCrop" />
+            </androidx.cardview.widget.CardView>
+
+            <TextView
+                android:id="@+id/tvCountry"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_gravity="center"
+                android:fontFamily="@font/outfit_regular"
+                android:gravity="center"
+                android:maxLines="2"
+                android:text="Searching"
+                android:textColor="@color/white_half"
+                android:textSize="16sp" />
+        </LinearLayout>
+
+
+        <TextView
+            android:id="@+id/tv_connect_status"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="50dp"
+            android:fontFamily="@font/outfit_regular"
+            android:text="YOU ARE NOT CONNECTED"
+            android:textAllCaps="true"
+            android:textColor="@color/white_half"
+            android:textSize="8pt"
+            app:layout_constraintBottom_toTopOf="@+id/connectRippleEffect"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent" />
+
+        <TextView
+            android:id="@+id/textView8"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="20dp"
+            android:fontFamily="@font/outfit_medium"
+            android:text="Tap to connect"
+            android:textAllCaps="true"
+            android:textColor="@color/white"
+            android:textSize="14dp"
+            android:visibility="gone"
+            app:layout_constraintBottom_toTopOf="@+id/ll_recommended_server"
+            app:layout_constraintEnd_toEndOf="@+id/connectRippleEffect"
+            app:layout_constraintStart_toStartOf="@+id/connectRippleEffect"
+            />
+
+        <com.skyfishjy.library.RippleBackground
+            android:id="@+id/connectRippleEffect"
+            android:layout_width="230dp"
+            android:layout_height="230dp"
+            android:gravity="center"
+            android:layout_marginBottom="125dp"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintHorizontal_bias="0.5"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:rb_color="#ffffff"
+            app:rb_duration="1500"
+            app:rb_radius="16dp"
+            app:rb_rippleAmount="4"
+            app:rb_scale="4">
+
+            <!--        android:background="@drawable/gradient_list_button"-->
+
+
+            <androidx.cardview.widget.CardView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:clickable="true"
+                android:focusable="true"
+                app:cardCornerRadius="115dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintHorizontal_bias="0.50"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent">
+
+                <androidx.constraintlayout.widget.ConstraintLayout
+                    android:id="@+id/root_home"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:background="@color/connect_button_color">
+
+                    <ImageView
+                        android:id="@+id/ivConnect"
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:layout_centerInParent="true"
+                        android:layout_gravity="center"
+                        android:background="@drawable/ripple_effect"
+                        app:layout_constraintBottom_toBottomOf="parent"
+                        app:layout_constraintEnd_toEndOf="parent"
+                        app:layout_constraintStart_toStartOf="parent"
+                        app:layout_constraintTop_toTopOf="parent"
+                        app:srcCompat="@drawable/ic_connect_n_new" />
+
+                </androidx.constraintlayout.widget.ConstraintLayout>
+
+            </androidx.cardview.widget.CardView>
+
+        </com.skyfishjy.library.RippleBackground>
+
+
+        <Button
+            android:id="@+id/button2"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="80dp"
+            android:text="Button"
+            android:visibility="gone"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintHorizontal_bias="0.925"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <LinearLayout
+            android:id="@+id/ll_fastest"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintBottom_toTopOf="@id/llServer"
+            android:orientation="vertical"
+            android:background="@color/transparent"
+            android:layout_marginBottom="10dp"
+            android:gravity="center"
+            android:paddingTop="20dp"
+            android:paddingBottom="20dp"
+            >
+
+            <TextView
+                android:id="@+id/tv_nearest_server"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="Smart Connect"
+                android:padding="20dp"
+                android:paddingStart="15dp"
+                android:paddingEnd="25dp"
+                android:gravity="center"
+                android:visibility="visible"
+                android:clickable="true"
+                android:focusable="true"
+                android:layout_gravity="center"
+                android:fontFamily="@font/outfit_regular"
+                android:textColor="@color/white"
+                android:textSize="16sp"
+                android:letterSpacing="0.032"
+                android:background="@drawable/border_round_alpha_f"
+                app:drawableStartCompat="@drawable/flash"
+                android:drawablePadding="5dp"
+                />
+
+            <TextView
+                android:id="@+id/tv_connect_fast_info"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/connect_fast_server_msg"
+                android:gravity="center"
+                android:visibility="gone"
+                android:clickable="true"
+                android:focusable="true"
+                android:layout_gravity="center"
+                android:fontFamily="@font/outfit_regular"
+                android:textColor="@color/white_half"
+                android:textSize="13sp"
+                android:paddingTop="8dp"
+                android:layout_marginTop="2dp"
+                android:layout_marginBottom="12dp"
+                />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/ll_recommended_server"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toBottomOf="@id/ll_fastest"
+            android:orientation="horizontal"
+            android:background="@color/Light_Blue_Transparent_2"
+            android:gravity="center"
+            android:paddingBottom="15dp"
+            android:visibility="gone"
+            >
+
+            <androidx.recyclerview.widget.RecyclerView
+                android:id="@+id/rvList_fastservers"
+                android:layout_width="250dp"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal"
+                android:visibility="visible"
+                android:layout_marginStart="0dp"
+                android:layout_marginEnd="0dp"
+                app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
+                tools:listitem="@layout/item_server_fast"
+                android:clipToPadding="false"
+                android:overScrollMode="never"
+                android:layout_gravity="center"
+                />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/llServer"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:background="@drawable/round_alpha_white"
+            android:gravity="center_vertical"
+            android:orientation="horizontal"
+            android:padding="8dp"
+            android:paddingStart="8dp"
+            android:paddingEnd="10dp"
+            android:layout_marginTop="0dp"
+            android:layout_marginBottom="90dp"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="@+id/connectRippleEffect"
+            app:layout_constraintStart_toStartOf="@+id/connectRippleEffect"
+            >
+
+            <androidx.cardview.widget.CardView
+                android:id="@+id/card_iv_country"
+                android:layout_width="50dp"
+                android:layout_height="50dp"
+                android:layout_marginEnd="7dp"
+                app:cardBackgroundColor="@color/colorTransparent"
+                app:cardCornerRadius="25dp">
+
+                <ImageView
+                    android:id="@+id/ivCountry"
+                    android:layout_width="50dp"
+                    android:layout_height="50dp"
+                    android:elevation="0dp"
+                    android:scaleType="fitXY" />
+            </androidx.cardview.widget.CardView>
+
+            <TextView
+                android:id="@+id/tvServer"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:layout_marginStart="4dp"
+                android:layout_weight="1"
+                android:fontFamily="@font/outfit_regular"
+                android:text="Select Server"
+                android:textColor="@color/white"
+                android:textSize="16sp" />
+
+            <ImageView
+                android:layout_width="24dp"
+                android:layout_height="24dp"
+                android:layout_marginStart="8dp"
+                android:layout_marginEnd="1dp"
+                android:src="@drawable/ic_arrow_right" />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/navContainer"
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:gravity="bottom"
+            android:orientation="vertical"
+            android:visibility="gone"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintVertical_bias="1.0" />
+
+        <FrameLayout
+            android:id="@+id/container"
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:background="@drawable/gradient_blue_bg"
+            android:clickable="true"
+            android:focusable="true"
+            android:visibility="gone"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintVertical_bias="1.0" />
+
+        <FrameLayout
+            android:id="@+id/server_container"
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:background="@color/transparent"
+            android:clickable="true"
+            android:focusable="true"
+            android:visibility="gone"
+            android:pointerIcon="hand"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintVertical_bias="1.0" />
+
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+</androidx.coordinatorlayout.widget.CoordinatorLayout>

+ 219 - 0
app/src/main/res/layout/activity_login_tv.xml

@@ -0,0 +1,219 @@
+
+
+<!--    <ScrollView-->
+<!--        android:layout_width="match_parent"-->
+<!--        android:layout_height="match_parent"-->
+<!--        android:background="@drawable/bg_app"-->
+<!--        android:fillViewport="false">-->
+<!--        -->
+<!--        -->
+<!--    </ScrollView>-->
+
+<layout
+    android:id="@+id/main"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@drawable/bg_app"
+        android:padding="@dimen/x5dp">
+
+        <LinearLayout
+            android:id="@+id/linearLayout2"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/x30dp"
+            android:layout_marginTop="0dp"
+            android:layout_marginRight="@dimen/x30dp"
+            android:gravity="center"
+            android:orientation="vertical"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            >
+
+            <TextView
+                android:id="@+id/textView6"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="30dp"
+                android:fontFamily="@font/outfit_semibold"
+                android:text="Welcome back!"
+                android:textColor="@color/white"
+                android:layout_gravity="center"
+                android:textSize="20sp" />
+
+            <TextView
+                android:id="@+id/textView7"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="1pt"
+                android:alpha="0.5"
+                android:fontFamily="@font/outfit_regular"
+                android:text="Please login to your account."
+                android:textColor="@color/white"
+                android:textSize="16sp"
+                android:visibility="gone"
+                android:textStyle="normal" />
+
+            <LinearLayout
+                android:id="@+id/llemail"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="16dp"
+                android:background="@drawable/border_round_gray"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:layout_marginStart="0dp"
+                android:layout_marginEnd="0dp"
+                >
+
+                <EditText
+                    android:id="@+id/etEmail"
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="@drawable/border_round_gray"
+                    android:drawablePadding="16dp"
+                    android:fontFamily="@font/outfit_regular"
+                    android:hint="@string/email"
+                    android:inputType="textEmailAddress"
+                    android:padding="18dp"
+                    android:textColor="@color/text_color_white"
+                    android:textColorHint="@color/text_color_white"
+                    android:textSize="16sp"
+                    >
+
+                </EditText>
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/llPassword"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="2pt"
+                android:background="@drawable/border_round_gray"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:layout_marginStart="0dp"
+                android:layout_marginEnd="0dp"
+                >
+
+                <EditText
+                    android:id="@+id/etPassword"
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="#00000000"
+                    android:drawablePadding="16dp"
+                    android:focusable="true"
+                    android:fontFamily="@font/outfit_regular"
+                    android:hint="@string/pass"
+                    android:inputType="textPassword"
+                    android:padding="18dp"
+                    android:textColor="@color/text_color_white"
+                    android:textColorHint="@color/text_color_white"
+                    android:textSize="16sp" />
+
+                <ImageView
+                    android:id="@+id/ivEye"
+                    android:layout_width="32dp"
+                    android:layout_height="32dp"
+                    android:layout_marginStart="8dp"
+                    android:layout_marginEnd="16dp"
+                    android:visibility="gone"
+                    android:src="@drawable/ic_hide_password" />
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/x10dp"
+                android:orientation="horizontal"
+                android:weightSum="2">
+
+                <TextView
+                    android:id="@+id/tv_signup"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:layout_weight="1"
+                    android:clickable="true"
+                    android:focusable="true"
+                    android:fontFamily="@font/outfit_regular"
+                    android:gravity="left"
+                    android:padding="@dimen/x5dp"
+                    android:text="@string/signup"
+                    android:textColor="@color/app_yellow_color"
+                    android:textSize="16dp"
+                    android:visibility="gone"
+                    android:textStyle="bold" />
+
+                <TextView
+                    android:id="@+id/tvForgotPassword"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:layout_weight="1"
+                    android:clickable="true"
+                    android:focusable="true"
+                    android:fontFamily="@font/outfit_regular"
+                    android:gravity="right"
+                    android:padding="@dimen/x5dp"
+                    android:text="@string/forgot_password"
+                    android:textColor="@color/app_yellow_color"
+                    android:textSize="16dp"
+                    android:visibility="gone"
+                    android:textStyle="bold" />
+            </LinearLayout>
+
+        </LinearLayout>
+
+        <Button
+            android:id="@+id/tvLogin"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/x30dp"
+            android:background="@drawable/button_selector_state"
+            android:focusable="true"
+            android:fontFamily="@font/outfit_regular"
+            android:gravity="center"
+            android:letterSpacing="0.1"
+            android:shadowColor="@color/white"
+            android:text="@string/login"
+            android:textAllCaps="false"
+            android:textColor="@color/textviewhover"
+            android:textSize="16sp"
+            android:visibility="visible"
+            android:layout_marginStart="0dp"
+            android:layout_marginEnd="0dp"
+            app:layout_constraintEnd_toEndOf="@+id/linearLayout2"
+            app:layout_constraintStart_toStartOf="@+id/linearLayout2"
+            app:layout_constraintTop_toBottomOf="@id/linearLayout2" />
+
+        <ImageView
+            android:id="@+id/imageView7"
+            android:layout_width="60dp"
+            android:layout_height="60dp"
+            android:layout_marginBottom="@dimen/x30dp"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintBottom_toTopOf="@id/linearLayout2"
+            app:srcCompat="@drawable/ic_logo1" />
+
+        <ProgressBar
+            android:id="@+id/progressBar"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            android:indeterminateTint="@color/app_yellow_color"
+            android:visibility="gone" />
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+</layout>

+ 30 - 0
app/src/main/res/layout/activity_main.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:fitsSystemWindows="false">
+
+        <RelativeLayout
+            android:id="@+id/contentFrame"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent">
+
+            <FrameLayout
+                android:id="@+id/mainFrameLayout"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_alignWithParentIfMissing="true"
+                android:layout_centerVertical="true"
+                android:layout_alignParentBottom="true"
+                android:layout_centerHorizontal="true"
+                android:background="@color/transparent">
+
+            </FrameLayout>
+
+        </RelativeLayout>
+
+    </RelativeLayout>
+
+</layout>

+ 73 - 0
app/src/main/res/layout/dialogs_exit.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/logout_border_points"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/tv_dialogTitle"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="20dp"
+        android:gravity="center"
+        android:text="LOGOUT"
+        android:textColor="#000000"
+        android:textSize="20sp"
+        android:textStyle="bold" />
+
+    <TextView
+        android:id="@+id/tv_dialogDesc"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginTop="5dp"
+        android:layout_marginStart="15dp"
+        android:layout_marginEnd="15dp"
+        android:gravity="center"
+        android:textColor="@color/DarkSlateGray"
+        android:text="Are you sure you want to Logout?"
+        android:maxLines="2"
+        />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="15dp"
+        android:layout_marginBottom="20dp"
+        android:gravity="center"
+        android:orientation="horizontal"
+        android:paddingLeft="10dp"
+        android:paddingRight="10dp">
+
+        <Button
+            android:id="@+id/tvNo"
+            android:layout_width="100dp"
+            android:layout_height="35dp"
+            android:layout_marginLeft="10dp"
+            android:layout_marginRight="10dp"
+            android:background="@drawable/ic_btnpopup"
+            android:text="No"
+            android:textColor="@color/btntexthover"
+            android:focusable="true"
+            android:nextFocusDown="@+id/tvYes"
+            android:nextFocusUp="@+id/tvYes"
+            android:textStyle="bold" />
+
+        <Button
+            android:id="@+id/tvYes"
+            android:layout_width="100dp"
+            android:layout_height="35dp"
+            android:layout_marginLeft="10dp"
+            android:layout_marginRight="10dp"
+            android:background="@drawable/ic_exit"
+            android:text="Yes"
+            android:textColor="@color/btntexthover2"
+            android:focusable="true"
+            android:nextFocusDown="@+id/tvNo"
+            android:nextFocusUp="@+id/tvNo"
+            android:textStyle="bold" />
+    </LinearLayout>
+
+
+</LinearLayout>

+ 176 - 175
app/src/main/res/layout/fragment_login.xml

@@ -9,198 +9,199 @@
 <!--        -->
 <!--    </ScrollView>-->
 
+<layout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
     <androidx.constraintlayout.widget.ConstraintLayout
-            xmlns:android="http://schemas.android.com/apk/res/android"
-            xmlns:app="http://schemas.android.com/apk/res-auto"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:background="@drawable/bg_app"
-            android:padding="@dimen/x5dp">
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="@drawable/bg_app"
+        android:padding="@dimen/x5dp">
+
+        <LinearLayout
+            android:id="@+id/linearLayout2"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/x30dp"
+            android:layout_marginTop="0dp"
+            android:layout_marginRight="@dimen/x30dp"
+            android:gravity="center"
+            android:orientation="vertical"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            app:layout_constraintBottom_toBottomOf="parent"
+            >
+
+            <TextView
+                android:id="@+id/textView6"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="30dp"
+                android:fontFamily="@font/outfit_semibold"
+                android:text="Welcome back!"
+                android:textColor="@color/white"
+                android:layout_gravity="center"
+                android:textSize="20sp" />
+
+            <TextView
+                android:id="@+id/textView7"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="1pt"
+                android:alpha="0.5"
+                android:fontFamily="@font/outfit_regular"
+                android:text="Please login to your account."
+                android:textColor="@color/white"
+                android:textSize="16sp"
+                android:visibility="gone"
+                android:textStyle="normal" />
 
             <LinearLayout
-                android:id="@+id/linearLayout2"
-                android:layout_width="0dp"
+                android:id="@+id/llemail"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="@dimen/x30dp"
-                android:layout_marginTop="0dp"
-                android:layout_marginRight="@dimen/x30dp"
-                android:gravity="center"
-                android:orientation="vertical"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintTop_toTopOf="parent"
-                app:layout_constraintBottom_toBottomOf="parent"
+                android:layout_marginBottom="16dp"
+                android:background="@drawable/border_round_gray"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:layout_marginStart="0dp"
+                android:layout_marginEnd="0dp"
                 >
 
-                <TextView
-                    android:id="@+id/textView6"
-                    android:layout_width="wrap_content"
+                <EditText
+                    android:id="@+id/etEmail"
+                    android:layout_width="0dp"
                     android:layout_height="wrap_content"
-                    android:layout_marginBottom="30dp"
-                    android:fontFamily="@font/outfit_semibold"
-                    android:text="Welcome back!"
-                    android:textColor="@color/white"
-                    android:layout_gravity="center"
-                    android:textSize="20sp" />
+                    android:layout_weight="1"
+                    android:background="@drawable/border_round_gray"
+                    android:drawablePadding="16dp"
+                    android:fontFamily="@font/outfit_regular"
+                    android:hint="@string/email"
+                    android:inputType="textEmailAddress"
+                    android:padding="18dp"
+                    android:textColor="@color/text_color_white"
+                    android:textColorHint="@color/text_color_white"
+                    android:textSize="16sp"
+                    >
 
-                <TextView
-                    android:id="@+id/textView7"
-                    android:layout_width="wrap_content"
+                </EditText>
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/llPassword"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="2pt"
+                android:background="@drawable/border_round_gray"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:layout_marginStart="0dp"
+                android:layout_marginEnd="0dp"
+                >
+
+                <EditText
+                    android:id="@+id/etPassword"
+                    android:layout_width="0dp"
                     android:layout_height="wrap_content"
-                    android:layout_marginTop="1pt"
-                    android:alpha="0.5"
+                    android:layout_weight="1"
+                    android:background="#00000000"
+                    android:drawablePadding="16dp"
+                    android:focusable="true"
                     android:fontFamily="@font/outfit_regular"
-                    android:text="Please login to your account."
-                    android:textColor="@color/white"
-                    android:textSize="16sp"
+                    android:hint="@string/pass"
+                    android:inputType="textPassword"
+                    android:padding="18dp"
+                    android:textColor="@color/text_color_white"
+                    android:textColorHint="@color/text_color_white"
+                    android:textSize="16sp" />
+
+                <ImageView
+                    android:id="@+id/ivEye"
+                    android:layout_width="32dp"
+                    android:layout_height="32dp"
+                    android:layout_marginStart="8dp"
+                    android:layout_marginEnd="16dp"
                     android:visibility="gone"
-                    android:textStyle="normal" />
+                    android:src="@drawable/ic_hide_password" />
 
-                <LinearLayout
-                    android:id="@+id/llemail"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_marginBottom="16dp"
-                    android:background="@drawable/border_round_gray"
-                    android:gravity="center_vertical"
-                    android:orientation="horizontal"
-                    android:layout_marginStart="0dp"
-                    android:layout_marginEnd="0dp"
-                    >
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/x10dp"
+                android:orientation="horizontal"
+                android:weightSum="2">
 
-                    <EditText
-                        android:id="@+id/etEmail"
-                        android:layout_width="0dp"
-                        android:layout_height="wrap_content"
-                        android:layout_weight="1"
-                        android:background="@drawable/border_round_gray"
-                        android:drawablePadding="16dp"
-                        android:fontFamily="@font/outfit_regular"
-                        android:hint="@string/email"
-                        android:inputType="textEmailAddress"
-                        android:padding="18dp"
-                        android:textColor="@color/text_color_white"
-                        android:textColorHint="@color/text_color_white"
-                        android:textSize="16sp"
-                        >
-
-                    </EditText>
-                </LinearLayout>
-
-                <LinearLayout
-                    android:id="@+id/llPassword"
+                <TextView
+                    android:id="@+id/tv_signup"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_marginTop="2pt"
-                    android:background="@drawable/border_round_gray"
-                    android:gravity="center_vertical"
-                    android:orientation="horizontal"
-                    android:layout_marginStart="0dp"
-                    android:layout_marginEnd="0dp"
-                    >
+                    android:layout_gravity="center"
+                    android:layout_weight="1"
+                    android:clickable="true"
+                    android:focusable="true"
+                    android:fontFamily="@font/outfit_regular"
+                    android:gravity="left"
+                    android:padding="@dimen/x5dp"
+                    android:text="@string/signup"
+                    android:textColor="@color/app_yellow_color"
+                    android:textSize="16dp"
+                    android:visibility="gone"
+                    android:textStyle="bold" />
 
-                    <EditText
-                        android:id="@+id/etPassword"
-                        android:layout_width="0dp"
-                        android:layout_height="wrap_content"
-                        android:layout_weight="1"
-                        android:background="#00000000"
-                        android:drawablePadding="16dp"
-                        android:focusable="true"
-                        android:fontFamily="@font/outfit_regular"
-                        android:hint="@string/pass"
-                        android:inputType="textPassword"
-                        android:padding="18dp"
-                        android:textColor="@color/text_color_white"
-                        android:textColorHint="@color/text_color_white"
-                        android:textSize="16sp" />
-
-                    <ImageView
-                        android:id="@+id/ivEye"
-                        android:layout_width="32dp"
-                        android:layout_height="32dp"
-                        android:layout_marginStart="8dp"
-                        android:layout_marginEnd="16dp"
-                        android:visibility="gone"
-                        android:src="@drawable/ic_hide_password" />
-
-                </LinearLayout>
-
-                <LinearLayout
+                <TextView
+                    android:id="@+id/tvForgotPassword"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    android:layout_marginTop="@dimen/x10dp"
-                    android:orientation="horizontal"
-                    android:weightSum="2">
-
-                    <TextView
-                        android:id="@+id/tv_signup"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_gravity="center"
-                        android:layout_weight="1"
-                        android:clickable="true"
-                        android:focusable="true"
-                        android:fontFamily="@font/outfit_regular"
-                        android:gravity="left"
-                        android:padding="@dimen/x5dp"
-                        android:text="@string/signup"
-                        android:textColor="@color/app_yellow_color"
-                        android:textSize="16dp"
-                        android:visibility="gone"
-                        android:textStyle="bold" />
-
-                    <TextView
-                        android:id="@+id/tvForgotPassword"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_gravity="center"
-                        android:layout_weight="1"
-                        android:clickable="true"
-                        android:focusable="true"
-                        android:fontFamily="@font/outfit_regular"
-                        android:gravity="right"
-                        android:padding="@dimen/x5dp"
-                        android:text="@string/forgot_password"
-                        android:textColor="@color/app_yellow_color"
-                        android:textSize="16dp"
-                        android:visibility="gone"
-                        android:textStyle="bold" />
-                </LinearLayout>
-
+                    android:layout_gravity="center"
+                    android:layout_weight="1"
+                    android:clickable="true"
+                    android:focusable="true"
+                    android:fontFamily="@font/outfit_regular"
+                    android:gravity="right"
+                    android:padding="@dimen/x5dp"
+                    android:text="@string/forgot_password"
+                    android:textColor="@color/app_yellow_color"
+                    android:textSize="16dp"
+                    android:visibility="gone"
+                    android:textStyle="bold" />
             </LinearLayout>
 
-            <Button
-                android:id="@+id/tvLogin"
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_marginTop="@dimen/x30dp"
-                android:background="@drawable/button_selector_state"
-                android:focusable="true"
-                android:fontFamily="@font/outfit_regular"
-                android:gravity="center"
-                android:letterSpacing="0.1"
-                android:shadowColor="@color/white"
-                android:text="@string/login"
-                android:textAllCaps="false"
-                android:textColor="@color/textviewhover"
-                android:textSize="16sp"
-                android:visibility="visible"
-                android:layout_marginStart="0dp"
-                android:layout_marginEnd="0dp"
-                app:layout_constraintEnd_toEndOf="@+id/linearLayout2"
-                app:layout_constraintStart_toStartOf="@+id/linearLayout2"
-                app:layout_constraintTop_toBottomOf="@id/linearLayout2" />
-
-            <ImageView
-                android:id="@+id/imageView7"
-                android:layout_width="60dp"
-                android:layout_height="60dp"
-                android:layout_marginBottom="@dimen/x30dp"
-                app:layout_constraintEnd_toEndOf="parent"
-                app:layout_constraintStart_toStartOf="parent"
-                app:layout_constraintBottom_toTopOf="@id/linearLayout2"
-                app:srcCompat="@drawable/ic_logo1" />
-
-        </androidx.constraintlayout.widget.ConstraintLayout>
-
+        </LinearLayout>
+
+        <Button
+            android:id="@+id/tvLogin"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/x30dp"
+            android:background="@drawable/button_selector_state"
+            android:focusable="true"
+            android:fontFamily="@font/outfit_regular"
+            android:gravity="center"
+            android:letterSpacing="0.1"
+            android:shadowColor="@color/white"
+            android:text="@string/login"
+            android:textAllCaps="false"
+            android:textColor="@color/textviewhover"
+            android:textSize="16sp"
+            android:visibility="visible"
+            android:layout_marginStart="0dp"
+            android:layout_marginEnd="0dp"
+            app:layout_constraintEnd_toEndOf="@+id/linearLayout2"
+            app:layout_constraintStart_toStartOf="@+id/linearLayout2"
+            app:layout_constraintTop_toBottomOf="@id/linearLayout2" />
+
+        <ImageView
+            android:id="@+id/imageView7"
+            android:layout_width="60dp"
+            android:layout_height="60dp"
+            android:layout_marginBottom="@dimen/x30dp"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintBottom_toTopOf="@id/linearLayout2"
+            app:srcCompat="@drawable/ic_logo1" />
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+</layout>

+ 68 - 0
app/src/main/res/layout/item_settings_tv.xml

@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    xmlns:tools="http://schemas.android.com/tools"
+    app:cardBackgroundColor="#A9C5C3C3"
+    app:cardCornerRadius="10dp"
+    app:cardUseCompatPadding="true">
+
+    <androidx.cardview.widget.CardView
+        android:id="@+id/card_bg"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_margin="1px"
+        app:cardBackgroundColor="#06143B"
+        app:cardCornerRadius="10dp">
+
+        <LinearLayout
+            android:id="@+id/audio_row"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:gravity="center_vertical"
+            android:orientation="vertical"
+            android:padding="10dp">
+
+            <androidx.cardview.widget.CardView
+                android:layout_width="80dp"
+                android:layout_height="80dp"
+                android:layout_gravity="center"
+                android:layout_marginBottom="0dp"
+                android:layout_marginTop="0dp"
+                app:cardCornerRadius="10dp"
+                app:cardBackgroundColor="#06143B"
+                app:cardElevation="0dp">
+
+                <ImageView
+                    android:id="@+id/ivIconItem"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:layout_gravity="center"
+                    android:scaleType="centerCrop"
+                    android:src="@drawable/ic_settings_y"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+            </androidx.cardview.widget.CardView>
+
+            <TextView
+                android:id="@+id/item_name"
+                android:layout_width="100dp"
+                android:layout_height="30dp"
+                android:layout_marginStart="0dp"
+                android:layout_marginTop="5dp"
+                android:layout_marginEnd="0dp"
+                android:fontFamily="@font/outfit_regular"
+                android:gravity="center"
+                android:layout_gravity="center"
+                android:text="Settings"
+                android:textColor="#ffffff"
+                android:textSize="12dp" />
+
+
+        </LinearLayout>
+    </androidx.cardview.widget.CardView>
+</androidx.cardview.widget.CardView>