Skip to content

Instantly share code, notes, and snippets.

View Ochornma's full-sized avatar
🎯
Looking for new opportunities

Promise Ochornma Ochornma

🎯
Looking for new opportunities
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<group android:checkableBehavior="single">
<item
android:id="@+id/dashboard"
android:title="@string/menu_home" />
<item
class SoftKashApplication : Application(), KodeinAware {
companion object {
lateinit var ApplicationContext: Context
}
override fun onCreate() {
super.onCreate()
ApplicationContext = this
}
@Suppress("UNCHECKED_CAST")
class VerifyBVNFactory(
private val repository: SoftKashRepository
): ViewModelProvider.NewInstanceFactory() {
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
return VerifyBVNViewModel(repository) as T
}
}
class VerifyBVNViewModel( private val repository: SoftKashRepository
) : ViewModel() {
private val viewModelJob = SupervisorJob()
private val viewModelScope = CoroutineScope(viewModelJob + Dispatchers.Main)
fun getUnverifiedBVN(result: (Response<UnverifiedResponse>) -> Unit){
viewModelScope.launch {
repository.getUnverifiedBVN{
class VerifyBVNFragment : ScopedFragment(), KodeinAware, VerifyAdapter.OnItemClickListener {
companion object {
fun newInstance() = VerifyBVNFragment()
}
override val kodein by closestKodein()
private val viewModelFactory: VerifyBVNFactory by instance()
private var _binding: VerifyBVNFragmentBinding? = null
/*
This is package of this data class
package com.app.softkash.data.entity.userDetails
*/
@Keep
data class Data(
@SerializedName("address")
val address: String,
@Keep
data class VerifyBvnResponse(
// @SerializedName("data")
// val `data`: String,
// @SerializedName("response_code")
// val responseCode: String,
@SerializedName("response_message")
val responseMessage: String,
@SerializedName("success")
class LoanFragment : Fragment() {
private var _binding: FragmentLoanBinding? = null
private val binding get() = _binding
private lateinit var viewModel: LoanViewModel
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
// Inflate the layout for this fragment
_binding = FragmentLoanBinding.inflate(inflater, container, false)
class VerifyBVN : Fragment() {
private var _binding: FragmentVerifyBvnBinding? = null
private val binding get() = _binding
private lateinit var viewModel: VerifyBVNViewModel
private var code = ""
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
class BVNNotVerifiedFragment : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}