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
90776c2c
authored
Oct 11, 2019
by
Simhachalam ch
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'fulton_county_demo' into fulton_refactor
parents
9c123494
f70f4a8b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
62 deletions
app/build.gradle
app/src/main/java/com/vsoft/vera/ui/ADALActivity.java
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/vportal/debug/app-vportal-debug.apk
app/build.gradle
View file @
90776c2c
...
...
@@ -72,7 +72,7 @@ android {
vportal
{
applicationId
"com.vsoft.vera.vportal"
versionCode
1
versionName
"
0.2.1
"
versionName
"
1.1.0
"
}
}
}
...
...
app/src/main/java/com/vsoft/vera/ui/ADALActivity.java
View file @
90776c2c
...
...
@@ -170,7 +170,8 @@ public class ADALActivity extends AppCompatActivity {
});
getCountryCode
();
// CheckLoginValues();
// CheckLoginValues();
callGraphButton
=
(
Button
)
findViewById
(
R
.
id
.
callGraph
);
signOutButton
=
(
Button
)
findViewById
(
R
.
id
.
clearCache
);
login_with_otp
=
(
Button
)
findViewById
(
R
.
id
.
login_with_otp
);
...
...
@@ -190,7 +191,6 @@ public class ADALActivity extends AppCompatActivity {
});
login_with_otp
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
public
void
onClick
(
View
v
)
{
// onSignOutClicked();
...
...
@@ -237,33 +237,6 @@ public class ADALActivity extends AppCompatActivity {
}
}
/*
* getCountryCode - To get the Country mobile code dynamically.
*
* @return void
* */
public
void
getCountryCode
()
{
try
{
TelephonyManager
telephonyManager
=
(
TelephonyManager
)
this
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
);
if
(
telephonyManager
!=
null
)
{
String
countryName
=
telephonyManager
.
getNetworkCountryIso
();
Log
.
e
(
TAG
,
"countryCode: "
+
countryName
);
if
(
countryName
.
equalsIgnoreCase
(
"us"
))
{
Constants
.
TWILIO_COUNTRY_CODE
=
"+1"
;
}
if
(
countryName
.
equalsIgnoreCase
(
"in"
))
{
Constants
.
TWILIO_COUNTRY_CODE
=
"+91"
;
}
Log
.
e
(
TAG
,
"countryCode: "
+
Constants
.
TWILIO_COUNTRY_CODE
);
}
}
catch
(
Exception
e
)
{
Constants
.
TWILIO_COUNTRY_CODE
=
"+1"
;
}
}
private
void
CheckLoginValues
()
{
String
sysId
=
PrefManager
.
getSharedPref
(
ADALActivity
.
this
,
PrefManager
.
PREFERENCE_USER_SYS_ID
);
if
(!
TextUtils
.
isEmpty
(
sysId
))
{
...
...
@@ -760,4 +733,28 @@ public class ADALActivity extends AppCompatActivity {
}
}
}
/*
* getCountryCode - To get the Country mobile code dynamically.
*
* @return void
* */
public
void
getCountryCode
()
{
try
{
TelephonyManager
telephonyManager
=
(
TelephonyManager
)
this
.
getSystemService
(
Context
.
TELEPHONY_SERVICE
);
if
(
telephonyManager
!=
null
)
{
String
countryName
=
telephonyManager
.
getNetworkCountryIso
();
if
(
countryName
.
equalsIgnoreCase
(
"us"
))
{
Constants
.
TWILIO_COUNTRY_CODE
=
"+1"
;
}
if
(
countryName
.
equalsIgnoreCase
(
"in"
))
{
Constants
.
TWILIO_COUNTRY_CODE
=
"+91"
;
}
}
}
catch
(
Exception
e
)
{
Constants
.
TWILIO_COUNTRY_CODE
=
"+1"
;
}
}
}
app/src/main/java/com/vsoft/vera/ui/OtpValidationActivity.java
View file @
90776c2c
...
...
@@ -14,7 +14,6 @@ import android.view.View;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.bumptech.glide.Glide
;
...
...
@@ -82,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
();
}
...
...
@@ -102,16 +99,11 @@ public class OtpValidationActivity extends Activity {
phoneString
=
mPhoneEditText
.
getText
().
toString
().
trim
();
if
(
TextUtils
.
isEmpty
(
phoneString
))
{
mPhoneEditText
.
setError
(
getResources
().
getString
(
R
.
string
.
phone_error
));
}
if
(!
TextUtils
.
isEmpty
(
phoneString
)
&&
phoneString
.
length
()
>=
10
)
{
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
())
{
new
generateOtp
().
execute
(
phoneString
);
}
else
{
DialogUtils
.
showNoConnectionDialog
(
OtpValidationActivity
.
this
);
}
...
...
@@ -120,21 +112,18 @@ public class OtpValidationActivity extends Activity {
private
void
callValidateOtpAPI
()
{
String
o
pt
Code
=
mOTPEditText
.
getText
().
toString
().
trim
();
if
(
TextUtils
.
isEmpty
(
o
pt
Code
))
{
String
o
tp
Code
=
mOTPEditText
.
getText
().
toString
().
trim
();
if
(
TextUtils
.
isEmpty
(
o
tp
Code
))
{
mOTPEditText
.
setError
(
getResources
().
getString
(
R
.
string
.
otp_error
));
}
else
{
}
else
if
(!
TextUtils
.
isEmpty
(
otpCode
)
&&
otpCode
.
length
()
<=
8
)
{
KeyboardUtil
.
hideKeyboard
(
OtpValidationActivity
.
this
);
if
(
mApplication
.
isNetConnected
())
{
new
validateOtp
().
execute
(
phoneString
,
optCode
);
if
(
mApplication
.
isNetConnected
())
{
new
validateOtp
().
execute
(
phoneString
,
otpCode
);
}
else
{
DialogUtils
.
showNoConnectionDialog
(
OtpValidationActivity
.
this
);
}
}
}
...
...
@@ -162,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
;
}
...
...
@@ -189,7 +176,6 @@ public class OtpValidationActivity extends Activity {
}
if
(
apiStatus
==
1
){
// success
showPhoneLayout
(
false
);
}
else
{
showPhoneLayout
(
true
);
...
...
@@ -227,23 +213,17 @@ public class OtpValidationActivity extends Activity {
String
phoneString
=
params
[
0
];
String
otpCode
=
params
[
1
];
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 @
90776c2c
...
...
@@ -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 @
90776c2c
...
...
@@ -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>
...
...
@@ -144,7 +145,7 @@
<!-- messages -->
<string
name=
"message_welcome"
>
Chat with VERA
</string>
<string
name=
"reset_password"
>
RESET PASSWORD
</string>
<string
name=
"view_all_str"
><u>
View
ALL
</u></string>
<string
name=
"view_all_str"
><u>
View
all
</u></string>
<!--Speech Recognizer-->
<string
name=
"ds_listening"
>
Listening…
</string>
...
...
app/vportal/debug/app-vportal-debug.apk
deleted
100644 → 0
View file @
9c123494
The file could not be displayed because it is too large.
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