Browse Source

RecipientListing Gateway constructor injected

master
Preyea Regmi 5 years ago
parent
commit
ef3850f4b6
  1. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/gateway/recipientlistingV3/RecipientListingV3Gateway.java
  2. 7
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientlistingV3/RecipientListingV3Presenter.java
  3. 3
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/view/RecipientListingV3Activity.java

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/gateway/recipientlistingV3/RecipientListingV3Gateway.java

@ -13,8 +13,6 @@ import okhttp3.ResponseBody;
public class RecipientListingV3Gateway extends PrivilegedGateway implements RecipientListingV3InteractorInterface.RecipientListingV3GatewayInterface { public class RecipientListingV3Gateway extends PrivilegedGateway implements RecipientListingV3InteractorInterface.RecipientListingV3GatewayInterface {
@Override @Override
public Observable<ResponseBody> getAllRecipientFromNetwork(String auth, String senderId) { public Observable<ResponseBody> getAllRecipientFromNetwork(String auth, String senderId) {
return HttpClientV2.getInstance().getAllRecipientV3(auth,senderId); return HttpClientV2.getInstance().getAllRecipientV3(auth,senderId);

7
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientlistingV3/RecipientListingV3Presenter.java

@ -13,7 +13,6 @@ import com.gmeremit.online.gmeremittance_native.utils.https.GenericResponseDataM
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
@ -23,15 +22,15 @@ import io.reactivex.schedulers.Schedulers;
public class RecipientListingV3Presenter extends BasePresenter implements RecipientListingV3PresenterInterface { public class RecipientListingV3Presenter extends BasePresenter implements RecipientListingV3PresenterInterface {
private final RecipientListingV3ContractInterface view; private final RecipientListingV3ContractInterface view;
private final RecipientListingV3Gateway gateway;
private final RecipientListingV3InteractorInterface.RecipientListingV3GatewayInterface gateway;
private ReceiverInfoV3Model selectedRecipient; private ReceiverInfoV3Model selectedRecipient;
CompositeDisposable compositeDisposable; CompositeDisposable compositeDisposable;
private List<AutoDebitAccount> availablePaymentSources; private List<AutoDebitAccount> availablePaymentSources;
public RecipientListingV3Presenter(RecipientListingV3ContractInterface view) {
public RecipientListingV3Presenter(RecipientListingV3ContractInterface view, RecipientListingV3InteractorInterface.RecipientListingV3GatewayInterface gatewayInterface) {
this.view=view; this.view=view;
this.gateway=new RecipientListingV3Gateway();
this.gateway=gatewayInterface;
this.compositeDisposable = new CompositeDisposable(); this.compositeDisposable = new CompositeDisposable();
} }

3
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/view/RecipientListingV3Activity.java

@ -15,6 +15,7 @@ import com.gmeremit.online.gmeremittance_native.base.BaseActivity;
import com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView; import com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView;
import com.gmeremit.online.gmeremittance_native.recipientV2.adapter.RecipientListingRvAdapter; import com.gmeremit.online.gmeremittance_native.recipientV2.adapter.RecipientListingRvAdapter;
import com.gmeremit.online.gmeremittance_native.recipientV3.adapter.RecipientListingV3RvAdapter; import com.gmeremit.online.gmeremittance_native.recipientV3.adapter.RecipientListingV3RvAdapter;
import com.gmeremit.online.gmeremittance_native.recipientV3.gateway.recipientlistingV3.RecipientListingV3Gateway;
import com.gmeremit.online.gmeremittance_native.recipientV3.model.ReceiverInfoV3Model; import com.gmeremit.online.gmeremittance_native.recipientV3.model.ReceiverInfoV3Model;
import com.gmeremit.online.gmeremittance_native.recipientV3.presenter.recipientlistingV3.RecipientListingV3Presenter; import com.gmeremit.online.gmeremittance_native.recipientV3.presenter.recipientlistingV3.RecipientListingV3Presenter;
import com.gmeremit.online.gmeremittance_native.recipientV3.presenter.recipientlistingV3.RecipientListingV3PresenterInterface; import com.gmeremit.online.gmeremittance_native.recipientV3.presenter.recipientlistingV3.RecipientListingV3PresenterInterface;
@ -72,7 +73,7 @@ public class RecipientListingV3Activity extends BaseActivity implements Recipien
private void init() private void init()
{ {
this.presenter=new RecipientListingV3Presenter(this);
this.presenter=new RecipientListingV3Presenter(this,new RecipientListingV3Gateway());
setupRecyclerView(); setupRecyclerView();
} }

Loading…
Cancel
Save