Commit a90983ff authored by shohboz's avatar shohboz

[UPD] MUS-199 Feature, updated service screens to one fragment

parent c5da9444
package com.mobiuz.app.dev.model
data class ServiceData (
val id:Int,
val title:UzRuEn,
val short_description:UzRuEn,
val data: List<InnerData>
)
data class UzRuEn(
val uz:String,
val ru:String,
val en:String
)
data class InnerData(
val title:UzRuEn,
val data: List<UssdData>
)
data class UssdData(
val title:UzRuEn,
val short_description:UzRuEn,
val code: String,
val limit: Int,
)
\ No newline at end of file
package com.mobiuz.app.dev.ui.service.ussd
package com.mobiuz.app.dev.ui.service
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.mobiuz.app.databinding.ItemUssdBinding
import com.mobiuz.app.dev.model.PinData
import com.mobiuz.app.databinding.ItemServiceBinding
import com.mobiuz.app.dev.model.ServiceData
import com.mobiuz.app.dev.ui.global.ButtonClick
import com.mobiuz.app.dev.utils.extensions.SingleBlock
import com.mobiuz.app.dev.utils.extensions.getCurrentName
class MainUssdAdapter : RecyclerView.Adapter<MainUssdAdapter.VHolder>() {
class ServiceAdapter(val lang: String) : RecyclerView.Adapter<ServiceAdapter.VHolder>() {
private val list: ArrayList<PinData> by lazy { ArrayList() }
private var listener: SingleBlock<String>? = null
private val list: ArrayList<ServiceData> by lazy { ArrayList() }
private var listener: SingleBlock<ServiceData>? = null
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VHolder {
return VHolder(ItemUssdBinding.inflate(LayoutInflater.from(parent.context)))
return VHolder(ItemServiceBinding.inflate(LayoutInflater.from(parent.context)))
}
override fun onBindViewHolder(holder: VHolder, position: Int) = holder.bind(position)
override fun getItemCount() = 16
override fun getItemCount() = list.size
inner class VHolder(private val binding: ItemUssdBinding) : RecyclerView.ViewHolder(binding.root) {
inner class VHolder(private val binding: ItemServiceBinding) : RecyclerView.ViewHolder(binding.root) {
fun bind(position: Int) {
itemView.setOnClickListener {
listener?.invoke("")
val d = list[position]
binding.apply {
txtTitle.text = d.title.getCurrentName(lang)
txtDescription.text = d.short_description.getCurrentName(lang)
cardView.setOnClickListener(object : ButtonClick() {
override fun onSingleClick(v: View?) {
listener?.invoke(d)
}
})
}
// val d = list[position]
// binding.imagePin.setImageResource(if (d.count == -1) R.drawable.ic_pin_unchecked else R.drawable.ic_pin_checked)
}
}
fun submitList(ls: List<PinData>) {
fun submitList(ls: List<ServiceData>) {
list.clear()
list.addAll(ls)
notifyDataSetChanged()
}
fun setOnClickListener(block: SingleBlock<String>) {
fun setOnClickListener(block: SingleBlock<ServiceData>) {
listener = block
}
......
......@@ -3,25 +3,39 @@ package com.mobiuz.app.dev.ui.service
import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.core.os.bundleOf
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import androidx.recyclerview.widget.RecyclerView
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.mobiuz.app.R
import com.mobiuz.app.databinding.FragmentServiceBinding
import com.mobiuz.app.dev.MainViewModel
import com.mobiuz.app.dev.model.ServiceData
import com.mobiuz.app.dev.model.SharedPref
import com.mobiuz.app.dev.ui.base.BaseFragment
import com.mobiuz.app.dev.ui.global.ButtonClick
import com.mobiuz.app.dev.ui.global.CONSTANTS
import dagger.hilt.android.AndroidEntryPoint
import me.everything.android.ui.overscroll.OverScrollDecoratorHelper
import javax.inject.Inject
@AndroidEntryPoint
class ServiceFragment : BaseFragment(R.layout.fragment_service) {
@Inject
lateinit var pref: SharedPref
private lateinit var mainViewModel: MainViewModel
private var _bn: FragmentServiceBinding? = null
private val bn get() = _bn ?: throw NullPointerException("cannot inflate")
private lateinit var adapter: ServiceAdapter
private val navController: NavController by lazy(LazyThreadSafetyMode.NONE) { NavHostFragment.findNavController(this) }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
mainViewModel = ViewModelProvider(requireActivity())[MainViewModel::class.java]
adapter = ServiceAdapter(pref.language)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
......@@ -34,50 +48,45 @@ class ServiceFragment : BaseFragment(R.layout.fragment_service) {
}
override fun onResume() {
super.onResume()
mainViewModel.bottomSheet(true)
mainViewModel.swipeDrawer(true)
}
override fun setUpUI() {
bn.apply {
rvService.adapter = adapter
// rvService.edgeEffectFactory = RecyclerView.EdgeEffectFactory()
val arg = pref.services
val list = Gson().fromJson<List<ServiceData>>(arg,object : TypeToken<List<ServiceData>>(){}.type)
adapter.submitList(list)
OverScrollDecoratorHelper.setUpStaticOverScroll(bn.rvService, OverScrollDecoratorHelper.ORIENTATION_VERTICAL)
adapter.setOnClickListener {
navigateToServiceScreen(it)
}
toolbar.setNavigationOnClickListener {
mainViewModel.mainIndex(System.currentTimeMillis())
}
btnUsdCommand.setOnClickListener(object : ButtonClick(){
override fun onSingleClick(v: View?) {
val intent = Intent(requireContext(), ServicesActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_TASK_ON_HOME
startActivity(intent)
}
})
btnTarifi.setOnClickListener(object : ButtonClick(){
override fun onSingleClick(v: View?) {
val intent = Intent(requireContext(), ServicesActivity::class.java)
intent.putExtra(CONSTANTS.TYPE_SERVICE, CONSTANTS.TARIFFS)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_TASK_ON_HOME
startActivity(intent)
}
})
btnPaketi.setOnClickListener(object : ButtonClick(){
override fun onSingleClick(v: View?) {
val intent = Intent(requireContext(), ServicesActivity::class.java)
intent.putExtra(CONSTANTS.TYPE_SERVICE, CONSTANTS.PACKETS)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_TASK_ON_HOME
startActivity(intent)
}
})
btnMinutesAndSms.setOnClickListener(object : ButtonClick(){
override fun onSingleClick(v: View?) {
val intent = Intent(requireContext(), ServicesActivity::class.java)
intent.putExtra(CONSTANTS.TYPE_SERVICE, CONSTANTS.MINUTES)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_TASK_ON_HOME
startActivity(intent)
}
})
}
}
override fun onStop() {
super.onStop()
mainViewModel.swipeDrawer(false)
}
private fun navigateToServiceScreen(key: ServiceData) {
navController.navigate(R.id.servicesFragmentActivity, bundleOf(CONSTANTS.SERVICE to Gson().toJson(key)))
mainViewModel.bottomSheet(false)
}
override fun collects() {
}
......
......@@ -2,63 +2,84 @@ package com.mobiuz.app.dev.ui.service
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.isVisible
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import com.google.android.material.tabs.TabLayout.MODE_SCROLLABLE
import com.google.android.material.tabs.TabLayoutMediator
import com.google.gson.Gson
import com.mobiuz.app.R
import com.mobiuz.app.databinding.ActivityServicesBinding
import com.mobiuz.app.dev.model.ServiceData
import com.mobiuz.app.dev.model.SharedPref
import com.mobiuz.app.dev.ui.base.BaseFragment
import com.mobiuz.app.dev.ui.global.CONSTANTS
import com.mobiuz.app.dev.utils.LocaleHelper
import com.mobiuz.app.dev.utils.Utils
import com.mobiuz.app.dev.utils.extensions.getCurrentName
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
@AndroidEntryPoint
class ServicesActivity : AppCompatActivity() {
class ServicesFragmentActivity : BaseFragment(R.layout.activity_services) {
private var _bn: ActivityServicesBinding? = null
private val bn get() = _bn ?: throw NullPointerException("cannot inflate")
private lateinit var navController: NavController
@Inject
lateinit var pref: SharedPref
private var service: ServiceData? = null
private lateinit var adapter: FragmentPagerAdapter
private val navController: NavController by lazy(LazyThreadSafetyMode.NONE) { NavHostFragment.findNavController(this) }
override fun onCreate(savedInstanceState: Bundle?) {
LocaleHelper.setLocale(this)
super.onCreate(savedInstanceState)
_bn = ActivityServicesBinding.inflate(layoutInflater)
setContentView(bn.root)
val window = window.decorView
window.systemUiVisibility = window.systemUiVisibility or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
val fragment = supportFragmentManager.findFragmentById(R.id.services_container) as NavHostFragment
navController = NavHostFragment.findNavController(fragment)
intent?.let {
val type = it.getStringExtra(CONSTANTS.TYPE_SERVICE)
when (type) {
CONSTANTS.TARIFFS -> {
navController.popBackStack()
navController.navigate(R.id.tariffsFragment, null, Utils.navOptions())
}
arguments?.let {
val arg = it.getString(CONSTANTS.SERVICE)
service = Gson().fromJson(arg, ServiceData::class.java)
}
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
_bn = ActivityServicesBinding.bind(view)
setUpUI()
collects()
}
CONSTANTS.PACKETS -> {
navController.popBackStack()
navController.navigate(R.id.packetsFragment, null, Utils.navOptions())
override fun setUpUI() {
bn.apply {
toolbar.setNavigationOnClickListener {
navController.navigateUp()
}
service?.let {
toolbar.title = it.title.getCurrentName(pref.language)
if (it.data.size == 1) {
tabLayout.isVisible = false
}
CONSTANTS.MINUTES -> {
navController.popBackStack()
navController.navigate(R.id.minutesFragment, null, Utils.navOptions())
if (it.data.size > 3) {
tabLayout.tabMode = MODE_SCROLLABLE
}
else -> Unit
adapter = FragmentPagerAdapter(this@ServicesFragmentActivity, it)
viewPager.adapter = adapter
TabLayoutMediator(bn.tabLayout, bn.viewPager) { tab, pos ->
tab.text = it.data[pos].title.getCurrentName(pref.language)
}.attach()
}
}
}
override fun collects() {
}
override fun onDestroy() {
_bn = null
super.onDestroy()
......
package com.mobiuz.app.dev.ui.service.minutes
import android.os.Bundle
import android.view.View
import androidx.lifecycle.ViewModelProvider
import com.google.android.material.tabs.TabLayoutMediator
import com.mobiuz.app.R
import com.mobiuz.app.databinding.FragmentMinutesBinding
import com.mobiuz.app.dev.MainViewModel
import com.mobiuz.app.dev.ui.base.BaseFragment
import com.mobiuz.app.dev.ui.service.FragmentPagerAdapter
import dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint
class MinutesFragment : BaseFragment(R.layout.fragment_minutes) {
private lateinit var mainViewModel: MainViewModel
private var _bn: FragmentMinutesBinding? = null
private val bn get() = _bn ?: throw NullPointerException("cannot inflate")
private lateinit var adapter : FragmentPagerAdapter
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
mainViewModel = ViewModelProvider(requireActivity())[MainViewModel::class.java]
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
_bn = FragmentMinutesBinding.bind(view)
adapter = FragmentPagerAdapter(this, arrayListOf("",""))
setUpUI()
collects()
}
override fun setUpUI() {
bn.apply {
viewPager.adapter = adapter
toolbar.setNavigationOnClickListener {
requireActivity().finish()
}
TabLayoutMediator(bn.tabLayout,bn.viewPager){tab,pos->
if(pos == 0){
tab.text = "МИНУТЫ"
}else{
tab.text = "SMS"
}
}.attach()
}
}
override fun collects() {
}
override fun onDestroy() {
_bn = null
super.onDestroy()
}
}
\ No newline at end of file
package com.mobiuz.app.dev.ui.service.ussd
import android.os.Bundle
import android.view.View
import androidx.lifecycle.ViewModelProvider
import com.mobiuz.app.R
import com.mobiuz.app.databinding.FragmentMainUssdBinding
import com.mobiuz.app.dev.MainViewModel
import com.mobiuz.app.dev.ui.base.BaseFragment
import com.mobiuz.app.dev.ui.service.UssdBottomSheetDialog
import com.mobiuz.app.dev.ui.service.UssdData
import dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint
class MainUssdFragment : BaseFragment(R.layout.fragment_main_ussd) {
private lateinit var mainViewModel: MainViewModel
private var _bn: FragmentMainUssdBinding? = null
private val bn get() = _bn ?: throw NullPointerException("cannot inflate")
private val adapter = MainUssdAdapter()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
mainViewModel = ViewModelProvider(requireActivity())[MainViewModel::class.java]
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
_bn = FragmentMainUssdBinding.bind(view)
setUpUI()
collects()
}
override fun setUpUI() {
bn.apply {
rvUssdCommand.adapter = adapter
toolbar.setNavigationOnClickListener {
requireActivity().finish()
}
adapter.setOnClickListener {
val dialog = UssdBottomSheetDialog(UssdData("USSD ЗАПРОС", "проверка баланса", "*111*120#", "Запросить"))
dialog.show(childFragmentManager, "tag")
}
}
}
override fun collects() {
}
override fun onDestroy() {
_bn = null
super.onDestroy()
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="false">
android:fitsSystemWindows="false"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white100">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/services_container"
android:name="androidx.navigation.fragment.NavHostFragment"
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:background="@color/white100"
android:elevation="0dp"
app:navigationIcon="@drawable/ic_baseline_arrow_back"
app:title="@string/minutes_and_sms" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white100"
app:tabIndicatorColor="@color/primary100"
app:tabMode="fixed"
app:tabSelectedTextColor="@color/primary100"
app:tabTextColor="@color/grey70" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:navGraph="@navigation/nav_graph_services"
tools:context=".dev.ui.auth.AuthActivity"/>
android:layout_height="match_parent" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -23,7 +23,7 @@
android:textStyle="bold" />
<TextView
android:id="@+id/txt_tarif"
android:id="@+id/txt_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
xmlns:tools="http://schemas.android.com/tools"
android:fitsSystemWindows="true"
android:orientation="vertical">
<com.google.android.material.appbar.MaterialToolbar
android:layout_width="match_parent"
app:title="@string/main_ussd_command"
android:background="@color/white100"
android:layout_height="wrap_content"
android:id="@+id/toolbar"
android:elevation="0dp"
app:navigationIcon="@drawable/ic_baseline_arrow_back" />
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:id="@+id/rv_ussd_command"
android:layout_marginHorizontal="12dp"
tools:listitem="@layout/item_ussd"
android:layout_height="match_parent"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:fitsSystemWindows="true"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white100"
app:navigationIcon="@drawable/ic_baseline_arrow_back"
app:title="@string/minutes_and_sms" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white100"
app:tabIndicatorColor="@color/primary100"
app:tabMode="fixed"
app:tabSelectedTextColor="@color/primary100"
app:tabTextColor="@color/grey70" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:navigationIcon="@drawable/ic_baseline_arrow_back"
/>
<TextView
style="@style/TitleTextStyle"
android:id="@+id/txt_password"
android:layout_marginHorizontal="@dimen/_12sdp"
android:layout_marginTop="@dimen/_14sdp"
android:text="@string/enter_new_password"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/txt_hint_confirm"
app:layout_constraintTop_toBottomOf="@id/toolbar" />
<TextView
android:id="@+id/txt_hint_confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="60dp"
android:text="@string/enter_password"
android:textSize="15sp"
android:textColor="@color/black75"
app:layout_constraintStart_toStartOf="@id/layout_input_password"
app:layout_constraintTop_toBottomOf="@id/txt_password" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/layout_input_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="@dimen/_12sdp"
android:layout_marginEnd="@dimen/_12sdp"
app:endIconMode="password_toggle"
app:layout_constraintTop_toBottomOf="@id/txt_hint_confirm">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_password"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/edit_text_unchecked"
android:imeOptions="actionDone"
android:inputType="numberPassword"
android:maxLength="7"
android:textSize="@dimen/_12sdp"
android:paddingVertical="@dimen/_12sdp"
android:paddingStart="@dimen/_12sdp"
tools:ignore="RtlSymmetry" />
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/helper_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/phone"
android:visibility="gone"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/layout_input_confirm"
app:layout_constraintTop_toBottomOf="@id/layout_input_confirm"
android:layout_marginTop="@dimen/_4sdp"
android:layout_marginStart="@dimen/_12sdp"
android:layout_gravity="start"
android:textColor="@color/primary100"
/>
<TextView
android:id="@+id/txt_forget_password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/_6sdp"
android:textSize="16sp"
android:text="@string/forget_password"
android:background="?android:selectableItemBackground"
android:textColor="@color/grey110"
android:textStyle="bold"
android:layout_marginTop="@dimen/_10sdp"
android:layout_marginEnd="@dimen/_10sdp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/layout_input_password" />
<Button
android:id="@+id/btn_login"
android:layout_width="match_parent"
android:enabled="false"
android:textSize="@dimen/_12sdp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginHorizontal="@dimen/_12sdp"
android:layout_marginTop="@dimen/_34sdp"
android:text="@string/enter"
app:layout_constraintTop_toBottomOf="@id/layout_input_password"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:fitsSystemWindows="true"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white100"
app:navigationIcon="@drawable/ic_baseline_arrow_back"
app:title="@string/packets" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white100"
app:tabGravity="center"
app:tabIndicatorColor="@color/primary100"
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/primary100"
app:tabTextColor="@color/grey70" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
......@@ -13,174 +13,25 @@
app:navigationIcon="@drawable/ic_menu_red" />
<TextView
style="@style/TitleTextStyle"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textSize="34sp"
android:textStyle="bold"
android:layout_marginStart="16dp"
android:layout_marginTop="10dp"
android:text="@string/services" />
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:id="@+id/btn_usd_command"
android:layout_height="70dp"
app:cardElevation="1dp"
app:cardCornerRadius="12dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="32dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
style="@style/ServicesTextStyle"
android:text="Основные ussd команды" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="23 команды"
android:textColor="@color/grey80"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_baseline_arrow_red" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:minHeight="74dp"
android:id="@+id/btn_tarifi"
app:cardElevation="1dp"
app:cardCornerRadius="12dp"
android:layout_height="70dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="12dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
style="@style/ServicesTextStyle"
android:text="Тарифы" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Активные • Годовые"
android:textColor="@color/grey80"
/>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_baseline_arrow_red" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:minHeight="64dp"
android:id="@+id/btn_paketi"
app:cardElevation="1dp"
app:cardCornerRadius="12dp"
android:layout_height="70dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="12dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
style="@style/ServicesTextStyle"
android:text="Интернет пакеты" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Месячные • Суточные • Ночные • Ночной Drive"
android:textColor="@color/grey80"
/>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_baseline_arrow_red" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:minHeight="64dp"
app:cardElevation="1dp"
app:cardCornerRadius="12dp"
android:id="@+id/btn_minutes_and_sms"
android:layout_height="70dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="12dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
style="@style/ServicesTextStyle"
android:text="Минуты и SMS" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Пакеты минут • Роуминг пакеты • SMS пакеты"
android:textColor="@color/grey80"
/>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_baseline_arrow_red" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
android:id="@+id/rv_service"
android:visibility="visible"
android:scrollbars="none"
android:overScrollMode="never"
android:layout_marginTop="@dimen/_20sdp"
android:layout_marginHorizontal="12dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:layout_height="match_parent"/>
</LinearLayout>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<LinearLayout
android:layout_width="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="true"
android:fitsSystemWindows="false"
android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
......@@ -10,8 +10,10 @@
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
app:cardCornerRadius="12dp"
android:id="@+id/card_view"
app:cardUseCompatPadding="true"
android:layout_height="100dp">
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -21,11 +23,12 @@
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
style="@style/ServicesTextStyle"
android:id="@+id/title"
android:text="Mobi 20" />
<TextView
......@@ -33,6 +36,8 @@
android:layout_height="wrap_content"
android:text="20 000/1 000 so‘m"
android:textStyle="bold"
android:textSize="14sp"
android:id="@+id/description"
android:textColor="@color/primary100"
/>
......@@ -40,7 +45,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="*100#"
android:textSize="13sp"
android:textStyle="bold"
android:id="@+id/code"
android:textColor="@color/grey80"
/>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="wrap_content"
android:fitsSystemWindows="false"
android:orientation="vertical">
<com.google.android.material.card.MaterialCardView
android:id="@+id/card_view"
app:cardUseCompatPadding="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="12dp"
app:cardElevation="1dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/txt_title"
style="@style/ServicesTextStyle"
android:layout_marginEnd="12dp"
android:ellipsize="end"
android:maxLines="1"
android:text="Основные ussd команды" />
<TextView
android:id="@+id/txt_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:ellipsize="end"
android:maxLines="1"
android:text="23 команды"
android:textColor="@color/grey80"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_baseline_arrow_red" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
<View
android:layout_width="match_parent"
android:layout_height="1dp" />
</LinearLayout>
\ No newline at end of file
......@@ -10,6 +10,7 @@
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
app:cardCornerRadius="12dp"
android:id="@+id/card_view"
app:cardUseCompatPadding="true"
android:layout_height="84dp">
<LinearLayout
......
<?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/nav_graph_services"
app:startDestination="@id/mainUssdFragment">
<fragment
android:id="@+id/mainUssdFragment"
android:name="com.mobiuz.app.dev.ui.service.ussd.MainUssdFragment"
android:label="fragment_main_ussd"
tools:layout="@layout/fragment_main_ussd" />
<fragment
android:id="@+id/tariffsFragment"
android:name="com.mobiuz.app.dev.ui.service.tarifes.TariffsFragment"
android:label="TariffsFragment" />
<fragment
android:id="@+id/packetsFragment"
android:name="com.mobiuz.app.dev.ui.service.packets.PacketsFragment"
android:label="PacketsFragment" />
<fragment
android:id="@+id/minutesFragment"
android:name="com.mobiuz.app.dev.ui.service.minutes.MinutesFragment"
android:label="MinutesFragment" />
</navigation>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment