Browse Source

Contact added

master
preyearegmi 6 years ago
parent
commit
541ef69523
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. 7
      app/build.gradle
  3. 32
      app/src/main/AndroidManifest.xml
  4. 68
      app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/adapter/AgentListV2RvAdapter.java
  5. 74
      app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/gateway/AgentListV2Gateway.java
  6. 55
      app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/model/AgentInfoModel.java
  7. 55
      app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/model/AgentsListApiResponse.java
  8. 18
      app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/presenter/AgentListV2InteractorInterface.java
  9. 68
      app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/presenter/AgentListV2Presenter.java
  10. 19
      app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/presenter/AgentListV2PresenterInterface.java
  11. 105
      app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/view/AgentListV2Activity.java
  12. 75
      app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/view/AgentListV2ItemViewHolder.java
  13. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/CountryFlagMapper.java
  14. 3
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/CountryListRvViewHolder.java
  15. 7
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/CountryListingRvAdapter.java
  16. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/ExchangeRateCountryListingDialog.java
  17. 3
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2Presenter.java
  18. 89
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java
  19. 5
      app/src/main/java/com/gmeremit/online/gmeremittance_native/home/view/HomeActivity.java
  20. 22
      app/src/main/res/layout/activity_agent_list_v2.xml
  21. 117
      app/src/main/res/layout/agent_info_item_view.xml

BIN
.idea/caches/build_file_checksums.ser

7
app/build.gradle

@ -26,7 +26,7 @@ android {
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
ndk {
abiFilters 'armeabi','x86'
abiFilters 'armeabi', 'x86'
}
def dateTime = new Date().format("MMM_dd_HH");
setProperty("archivesBaseName", "GME_" + dateTime + "_v" + versionCode + "(" + versionName + ")")
@ -52,7 +52,7 @@ android {
shrinkResources false
}
stag{
stag {
signingConfig signingConfigs.debug
buildConfigField 'String', 'BASE_URL', '"http://121.156.120.71:9091/api/v1/"'
buildConfigField 'String', 'BASE_URL_SOCIAL', '"http://10.1.1.171:8080/v1/"'
@ -61,7 +61,7 @@ android {
shrinkResources false
}
uat{
uat {
signingConfig signingConfigs.debug
buildConfigField 'String', 'BASE_URL', '"http://116.66.197.118:1235/api/v1/"'
buildConfigField 'String', 'BASE_URL_SOCIAL', '"http://10.1.1.171:8080/v1/"'
@ -114,4 +114,3 @@ dependencies {
implementation 'org.greenrobot:eventbus:3.1.1'
}
apply plugin: 'com.google.gms.google-services'

32
app/src/main/AndroidManifest.xml

@ -3,6 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="com.gmeremit.online.gmeremittance_native">
<uses-sdk tools:overrideLibrary="app.frantic.mylibrary" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
@ -17,7 +19,6 @@
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<uses-sdk tools:overrideLibrary="app.frantic.mylibrary" />
<uses-feature
android:name="android.hardware.camera"
@ -29,7 +30,6 @@
android:name="android.hardware.camera.front"
android:required="false" />
<application
android:name=".GmeApplication"
android:allowBackup="true"
@ -49,15 +49,14 @@
android:windowSoftInputMode="stateAlwaysHidden">
<intent-filter>
<action android:name="HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
@ -68,6 +67,7 @@
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider331163960743784"
@ -104,13 +104,11 @@
<activity
android:name=".reset_password.view.ResetPasswordActivity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden"></activity>
android:windowSoftInputMode="stateAlwaysHidden" />
<activity
android:name=".kycform.view.KycFormActivity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden">
</activity>
android:windowSoftInputMode="stateAlwaysHidden"></activity>
<activity android:name=".socials.view.SocialActivity" />
<activity
android:name=".socials.view.CommentsActivity"
@ -326,8 +324,7 @@
android:name=".exchange_rate.view.ExchangeMethodV2Activity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateHidden"
/>
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".gme_branches.view.GmeBranchesActivity"
android:screenOrientation="portrait"
@ -383,7 +380,7 @@
<activity
android:name=".invite.view.InviteActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"></activity>
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".invite.view.InviteFormActivity"
android:screenOrientation="portrait"
@ -423,7 +420,7 @@
android:name=".wallet_to_wallet.view.BorrowStatusListActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateHidden"></activity>
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".wallet_to_wallet.view.TransferredListActivity"
android:screenOrientation="portrait"
@ -433,12 +430,12 @@
android:name=".wallet_to_wallet.view.UserRequestListActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateHidden"></activity>
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".reward_points.view.RewardPointsActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateHidden"></activity>
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".reward_points.view.RewardPointsShippingActivity"
android:screenOrientation="portrait"
@ -463,11 +460,16 @@
android:name=".exchange_rate.view.ExchangeMethodActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden"></activity>
android:windowSoftInputMode="stateAlwaysHidden" />
<meta-data
android:name="io.fabric.ApiKey"
android:value="7eb95a28f547df8a78962debbacd94ceeaa826dd" />
<activity android:name=".agentsV2.view.AgentListV2Activity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="stateAlwaysHidden"
android:screenOrientation="portrait"/>
</application>
</manifest>

68
app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/adapter/AgentListV2RvAdapter.java

@ -0,0 +1,68 @@
package com.gmeremit.online.gmeremittance_native.agentsV2.adapter;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentInfoModel;
import com.gmeremit.online.gmeremittance_native.agentsV2.view.AgentListV2ItemViewHolder;
import java.util.ArrayList;
import java.util.List;
public class AgentListV2RvAdapter extends RecyclerView.Adapter<AgentListV2ItemViewHolder> {
AgentV2ActionListener agentV2ActionListener;
List<AgentInfoModel> data;
public AgentListV2RvAdapter(AgentV2ActionListener agentV2ActionListener) {
this.agentV2ActionListener = agentV2ActionListener;
this.data=new ArrayList<>();
}
@Override
public AgentListV2ItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.agent_info_item_view, parent, false);
return new AgentListV2ItemViewHolder(view);
}
@Override
public void onBindViewHolder(AgentListV2ItemViewHolder holder, int position) {
AgentInfoModel agentInfoModel=data.get(holder.getAdapterPosition()) ;
holder.setHeader(agentInfoModel.getTitle());
holder.setLabel1(agentInfoModel.getAddress());
holder.setLabel2(agentInfoModel.getLanguage());
holder.setContact(agentInfoModel.getContactNumber());
holder.getAgent_info_txt_label_contact().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(agentV2ActionListener!=null)
agentV2ActionListener.onContactViewClicked(data.get(holder.getAdapterPosition()).getContactNumber());
}
});
}
public void setData(List<AgentInfoModel> data)
{
if(data!=null&&data.size()>0)
{
this.data=data;
notifyDataSetChanged();
}
}
@Override
public int getItemCount() {
return data.size();
}
public interface AgentV2ActionListener
{
void onContactViewClicked(String contactNumber);
void onShowOnMapClicked();
}
}

