home side bar completed
built custom bottom nav for home new activity for ExploreWokaActivity research to blur the background with transparency Made 2 theme Home fragment and MyList Fragment Connected them with the side bar with respect to the selected theme
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools" >
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
@@ -14,12 +14,16 @@
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Woka"
|
||||
tools:targetApi="31" >
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".home.ExploreWokaActivity"
|
||||
android:exported="false"
|
||||
android:theme="@style/TransparentActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".home.HomeActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="portrait"
|
||||
/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".onboard.OnboardActivity"
|
||||
android:exported="false"
|
||||
@@ -29,7 +33,7 @@
|
||||
android:name=".onboard.WelcomeActivity"
|
||||
android:exported="true"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/Theme.App.Starting" >
|
||||
android:theme="@style/Theme.App.Starting">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
||||
35
app/src/main/java/com/woka/home/BlurBackground.kt
Normal file
35
app/src/main/java/com/woka/home/BlurBackground.kt
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.woka.home
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.renderscript.Allocation
|
||||
import android.renderscript.Element
|
||||
import android.renderscript.RenderScript
|
||||
import android.renderscript.ScriptIntrinsicBlur
|
||||
|
||||
class BlurBackground {
|
||||
companion object {
|
||||
private const val BITMAP_SCALE = 0.4f
|
||||
private const val BLUR_RADIUS = 7.5f
|
||||
|
||||
fun blur(context: Context, image: Bitmap): Bitmap {
|
||||
val width = (image.width * BITMAP_SCALE).toInt()
|
||||
val height = (image.height * BITMAP_SCALE).toInt()
|
||||
|
||||
val inputBitmap = Bitmap.createScaledBitmap(image, width, height, false)
|
||||
val outputBitmap = Bitmap.createBitmap(inputBitmap)
|
||||
|
||||
val rs = RenderScript.create(context)
|
||||
val script = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs))
|
||||
val tmpIn = Allocation.createFromBitmap(rs, inputBitmap)
|
||||
val tmpOut = Allocation.createFromBitmap(rs, outputBitmap)
|
||||
|
||||
script.setRadius(BLUR_RADIUS)
|
||||
script.setInput(tmpIn)
|
||||
script.forEach(tmpOut)
|
||||
tmpOut.copyTo(outputBitmap)
|
||||
|
||||
return outputBitmap
|
||||
}
|
||||
}
|
||||
}
|
||||
112
app/src/main/java/com/woka/home/BottomNavigation.kt
Normal file
112
app/src/main/java/com/woka/home/BottomNavigation.kt
Normal file
@@ -0,0 +1,112 @@
|
||||
package com.woka.home
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.util.AttributeSet
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.cardview.widget.CardView
|
||||
import com.woka.R
|
||||
import com.woka.utils.toast
|
||||
|
||||
class BottomNavigation: FrameLayout {
|
||||
|
||||
companion object{
|
||||
const val HOME = 1
|
||||
const val EXPLORE_WOKA = 2
|
||||
const val MY_LIST = 3
|
||||
}
|
||||
|
||||
private var bottomTabSelectListener: OnBottomTabSelectListener? = null
|
||||
|
||||
fun setOnBottomTabSelectListener(listener: OnBottomTabSelectListener){
|
||||
bottomTabSelectListener = listener
|
||||
}
|
||||
|
||||
private var selectedItem = HOME
|
||||
|
||||
fun getSelectedTab() = selectedItem
|
||||
|
||||
// colors
|
||||
private val primaryColor = ColorStateList.valueOf(context.getColor(R.color.color_primary))
|
||||
private val darkGray = ColorStateList.valueOf(context.getColor(android.R.color.darker_gray))
|
||||
|
||||
// uis
|
||||
private var homeCard: CardView? = null
|
||||
private var exploreCard: CardView? = null
|
||||
private var myListCard: CardView? = null
|
||||
|
||||
private var homeImg: ImageView? = null
|
||||
private var homeTxt: TextView? = null
|
||||
|
||||
private var myListImg: ImageView? = null
|
||||
private var myListTxt: TextView? = null
|
||||
|
||||
init {
|
||||
val view = inflate(context, R.layout.layout_bottom_nav, this)
|
||||
|
||||
homeCard = view.findViewById(R.id.home_bn)
|
||||
exploreCard = view.findViewById(R.id.explore_woka_bn)
|
||||
myListCard = view.findViewById(R.id.my_list_bn)
|
||||
|
||||
homeImg = view.findViewById(R.id.home_img_bn)
|
||||
homeTxt = view.findViewById(R.id.home_txt_bn)
|
||||
|
||||
myListImg = view.findViewById(R.id.my_list_img_bn)
|
||||
myListTxt = view.findViewById(R.id.my_list_txt_bn)
|
||||
|
||||
clickEvents()
|
||||
}
|
||||
|
||||
constructor(context: Context): super(context)
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet): super(context, attrs)
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, style: Int): super(context, attrs, style)
|
||||
|
||||
fun clickEvents(){
|
||||
|
||||
homeCard?.setOnClickListener {
|
||||
if (selectedItem != HOME){
|
||||
selectTab(HOME)
|
||||
}
|
||||
}
|
||||
|
||||
exploreCard?.setOnClickListener {
|
||||
if (selectedItem != EXPLORE_WOKA) {
|
||||
bottomTabSelectListener?.onBottomTabSelected(EXPLORE_WOKA)
|
||||
}
|
||||
}
|
||||
|
||||
myListCard?.setOnClickListener {
|
||||
if (selectedItem != MY_LIST) {
|
||||
selectTab(MY_LIST)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun selectTab(tab: Int){
|
||||
if (tab == HOME){
|
||||
homeImg?.imageTintList = primaryColor
|
||||
homeTxt?.setTextColor(primaryColor)
|
||||
|
||||
myListImg?.imageTintList = darkGray
|
||||
myListTxt?.setTextColor(darkGray)
|
||||
}else if (tab == MY_LIST){
|
||||
myListImg?.imageTintList = primaryColor
|
||||
myListTxt?.setTextColor(primaryColor)
|
||||
|
||||
homeImg?.imageTintList = darkGray
|
||||
homeTxt?.setTextColor(darkGray)
|
||||
}
|
||||
|
||||
bottomTabSelectListener?.onBottomTabSelected(tab)
|
||||
selectedItem = tab
|
||||
}
|
||||
|
||||
interface OnBottomTabSelectListener{
|
||||
fun onBottomTabSelected(tab: Int)
|
||||
}
|
||||
}
|
||||
33
app/src/main/java/com/woka/home/ExploreWokaActivity.kt
Normal file
33
app/src/main/java/com/woka/home/ExploreWokaActivity.kt
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.woka.home
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.woka.R
|
||||
import com.woka.databinding.ActivityExploreWokaBinding
|
||||
import com.woka.utils.WokaBaseActivity
|
||||
|
||||
|
||||
class ExploreWokaActivity : WokaBaseActivity() {
|
||||
|
||||
private lateinit var binding: ActivityExploreWokaBinding
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
binding = ActivityExploreWokaBinding.inflate(layoutInflater)
|
||||
|
||||
setContentView(binding.root)
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,41 @@
|
||||
package com.woka.home
|
||||
|
||||
import android.graphics.Color
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.Gravity
|
||||
import android.view.View.GONE
|
||||
import android.view.View.VISIBLE
|
||||
import android.view.WindowManager
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.GravityCompat
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.bumptech.glide.Glide
|
||||
import com.woka.BuildConfig
|
||||
import com.woka.R
|
||||
import com.woka.WokaApp.Companion.userPrefs
|
||||
import com.woka.databinding.ActivityHomeBinding
|
||||
import com.woka.home.BottomNavigation.Companion.EXPLORE_WOKA
|
||||
import com.woka.home.BottomNavigation.Companion.HOME
|
||||
import com.woka.home.BottomNavigation.Companion.MY_LIST
|
||||
import com.woka.home.fragments.Home1Fragment
|
||||
import com.woka.home.fragments.Home2Fragment
|
||||
import com.woka.home.fragments.MyListFragment
|
||||
import com.woka.mvvm.userDataModels.UserDataResponse
|
||||
import com.woka.networking.ApiResult
|
||||
import com.woka.utils.LOCALE_ENGLISH
|
||||
import com.woka.utils.LOCALE_HINDI
|
||||
import com.woka.utils.TAG
|
||||
import com.woka.utils.UserType
|
||||
import com.woka.utils.WokaBaseActivity
|
||||
import com.woka.utils.toast
|
||||
|
||||
class HomeActivity : WokaBaseActivity(), Observer<ApiResult<UserDataResponse>> {
|
||||
class HomeActivity : WokaBaseActivity(), Observer<ApiResult<UserDataResponse>>, BottomNavigation.OnBottomTabSelectListener {
|
||||
|
||||
private lateinit var binding: ActivityHomeBinding
|
||||
|
||||
private lateinit var viewModel: HomeViewModel
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
@@ -39,6 +47,8 @@ class HomeActivity : WokaBaseActivity(), Observer<ApiResult<UserDataResponse>> {
|
||||
insets
|
||||
}
|
||||
|
||||
viewModel = ViewModelProvider(this)[HomeViewModel::class.java]
|
||||
|
||||
userPrefs?.userLiveData?.observe(this, this)
|
||||
|
||||
initViews()
|
||||
@@ -46,16 +56,25 @@ class HomeActivity : WokaBaseActivity(), Observer<ApiResult<UserDataResponse>> {
|
||||
clickEvents()
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
if (binding.bottomNav.getSelectedTab() != HOME){
|
||||
binding.bottomNav.selectTab(HOME)
|
||||
}else {
|
||||
super.onBackPressed()
|
||||
}
|
||||
}
|
||||
|
||||
private fun initViews() {
|
||||
binding.apply {
|
||||
val versionName = "VER ${BuildConfig.VERSION_NAME}"
|
||||
sbVersion.text = versionName
|
||||
|
||||
bottomNav.setOnItemSelectedListener {
|
||||
if (bottomNav.selectedItemId != it.itemId)
|
||||
toast(it.title.toString())
|
||||
|
||||
true
|
||||
}
|
||||
bottomNav.setOnBottomTabSelectListener(this@HomeActivity)
|
||||
}
|
||||
|
||||
selectTheme(userPrefs?.appTheme?: Theme.THEME_ONE, true)
|
||||
|
||||
selectLanguage(userPrefs?.appLanguage?: LOCALE_ENGLISH, true)
|
||||
}
|
||||
|
||||
private fun clickEvents() {
|
||||
@@ -67,9 +86,99 @@ class HomeActivity : WokaBaseActivity(), Observer<ApiResult<UserDataResponse>> {
|
||||
closeDrawer.setOnClickListener {
|
||||
homeDrawer.closeDrawer(GravityCompat.END)
|
||||
}
|
||||
|
||||
sbTheme1.setOnClickListener {
|
||||
selectTheme(Theme.THEME_ONE)
|
||||
}
|
||||
|
||||
sbTheme2.setOnClickListener {
|
||||
selectTheme(Theme.THEME_TWO)
|
||||
}
|
||||
|
||||
sbEnglish.setOnClickListener {
|
||||
selectLanguage(LOCALE_ENGLISH)
|
||||
}
|
||||
|
||||
sbHindi.setOnClickListener {
|
||||
selectLanguage(LOCALE_HINDI)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun selectTheme(theme: Theme, init: Boolean = false){
|
||||
if (init || userPrefs?.appTheme != theme){
|
||||
// changing ui
|
||||
binding.apply {
|
||||
when(theme){
|
||||
Theme.THEME_ONE -> {
|
||||
sbTheme1Selected.visibility = VISIBLE
|
||||
sbTheme2Selected.visibility = GONE
|
||||
}
|
||||
Theme.THEME_TWO -> {
|
||||
sbTheme2Selected.visibility = VISIBLE
|
||||
sbTheme1Selected.visibility = GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
userPrefs?.appTheme = theme
|
||||
|
||||
binding.homeDrawer.closeDrawer(GravityCompat.END)
|
||||
binding.bottomNav.selectTab(HOME)
|
||||
}
|
||||
}
|
||||
|
||||
private fun selectLanguage(locale: String, init: Boolean = false){
|
||||
if (init || userPrefs?.appLanguage != locale){
|
||||
binding.apply {
|
||||
when(locale){
|
||||
LOCALE_ENGLISH -> {
|
||||
sbEnglish.setTextColor(ContextCompat.getColor(this@HomeActivity, R.color.color_primary_dark))
|
||||
sbEnglish.background = ContextCompat.getDrawable(this@HomeActivity, R.drawable.lang_tab_bg)
|
||||
|
||||
sbHindi.setTextColor(ContextCompat.getColor(this@HomeActivity, R.color.white))
|
||||
sbHindi.background = ContextCompat.getDrawable(this@HomeActivity, android.R.color.transparent)
|
||||
}
|
||||
LOCALE_HINDI -> {
|
||||
sbHindi.setTextColor(ContextCompat.getColor(this@HomeActivity, R.color.color_primary_dark))
|
||||
sbHindi.background = ContextCompat.getDrawable(this@HomeActivity, R.drawable.lang_tab_bg)
|
||||
|
||||
sbEnglish.setTextColor(ContextCompat.getColor(this@HomeActivity, R.color.white))
|
||||
sbEnglish.background = ContextCompat.getDrawable(this@HomeActivity, android.R.color.transparent)
|
||||
}
|
||||
}
|
||||
|
||||
userPrefs?.appLanguage = locale
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// on bottom navigation tab is selected
|
||||
override fun onBottomTabSelected(tab: Int) {
|
||||
when (tab){
|
||||
HOME -> {
|
||||
if (userPrefs?.appTheme == Theme.THEME_TWO){
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.fc_home, Home2Fragment.newInstance())
|
||||
.commit()
|
||||
}else{
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.fc_home, Home1Fragment.newInstance())
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
EXPLORE_WOKA -> {
|
||||
startActivity(Intent(this, ExploreWokaActivity::class.java))
|
||||
}
|
||||
MY_LIST -> {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.fc_home, MyListFragment.newInstance())
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// observer for userdata changes
|
||||
override fun onChanged(value: ApiResult<UserDataResponse>) {
|
||||
when(value){
|
||||
is ApiResult.Error -> {}
|
||||
|
||||
5
app/src/main/java/com/woka/home/HomeViewModel.kt
Normal file
5
app/src/main/java/com/woka/home/HomeViewModel.kt
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.woka.home
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
|
||||
class HomeViewModel: ViewModel()
|
||||
15
app/src/main/java/com/woka/home/Theme.kt
Normal file
15
app/src/main/java/com/woka/home/Theme.kt
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.woka.home
|
||||
|
||||
enum class Theme(val id: Int){
|
||||
THEME_ONE(1),
|
||||
THEME_TWO(2);
|
||||
|
||||
companion object{
|
||||
fun create(id: Int): Theme{
|
||||
return when(id){
|
||||
1 -> THEME_ONE
|
||||
else -> THEME_TWO
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
25
app/src/main/java/com/woka/home/fragments/Home1Fragment.kt
Normal file
25
app/src/main/java/com/woka/home/fragments/Home1Fragment.kt
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.woka.home.fragments
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.woka.databinding.FragmentHome1Binding
|
||||
|
||||
class Home1Fragment : Fragment() {
|
||||
|
||||
private lateinit var binding: FragmentHome1Binding
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
binding = FragmentHome1Binding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance() = Home1Fragment()
|
||||
}
|
||||
}
|
||||
25
app/src/main/java/com/woka/home/fragments/Home2Fragment.kt
Normal file
25
app/src/main/java/com/woka/home/fragments/Home2Fragment.kt
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.woka.home.fragments
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.woka.databinding.FragmentHome2Binding
|
||||
|
||||
class Home2Fragment : Fragment() {
|
||||
|
||||
private lateinit var binding: FragmentHome2Binding
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
binding = FragmentHome2Binding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance() = Home2Fragment()
|
||||
}
|
||||
}
|
||||
25
app/src/main/java/com/woka/home/fragments/MyListFragment.kt
Normal file
25
app/src/main/java/com/woka/home/fragments/MyListFragment.kt
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.woka.home.fragments
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.woka.databinding.FragmentMyListBinding
|
||||
|
||||
class MyListFragment : Fragment() {
|
||||
|
||||
private lateinit var binding: FragmentMyListBinding
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
binding = FragmentMyListBinding.inflate(inflater, container, false)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance() = MyListFragment()
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,8 @@ import androidx.core.app.ActivityOptionsCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.woka.databinding.FragmentLanguageBinding
|
||||
import com.woka.onboard.OnboardActivity
|
||||
import com.woka.utils.LOCALE_ENGLISH
|
||||
import com.woka.utils.LOCALE_HINDI
|
||||
import com.woka.utils.ProgressView
|
||||
import com.woka.utils.changeLocale
|
||||
|
||||
@@ -39,12 +41,12 @@ class LanguageFragment : Fragment() {
|
||||
|
||||
private fun clickEvents() {
|
||||
binding.english.setOnClickListener {
|
||||
requireActivity().changeLocale("en")
|
||||
requireActivity().changeLocale(LOCALE_ENGLISH)
|
||||
gotoOnboardActivity()
|
||||
}
|
||||
|
||||
binding.hindi.setOnClickListener {
|
||||
requireActivity().changeLocale("hi")
|
||||
requireActivity().changeLocale(LOCALE_HINDI)
|
||||
gotoOnboardActivity()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.provider.Settings
|
||||
import android.provider.Settings.Secure
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.woka.home.Theme
|
||||
import com.woka.mvvm.UserApiService
|
||||
import com.woka.mvvm.UserRepository
|
||||
import com.woka.mvvm.userDataModels.UserData
|
||||
@@ -21,21 +22,27 @@ import kotlinx.coroutines.launch
|
||||
|
||||
class UserPreference(context: Context) {
|
||||
|
||||
companion object{
|
||||
companion object {
|
||||
private const val USER_PREFERENCE = "woka_user_preferences"
|
||||
private const val APP_LANGUAGE = "app_language"
|
||||
private const val APP_THEME = "app_theme"
|
||||
private const val ACCESS_TOKEN = "access_token"
|
||||
private const val USER_TYPE = "user_type"
|
||||
private const val GUEST_USER_NAME = "guest_user_name"
|
||||
}
|
||||
|
||||
private val userPrefs: SharedPreferences = context.getSharedPreferences(USER_PREFERENCE, MODE_PRIVATE)
|
||||
private val userPrefs: SharedPreferences =
|
||||
context.getSharedPreferences(USER_PREFERENCE, MODE_PRIVATE)
|
||||
|
||||
@SuppressLint("HardwareIds")
|
||||
val deviceId: String = Secure.getString(context.contentResolver, Secure.ANDROID_ID)
|
||||
|
||||
var appLanguage: String
|
||||
get() = userPrefs.getString(APP_LANGUAGE, "en")?:"en"
|
||||
get() = userPrefs.getString(APP_LANGUAGE, "en") ?: "en"
|
||||
set(value) = userPrefs.edit().putString(APP_LANGUAGE, value).apply()
|
||||
var appTheme: Theme
|
||||
get() = Theme.create(userPrefs.getInt(APP_THEME, 1))
|
||||
set(value) = userPrefs.edit().putInt(APP_THEME, value.id).apply()
|
||||
|
||||
var accessToken: String?
|
||||
get() = userPrefs.getString(ACCESS_TOKEN, null)
|
||||
@@ -49,13 +56,14 @@ class UserPreference(context: Context) {
|
||||
get() = userPrefs.getString(GUEST_USER_NAME, null)
|
||||
set(value) = userPrefs.edit().putString(GUEST_USER_NAME, value).apply()
|
||||
|
||||
private val userRepository = UserRepository(RetrofitHelper.getRetrofit().create(UserApiService::class.java))
|
||||
private val userRepository =
|
||||
UserRepository(RetrofitHelper.getRetrofit().create(UserApiService::class.java))
|
||||
|
||||
private val _userLiveData = MutableLiveData<ApiResult<UserDataResponse>>()
|
||||
val userLiveData: LiveData<ApiResult<UserDataResponse>>
|
||||
get() = _userLiveData
|
||||
|
||||
fun loadUserData(){
|
||||
fun loadUserData() {
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
_userLiveData.postValue(ApiResult.Loading())
|
||||
_userLiveData.postValue(userRepository.getUserData())
|
||||
|
||||
@@ -5,5 +5,10 @@ const val TAG = "aditya_testing"
|
||||
const val PARENT_TYPE = "2"
|
||||
const val CHILD_TYPE = "1"
|
||||
|
||||
// networking
|
||||
const val NO_INTERNET_MESSAGE = "Make sure you are connected to internet"
|
||||
const val UNKNOWN_ERROR_MESSAGE = "An unknown error occurred"
|
||||
const val UNKNOWN_ERROR_MESSAGE = "An unknown error occurred"
|
||||
|
||||
// language code
|
||||
const val LOCALE_HINDI = "hi"
|
||||
const val LOCALE_ENGLISH = "en"
|
||||
@@ -18,6 +18,6 @@ open class WokaBaseActivity: AppCompatActivity() {
|
||||
configuration.fontScale = min(configuration.fontScale.toDouble(), 1.0).toFloat()
|
||||
applyOverrideConfiguration(configuration)
|
||||
super.attachBaseContext(newBase)
|
||||
changeLocale(userPrefs?.appLanguage?:"en")
|
||||
changeLocale(userPrefs?.appLanguage?: LOCALE_ENGLISH)
|
||||
}
|
||||
}
|
||||
5
app/src/main/res/drawable/ic_close_filled.xml
Normal file
5
app/src/main/res/drawable/ic_close_filled.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||
|
||||
<path android:fillColor="@android:color/white" android:pathData="M12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM17,15.59L15.59,17 12,13.41 8.41,17 7,15.59 10.59,12 7,8.41 8.41,7 12,10.59 15.59,7 17,8.41 13.41,12 17,15.59z"/>
|
||||
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_home_bn.xml
Normal file
10
app/src/main/res/drawable/ic_home_bn.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="19dp"
|
||||
android:height="18dp"
|
||||
android:viewportWidth="19"
|
||||
android:viewportHeight="18">
|
||||
<path
|
||||
android:pathData="M14.665,0C14.255,0 13.922,0.337 13.922,0.751V4.342L9.996,0.375C9.706,0.082 9.218,0.082 8.928,0.375L0.218,9.199C-0.073,9.493 -0.073,9.962 0.218,10.255C0.508,10.549 0.973,10.549 1.263,10.255L9.462,1.971L17.684,10.279C17.83,10.426 18.027,10.514 18.219,10.514C18.41,10.514 18.584,10.426 18.73,10.279C19.02,9.986 19.02,9.516 18.73,9.223L16.151,6.618V0.751C16.151,0.337 15.818,0 15.408,0H14.665ZM9.462,3.356L1.286,11.617V15.747C1.286,16.991 2.285,18 3.516,18H15.408C16.639,18 17.638,16.991 17.638,15.747V11.617L9.462,3.356ZM11.692,11.241C11.692,10.828 11.358,10.49 10.949,10.49H7.976C7.566,10.49 7.232,10.828 7.232,11.241V15.747C7.232,16.161 7.566,16.498 7.976,16.498H10.949C11.358,16.498 11.692,16.161 11.692,15.747V11.241Z"
|
||||
android:fillColor="#09005D"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
25
app/src/main/res/layout/activity_explore_woka.xml
Normal file
25
app/src/main/res/layout/activity_explore_woka.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".home.ExploreWokaActivity">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_close_filled"
|
||||
app:tint="@color/color_primary"
|
||||
|
||||
android:layout_marginBottom="15dp"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -41,6 +41,7 @@
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fc_home"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
|
||||
@@ -48,17 +49,13 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
<com.woka.home.BottomNavigation
|
||||
android:id="@+id/bottom_nav"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
app:backgroundTint="@color/white"
|
||||
app:menu="@menu/home_bottom_menu"
|
||||
app:itemIconTint="@color/color_primary"
|
||||
app:itemTextColor="@color/color_primary"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -70,19 +67,19 @@
|
||||
android:fitsSystemWindows="true"
|
||||
>
|
||||
|
||||
<ScrollView
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:layout_marginTop="40dp"
|
||||
android:scrollbars="none"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="25dp"
|
||||
android:layout_marginHorizontal="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
@@ -171,6 +168,7 @@
|
||||
>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/sb_theme_1"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="120dp"
|
||||
app:cardCornerRadius="3dp"
|
||||
@@ -185,23 +183,33 @@
|
||||
android:src="@drawable/theme_1"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
<RelativeLayout
|
||||
android:id="@+id/sb_theme_1_selected"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/theme_selected_tint"/>
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_green_tick"
|
||||
/>
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/theme_selected_tint"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_green_tick"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/sb_theme_2"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="120dp"
|
||||
app:strokeWidth="1dp"
|
||||
@@ -218,17 +226,48 @@
|
||||
android:src="@drawable/theme_2"
|
||||
/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/sb_theme_2_selected"
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/theme_selected_tint"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_green_tick"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/woka_sky_blue"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
/>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:cardCornerRadius="30dp"
|
||||
app:cardBackgroundColor="#050038"
|
||||
app:cardBackgroundColor="@color/color_primary_dark"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
@@ -238,6 +277,7 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sb_english"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -245,17 +285,18 @@
|
||||
android:text="@string/english"
|
||||
android:textAllCaps="true"
|
||||
android:fontFamily="@font/exo_2_medium"
|
||||
android:textColor="#050038"
|
||||
android:textColor="@color/white"
|
||||
android:textAlignment="center"
|
||||
android:textSize="@dimen/_11ssp"
|
||||
|
||||
android:background="@drawable/lang_tab_bg"
|
||||
android:background="@android:color/transparent"
|
||||
|
||||
android:paddingVertical="10dp"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sb_hindi"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -277,9 +318,268 @@
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/woka_sky_blue"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/about_woka"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:paddingVertical="5dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/faqs"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:paddingVertical="5dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/woka_support"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:paddingVertical="5dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:visibility="gone"
|
||||
|
||||
android:text="@string/my_profile"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:paddingVertical="5dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:visibility="gone"
|
||||
|
||||
android:text="@string/my_orders"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:paddingVertical="5dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:visibility="gone"
|
||||
|
||||
android:text="@string/de_activate_account"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_14ssp"
|
||||
|
||||
android:paddingVertical="5dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:background="@color/woka_sky_blue"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/terms_conditions"
|
||||
android:fontFamily="@font/exo_2_medium"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_10ssp"
|
||||
|
||||
android:paddingVertical="5dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="15dp"
|
||||
android:background="@color/white"
|
||||
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginHorizontal="2dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/privacy_policy"
|
||||
android:fontFamily="@font/exo_2_medium"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_10ssp"
|
||||
|
||||
android:paddingVertical="5dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
|
||||
android:background="@color/woka_sky_blue"
|
||||
android:layout_marginVertical="8dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/disclaimer"
|
||||
android:fontFamily="@font/exo_2_medium"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_10ssp"
|
||||
|
||||
android:paddingVertical="5dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
/>
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
|
||||
android:background="@color/woka_sky_blue"
|
||||
android:layout_marginVertical="8dp"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:weightSum="10"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="7"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/woka_creations_private_ltd"
|
||||
android:fontFamily="@font/exo_2_medium"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_10ssp"
|
||||
|
||||
android:paddingVertical="5dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sb_version"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="3"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:text="VER 25.1.1"
|
||||
android:fontFamily="@font/exo_2_medium"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_10ssp"
|
||||
android:textAlignment="viewEnd"
|
||||
|
||||
android:paddingVertical="5dp"
|
||||
android:paddingHorizontal="5dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</com.google.android.material.navigation.NavigationView>
|
||||
|
||||
|
||||
17
app/src/main/res/layout/fragment_home2.xml
Normal file
17
app/src/main/res/layout/fragment_home2.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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"
|
||||
android:background="@android:color/black"
|
||||
tools:context=".home.fragments.Home1Fragment">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Home"
|
||||
android:textColor="@color/white"
|
||||
android:layout_centerInParent="true"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
16
app/src/main/res/layout/fragment_home_1.xml
Normal file
16
app/src/main/res/layout/fragment_home_1.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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"
|
||||
android:background="@android:color/darker_gray"
|
||||
tools:context=".home.fragments.Home1Fragment">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Home"
|
||||
android:layout_centerInParent="true"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
16
app/src/main/res/layout/fragment_my_list.xml
Normal file
16
app/src/main/res/layout/fragment_my_list.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout 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"
|
||||
android:background="@android:color/holo_blue_bright"
|
||||
tools:context=".home.fragments.Home1Fragment">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Home"
|
||||
android:layout_centerInParent="true"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
152
app/src/main/res/layout/layout_bottom_nav.xml
Normal file
152
app/src/main/res/layout/layout_bottom_nav.xml
Normal file
@@ -0,0 +1,152 @@
|
||||
<?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"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.1dp"
|
||||
android:background="@android:color/darker_gray"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="3">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/home_bn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardElevation="0dp"
|
||||
app:cardCornerRadius="15dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginVertical="10dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/home_img_bn"
|
||||
android:layout_width="@dimen/_15sdp"
|
||||
android:layout_height="@dimen/_15sdp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_home_bn"
|
||||
app:tint="@android:color/darker_gray" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/home_txt_bn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/home"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textAlignment="center"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/explore_woka_bn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardElevation="0dp"
|
||||
app:cardCornerRadius="15dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginVertical="10dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/_25sdp"
|
||||
android:layout_height="@dimen/_15sdp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_woka"
|
||||
android:scaleType="fitXY"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/explore_woka"
|
||||
android:textColor="@color/color_primary"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textAlignment="center"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/my_list_bn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardElevation="0dp"
|
||||
app:cardCornerRadius="15dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginVertical="10dp"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/my_list_img_bn"
|
||||
android:layout_width="@dimen/_15sdp"
|
||||
android:layout_height="@dimen/_15sdp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_heart_filled"
|
||||
app:tint="@android:color/darker_gray"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/my_list_txt_bn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/my_list"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textAlignment="center"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:id="@+id/home_bm"
|
||||
android:title="@string/home"
|
||||
android:icon="@drawable/ic_home"
|
||||
/>
|
||||
|
||||
<item android:id="@+id/explore_woka_bm"
|
||||
android:title="@string/explore_woka"
|
||||
android:icon="@drawable/ic_woka"
|
||||
/>
|
||||
|
||||
<item android:id="@+id/my_list_bm"
|
||||
android:title="@string/my_list"
|
||||
android:icon="@drawable/ic_heart_filled"
|
||||
/>
|
||||
|
||||
</menu>
|
||||
@@ -4,6 +4,7 @@
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="white_50">#80FFFFFF</color>
|
||||
<color name="color_primary">#09005D</color>
|
||||
<color name="color_primary_dark">#050038</color>
|
||||
<color name="woka_sky_blue">#6ed5fe</color>
|
||||
|
||||
<color name="age_box_color">#9909005D</color>
|
||||
|
||||
@@ -108,4 +108,14 @@
|
||||
<string name="my_list">My List</string>
|
||||
<string name="logout">Logout</string>
|
||||
<string name="theme">THEME</string>
|
||||
<string name="about_woka">About WOKA</string>
|
||||
<string name="faqs">FAQs</string>
|
||||
<string name="woka_support">WOKA Support</string>
|
||||
<string name="my_profile">My Profile</string>
|
||||
<string name="my_orders">My Orders</string>
|
||||
<string name="de_activate_account">De-activate Account</string>
|
||||
<string name="terms_conditions"><![CDATA[Terms & Conditions]]></string>
|
||||
<string name="privacy_policy"><![CDATA[Privacy & Policy]]></string>
|
||||
<string name="disclaimer">Disclaimer</string>
|
||||
<string name="woka_creations_private_ltd">WOKA CREATIONS PVT LTD</string>
|
||||
</resources>
|
||||
@@ -22,5 +22,12 @@
|
||||
<item name="android:fontFamily">@font/exo_2</item>
|
||||
</style>
|
||||
|
||||
<!-- transparent activity-->
|
||||
<style name="TransparentActivity" parent="Base.Theme.Woka">
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowTranslucentStatus">true</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Woka" parent="Base.Theme.Woka" />
|
||||
</resources>
|
||||
Reference in New Issue
Block a user