Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Krishna Vemulavada
/
vera_2.1_app
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f70f4a8b
authored
Oct 11, 2019
by
Sreenivasulu Mannem
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Mobile number and otp validation changes
parent
d46aa5a5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
14 deletions
app/src/main/java/com/vsoft/vera/ui/OtpValidationActivity.java
app/src/main/res/layout/activity_otp_validation.xml
app/src/main/res/values/strings.xml
app/src/main/java/com/vsoft/vera/ui/OtpValidationActivity.java
View file @
f70f4a8b
...
...
@@ -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
;
...
...
app/src/main/res/layout/activity_otp_validation.xml
View file @
f70f4a8b
...
...
@@ -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"
/>
...
...
app/src/main/res/values/strings.xml
View file @
f70f4a8b
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment