Preyea Regmi
5 years ago
12 changed files with 1469 additions and 330 deletions
-
1228app/src/main/assets/nativecountrylist.json
-
21app/src/main/java/com/gmeremit/online/gmeremittance_native/base/BaseGateway.java
-
2app/src/main/java/com/gmeremit/online/gmeremittance_native/base/PrivilegedGateway.java
-
55app/src/main/java/com/gmeremit/online/gmeremittance_native/registerV2/gateway/RegisterV2Gateway.java
-
8app/src/main/java/com/gmeremit/online/gmeremittance_native/registerV2/presenter/RegisterV2InteractorInterface.java
-
158app/src/main/java/com/gmeremit/online/gmeremittance_native/registerV2/presenter/RegisterV2Presenter.java
-
25app/src/main/java/com/gmeremit/online/gmeremittance_native/registerV2/presenter/RegisterV2PresenterInterface.java
-
214app/src/main/java/com/gmeremit/online/gmeremittance_native/registerV2/view/RegisterV2Activity.java
-
6app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/security/SecurityUtils.java
-
8app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/security/securitykeypad/SecurityKeyboardManager.java
-
72app/src/main/res/layout/activity_register_v2.xml
-
2app/src/main/res/values/strings.xml
1228
app/src/main/assets/nativecountrylist.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,4 +1,25 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.base; |
package com.gmeremit.online.gmeremittance_native.base; |
||||
|
|
||||
|
import android.content.Context; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.io.InputStream; |
||||
|
|
||||
public class BaseGateway implements BaseGatewayInterface { |
public class BaseGateway implements BaseGatewayInterface { |
||||
|
|
||||
|
public String loadJSONFromAsset(Context context,String filePath) { |
||||
|
String json = null; |
||||
|
try { |
||||
|
InputStream is = context.getAssets().open(filePath); |
||||
|
int size = is.available(); |
||||
|
byte[] buffer = new byte[size]; |
||||
|
is.read(buffer); |
||||
|
is.close(); |
||||
|
json = new String(buffer, "UTF-8"); |
||||
|
} catch (IOException ex) { |
||||
|
ex.printStackTrace(); |
||||
|
return null; |
||||
|
} |
||||
|
return json; |
||||
|
} |
||||
} |
} |
@ -1,56 +1,63 @@ |
|||||
package com.gmeremit.online.gmeremittance_native.registerV2.gateway; |
package com.gmeremit.online.gmeremittance_native.registerV2.gateway; |
||||
|
|
||||
|
import android.annotation.SuppressLint; |
||||
|
import android.content.Context; |
||||
|
|
||||
import com.gmeremit.online.gmeremittance_native.GmeApplication; |
import com.gmeremit.online.gmeremittance_native.GmeApplication; |
||||
import com.gmeremit.online.gmeremittance_native.base.PrefKeys; |
import com.gmeremit.online.gmeremittance_native.base.PrefKeys; |
||||
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGateway; |
import com.gmeremit.online.gmeremittance_native.base.PrivilegedGateway; |
||||
import com.gmeremit.online.gmeremittance_native.loginV2.presenter.LoginV2InteractorInterface; |
|
||||
import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientadd.AddRecipientApiResponse; |
|
||||
import com.gmeremit.online.gmeremittance_native.recipientV2.model.recipientlisting.GetAllRecipientApiResponse; |
|
||||
import com.gmeremit.online.gmeremittance_native.recipientV2.presenter.recipientlisting.RecipientListingV2InteractorInterface; |
|
||||
|
import com.gmeremit.online.gmeremittance_native.kycV2.model.kyc.NativeCountry; |
||||
import com.gmeremit.online.gmeremittance_native.registerV2.model.RegisterApiResponse; |
import com.gmeremit.online.gmeremittance_native.registerV2.model.RegisterApiResponse; |
||||
import com.gmeremit.online.gmeremittance_native.registerV2.presenter.RegisterV2InteractorInterface; |
import com.gmeremit.online.gmeremittance_native.registerV2.presenter.RegisterV2InteractorInterface; |
||||
import com.gmeremit.online.gmeremittance_native.utils.https.HttpClientV2; |
import com.gmeremit.online.gmeremittance_native.utils.https.HttpClientV2; |
||||
import com.google.gson.JsonObject; |
import com.google.gson.JsonObject; |
||||
|
import com.google.gson.reflect.TypeToken; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
import io.reactivex.Observable; |
import io.reactivex.Observable; |
||||
import okhttp3.ResponseBody; |
|
||||
|
|
||||
public class RegisterV2Gateway extends PrivilegedGateway implements RegisterV2InteractorInterface.Register2GatewayInterface { |
public class RegisterV2Gateway extends PrivilegedGateway implements RegisterV2InteractorInterface.Register2GatewayInterface { |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
private final RegisterV2InteractorInterface interactor; |
private final RegisterV2InteractorInterface interactor; |
||||
|
|
||||
public RegisterV2Gateway(RegisterV2InteractorInterface agentListV2InteractorInterface) { |
public RegisterV2Gateway(RegisterV2InteractorInterface agentListV2InteractorInterface) { |
||||
this.interactor=agentListV2InteractorInterface; |
|
||||
|
this.interactor = agentListV2InteractorInterface; |
||||
} |
} |
||||
|
|
||||
@Override |
@Override |
||||
public Observable<RegisterApiResponse> registerUser(String auth, String userName, String password,String confirmPassword, String dob, String clientId, String fcmId, String appVersion, String phoneBrand, String phoneOs, String deviceId, String osVersion) { |
|
||||
|
public Observable<RegisterApiResponse> registerUser(String auth, String userName, String password, String confirmPassword, String dob, String clientId, String fcmId, String appVersion, String phoneBrand, String phoneOs, String deviceId, String osVersion) { |
||||
|
|
||||
|
|
||||
JsonObject jsonObject=new JsonObject(); |
|
||||
jsonObject.addProperty("username",userName); |
|
||||
jsonObject.addProperty("password",password); |
|
||||
jsonObject.addProperty("confirmPassword",confirmPassword); |
|
||||
jsonObject.addProperty("dob",dob); |
|
||||
jsonObject.addProperty("clientId",clientId); |
|
||||
jsonObject.addProperty("uuid",deviceId); |
|
||||
jsonObject.addProperty("appVersion",appVersion); |
|
||||
jsonObject.addProperty("phoneBrand",phoneBrand); |
|
||||
jsonObject.addProperty("phoneOS",phoneOs); |
|
||||
jsonObject.addProperty("fcmId",fcmId); |
|
||||
jsonObject.addProperty("osVersion",osVersion); |
|
||||
|
JsonObject jsonObject = new JsonObject(); |
||||
|
jsonObject.addProperty("username", userName); |
||||
|
jsonObject.addProperty("password", password); |
||||
|
jsonObject.addProperty("confirmPassword", confirmPassword); |
||||
|
jsonObject.addProperty("dob", dob); |
||||
|
jsonObject.addProperty("clientId", clientId); |
||||
|
jsonObject.addProperty("uuid", deviceId); |
||||
|
jsonObject.addProperty("appVersion", appVersion); |
||||
|
jsonObject.addProperty("phoneBrand", phoneBrand); |
||||
|
jsonObject.addProperty("phoneOS", phoneOs); |
||||
|
jsonObject.addProperty("fcmId", fcmId); |
||||
|
jsonObject.addProperty("osVersion", osVersion); |
||||
|
|
||||
return HttpClientV2.getInstance().signUpV2(auth,jsonObject); |
|
||||
|
return HttpClientV2.getInstance().signUpV2(auth, jsonObject); |
||||
|
|
||||
} |
} |
||||
|
|
||||
|
@SuppressLint("ApplySharedPref") |
||||
@Override |
@Override |
||||
public void updateUserId(String userId) { |
public void updateUserId(String userId) { |
||||
GmeApplication.getStorage().edit().putString(PrefKeys.USER_ID,userId).commit(); |
|
||||
GmeApplication.getStorage().edit().putString(PrefKeys.USER_LOGGED_IN_STATUS,"HOME").apply(); |
|
||||
|
GmeApplication.getStorage().edit().putString(PrefKeys.USER_ID, userId).commit(); |
||||
|
GmeApplication.getStorage().edit().putString(PrefKeys.USER_LOGGED_IN_STATUS, "HOME").apply(); |
||||
|
|
||||
} |
} |
||||
|
|
||||
|
@Override |
||||
|
public Observable<List<NativeCountry>> getNativeCountryList(Context context) { |
||||
|
return Observable.fromCallable(() -> loadJSONFromAsset(context, "nativecountrylist.json")) |
||||
|
.map(nativeCountryJson -> HttpClientV2.getDeserializer().fromJson(nativeCountryJson, TypeToken.getParameterized(List.class, NativeCountry.class).getType())); |
||||
|
} |
||||
} |
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue