瀏覽代碼

admin page in progress

dola 1 年之前
父節點
當前提交
9190e26c24
共有 21 個文件被更改,包括 568 次插入30 次删除
  1. 12 9
      app/src/main/AndroidManifest.xml
  2. 18 0
      app/src/main/java/com/sambath/kunkhmer/app/AdminActivity.kt
  3. 17 0
      app/src/main/java/com/sambath/kunkhmer/screen/account/AccountFragment.kt
  4. 60 0
      app/src/main/java/com/sambath/kunkhmer/screen/event/EventAdminFragment.kt
  5. 60 0
      app/src/main/java/com/sambath/kunkhmer/screen/fighter/FighterAdminFragment.kt
  6. 60 0
      app/src/main/java/com/sambath/kunkhmer/screen/lives/LivesAdminFragment.kt
  7. 12 9
      app/src/main/java/com/sambath/kunkhmer/screen/login/LoginActivity.kt
  8. 1 1
      app/src/main/java/com/sambath/kunkhmer/screen/login/LoginViewModel.kt
  9. 2 1
      app/src/main/java/com/sambath/kunkhmer/screen/login/LoginViewState.kt
  10. 60 0
      app/src/main/java/com/sambath/kunkhmer/screen/news/NewsAdminFragment.kt
  11. 60 0
      app/src/main/java/com/sambath/kunkhmer/screen/shop/ShopAdminFragment.kt
  12. 22 10
      app/src/main/java/com/sambath/kunkhmer/screen/splash/SplashScreenActivity.kt
  13. 1 0
      app/src/main/java/com/sambath/kunkhmer/util/PrefHelper.kt
  14. 41 0
      app/src/main/res/layout/activity_admin.xml
  15. 14 0
      app/src/main/res/layout/fragment_event_admin.xml
  16. 14 0
      app/src/main/res/layout/fragment_fighter_admin.xml
  17. 14 0
      app/src/main/res/layout/fragment_lives_admin.xml
  18. 14 0
      app/src/main/res/layout/fragment_news_admin.xml
  19. 14 0
      app/src/main/res/layout/fragment_shop_admin.xml
  20. 28 0
      app/src/main/res/menu/bottom_nav_menu_admin.xml
  21. 44 0
      app/src/main/res/navigation/mobile_navigation_admin.xml

+ 12 - 9
app/src/main/AndroidManifest.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
-    package="com.sambath.kunkhmer" >
+    package="com.sambath.kunkhmer">
 
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
@@ -9,7 +9,7 @@
     <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
 
     <application
-        android:name="com.sambath.kunkhmer.app.App"
+        android:name=".app.App"
         android:allowBackup="false"
         android:hardwareAccelerated="true"
         android:icon="@mipmap/ic_launcher"
@@ -17,31 +17,34 @@
         android:supportsRtl="true"
         android:theme="@style/AppTheme"
         android:usesCleartextTraffic="true"
-        tools:targetApi="m" >
+        tools:targetApi="m">
         <activity
-            android:name="com.sambath.kunkhmer.app.MainActivity"
+            android:name=".app.AdminActivity"
             android:exported="false" />
         <activity
-            android:name="com.sambath.kunkhmer.screen.register.RegisterActivity"
+            android:name=".app.MainActivity"
             android:exported="false" />
         <activity
-            android:name="com.sambath.kunkhmer.app.ShareActivity"
+            android:name=".screen.register.RegisterActivity"
+            android:exported="false" />
+        <activity
+            android:name=".app.ShareActivity"
             android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
             android:label="@string/app_name"
             android:screenOrientation="sensorPortrait"
             android:windowSoftInputMode="adjustResize" />
         <activity
-            android:name="com.sambath.kunkhmer.screen.login.LoginActivity"
+            android:name=".screen.login.LoginActivity"
             android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
             android:label="@string/app_name"
             android:screenOrientation="sensorPortrait"
             android:windowSoftInputMode="adjustResize" />
         <activity