74
app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/gateway/AgentListV2Gateway.java

@ -0,0 +1,74 @@
package com.gmeremit.online.gmeremittance_native.agentsV2.gateway;
import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentsListApiResponse;
import com.gmeremit.online.gmeremittance_native.agentsV2.presenter.AgentListV2InteractorInterface;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGateway;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentServiceApiResponse;
import com.gmeremit.online.gmeremittance_native.exchange_rate.presenter.ExchangeRateV2InteractorInterface;
import com.gmeremit.online.gmeremittance_native.utils.https.HttpClientV2;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import java.util.List;
import io.reactivex.Observable;
public class AgentListV2Gateway extends PrivilegedGateway implements AgentListV2InteractorInterface.AgentListV2GatewayInterface {
private final AgentListV2InteractorInterface interactor;
private String agentListMocked="{\n" +
" \"ErrorCode\": \"0\",\n" +
" \"Msg\": \"success\",\n" +
" \"Id\": \"\",\n" +
" \"Data\": [\n" +
" {\n" +
" \"title\": \"Head Office\",\n" +
" \"address\": \"325, Jong-ro, Jongno-gu, 03104 Seoul\",\n" +
" \"contactNumber\": \"15886864\",\n" +
" \"language\": \"Korean Language Support\"\n" +
" },\n" +
" {\n" +
" \"title\": \"Dongdaemun Branch\",\n" +
" \"address\": \"315, Jong-ro, Jongno-gu, 03105 Seoul (Near Dongdaemun Station Gate 3)\",\n" +
" \"contactNumber\": \"027635559\",\n" +
" \"language\": \"\"\n" +
" },\n" +
" {\n" +
" \"title\": \"Ansan Branch\",\n" +
" \"address\": \"Ansan-si, Gyeonggido Dan-Wongu, Wongogdong Jung-Angdaero 445 (798-12 beonji) 2nd floor\",\n" +
" \"contactNumber\": \"0313626740\",\n" +
" \"language\": \"\"\n" +
" },\n" +
" {\n" +
" \"title\": \"Gimhae Branch\",\n" +
" \"address\": \"84, Garak-ro, Gimhae-si, Gyeongsangnam-do\",\n" +
" \"contactNumber\": \"0313626740\",\n" +
" \"language\": \"\"\n" +
" },\n" +
" {\n" +
" \"title\": \"Songu-ri Branch\",\n" +
" \"address\": \"91, Solmoru-ro, Soheul-eup, Pocheon-si, Gyeonggi-do, Korea 11175 (Across from K-Mart)\",\n" +
" \"contactNumber\": \"0315411856\",\n" +
" \"language\": \"\"\n" +
" }\n" +
" ]\n" +
"}";
public AgentListV2Gateway(AgentListV2InteractorInterface agentListV2InteractorInterface) {
this.interactor=agentListV2InteractorInterface;
}
@Override
public Observable<AgentsListApiResponse> getAgentInfoListFromNetwork(String auth) {
Gson gson=new GsonBuilder().create();
AgentsListApiResponse agentsListApiResponse=gson.fromJson(agentListMocked,AgentsListApiResponse.class);
return Observable.just(agentsListApiResponse);
}
}

55
app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/model/AgentInfoModel.java

@ -0,0 +1,55 @@
package com.gmeremit.online.gmeremittance_native.agentsV2.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class AgentInfoModel {
@SerializedName("title")
@Expose
private String title;
@SerializedName("address")
@Expose
private String address;
@SerializedName("contactNumber")
@Expose
private String contactNumber;
@SerializedName("language")
@Expose
private String language;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getContactNumber() {
return contactNumber;
}
public void setContactNumber(String contactNumber) {
this.contactNumber = contactNumber;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
}

55
app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/model/AgentsListApiResponse.java

@ -0,0 +1,55 @@
package com.gmeremit.online.gmeremittance_native.agentsV2.model;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.ExchangeCalculationModel;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class AgentsListApiResponse {
@SerializedName("ErrorCode")
@Expose
private String errorCode;
@SerializedName("Msg")
@Expose
private String msg;
@SerializedName("Id")
@Expose
private String id;
@SerializedName("Data")
@Expose
private List<AgentInfoModel> data;
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public List<AgentInfoModel> getData() {
return data;
}
public void setData(List<AgentInfoModel> data) {
this.data = data;
}
}

18
app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/presenter/AgentListV2InteractorInterface.java

@ -0,0 +1,18 @@
package com.gmeremit.online.gmeremittance_native.agentsV2.presenter;
import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentsListApiResponse;
import com.gmeremit.online.gmeremittance_native.base.BaseInteractorInterface;
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGatewayInterface;
import io.reactivex.Observable;
public interface AgentListV2InteractorInterface extends BaseInteractorInterface {
interface AgentListV2GatewayInterface extends PrivilegedGatewayInterface
{
Observable<AgentsListApiResponse> getAgentInfoListFromNetwork(String auth);
}
}

68
app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/presenter/AgentListV2Presenter.java

@ -0,0 +1,68 @@
package com.gmeremit.online.gmeremittance_native.agentsV2.presenter;
import com.gmeremit.online.gmeremittance_native.agentsV2.gateway.AgentListV2Gateway;
import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentsListApiResponse;
import com.gmeremit.online.gmeremittance_native.base.BasePresenter;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.utils.Constants;
import com.gmeremit.online.gmeremittance_native.utils.https.GenericApiObserverResponse;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.Schedulers;
public class AgentListV2Presenter extends BasePresenter implements AgentListV2PresenterInterface, AgentListV2InteractorInterface {
AgentListV2ContractInterface view;
AgentListV2GatewayInterface gateway;
CompositeDisposable compositeDisposable;
public AgentListV2Presenter(AgentListV2ContractInterface view) {
this.view = view;
this.gateway = new AgentListV2Gateway(this);
this.compositeDisposable = new CompositeDisposable();
}
@Override
public void getAllData() {
compositeDisposable.add(
this.gateway.getAgentInfoListFromNetwork(gateway.getAuth())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(new AgentListObserver())
);
}
@Override
public void onViewDestroyed() {
super.onViewDestroyed();
if (compositeDisposable != null && !compositeDisposable.isDisposed())
compositeDisposable.dispose();
}
public class AgentListObserver extends GenericApiObserverResponse<AgentsListApiResponse> {
@Override
protected void onSuccess(AgentsListApiResponse agentList) {
if(agentList.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2))
{
view.showAgentListToUser(agentList.getData());
}
else
{
view.showPopUpMessage(agentList.getMsg(), CustomAlertDialog.AlertType.FAILED,null);
}
}
@Override
public void onFailed(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED,null);
}
@Override
protected void onConnectionNotEstablished(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.NO_INTERNET,null);
}
}
}

