Mohan Shiwakoti
1 year ago
17 changed files with 182 additions and 94 deletions
-
45app/src/main/java/com/remit/jmecustomer/features/homeV3/adpaters/IndicatorAdapter.kt
-
5app/src/main/java/com/remit/jmecustomer/features/homeV3/adpaters/SendTypeAdapter.kt
-
6app/src/main/java/com/remit/jmecustomer/features/homeV3/view/HomeActivityV3.kt
-
21app/src/main/java/com/remit/jmecustomer/features/homeV3/view/HomeFragmentV3.kt
-
42app/src/main/java/com/remit/jmecustomer/features/kyc/newCustomer/presenter/KYCV3ViewModel.java
-
4app/src/main/java/com/remit/jmecustomer/features/kyc/newCustomer/view/KYCV3Activity.java
-
1app/src/main/java/com/remit/jmecustomer/features/kyc/newCustomer/view/choose/ChooseKycFragment.kt
-
44app/src/main/java/com/remit/jmecustomer/features/kyc/newCustomer/view/documents/KYCIDTypeFragment.java
-
52app/src/main/java/com/remit/jmecustomer/features/newkyc/newCustomer/view/choose/ChooseKycFragment.kt
-
2app/src/main/java/com/remit/jmecustomer/features/registerv3/newcustomer/view/NewRegisterV3Activity.java
-
8app/src/main/res/drawable/circle_black_bullet.xml
-
4app/src/main/res/layout/activity_home_v3.xml
-
6app/src/main/res/layout/fragment_choose_kyc.xml
-
19app/src/main/res/layout/fragment_home_new.xml
-
14app/src/main/res/layout/item_indicator.xml
-
1app/src/main/res/layout/toolbar_dashboard_v3.xml
-
2app/src/main/res/values/styles.xml
@ -0,0 +1,45 @@ |
|||
package com.remit.jmecustomer.features.homeV3.adpaters |
|||
|
|||
import android.view.LayoutInflater |
|||
import android.view.View |
|||
import android.view.ViewGroup |
|||
import androidx.recyclerview.widget.RecyclerView |
|||
import com.remit.jmecustomer.R |
|||
|
|||
|
|||
class IndicatorAdapter(private val items: List<Any>) : |
|||
RecyclerView.Adapter<IndicatorAdapter.IndicatorViewHolder>() { |
|||
private var selectedPosition = 0 |
|||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): IndicatorViewHolder { |
|||
val itemView: View = |
|||
LayoutInflater.from(parent.context).inflate(R.layout.item_indicator, parent, false) |
|||
return IndicatorViewHolder(itemView) |
|||
} |
|||
|
|||
override fun onBindViewHolder(holder: IndicatorViewHolder, position: Int) { |
|||
// Set indicator appearance based on selected/unselected state |
|||
if (position == selectedPosition) { |
|||
holder.viewIndicator.setBackgroundResource(R.drawable.circle_black_bullet) |
|||
} else { |
|||
holder.viewIndicator.setBackgroundResource(R.drawable.grey_border_dark_indicator) |
|||
} |
|||
} |
|||
|
|||
override fun getItemCount(): Int { |
|||
return items.size |
|||
} |
|||
|
|||
fun setSelectedPosition(selectedPosition: Int) { |
|||
this.selectedPosition = selectedPosition |
|||
notifyDataSetChanged() |
|||
} |
|||
|
|||
inner class IndicatorViewHolder(itemView: View) : |
|||
RecyclerView.ViewHolder(itemView) { |
|||
var viewIndicator: View |
|||
|
|||
init { |
|||
viewIndicator = itemView.findViewById<View>(R.id.viewIndicator) |
|||
} |
|||
} |
|||
} |
@ -1,52 +0,0 @@ |
|||
package com.remit.jmecustomer.features.newkyc.newCustomer.view.choose |
|||
|
|||
import android.os.Bundle |
|||
import android.view.LayoutInflater |
|||
import android.view.View |
|||
import android.view.ViewGroup |
|||
import androidx.lifecycle.ViewModelProvider |
|||
import androidx.recyclerview.widget.LinearLayoutManager |
|||
import com.remit.jmecustomer.base.BaseFragment |
|||
import com.remit.jmecustomer.databinding.FragmentChooseKycBinding |
|||
import com.remit.jmecustomer.features.kyc.newCustomer.model.kycSetting.Option |
|||
import com.remit.jmecustomer.features.kyc.newCustomer.presenter.KYCV3ViewModel |
|||
import com.remit.jmecustomer.features.kyc.newCustomer.view.adapter.KycTypeAdapter |
|||
|
|||
class ChooseKycFragment(private var options: List<Option>? = null) : BaseFragment() { |
|||
|
|||
private var _binding: FragmentChooseKycBinding? = null |
|||
private val binding get() = _binding!! |
|||
private var kycv3ViewModel: KYCV3ViewModel? = null |
|||
|
|||
override fun onCreateView( |
|||
inflater: LayoutInflater, |
|||
container: ViewGroup?, |
|||
savedInstanceState: Bundle? |
|||
): View? { |
|||
_binding = FragmentChooseKycBinding.inflate(inflater, container, false) |
|||
init() |
|||
return binding.root |
|||
} |
|||
|
|||
fun onFragmentedSelected() {} |
|||
|
|||
fun init() { |
|||
val layoutManagerVertical = LinearLayoutManager(requireActivity()) |
|||
binding.rvChooseKyc.layoutManager = layoutManagerVertical |
|||
kycv3ViewModel = ViewModelProvider(requireActivity())[KYCV3ViewModel::class.java] |
|||
val adapter = KycTypeAdapter(options!!) |
|||
binding.rvChooseKyc.adapter = adapter |
|||
adapter.setOnItemClickListener(object : KycTypeAdapter.ItemClickListener{ |
|||
override fun onItemClicked(option: Option) { |
|||
kycv3ViewModel?.setSelectedOption(option) |
|||
} |
|||
|
|||
}) |
|||
|
|||
binding.btnSubmit1.setOnClickListener { |
|||
kycv3ViewModel?.redirectToInformation() |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,8 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> |
|||
<item> |
|||
<shape android:shape="oval"> |
|||
<solid android:color="@color/black"/> |
|||
</shape> |
|||
</item> |
|||
</selector> |
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<LinearLayout |
|||
xmlns:android="http://schemas.android.com/apk/res/android" |
|||
android:layout_marginHorizontal="@dimen/_5sdp" |
|||
android:layout_width="8dp" |
|||
android:layout_height="8dp"> |
|||
|
|||
<RelativeLayout |
|||
android:gravity="center" |
|||
android:id="@+id/viewIndicator" |
|||
android:layout_width="8dp" |
|||
android:layout_height="8dp" |
|||
android:background="@drawable/grey_border_dark_indicator" /> |
|||
</LinearLayout> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue