-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conversion: Groups related fragments
- Loading branch information
1 parent
fb77683
commit 9f9bc1d
Showing
34 changed files
with
2,438 additions
and
3,025 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 57 additions & 69 deletions
126
...os/mifosxdroid/online/GroupsActivity.java → ...ifos/mifosxdroid/online/GroupsActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,122 +1,110 @@ | ||
package com.mifos.mifosxdroid.online; | ||
package com.mifos.mifosxdroid.online | ||
|
||
import android.os.Bundle; | ||
|
||
import com.mifos.mifosxdroid.R; | ||
import com.mifos.mifosxdroid.core.MifosBaseActivity; | ||
import com.mifos.mifosxdroid.online.clientlist.ClientListFragment; | ||
import com.mifos.mifosxdroid.online.groupdetails.GroupDetailsFragment; | ||
import com.mifos.mifosxdroid.online.loanaccountsummary.LoanAccountSummaryFragment; | ||
import com.mifos.mifosxdroid.online.loanrepayment.LoanRepaymentFragment; | ||
import com.mifos.mifosxdroid.online.loanrepaymentschedule.LoanRepaymentScheduleFragment; | ||
import com.mifos.mifosxdroid.online.loantransactions.LoanTransactionsFragment; | ||
import com.mifos.mifosxdroid.online.savingaccountsummary.SavingsAccountSummaryFragment; | ||
import com.mifos.mifosxdroid.online.savingaccounttransaction.SavingsAccountTransactionFragment; | ||
import com.mifos.objects.accounts.loan.LoanWithAssociations; | ||
import com.mifos.objects.accounts.savings.DepositType; | ||
import com.mifos.objects.accounts.savings.SavingsAccountWithAssociations; | ||
import com.mifos.objects.client.Client; | ||
import com.mifos.utils.Constants; | ||
|
||
import java.util.List; | ||
|
||
import butterknife.ButterKnife; | ||
import android.os.Bundle | ||
import butterknife.ButterKnife | ||
import com.mifos.mifosxdroid.R | ||
import com.mifos.mifosxdroid.core.MifosBaseActivity | ||
import com.mifos.mifosxdroid.online.clientlist.ClientListFragment | ||
import com.mifos.mifosxdroid.online.groupdetails.GroupDetailsFragment | ||
import com.mifos.mifosxdroid.online.groupdetails.GroupDetailsFragment.Companion.newInstance | ||
import com.mifos.mifosxdroid.online.loanaccountsummary.LoanAccountSummaryFragment | ||
import com.mifos.mifosxdroid.online.loanrepayment.LoanRepaymentFragment | ||
import com.mifos.mifosxdroid.online.loanrepaymentschedule.LoanRepaymentScheduleFragment | ||
import com.mifos.mifosxdroid.online.loantransactions.LoanTransactionsFragment | ||
import com.mifos.mifosxdroid.online.savingaccountsummary.SavingsAccountSummaryFragment | ||
import com.mifos.mifosxdroid.online.savingaccounttransaction.SavingsAccountTransactionFragment | ||
import com.mifos.objects.accounts.loan.LoanWithAssociations | ||
import com.mifos.objects.accounts.savings.DepositType | ||
import com.mifos.objects.accounts.savings.SavingsAccountWithAssociations | ||
import com.mifos.objects.client.Client | ||
import com.mifos.utils.Constants | ||
|
||
/** | ||
* Created by nellyk on 2/27/2016. | ||
*/ | ||
public class GroupsActivity extends MifosBaseActivity implements GroupDetailsFragment | ||
.OnFragmentInteractionListener, LoanAccountSummaryFragment.OnFragmentInteractionListener, | ||
LoanRepaymentFragment.OnFragmentInteractionListener, | ||
SavingsAccountSummaryFragment.OnFragmentInteractionListener { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_toolbar_container); | ||
ButterKnife.bind(this); | ||
showBackButton(); | ||
int groupId = getIntent().getExtras().getInt(Constants.GROUP_ID); | ||
replaceFragment(GroupDetailsFragment.newInstance(groupId), false, R.id.container); | ||
class GroupsActivity : MifosBaseActivity(), GroupDetailsFragment.OnFragmentInteractionListener, LoanAccountSummaryFragment.OnFragmentInteractionListener, LoanRepaymentFragment.OnFragmentInteractionListener, SavingsAccountSummaryFragment.OnFragmentInteractionListener { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_toolbar_container) | ||
ButterKnife.bind(this) | ||
showBackButton() | ||
val groupId = intent.extras.getInt(Constants.GROUP_ID) | ||
replaceFragment(newInstance(groupId), false, R.id.container) | ||
} | ||
|
||
/** | ||
* Called when a Loan Account is Selected | ||
* from the list of Loan Accounts on Client Details Fragment | ||
* It displays the summary of the Selected Loan Account | ||
*/ | ||
@Override | ||
public void loadLoanAccountSummary(int loanAccountNumber) { | ||
override fun loadLoanAccountSummary(loanAccountNumber: Int) { | ||
replaceFragment(LoanAccountSummaryFragment.newInstance(loanAccountNumber, true), true, | ||
R.id.container); | ||
R.id.container) | ||
} | ||
|
||
/** | ||
* Called when a Savings Account is Selected | ||
* from the list of Savings Accounts on Client Details Fragment | ||
* <p/> | ||
* | ||
* | ||
* It displays the summary of the Selected Savings Account | ||
*/ | ||
@Override | ||
public void loadSavingsAccountSummary(int savingsAccountNumber, DepositType accountType) { | ||
override fun loadSavingsAccountSummary(savingsAccountNumber: Int, accountType: DepositType?) { | ||
replaceFragment(SavingsAccountSummaryFragment.newInstance(savingsAccountNumber, | ||
accountType, true), true, R.id.container); | ||
} | ||
|
||
@Override | ||
public void loadGroupClients(List<Client> clients) { | ||
replaceFragment(ClientListFragment.newInstance(clients, true), true, R.id.container); | ||
accountType, true), true, R.id.container) | ||
} | ||
|
||
/** | ||
* Called when the make the make repayment button is clicked | ||
* in the Loan Account Summary Fragment. | ||
* <p/> | ||
* | ||
* | ||
* It will display the Loan Repayment Fragment where | ||
* the Information of the repayment has to be filled in. | ||
*/ | ||
@Override | ||
public void makeRepayment(LoanWithAssociations loan) { | ||
replaceFragment(LoanRepaymentFragment.newInstance(loan), true, R.id.container); | ||
override fun makeRepayment(loan: LoanWithAssociations) { | ||
replaceFragment(LoanRepaymentFragment.newInstance(loan), true, R.id.container) | ||
} | ||
|
||
/** | ||
* Called when the Repayment Schedule option from the Menu is | ||
* clicked | ||
* <p/> | ||
* | ||
* | ||
* It will display the Complete Loan Repayment Schedule. | ||
*/ | ||
@Override | ||
public void loadRepaymentSchedule(int loanId) { | ||
replaceFragment(LoanRepaymentScheduleFragment.newInstance(loanId), true, R.id.container); | ||
override fun loadRepaymentSchedule(loanId: Int) { | ||
replaceFragment(LoanRepaymentScheduleFragment.newInstance(loanId), true, R.id.container) | ||
} | ||
|
||
/** | ||
* Called when the Transactions option from the Menu is clicked | ||
* <p/> | ||
* | ||
* | ||
* It will display all the Transactions associated with the Loan | ||
* and also their details | ||
*/ | ||
|
||
@Override | ||
public void loadLoanTransactions(int loanId) { | ||
replaceFragment(LoanTransactionsFragment.newInstance(loanId), true, R.id.container); | ||
override fun loadLoanTransactions(loanId: Int) { | ||
replaceFragment(LoanTransactionsFragment.newInstance(loanId), true, R.id.container) | ||
} | ||
|
||
/** | ||
* Called when the make the make deposit button is clicked | ||
* in the Savings Account Summary Fragment. | ||
* <p/> | ||
* | ||
* | ||
* It will display the Transaction Fragment where the information | ||
* of the transaction has to be filled in. | ||
* <p/> | ||
* | ||
* | ||
* The transactionType defines if the transaction is a Deposit or a Withdrawal | ||
*/ | ||
@Override | ||
public void doTransaction(SavingsAccountWithAssociations savingsAccountWithAssociations, | ||
String transactionType, DepositType accountType) { | ||
replaceFragment(SavingsAccountTransactionFragment.newInstance | ||
(savingsAccountWithAssociations, transactionType, accountType), true, R.id | ||
.container); | ||
override fun doTransaction(savingsAccountWithAssociations: SavingsAccountWithAssociations, | ||
transactionType: String, accountType: DepositType) { | ||
replaceFragment(SavingsAccountTransactionFragment.newInstance(savingsAccountWithAssociations, transactionType, accountType), true, R.id.container) | ||
} | ||
|
||
override fun loadGroupClients(clients: List<Client>?) { | ||
replaceFragment(ClientListFragment.newInstance(clients, true), true, R.id.container) | ||
} | ||
} | ||
} |
Oops, something went wrong.