19
app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/presenter/AgentListV2PresenterInterface.java

@ -0,0 +1,19 @@
package com.gmeremit.online.gmeremittance_native.agentsV2.presenter;
import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentInfoModel;
import com.gmeremit.online.gmeremittance_native.base.BaseContractInterface;
import com.gmeremit.online.gmeremittance_native.base.BasePresenterInterface;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import java.util.List;
public interface AgentListV2PresenterInterface extends BasePresenterInterface {
void getAllData();
interface AgentListV2ContractInterface extends BaseContractInterface
{
void showAgentListToUser(List<AgentInfoModel> agentList);
}
}

105
app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/view/AgentListV2Activity.java

@ -0,0 +1,105 @@
package com.gmeremit.online.gmeremittance_native.agentsV2.view;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.agentsV2.adapter.AgentListV2RvAdapter;
import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentInfoModel;
import com.gmeremit.online.gmeremittance_native.agentsV2.presenter.AgentListV2Presenter;
import com.gmeremit.online.gmeremittance_native.agentsV2.presenter.AgentListV2PresenterInterface;
import com.gmeremit.online.gmeremittance_native.base.BaseActivity;
import com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
public class AgentListV2Activity extends BaseActivity implements AgentListV2RvAdapter.AgentV2ActionListener, View.OnClickListener, AgentListV2PresenterInterface.AgentListV2ContractInterface {
@BindView(R.id.agentListRv)
RecyclerView agentListRv;
@BindView(R.id.iv_back)
View iv_back;
@BindView(R.id.iv_cancel)
View iv_cancel;
@BindView(R.id.toolbar_title)
GmeTextView toolbarTitle;
private AgentListV2RvAdapter agentListAdapter;
private AgentListV2PresenterInterface presenter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_agent_list_v2);
ButterKnife.bind(this);
init();
performDefaultAction(savedInstanceState);
}
private void init() {
iv_cancel.setVisibility(View.INVISIBLE);
setupRv();
this.presenter = new AgentListV2Presenter(this);
}
@Override
protected void onStart() {
super.onStart();
iv_back.setOnClickListener(this);
}
@Override
protected void onStop() {
super.onStop();
iv_back.setOnClickListener(null);
}
private void setupRv() {
agentListAdapter = new AgentListV2RvAdapter(this);
agentListRv.setAdapter(agentListAdapter);
}
private void performDefaultAction(Bundle savedInstanceState) {
toolbarTitle.setText("Contacts");
this.presenter.getAllData();
}
@Override
public void onContactViewClicked(String contactNumber) {
Intent intent = new Intent(Intent.ACTION_DIAL);
// Send phone number to intent as data
intent.setData(Uri.parse("tel:" + contactNumber));
// Start the dialer app activity with number
startActivity(intent);
}
@Override
public void onShowOnMapClicked() {
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.iv_back:
onBackPressed();
break;
}
}
@Override
public void showAgentListToUser(List<AgentInfoModel> agentList) {
this.agentListAdapter.setData(agentList);
}
}

75
app/src/main/java/com/gmeremit/online/gmeremittance_native/agentsV2/view/AgentListV2ItemViewHolder.java