-            android:name="com.sambath.kunkhmer.screen.splash.SplashScreenActivity"
+            android:name=".screen.splash.SplashScreenActivity"
             android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
             android:exported="true"
             android:screenOrientation="sensorPortrait"
-            android:windowSoftInputMode="adjustResize" >
+            android:windowSoftInputMode="adjustResize">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 

+ 18 - 0
app/src/main/java/com/sambath/kunkhmer/app/AdminActivity.kt

@@ -0,0 +1,18 @@
+package com.sambath.kunkhmer.app
+
+import androidx.appcompat.app.AppCompatActivity
+import android.os.Bundle
+import androidx.navigation.findNavController
+import com.sambath.kunkhmer.R
+import kotlinx.android.synthetic.main.app_bar_boxing.iv_account
+
+class AdminActivity : AppCompatActivity() {
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        setContentView(R.layout.activity_admin)
+
+        iv_account.setOnClickListener{
+            findNavController(R.id.nav_host_fragment_activity_main).navigate(R.id.navigation_account)
+        }
+    }
+}

+ 17 - 0
app/src/main/java/com/sambath/kunkhmer/screen/account/AccountFragment.kt

@@ -1,5 +1,6 @@
 package com.sambath.kunkhmer.screen.account
 
+import android.content.Intent
 import android.os.Bundle
 import androidx.fragment.app.Fragment
 import android.view.LayoutInflater
@@ -8,10 +9,13 @@ import android.view.ViewGroup
 import com.sambath.kunkhmer.R
 import com.sambath.kunkhmer.app.App
 import com.sambath.kunkhmer.remote.User
+import com.sambath.kunkhmer.screen.login.LoginActivity
 import com.sambath.kunkhmer.util.Const
 import com.sambath.kunkhmer.util.ModelPreferencesManager
+import com.sambath.kunkhmer.util.PrefHelper
 import kotlinx.android.synthetic.main.fragment_account.view.country_tv
 import kotlinx.android.synthetic.main.fragment_account.view.email_tv
+import kotlinx.android.synthetic.main.fragment_account.view.logout_btn
 import kotlinx.android.synthetic.main.fragment_account.view.member_tv
 import kotlinx.android.synthetic.main.fragment_account.view.username_tv
 import java.text.SimpleDateFormat
@@ -23,6 +27,7 @@ class AccountFragment : Fragment() {
     private val binding get() = _root!!
     private lateinit var user: User
     private lateinit var accountViewModel: AccountViewModel
+    lateinit var sharePref: PrefHelper
 
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
@@ -32,6 +37,7 @@ class AccountFragment : Fragment() {
         // Inflate the layout for this fragment
         _root = inflater.inflate(R.layout.fragment_account, container, false)
         user = ModelPreferencesManager.get<User>(Const.USER_KEY)!!
+        sharePref = App.injectPrefHelper()
 
         binding.username_tv.text = user.userName
         accountViewModel = AccountViewModel(App.injectApiService(), App.injectPrefHelper())
@@ -40,6 +46,17 @@ class AccountFragment : Fragment() {
             render(it)
         })
 
+        binding.logout_btn.setOnClickListener{
+            // Clear user-related data or preferences, such as the user token.
+            sharePref.logout()
+            // Redirect the user to the login screen or perform any other necessary actions.
+            // For example, you can start a new activity or fragment for the login screen:
+            val intent = Intent(context, LoginActivity::class.java)
+            intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
+            startActivity(intent)
+
+        }
+
         return _root
     }
 

+ 60 - 0
app/src/main/java/com/sambath/kunkhmer/screen/event/EventAdminFragment.kt

