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
99ed65ef
authored
Sep 19, 2016
by
Kunj Gupta
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
UOFLMA-85 Fix : Login Screen, changed progress bar loading string.
parent
89670068
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
app/src/main/java/com/vsoft/uoflservicenow/ui/LoginScreen.java
app/src/main/res/values/strings.xml
app/src/main/java/com/vsoft/uoflservicenow/ui/LoginScreen.java
View file @
99ed65ef
...
...
@@ -21,6 +21,7 @@ import com.vsoft.uoflservicenow.api.managers.LoginApiManger;
import
com.vsoft.uoflservicenow.api.managers.UserApiManager
;
import
com.vsoft.uoflservicenow.db.models.UserApiValues
;
import
com.vsoft.uoflservicenow.enums.SyncStatus
;
import
com.vsoft.uoflservicenow.utils.CatalogueLog
;
import
com.vsoft.uoflservicenow.utils.Constants
;
import
com.vsoft.uoflservicenow.utils.DialogUtils
;
import
com.vsoft.uoflservicenow.utils.KeyboardUtil
;
...
...
@@ -114,8 +115,9 @@ public class LoginScreen extends Activity {
callLoginAPI
();
}
private
class
LoginDetailsSendToServer
extends
AsyncTask
<
String
,
Void
,
SyncStatus
>
{
private
class
LoginDetailsSendToServer
extends
AsyncTask
<
String
,
Integer
,
SyncStatus
>
{
private
ProgressDialog
progressDialog
;
private
static
final
int
USER_DETAIL
=
1
;
private
String
userName
;
...
...
@@ -123,7 +125,7 @@ public class LoginScreen extends Activity {
protected
void
onPreExecute
()
{
super
.
onPreExecute
();
progressDialog
=
new
ProgressDialog
(
LoginScreen
.
this
);
progressDialog
.
setMessage
(
getString
(
R
.
string
.
loading_string
));
progressDialog
.
setMessage
(
getString
(
R
.
string
.
lo
gin_screen_logging_in_lo
ading_string
));
progressDialog
.
show
();
progressDialog
.
setCancelable
(
false
);
}
...
...
@@ -139,6 +141,7 @@ public class LoginScreen extends Activity {
if
(
syncStatus
!=
null
)
{
if
(
syncStatus
==
SyncStatus
.
SUCCESS
)
{
publishProgress
(
USER_DETAIL
);
return
UserApiManager
.
getUserDetailResponse
(
userName
,
new
GetUserApiListener
()
{
@Override
public
void
onDoneApiCall
(
List
<
UserApiValues
>
userValues
)
{
...
...
@@ -157,19 +160,28 @@ public class LoginScreen extends Activity {
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
Toast
.
makeText
(
LoginScreen
.
this
,
R
.
string
.
login_screen_invalid_userna
n
e_and_password_string
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
LoginScreen
.
this
,
R
.
string
.
login_screen_invalid_userna
m
e_and_password_string
,
Toast
.
LENGTH_LONG
).
show
();
}
});
}
}
}
catch
(
Exception
e
)
{
CatalogueLog
.
e
(
"LoginScreen: LoginDetailsSendToServer: doInBackground: Exception: "
+
e
);
}
return
syncStatus
;
}
@Override
protected
void
onProgressUpdate
(
Integer
...
values
)
{
super
.
onProgressUpdate
(
values
);
if
(
values
[
0
]
==
USER_DETAIL
)
{
progressDialog
.
setMessage
(
getString
(
R
.
string
.
login_screen_getting_user_detail_loading_string
));
}
}
@Override
protected
void
onPostExecute
(
SyncStatus
syncStatus
)
{
super
.
onPostExecute
(
syncStatus
);
if
(
progressDialog
!=
null
&&
progressDialog
.
isShowing
())
{
...
...
app/src/main/res/values/strings.xml
View file @
99ed65ef
...
...
@@ -38,7 +38,9 @@
<!--Login Screen-->
<string
name=
"login_screen_login_string"
>
Login
</string>
<string
name=
"login_screen_invalid_usernane_and_password_string"
>
Invalid username and password
</string>
<string
name=
"login_screen_logging_in_loading_string"
>
Logging in
…
</string>
<string
name=
"login_screen_getting_user_detail_loading_string"
>
Getting user details
…
</string>
<string
name=
"login_screen_invalid_username_and_password_string"
>
Invalid username and password
</string>
<string
name=
"server_not_reachable"
>
Unable to connect to server. Please try again later.
</string>
<string
name=
"user_detail_not_available"
>
Unable to fetch user details.
</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