-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converison: Savings Account related fragments
- Loading branch information
1 parent
c59191c
commit 44dac89
Showing
31 changed files
with
1,795 additions
and
2,162 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
459 changes: 0 additions & 459 deletions
459
...java/com/mifos/mifosxdroid/online/savingaccountsummary/SavingsAccountSummaryFragment.java
This file was deleted.
Oops, something went wrong.
405 changes: 405 additions & 0 deletions
405
...n/java/com/mifos/mifosxdroid/online/savingaccountsummary/SavingsAccountSummaryFragment.kt
Large diffs are not rendered by default.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
.../java/com/mifos/mifosxdroid/online/savingaccountsummary/SavingsAccountSummaryMvpView.java
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
...in/java/com/mifos/mifosxdroid/online/savingaccountsummary/SavingsAccountSummaryMvpView.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.mifos.mifosxdroid.online.savingaccountsummary | ||
|
||
import com.mifos.api.GenericResponse | ||
import com.mifos.mifosxdroid.base.MvpView | ||
import com.mifos.objects.accounts.savings.SavingsAccountWithAssociations | ||
|
||
/** | ||
* Created by Rajan Maurya on 07/06/16. | ||
*/ | ||
interface SavingsAccountSummaryMvpView : MvpView { | ||
fun showSavingAccount(savingsAccountWithAssociations: SavingsAccountWithAssociations?) | ||
fun showSavingsActivatedSuccessfully(genericResponse: GenericResponse?) | ||
fun showFetchingError(errorMessage: Int) | ||
fun showFetchingError(errorMessage: String?) | ||
} |
72 changes: 0 additions & 72 deletions
72
...ava/com/mifos/mifosxdroid/online/savingaccountsummary/SavingsAccountSummaryPresenter.java
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
.../java/com/mifos/mifosxdroid/online/savingaccountsummary/SavingsAccountSummaryPresenter.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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.mifos.mifosxdroid.online.savingaccountsummary | ||
|
||
import com.mifos.api.datamanager.DataManagerSavings | ||
import com.mifos.mifosxdroid.R | ||
import com.mifos.mifosxdroid.base.BasePresenter | ||
import com.mifos.objects.accounts.savings.SavingsAccountWithAssociations | ||
import com.mifos.utils.Constants | ||
import rx.Subscriber | ||
import rx.android.schedulers.AndroidSchedulers | ||
import rx.schedulers.Schedulers | ||
import rx.subscriptions.CompositeSubscription | ||
import javax.inject.Inject | ||
|
||
/** | ||
* Created by Rajan Maurya on 07/06/16. | ||
*/ | ||
class SavingsAccountSummaryPresenter @Inject constructor(private val mDataManagerSavings: DataManagerSavings) : BasePresenter<SavingsAccountSummaryMvpView?>() { | ||
private val mSubscriptions: CompositeSubscription | ||
override fun attachView(mvpView: SavingsAccountSummaryMvpView?) { | ||
super.attachView(mvpView) | ||
} | ||
|
||
override fun detachView() { | ||
super.detachView() | ||
mSubscriptions.unsubscribe() | ||
} | ||
|
||
//This Method will hit end point ?associations=transactions | ||
fun loadSavingAccount(type: String?, accountId: Int) { | ||
checkViewAttached() | ||
mvpView!!.showProgressbar(true) | ||
mSubscriptions.add(mDataManagerSavings | ||
.getSavingsAccount(type, accountId, Constants.TRANSACTIONS) | ||
.observeOn(AndroidSchedulers.mainThread()) | ||
.subscribeOn(Schedulers.io()) | ||
.subscribe(object : Subscriber<SavingsAccountWithAssociations?>() { | ||
override fun onCompleted() { | ||
mvpView!!.showProgressbar(false) | ||
} | ||
|
||
override fun onError(e: Throwable) { | ||
mvpView!!.showProgressbar(false) | ||
mvpView!!.showFetchingError(R.string.failed_to_fetch_savingsaccount) | ||
} | ||
|
||
override fun onNext(savingsAccountWithAssociations: SavingsAccountWithAssociations?) { | ||
mvpView!!.showProgressbar(false) | ||
mvpView!!.showSavingAccount(savingsAccountWithAssociations) | ||
} | ||
})) | ||
} | ||
|
||
init { | ||
mSubscriptions = CompositeSubscription() | ||
} | ||
} |
Oops, something went wrong.