@@ -0,0 +1,60 @@
+package com.sambath.kunkhmer.screen.event
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.sambath.kunkhmer.R
+
+// TODO: Rename parameter arguments, choose names that match
+// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+private const val ARG_PARAM1 = "param1"
+private const val ARG_PARAM2 = "param2"
+
+/**
+ * A simple [Fragment] subclass.
+ * Use the [EventAdminFragment.newInstance] factory method to
+ * create an instance of this fragment.
+ */
+class EventAdminFragment : Fragment() {
+    // TODO: Rename and change types of parameters
+    private var param1: String? = null
+    private var param2: String? = null
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        arguments?.let {
+            param1 = it.getString(ARG_PARAM1)
+            param2 = it.getString(ARG_PARAM2)
+        }
+    }
+
+    override fun onCreateView(
+        inflater: LayoutInflater, container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View? {
+        // Inflate the layout for this fragment
+        return inflater.inflate(R.layout.fragment_event_admin, container, false)
+    }
+
+    companion object {
+        /**
+         * Use this factory method to create a new instance of
+         * this fragment using the provided parameters.
+         *
+         * @param param1 Parameter 1.
+         * @param param2 Parameter 2.
+         * @return A new instance of fragment EventAdminFragment.
+         */
+        // TODO: Rename and change types and number of parameters
+        @JvmStatic
+        fun newInstance(param1: String, param2: String) =
+            EventAdminFragment().apply {
+                arguments = Bundle().apply {
+                    putString(ARG_PARAM1, param1)
+                    putString(ARG_PARAM2, param2)
+                }
+            }
+    }
+}

+ 60 - 0
app/src/main/java/com/sambath/kunkhmer/screen/fighter/FighterAdminFragment.kt

@@ -0,0 +1,60 @@
+package com.sambath.kunkhmer.screen.fighter
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.sambath.kunkhmer.R
+
+// TODO: Rename parameter arguments, choose names that match
+// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+private const val ARG_PARAM1 = "param1"
+private const val ARG_PARAM2 = "param2"
+
+/**
+ * A simple [Fragment] subclass.
+ * Use the [FighterAdminFragment.newInstance] factory method to
+ * create an instance of this fragment.
+ */
+class FighterAdminFragment : Fragment() {
+    // TODO: Rename and change types of parameters
+    private var param1: String? = null
+    private var param2: String? = null
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        arguments?.let {
+            param1 = it.getString(ARG_PARAM1)
+            param2 = it.getString(ARG_PARAM2)
+        }
+    }
+
+    override fun onCreateView(
+        inflater: LayoutInflater, container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View? {
+        // Inflate the layout for this fragment
+        return inflater.inflate(R.layout.fragment_fighter_admin, container, false)
+    }
+
+    companion object {
+        /**
+         * Use this factory method to create a new instance of
+         * this fragment using the provided parameters.
+         *
+         * @param param1 Parameter 1.
+         * @param param2 Parameter 2.
+         * @return A new instance of fragment FighterAdminFragment.
+         */
+        // TODO: Rename and change types and number of parameters
+        @JvmStatic
+        fun newInstance(param1: String, param2: String) =
+            FighterAdminFragment().apply {
+                arguments = Bundle().apply {
+                    putString(ARG_PARAM1, param1)
+                    putString(ARG_PARAM2, param2)
+                }
+            }
+    }
+}

+ 60 - 0
app/src/main/java/com/sambath/kunkhmer/screen/lives/LivesAdminFragment.kt

@@ -0,0 +1,60 @@
+package com.sambath.kunkhmer.screen.lives
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.sambath.kunkhmer.R
+
+// TODO: Rename parameter arguments, choose names that match
+// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+private const val ARG_PARAM1 = "param1"
+private const val ARG_PARAM2 = "param2"
+
+/**
+ * A simple [Fragment] subclass.
+ * Use the [LivesAdminFragment.newInstance] factory method to
+ * create an instance of this fragment.
+ */
+class LivesAdminFragment : Fragment() {
+    // TODO: Rename and change types of parameters
+    private var param1: String? = null
+    private var param2: String? = null
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        arguments?.let {
+            param1 = it.getString(ARG_PARAM1)
+            param2 = it.getString(ARG_PARAM2)
+        }
+    }
+
+    override fun onCreateView(
+        inflater: LayoutInflater, container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View? {
+        // Inflate the layout for this fragment
+        return inflater.inflate(R.layout.fragment_lives_admin, container, false)
+    }
+
+    companion object {
+        /**
+         * Use this factory method to create a new instance of
+         * this fragment using the provided parameters.
+         *
+         * @param param1 Parameter 1.
+         * @param param2 Parameter 2.
+         * @return A new instance of fragment LivesAdminFragment.
+         */
+        // TODO: Rename and change types and number of parameters
+        @JvmStatic
+        fun newInstance(param1: String, param2: String) =
+            LivesAdminFragment().apply {
+                arguments = Bundle().apply {
+                    putString(ARG_PARAM1, param1)
+                    putString(ARG_PARAM2, param2)
+                }
+            }
+    }
+}