@ -0,0 +1,75 @@
package com.gmeremit.online.gmeremittance_native.agentsV2.view;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
import com.gmeremit.online.gmeremittance_native.R;
import butterknife.BindView;
import butterknife.ButterKnife;
public class AgentListV2ItemViewHolder extends RecyclerView.ViewHolder {
@BindView(R.id.agent_info_txt_header)
TextView agent_info_txt_header;
@BindView(R.id.agent_info_txt_label_1)
TextView agent_info_txt_label_1;
@BindView(R.id.agent_info_txt_label_2)
TextView agent_info_txt_label_2;
@BindView(R.id.agent_info_txt_label_contact)
TextView agent_info_txt_label_contact;
@BindView(R.id.agent_info_txt_label_map)
TextView agent_info_txt_label_map;
@BindView(R.id.agent_info_txt_label_contact_container)
View agent_info_txt_label_contact_container;
@BindView(R.id.agent_info_txt_label_map_container)
View agent_info_txt_label_map_container;
public AgentListV2ItemViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
}
public void setHeader(String header)
{
this.agent_info_txt_header.setText(header);
}
public void setLabel1(String label1)
{
this.agent_info_txt_label_1.setText(label1);
}
public void setLabel2(String label2)
{
if(label2==null||label2.length()<1)
agent_info_txt_label_2.setVisibility(View.GONE);
else
this.agent_info_txt_label_2.setText(label2);
}
public void setContact (String contact)
{
this.agent_info_txt_label_contact.setText(contact);
}
public View getAgent_info_txt_label_contact() {
return agent_info_txt_label_contact_container;
}
public View getAgent_info_txt_label_map() {
return agent_info_txt_label_map_container;
}
}

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/countrylistingdialog/CountryFlagMapper.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/CountryFlagMapper.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.customwidgets.countrylistingdialog;
package com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog;
import com.gmeremit.online.gmeremittance_native.R;

3
app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/countrylistingdialog/CountryListRvViewHolder.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/CountryListRvViewHolder.java

@ -1,7 +1,6 @@
package com.gmeremit.online.gmeremittance_native.customwidgets.countrylistingdialog;
package com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog;
import android.support.v7.widget.RecyclerView;
import android.view.TextureView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

