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
a234bb0e
authored
Sep 30, 2019
by
Krishna Vemulawada
Browse files
Options
_('Browse Files')
Download
Plain Diff
disabled otp
parents
5156da6a
84dff289
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
4 deletions
app/src/main/java/com/vsoft/vera/api/managers/OtpApiManager.java
app/src/main/java/com/vsoft/vera/ui/ADALActivity.java
app/src/main/java/com/vsoft/vera/ui/OtpValidationActivity.java
app/src/main/java/com/vsoft/vera/utils/Constants.java
app/src/main/res/layout/activity_otp_validation.xml
app/src/main/java/com/vsoft/vera/api/managers/OtpApiManager.java
View file @
a234bb0e
...
@@ -31,7 +31,8 @@ public class OtpApiManager {
...
@@ -31,7 +31,8 @@ public class OtpApiManager {
OtpPostData
otpPostData
=
new
OtpPostData
();
OtpPostData
otpPostData
=
new
OtpPostData
();
otpPostData
.
setPhone_number
(
mobileNumber
);
otpPostData
.
setPhone_number
(
mobileNumber
);
otpPostData
.
setVia
(
"sms"
);
otpPostData
.
setVia
(
"sms"
);
otpPostData
.
setCountry_code
(
"+91"
);
otpPostData
.
setCountry_code
(
Constants
.
TWILIO_COUNTRY_CODE
);
otpPostData
.
setLn
(
"en"
);
otpPostData
.
setLn
(
"en"
);
Call
<
ResponseBody
>
call
=
retrofit
.
create
(
OtpApi
.
class
).
getOtp
(
otpPostData
);
Call
<
ResponseBody
>
call
=
retrofit
.
create
(
OtpApi
.
class
).
getOtp
(
otpPostData
);
...
@@ -98,7 +99,8 @@ public class OtpApiManager {
...
@@ -98,7 +99,8 @@ public class OtpApiManager {
final
Retrofit
retrofit
=
RestClient
.
getInitializedRestAdapterWithOutAuthorizationHeader
();
final
Retrofit
retrofit
=
RestClient
.
getInitializedRestAdapterWithOutAuthorizationHeader
();
Call
<
ResponseBody
>
call
=
retrofit
.
create
(
OtpApi
.
class
).
validateOtp
(
mobileNumber
,
"+91"
,
verificationCode
,
"en"
);
Call
<
ResponseBody
>
call
=
retrofit
.
create
(
OtpApi
.
class
).
validateOtp
(
mobileNumber
,
Constants
.
TWILIO_COUNTRY_CODE
,
verificationCode
,
"en"
);
try
{
try
{
//Retrofit synchronous call
//Retrofit synchronous call
...
...
app/src/main/java/com/vsoft/vera/ui/ADALActivity.java
View file @
a234bb0e
...
@@ -198,7 +198,7 @@ public class ADALActivity extends AppCompatActivity {
...
@@ -198,7 +198,7 @@ public class ADALActivity extends AppCompatActivity {
public
void
handleMessage
(
Message
msg
)
{
public
void
handleMessage
(
Message
msg
)
{
if
(
sIntSignInInvoked
.
compareAndSet
(
false
,
true
))
{
if
(
sIntSignInInvoked
.
compareAndSet
(
false
,
true
))
{
if
(
msg
.
what
==
MSG_INTERACTIVE_SIGN_IN_PROMPT_AUTO
){
if
(
msg
.
what
==
MSG_INTERACTIVE_SIGN_IN_PROMPT_AUTO
){
mAuthContext
.
acquireToken
(
getActivity
(),
RESOURCE_ID
,
CLIENT_ID
,
REDIRECT_URI
,
PromptBehavior
.
A
uto
,
getAuthInteractiveCallback
());
mAuthContext
.
acquireToken
(
getActivity
(),
RESOURCE_ID
,
CLIENT_ID
,
REDIRECT_URI
,
PromptBehavior
.
A
lways
,
getAuthInteractiveCallback
());
}
else
if
(
msg
.
what
==
MSG_INTERACTIVE_SIGN_IN_PROMPT_ALWAYS
){
}
else
if
(
msg
.
what
==
MSG_INTERACTIVE_SIGN_IN_PROMPT_ALWAYS
){
mAuthContext
.
acquireToken
(
getActivity
(),
RESOURCE_ID
,
CLIENT_ID
,
REDIRECT_URI
,
PromptBehavior
.
Always
,
getAuthInteractiveCallback
());
mAuthContext
.
acquireToken
(
getActivity
(),
RESOURCE_ID
,
CLIENT_ID
,
REDIRECT_URI
,
PromptBehavior
.
Always
,
getAuthInteractiveCallback
());
}
}
...
...
app/src/main/java/com/vsoft/vera/ui/OtpValidationActivity.java
View file @
a234bb0e
...
@@ -81,13 +81,14 @@ public class OtpValidationActivity extends Activity {
...
@@ -81,13 +81,14 @@ public class OtpValidationActivity extends Activity {
ButterKnife
.
bind
(
this
);
ButterKnife
.
bind
(
this
);
mApplication
=
(
CatalogueApplication
)
getApplication
();
mApplication
=
(
CatalogueApplication
)
getApplication
();
new
LoginDetailsSendToServer
().
execute
();
}
}
@OnClick
(
R
.
id
.
otp_screen_text_view
)
@OnClick
(
R
.
id
.
otp_screen_text_view
)
void
onLoginClicked
()
{
void
onLoginClicked
()
{
// callOtpAPI();
// callOtpAPI();
new
LoginDetailsSendToServer
().
execute
();
}
}
@OnClick
(
R
.
id
.
otp_screen_validate_text_view
)
@OnClick
(
R
.
id
.
otp_screen_validate_text_view
)
...
...
app/src/main/java/com/vsoft/vera/utils/Constants.java
View file @
a234bb0e
...
@@ -11,6 +11,7 @@ import com.vsoft.vera.api.interfaces.PendingApprovalsApi;
...
@@ -11,6 +11,7 @@ import com.vsoft.vera.api.interfaces.PendingApprovalsApi;
public
class
Constants
{
public
class
Constants
{
public
static
final
String
TAG
=
AppConfig
.
APP_INTERNAL_NAME
;
public
static
final
String
TAG
=
AppConfig
.
APP_INTERNAL_NAME
;
public
static
final
String
TWILIO_COUNTRY_CODE
=
"+91"
;
public
static
final
String
[]
month
=
{
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sep"
,
"Oct"
,
"Nov"
,
"Dec"
};
public
static
final
String
[]
month
=
{
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sep"
,
"Oct"
,
"Nov"
,
"Dec"
};
/**
/**
...
...
app/src/main/res/layout/activity_otp_validation.xml
View file @
a234bb0e
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
<RelativeLayout
<RelativeLayout
android:id=
"@+id/phone_validate_layout"
android:id=
"@+id/phone_validate_layout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:visibility=
"gone"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
...
...
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