+ 12 - 9
app/src/main/java/com/sambath/kunkhmer/screen/login/LoginActivity.kt

@@ -5,6 +5,7 @@ import android.os.Bundle
 import androidx.appcompat.app.AppCompatActivity
 import androidx.lifecycle.Observer
 import com.sambath.kunkhmer.R
+import com.sambath.kunkhmer.app.AdminActivity
 import com.sambath.kunkhmer.app.App
 import com.sambath.kunkhmer.app.MainActivity
 import com.sambath.kunkhmer.app.ShareActivity
@@ -23,8 +24,8 @@ class LoginActivity : AppCompatActivity() {
         loginViewModel = LoginViewModel(App.injectApiService(), App.injectPrefHelper())
         super.onCreate(savedInstanceState)
         setContentView(R.layout.activity_login)
-        user = ModelPreferencesManager.get<User>(Const.USER_KEY)
-        if (user != null) et_username.setText(user?.userName)
+        /*user = ModelPreferencesManager.get<User>(Const.USER_KEY)
+        if (user != null) et_username.setText(user?.userName)*/
         loginViewModel.state.observe(this, Observer(this::render))
         btn_login.setOnClickListener {
             til_username.isErrorEnabled = false
@@ -44,10 +45,6 @@ class LoginActivity : AppCompatActivity() {
                 return@setOnClickListener
             }
             loginViewModel.login(username.toString(), password.toString())
-
-//            val intent = Intent(this, MainActivity::class.java)
-//            startActivity(intent)
-//            finishAffinity()
         }
 
         btn_signup.setOnClickListener {
@@ -62,9 +59,15 @@ class LoginActivity : AppCompatActivity() {
             tv_error.text = ""
         }
         if (state.isLoginSuccess) {
-            val intent = Intent(this, MainActivity::class.java)
-            startActivity(intent)
-            finishAffinity()
+            if (state.userName == "kk001") {
+                val intent = Intent(this, AdminActivity::class.java)
+                startActivity(intent)
+                finishAffinity()
+            } else {
+                val intent = Intent(this, MainActivity::class.java)
+                startActivity(intent)
+                finishAffinity()
+            }
         }
         if (state.error != null) {
             tv_error.text = state.error

+ 1 - 1
app/src/main/java/com/sambath/kunkhmer/screen/login/LoginViewModel.kt

@@ -31,7 +31,7 @@ class LoginViewModel(val apiService: ApiService, val prefHelper: PrefHelper) : B
                 .subscribe({
                     Log.d("login", it.toString())
                     if (it.resultCode == 1) {
-                        _state.value = prev().copy(isProgress = false, isLoginSuccess = true)
+                        _state.value = prev().copy(isProgress = false, isLoginSuccess = true, userName = it.data?.user?.userName)
                         prefHelper.setUserToken(it.data?.token ?: "")
                         prefHelper.setChannelType(1)
                         ModelPreferencesManager.put(it.data?.user, Const.USER_KEY)

+ 2 - 1
app/src/main/java/com/sambath/kunkhmer/screen/login/LoginViewState.kt

@@ -4,5 +4,6 @@ data class LoginViewState(
     val initial: Boolean = false,
     val isProgress: Boolean = false,
     val isLoginSuccess: Boolean = false,
-    val error: String? = null
+    val error: String? = null,
+    val userName: String? = null
 )

+ 60 - 0
app/src/main/java/com/sambath/kunkhmer/screen/news/NewsAdminFragment.kt

@@ -0,0 +1,60 @@
+package com.sambath.kunkhmer.screen.news
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.sambath.kunkhmer.R
+
+// TODO: Rename parameter arguments, choose names that match
+// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+private const val ARG_PARAM1 = "param1"
+private const val ARG_PARAM2 = "param2"
+
+/**
+ * A simple [Fragment] subclass.
+ * Use the [NewsAdminFragment.newInstance] factory method to
+ * create an instance of this fragment.
+ */
+class NewsAdminFragment : Fragment() {
+    // TODO: Rename and change types of parameters
+    private var param1: String? = null
+    private var param2: String? = null
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        arguments?.let {
+            param1 = it.getString(ARG_PARAM1)
+            param2 = it.getString(ARG_PARAM2)
+        }
+    }
+
+    override fun onCreateView(
+        inflater: LayoutInflater, container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View? {
+        // Inflate the layout for this fragment
+        return inflater.inflate(R.layout.fragment_news_admin, container, false)
+    }
+
+    companion object {
+        /**
+         * Use this factory method to create a new instance of
+         * this fragment using the provided parameters.
+         *
+         * @param param1 Parameter 1.
+         * @param param2 Parameter 2.
+         * @return A new instance of fragment NewsAdminFragment.
+         */
+        // TODO: Rename and change types and number of parameters
+        @JvmStatic
+        fun newInstance(param1: String, param2: String) =
+            NewsAdminFragment().apply {
+                arguments = Bundle().apply {
+                    putString(ARG_PARAM1, param1)
+                    putString(ARG_PARAM2, param2)
+                }
+            }
+    }
+}

+ 60 - 0
app/src/main/java/com/sambath/kunkhmer/screen/shop/ShopAdminFragment.kt

@@ -0,0 +1,60 @@
+package com.sambath.kunkhmer.screen.shop
+
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import com.sambath.kunkhmer.R
+
+// TODO: Rename parameter arguments, choose names that match
+// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
+private const val ARG_PARAM1 = "param1"
+private const val ARG_PARAM2 = "param2"
+
+/**
+ * A simple [Fragment] subclass.
+ * Use the [ShopAdminFragment.newInstance] factory method to
+ * create an instance of this fragment.
+ */
+class ShopAdminFragment : Fragment() {
+    // TODO: Rename and change types of parameters
+    private var param1: String? = null
+    private var param2: String? = null
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        arguments?.let {
+            param1 = it.getString(ARG_PARAM1)
+            param2 = it.getString(ARG_PARAM2)
+        }
+    }
+
+    override fun onCreateView(
+        inflater: LayoutInflater, container: ViewGroup?,
+        savedInstanceState: Bundle?
+    ): View? {
+        // Inflate the layout for this fragment
+        return inflater.inflate(R.layout.fragment_shop_admin, container, false)
+    }
+
+    companion object {
+        /**
+         * Use this factory method to create a new instance of
+         * this fragment using the provided parameters.
+         *
+         * @param param1 Parameter 1.
+         * @param param2 Parameter 2.
+         * @return A new instance of fragment ShopAdminFragment.
+         */
+        // TODO: Rename and change types and number of parameters
+        @JvmStatic
+        fun newInstance(param1: String, param2: String) =
+            ShopAdminFragment().apply {
+                arguments = Bundle().apply {
+                    putString(ARG_PARAM1, param1)
+                    putString(ARG_PARAM2, param2)
+                }
+            }
+    }
+}

+ 22 - 10
app/src/main/java/com/sambath/kunkhmer/screen/splash/SplashScreenActivity.kt

@@ -8,11 +8,15 @@ import android.view.animation.LinearInterpolator
 import android.view.animation.RotateAnimation
 import android.widget.ImageView
 import com.sambath.kunkhmer.R
+import com.sambath.kunkhmer.app.AdminActivity
 import com.sambath.kunkhmer.app.App
 import com.sambath.kunkhmer.app.MainActivity
 import com.sambath.kunkhmer.app.ShareActivity
 import com.sambath.kunkhmer.base.BaseActivity
+import com.sambath.kunkhmer.remote.User
 import com.sambath.kunkhmer.screen.login.LoginActivity
+import com.sambath.kunkhmer.util.Const
+import com.sambath.kunkhmer.util.ModelPreferencesManager
 
 class SplashScreenActivity : BaseActivity() {
     lateinit var imageLading: ImageView
@@ -28,6 +32,7 @@ class SplashScreenActivity : BaseActivity() {
 
         }
     }
+
     override fun onCreate(savedInstanceState: Bundle?) {
         super.onCreate(savedInstanceState)
         setContentView(R.layout.activity_splash)
@@ -48,25 +53,31 @@ class SplashScreenActivity : BaseActivity() {
         rotate.interpolator = LinearInterpolator()
         imageLading.startAnimation(rotate)
 
-        rotate.setAnimationListener(object : Animation.AnimationListener{
+        rotate.setAnimationListener(object : Animation.AnimationListener {
             override fun onAnimationRepeat(animation: Animation?) {
             }
 
             override fun onAnimationEnd(animation: Animation?) {
 
-                    //Test
-                    val intent = Intent(this@SplashScreenActivity, MainActivity::class.java)
-                    startActivity(intent)
+                //Test
+//                    val intent = Intent(this@SplashScreenActivity, MainActivity::class.java)
+//                    startActivity(intent)
 
-                    if (prefHelper.getToken().isNotEmpty()) {
-                        val intent = Intent(this@SplashScreenActivity, MainActivity::class.java)
+                if (prefHelper.getToken().isNotEmpty()) {
+                    val user = ModelPreferencesManager.get<User>(Const.USER_KEY)!!
+                    if (user.userName == "kk001") {
+                        val intent = Intent(this@SplashScreenActivity, AdminActivity::class.java)
                         startActivity(intent)
-                    }else{
-                        val intent = Intent(this@SplashScreenActivity, LoginActivity::class.java)
+                    } else {
+                        val intent = Intent(this@SplashScreenActivity, MainActivity::class.java)
                         startActivity(intent)
                     }
+                } else {
+                    val intent = Intent(this@SplashScreenActivity, LoginActivity::class.java)
+                    startActivity(intent)
+                }
 
-                    finishAffinity()
+                finishAffinity()
 
             }
 
@@ -78,6 +89,7 @@ class SplashScreenActivity : BaseActivity() {
 
 
     }
+
     override fun onDestroy() {
         //handler.removeCallbacks(runnable)
         super.onDestroy()
@@ -101,5 +113,5 @@ class SplashScreenActivity : BaseActivity() {
 //           // finishAffinity()
 //        }, 800)
 //
-   }
+    }
 }

+ 1 - 0
app/src/main/java/com/sambath/kunkhmer/util/PrefHelper.kt

@@ -42,5 +42,6 @@ class PrefHelper constructor(val context: Context) {
 
     fun logout() {
         sharedPreferences.edit().remove(TOKEN_KEY).apply()
+        ModelPreferencesManager.put(null, Const.USER_KEY)
     }
 }

+ 41 - 0
app/src/main/res/layout/activity_admin.xml

@@ -0,0 +1,41 @@
+<?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/coordinator"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".app.ShareActivity">
+
+    <include
+        android:id="@+id/app_bar"
+        layout="@layout/app_bar_boxing" />
+
+    <com.google.android.material.bottomnavigation.BottomNavigationView
+        android:id="@+id/nav_view"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="0dp"
+        android:layout_marginEnd="0dp"
+        android:background="@color/color_black"
+        app:itemIconTint="@drawable/selector_bottom_nav_item"
+        app:itemTextColor="@drawable/selector_bottom_nav_item"
+        app:labelVisibilityMode="labeled"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:menu="@menu/bottom_nav_menu_admin" />
+
+    <fragment
+        android:id="@+id/nav_host_fragment_activity_main"
+        android:name="androidx.navigation.fragment.NavHostFragment"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        app:layout_constraintTop_toBottomOf="@+id/app_bar"
+        app:layout_constraintBottom_toTopOf="@+id/nav_view"
+        app:defaultNavHost="true"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:navGraph="@navigation/mobile_navigation_admin" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>

+ 14 - 0
app/src/main/res/layout/fragment_event_admin.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".screen.event.EventAdminFragment">
+
+    <!-- TODO: Update blank fragment layout -->
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:text="@string/hello_blank_fragment" />
+
+</FrameLayout>

+ 14 - 0
app/src/main/res/layout/fragment_fighter_admin.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".screen.fighter.FighterAdminFragment">
+
+    <!-- TODO: Update blank fragment layout -->
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:text="@string/hello_blank_fragment" />
+
+</FrameLayout>

+ 14 - 0
app/src/main/res/layout/fragment_lives_admin.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".screen.lives.LivesAdminFragment">
+
+    <!-- TODO: Update blank fragment layout -->
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:text="@string/hello_blank_fragment" />
+
+</FrameLayout>

+ 14 - 0
app/src/main/res/layout/fragment_news_admin.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".screen.news.NewsAdminFragment">
+
+    <!-- TODO: Update blank fragment layout -->
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:text="@string/hello_blank_fragment" />
+
+</FrameLayout>

+ 14 - 0
app/src/main/res/layout/fragment_shop_admin.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context=".screen.shop.ShopAdminFragment">
+
+    <!-- TODO: Update blank fragment layout -->
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:text="@string/hello_blank_fragment" />
+
+</FrameLayout>

+ 28 - 0
app/src/main/res/menu/bottom_nav_menu_admin.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:id="@+id/navigation_home"
+        android:icon="@drawable/ic_fight"
+        android:title="@string/title_fighters" />
+
+    <item
+        android:id="@+id/navigation_dashboard"
+        android:icon="@drawable/ic_news_form"
+        android:title="@string/title_news" />
+
+    <item
+        android:id="@+id/navigation_live"
+        android:icon="@drawable/ic_live"
+        android:title="" />
+
+    <item
+        android:id="@+id/navigation_event"
+        android:icon="@drawable/ic_event_form"
+        android:title="@string/title_event" />
+
+    <item
+        android:id="@+id/navigation_shop"
+        android:icon="@drawable/ic_shop_form"
+        android:title="@string/title_shop" />
+
+</menu>

+ 44 - 0
app/src/main/res/navigation/mobile_navigation_admin.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<navigation 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/mobile_navigation"
+    app:startDestination="@+id/navigation_home">
+
+    <fragment
+        android:id="@+id/navigation_home"
+        android:name="com.sambath.kunkhmer.screen.fighter.FighterAdminFragment"
+        android:label="@string/title_fighters"
+        tools:layout="@layout/fragment_fighter_admin" />
+
+    <fragment
+        android:id="@+id/navigation_dashboard"
+        android:name="com.sambath.kunkhmer.screen.news.NewsAdminFragment"
+        android:label="@string/title_news"
+        tools:layout="@layout/fragment_news_admin" />
+
+    <fragment
+        android:id="@+id/navigation_live"
+        android:name="com.sambath.kunkhmer.screen.lives.LivesAdminFragment"
+        android:label="@string/title_live"
+        tools:layout="@layout/fragment_lives_admin" />
+
+    <fragment
+        android:id="@+id/navigation_event"
+        android:name="com.sambath.kunkhmer.screen.event.EventAdminFragment"
+        android:label="@string/title_event"
+        tools:layout="@layout/fragment_event_admin" />
+
+    <fragment
+        android:id="@+id/navigation_shop"
+        android:name="com.sambath.kunkhmer.screen.shop.ShopAdminFragment"
+        android:label="@string/title_shop"
+        tools:layout="@layout/fragment_shop_admin" />
+
+    <fragment
+        android:id="@+id/navigation_account"
+        android:name="com.sambath.kunkhmer.screen.account.AccountFragment"
+        android:label="@string/account"
+        tools:layout="@layout/fragment_account"/>
+
+</navigation>