7
app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/countrylistingdialog/CountryListingRvAdapter.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/CountryListingRvAdapter.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.customwidgets.countrylistingdialog;
package com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
@ -7,17 +7,16 @@ import android.view.ViewGroup;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.view.PaymentModeViewHolder;
import java.util.ArrayList;
import java.util.List;
public class CountryListingRvAdapter extends RecyclerView.Adapter<CountryListRvViewHolder> {
private final CountryListingDialog.CountrySelectionListener listener;
private final ExchangeRateCountryListingDialog.CountrySelectionListener listener;
private List<CountryPaymentService> data;
public CountryListingRvAdapter(CountryListingDialog.CountrySelectionListener listener) {
public CountryListingRvAdapter(ExchangeRateCountryListingDialog.CountrySelectionListener listener) {
this.data=new ArrayList<>();
this.listener=listener;
}

4
app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/countrylistingdialog/CountryListingDialog.java → app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/ExchangeRateCountryListingDialog.java

@ -1,4 +1,4 @@
package com.gmeremit.online.gmeremittance_native.customwidgets.countrylistingdialog;
package com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog;
import android.app.Dialog;
import android.app.DialogFragment;
@ -22,7 +22,7 @@ import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.Count
import java.util.ArrayList;
import java.util.List;
public class CountryListingDialog extends DialogFragment implements View.OnClickListener, TextWatcher {
public class ExchangeRateCountryListingDialog extends DialogFragment implements View.OnClickListener, TextWatcher {
private List<CountryPaymentService> data;
private CountrySelectionListener listener;

3
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2Presenter.java

@ -70,7 +70,8 @@ public class ExchangeRateV2Presenter extends BasePresenter implements ExchangeRa
@Override
public void onViewDestroyed() {
super.onViewDestroyed();
compositeDisposables.dispose();
if (compositeDisposables != null && !compositeDisposables.isDisposed())
compositeDisposables.dispose();
}
private boolean validateAmount(String amount) {

89
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java

@ -1,19 +1,14 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.view;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
import android.widget.Button;
import android.widget.EditText;
@ -23,23 +18,20 @@ import android.widget.TextView;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.BaseActivity;
import com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView;
import com.gmeremit.online.gmeremittance_native.customwidgets.countrylistingdialog.CountryFlagMapper;
import com.gmeremit.online.gmeremittance_native.customwidgets.countrylistingdialog.CountryListingDialog;
import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.CountryFlagMapper;
import com.gmeremit.online.gmeremittance_native.customwidgets.exchangecountrylistingdialog.ExchangeRateCountryListingDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.adapter.PaymentModeRvAdapter;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentService;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.CountryPaymentServiceSeedValueModel;
import com.gmeremit.online.gmeremittance_native.exchange_rate.model.datav2.PaymentMode;
import com.gmeremit.online.gmeremittance_native.exchange_rate.presenter.ExchangeRateV2Presenter;
import com.gmeremit.online.gmeremittance_native.exchange_rate.presenter.ExchangeRateV2PresenterInterface;
import com.gmeremit.online.gmeremittance_native.utils.Constants;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
public class ExchangeMethodV2Activity extends BaseActivity implements PaymentModeRvAdapter.OnPaymentModeSelectionListener, CountryListingDialog.CountrySelectionListener, View.OnClickListener, ExchangeRateV2PresenterInterface.ExchangeRateV2ContractInterface {
public class ExchangeMethodV2Activity extends BaseActivity implements PaymentModeRvAdapter.OnPaymentModeSelectionListener, ExchangeRateCountryListingDialog.CountrySelectionListener, View.OnClickListener, ExchangeRateV2PresenterInterface.ExchangeRateV2ContractInterface {
@BindView(R.id.sendAmountEdTxt)
EditText sendMoneyEditText;
@ -84,9 +76,8 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
private PaymentModeRvAdapter paymentModeRvAdapter;
private PaymentMode selectedPaymentMode;
private List<CountryPaymentService> mockedData;
private List<CountryPaymentService> paymentServiceList;
private CountryListingDialog countryListingDialog;
private ExchangeRateCountryListingDialog countryListingDialog;
private CountryPaymentService selectedCountryPaymentService;
private ExchangeRateV2PresenterInterface presenter;
private boolean shouldCaulatedByRecipient;
@ -110,16 +101,16 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
setupRv();
iv_cancel.setVisibility(View.INVISIBLE);
this.interpolator=new AccelerateDecelerateInterpolator();
this.interpolator = new AccelerateDecelerateInterpolator();
this.presenter = new ExchangeRateV2Presenter(this);
registerTextWatchers(true);
}
private void performDefaultAction(Bundle savedInstanceState) {
toolbarTitle.setText("Today's Rate");
this.presenter.getAllData();
}
@ -141,7 +132,7 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
}
private void showCountryListinDialog() {
countryListingDialog = new CountryListingDialog();
countryListingDialog = new ExchangeRateCountryListingDialog();
countryListingDialog.setCountryPaymentData(paymentServiceList);
countryListingDialog.setListener(this);
countryListingDialog.show(getFragmentManager(), "CountryListingDialog");
@ -153,7 +144,6 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
countrySelectionSpinner.setOnClickListener(this);
exRateCalculateButton.setOnClickListener(this);
iv_back.setOnClickListener(this);
registerTextWatchers(true);
}
@ -165,7 +155,6 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
exRateCalculateButton.setOnClickListener(null);
iv_back.setOnClickListener(null);
registerTextWatchers(false);
}
@ -178,10 +167,10 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
public void onCountrySelected(CountryPaymentService countryPaymentService) {
this.selectedCountryPaymentService = countryPaymentService;
showSelectedRecipient(countryPaymentService.getCountryCode(), countryPaymentService.getCurrency());
registerAvailableTextWatchersForEditText(recieveMoneyEditText,false);
registerAvailableTextWatchersForEditText(recieveMoneyEditText, false);
recieveMoneyEditText.setText("");
shouldCaulatedByRecipient=false;
registerAvailableTextWatchersForEditText(recieveMoneyEditText,true);
shouldCaulatedByRecipient = false;
registerAvailableTextWatchersForEditText(recieveMoneyEditText, true);
showPaymentService(true, countryPaymentService.getServiceAvailable());
if (this.countryListingDialog != null) {
this.countryListingDialog.hideKeyboard();
@ -213,17 +202,24 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
}
}
@Override
protected void onDestroy() {
super.onDestroy();
registerTextWatchers(false);
}
@Override
public void showCountryServiceData(List<CountryPaymentService> countryPaymentServiceList, CountryPaymentService defaultCountryPaymentService, String seedValue) {
if (defaultCountryPaymentService != null) {
//Update some flag here for forexchange (i.e either recieve)
if (seedValue != null) {
registerAvailableTextWatchersForEditText(this.sendMoneyEditText,false);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText,false);
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, false);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, false);
this.recieveMoneyEditText.setText(seedValue);
shouldCaulatedByRecipient=true;
registerAvailableTextWatchersForEditText(this.sendMoneyEditText,true);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText,true);
shouldCaulatedByRecipient = true;
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, true);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, true);
}
showSelectedRecipient(defaultCountryPaymentService.getCountryCode(), defaultCountryPaymentService.getCurrency());
showPaymentService(true, defaultCountryPaymentService.getServiceAvailable());
@ -234,13 +230,13 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
} else {
//Update some flag here for forexchange (i.e either send)
if (seedValue != null) {
registerAvailableTextWatchersForEditText(this.sendMoneyEditText,false);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText,false);
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, false);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, false);
this.sendMoneyEditText.setText(seedValue);
shouldCaulatedByRecipient=false;
shouldCaulatedByRecipient = false;
recieveMoneyEditText.setText("");
registerAvailableTextWatchersForEditText(this.sendMoneyEditText,true);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText,true);
registerAvailableTextWatchersForEditText(this.sendMoneyEditText, true);
registerAvailableTextWatchersForEditText(this.recieveMoneyEditText, true);
}
//We are taking first item as default as we don't have any default item enlisted
@ -258,6 +254,11 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
private void registerTextWatchers(boolean action) {
if (action) {
if (sendAmountTextWatcher == null)
sendAmountTextWatcher = new SendAmountTextWatcher();
if (recepientAmountTextWatcher == null)
recepientAmountTextWatcher = new RecipientAmountTextWatcher();
sendMoneyEditText.addTextChangedListener(sendAmountTextWatcher);
recieveMoneyEditText.addTextChangedListener(recepientAmountTextWatcher);
} else {
@ -269,13 +270,13 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
private void registerAvailableTextWatchersForEditText(EditText editText, boolean action) {
switch (editText.getId()) {
case R.id.sendAmountEdTxt:
if(action)
if (action)
sendMoneyEditText.addTextChangedListener(sendAmountTextWatcher);
else
sendMoneyEditText.removeTextChangedListener(sendAmountTextWatcher);
break;
case R.id.receiveAmountEdTxt:
if(action)
if (action)
recieveMoneyEditText.addTextChangedListener(recepientAmountTextWatcher);
else
recieveMoneyEditText.removeTextChangedListener(recepientAmountTextWatcher);
@ -291,8 +292,10 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
@Override
public void updateExchangeRates(String recipientAmount, String sendAmount, String transferDisplay, String exRateDisplay) {
registerAvailableTextWatchersForEditText(recieveMoneyEditText,false);
registerAvailableTextWatchersForEditText(sendMoneyEditText,false);
registerAvailableTextWatchersForEditText(recieveMoneyEditText, false);
registerAvailableTextWatchersForEditText(sendMoneyEditText, false);
this.recieveMoneyEditText.setText(recipientAmount);
this.sendMoneyEditText.setText(sendAmount);
@ -303,14 +306,14 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
this.exchangeRateTxtView.setVisibility(View.VISIBLE);
ViewCompat.animate(this.exchangeRateTxtView).translationY(0).setDuration(550).setInterpolator(this.interpolator).start();
this.transferFeeTxtView.setVisibility(View.INVISIBLE);
this.transferFeeTxtView.setVisibility(View.INVISIBLE);
this.transferFeeTxtView.setText(transferDisplay);
this.transferFeeTxtView.setTranslationY(this.transferFeeTxtView.getHeight());
this.transferFeeTxtView.setVisibility(View.VISIBLE);
ViewCompat.animate(this.transferFeeTxtView).translationY(0).setDuration(550).setInterpolator(this.interpolator).start();
registerAvailableTextWatchersForEditText(recieveMoneyEditText,true);
registerAvailableTextWatchersForEditText(sendMoneyEditText,true);
registerAvailableTextWatchersForEditText(recieveMoneyEditText, true);
registerAvailableTextWatchersForEditText(sendMoneyEditText, true);
}
@ -329,9 +332,9 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
@Override
public void afterTextChanged(Editable s) {
shouldCaulatedByRecipient = false;
registerAvailableTextWatchersForEditText(recieveMoneyEditText,false);
registerAvailableTextWatchersForEditText(recieveMoneyEditText, false);
recieveMoneyEditText.setText("");
registerAvailableTextWatchersForEditText(recieveMoneyEditText,true);
registerAvailableTextWatchersForEditText(recieveMoneyEditText, true);
}
}
@ -350,9 +353,9 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
@Override
public void afterTextChanged(Editable s) {
shouldCaulatedByRecipient = true;
registerAvailableTextWatchersForEditText(sendMoneyEditText,false);
registerAvailableTextWatchersForEditText(sendMoneyEditText, false);
sendMoneyEditText.setText("");
registerAvailableTextWatchersForEditText(sendMoneyEditText,true);
registerAvailableTextWatchersForEditText(sendMoneyEditText, true);
}
}

5
app/src/main/java/com/gmeremit/online/gmeremittance_native/home/view/HomeActivity.java

@ -38,6 +38,8 @@ import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.agentsV2.model.AgentsListApiResponse;
import com.gmeremit.online.gmeremittance_native.agentsV2.view.AgentListV2Activity;
import com.gmeremit.online.gmeremittance_native.customer_support.view.CustomerSupportFragment;
import com.gmeremit.online.gmeremittance_native.home.HomeContract;
import com.gmeremit.online.gmeremittance_native.home.events.DrawerEvent;
@ -429,7 +431,8 @@ public class HomeActivity extends AppCompatActivity implements HomeContract.Home
break;
case R.id.bottom_agent_layout:
bottomAgentLayout.setClickable(false);
startActivity(new Intent(getApplicationContext(), PayoutMultipleLocationActivity.class));
// startActivity(new Intent(getApplicationContext(), PayoutMultipleLocationActivity.class));
startActivity(new Intent(getApplicationContext(), AgentListV2Activity.class));
break;
case R.id.bottom_profile_layout:
bottomProfileLayout.setClickable(false);

22
app/src/main/res/layout/activity_agent_list_v2.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/layout_sendmoney_toolbar"/>
<android.support.v7.widget.RecyclerView
android:paddingTop="5dp"
android:background="@color/background_gray"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/agentListRv"
tools:context=".agentsV2.view.AgentListV2Activity"
app:layoutManager="android.support.v7.widget.LinearLayoutManager"
>
</android.support.v7.widget.RecyclerView>
</LinearLayout>

117
app/src/main/res/layout/agent_info_item_view.xml

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="15dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginStart="15dp"
android:layout_marginTop="10dp"
android:background="@drawable/ic_rounded_white"
android:orientation="vertical"
android:paddingBottom="5dp"
android:paddingEnd="15dp"
android:paddingStart="15dp"
android:paddingTop="5dp">
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/agent_info_txt_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|start"
android:inputType="text|number"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="Header 1"
android:textColor="@color/darkgray"
android:textSize="14sp"
app:fontName="@string/semibold" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/agent_info_txt_label_1"
android:layout_width="250dip"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:singleLine="false"
android:text="Transaction Date"
android:textColor="@color/darkgray"
android:textSize="14sp" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/agent_info_txt_label_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingTop="5dp"
android:text="Transaction Date"
android:textColor="@color/darkgray"
android:textSize="14sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="6dp"
android:layout_marginTop="6dp"
android:background="@color/gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="1">
<FrameLayout
android:id="@+id/agent_info_txt_label_contact_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/agent_info_txt_label_contact"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:drawableLeft="@drawable/ic_support_phone"
android:drawablePadding="8dp"
android:gravity="start"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="091283232"
android:textColor="@color/darkgray"
android:textSize="14sp" />
</FrameLayout>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginBottom="2dp"
android:layout_marginTop="2dp"
android:background="@color/gray"
android:visibility="gone" />
<FrameLayout
android:id="@+id/agent_info_txt_label_map_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:visibility="gone">
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/agent_info_txt_label_map"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:drawableLeft="@drawable/ic_agent_location"
android:drawablePadding="8dp"
android:maxLines="2"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:text="View on Map"
android:textColor="@color/darkgray"
android:textSize="14sp" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
Loading…
Cancel
Save