Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: migrated loan account details screen to compose #2519

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package org.mifos.mobile.ui.activities

import android.os.Bundle
import android.view.View
import org.mifos.mobile.R
import org.mifos.mobile.databinding.ActivityContainerBinding
import org.mifos.mobile.ui.activities.base.BaseActivity
import org.mifos.mobile.ui.fragments.LoanAccountsDetailFragment
import org.mifos.mobile.ui.loan_account.LoanAccountsDetailFragment
import org.mifos.mobile.utils.Constants

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@ class SavingsAccountContainerActivity : BaseActivity() {
}
}

fun hideToolbar() {
binding.apply {
toolbar?.visibility = View.GONE
}
}

fun showToolbar() {
binding.apply {
toolbar?.visibility = View.VISIBLE
}
}

companion object {
var transferSuccess = false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ open class BaseActivity : BasePassCodeActivity(), BaseActivityCallback {
}
}

fun showToolbar() {
toolbar = findViewById(R.id.toolbar)
toolbar?.visibility = View.VISIBLE
}

fun hideToolbar() {
toolbar = findViewById(R.id.toolbar)
toolbar?.visibility = View.GONE
}

/**
* Used for removing elevation from toolbar
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import org.mifos.mobile.R
import org.mifos.mobile.databinding.FragmentClientChargeBinding
import org.mifos.mobile.models.Charge
import org.mifos.mobile.ui.activities.SavingsAccountContainerActivity
import org.mifos.mobile.ui.activities.base.BaseActivity
import org.mifos.mobile.ui.adapters.ClientChargeAdapter
import org.mifos.mobile.ui.enums.ChargeType
import org.mifos.mobile.ui.fragments.base.BaseFragment
Expand Down Expand Up @@ -49,7 +50,7 @@ class ClientChargeFragment : BaseFragment() {
private var sweetUIErrorHandler: SweetUIErrorHandler? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
(activity as? SavingsAccountContainerActivity)?.showToolbar()
(activity as? BaseActivity)?.showToolbar()
if (arguments != null) {
id = arguments?.getLong(Constants.CLIENT_ID)
chargeType = arguments?.getCheckedSerializable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class GuarantorListFragment : BaseFragment() {
private var disposableDeleteGuarantor: Disposable? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
(activity as? BaseActivity)?.showToolbar()
if (arguments != null) loanId = requireArguments().getLong(Constants.LOAN_ID)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import dagger.hilt.android.AndroidEntryPoint
import org.mifos.mobile.R
import org.mifos.mobile.databinding.FragmentLoanAccountSummaryBinding
import org.mifos.mobile.models.accounts.loan.LoanWithAssociations
import org.mifos.mobile.ui.activities.base.BaseActivity
import org.mifos.mobile.ui.fragments.base.BaseFragment
import org.mifos.mobile.utils.Constants
import org.mifos.mobile.utils.CurrencyUtil
Expand All @@ -26,6 +27,7 @@ class LoanAccountSummaryFragment : BaseFragment() {
private var loanWithAssociations: LoanWithAssociations? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
(activity as? BaseActivity)?.showToolbar()
if (arguments != null) {
loanWithAssociations = arguments?.getCheckedParcelable(LoanWithAssociations::class.java, Constants.LOAN_ACCOUNT)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import kotlinx.coroutines.launch
import org.mifos.mobile.R
import org.mifos.mobile.databinding.FragmentLoanAccountTransactionsBinding
import org.mifos.mobile.models.accounts.loan.LoanWithAssociations
import org.mifos.mobile.ui.activities.base.BaseActivity
import org.mifos.mobile.ui.adapters.RecentTransactionListAdapter
import org.mifos.mobile.ui.fragments.base.BaseFragment
import org.mifos.mobile.utils.Constants
Expand Down Expand Up @@ -50,6 +51,7 @@ class LoanAccountTransactionFragment : BaseFragment() {
private var sweetUIErrorHandler: SweetUIErrorHandler? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
(activity as? BaseActivity)?.showToolbar()
if (arguments != null) {
loanId = arguments?.getLong(Constants.LOAN_ID)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import org.mifos.mobile.R
import org.mifos.mobile.databinding.FragmentLoanWithdrawBinding
import org.mifos.mobile.models.accounts.loan.LoanWithAssociations
import org.mifos.mobile.models.accounts.loan.LoanWithdraw
import org.mifos.mobile.ui.activities.base.BaseActivity
import org.mifos.mobile.ui.fragments.base.BaseFragment
import org.mifos.mobile.utils.Constants
import org.mifos.mobile.utils.DateHelper
Expand All @@ -36,6 +37,7 @@ class LoanAccountWithdrawFragment : BaseFragment() {
private var loanWithAssociations: LoanWithAssociations? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
(activity as? BaseActivity)?.showToolbar()
if (arguments != null) {
loanWithAssociations = arguments?.getCheckedParcelable(LoanWithAssociations::class.java, Constants.LOAN_ACCOUNT)
}
Expand Down
Loading
Loading