Mobile number and otp validation changes

parent d46aa5a5
......@@ -81,18 +81,16 @@ public class OtpValidationActivity extends Activity {
ButterKnife.bind(this);
mApplication = (CatalogueApplication) getApplication();
// new LoginDetailsSendToServer().execute();
}
@OnClick(R.id.otp_screen_text_view)
void onLoginClicked() {
callOtpAPI();
}
@OnClick(R.id.otp_screen_validate_text_view)
void onValidateClicked(){
callValidateOtpAPI();
}
......@@ -101,7 +99,7 @@ public class OtpValidationActivity extends Activity {
phoneString = mPhoneEditText.getText().toString().trim();
if (TextUtils.isEmpty(phoneString)) {
mPhoneEditText.setError(getResources().getString(R.string.phone_error));
mPhoneEditText.setError(getResources().getString(R.string.phone_no_error));
} else if (!TextUtils.isEmpty(phoneString) && phoneString.length() >= 10 && phoneString.length() <=20) {
KeyboardUtil.hideKeyboard(OtpValidationActivity.this);
if (mApplication.isNetConnected()) {
......@@ -153,12 +151,10 @@ public class OtpValidationActivity extends Activity {
public void onDoneApiCall(String message) {
apiMessage = message;
apiStatus = 1;
}
@Override
public void onFailApiCall(String message) {
apiMessage = message;
apiStatus = 0;
}
......@@ -180,7 +176,6 @@ public class OtpValidationActivity extends Activity {
}
if(apiStatus==1){ // success
showPhoneLayout(false);
}else{
showPhoneLayout(true);
......@@ -221,18 +216,14 @@ public class OtpValidationActivity extends Activity {
OtpApiManager.validateOTP(phoneString, otpCode,new GetValidateOtpApiListener() {
@Override
public void onDoneApiCall(String message) {
apiMessage = message;
apiStatus = 1;
}
@Override
public void onFailApiCall(String message) {
apiMessage = message;
apiStatus = 0;
}
});
return apiMessage;
......
......@@ -59,9 +59,10 @@
android:layout_marginLeft="@dimen/extra_large_margin"
android:layout_marginRight="@dimen/extra_large_margin"
android:background="@drawable/username_under_bg_box"
android:hint="Please enter mobile number"
android:hint="@string/phone_number"
android:lines="1"
android:inputType="number"
android:maxLength="20"
android:inputType="phone"
android:padding="@dimen/normal_margin"
android:singleLine="true" />
</android.support.design.widget.TextInputLayout>
......@@ -109,6 +110,7 @@
android:background="@drawable/username_under_bg_box"
android:hint="@string/enter_otp"
android:lines="1"
android:maxLength="8"
android:inputType="number"
android:padding="@dimen/normal_margin"
android:singleLine="true" />
......
......@@ -64,7 +64,8 @@
<string name="user_error">Please enter username</string>
<string name="pasw_error">Please enter password</string>
<string name="phone_error">Please enter mobile number</string>
<string name="phone_number">Please enter mobile number</string>
<string name="phone_no_error">Please enter valid mobile number</string>
<string name="otp_error">Please enter OTP</string>
<string name="username_string">Username</string>
<string name="password_string">Password</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment