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
f646c386
authored
Sep 08, 2016
by
Krishna Vemulavada
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
user name and password was change to as per requirement
parent
5a7d3502
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
43 deletions
app/src/main/java/com/vsoft/uoflservicenow/ui/LoginScreen.java
app/src/main/java/com/vsoft/uoflservicenow/utils/DialogUtils.java
app/src/main/res/layout/activity_login.xml
app/src/main/res/layout/home_screen_adapter.xml
app/src/main/res/values/strings.xml
app/src/main/java/com/vsoft/uoflservicenow/ui/LoginScreen.java
View file @
f646c386
...
@@ -52,6 +52,8 @@ public class LoginScreen extends Activity {
...
@@ -52,6 +52,8 @@ public class LoginScreen extends Activity {
@BindView
(
R
.
id
.
login_screen_username_edit_text
)
@BindView
(
R
.
id
.
login_screen_username_edit_text
)
EditText
userName
;
EditText
userName
;
@BindView
(
R
.
id
.
errormessage
)
TextView
errorMessage
;
@BindView
(
R
.
id
.
login_screen_password_edit_text
)
@BindView
(
R
.
id
.
login_screen_password_edit_text
)
EditText
password
;
EditText
password
;
@BindView
(
R
.
id
.
login_scroll
)
@BindView
(
R
.
id
.
login_scroll
)
...
@@ -71,14 +73,10 @@ public class LoginScreen extends Activity {
...
@@ -71,14 +73,10 @@ public class LoginScreen extends Activity {
ButterKnife
.
bind
(
this
);
ButterKnife
.
bind
(
this
);
CheckLoginValues
();
CheckLoginValues
();
password
.
setOnKeyListener
(
new
View
.
OnKeyListener
()
password
.
setOnKeyListener
(
new
View
.
OnKeyListener
()
{
{
public
boolean
onKey
(
View
v
,
int
keyCode
,
KeyEvent
event
)
{
public
boolean
onKey
(
View
v
,
int
keyCode
,
KeyEvent
event
)
if
(
event
.
getAction
()
==
KeyEvent
.
ACTION_DOWN
)
{
{
switch
(
keyCode
)
{
if
(
event
.
getAction
()
==
KeyEvent
.
ACTION_DOWN
)
{
switch
(
keyCode
)
{
case
KeyEvent
.
KEYCODE_DPAD_CENTER
:
case
KeyEvent
.
KEYCODE_DPAD_CENTER
:
case
KeyEvent
.
KEYCODE_ENTER
:
case
KeyEvent
.
KEYCODE_ENTER
:
callLoginAPI
();
callLoginAPI
();
...
@@ -120,7 +118,7 @@ public class LoginScreen extends Activity {
...
@@ -120,7 +118,7 @@ public class LoginScreen extends Activity {
}
}
}
}
private
void
callLoginAPI
()
{
private
void
callLoginAPI
()
{
userNameStrng
=
userName
.
getText
().
toString
().
trim
();
userNameStrng
=
userName
.
getText
().
toString
().
trim
();
passwordStrng
=
password
.
getText
().
toString
().
trim
();
passwordStrng
=
password
.
getText
().
toString
().
trim
();
...
@@ -140,9 +138,9 @@ public class LoginScreen extends Activity {
...
@@ -140,9 +138,9 @@ public class LoginScreen extends Activity {
}
}
}
}
}
}
@OnClick
(
R
.
id
.
login_screen_login_text_view
)
@OnClick
(
R
.
id
.
login_screen_login_text_view
)
void
onLoginClicked
()
{
void
onLoginClicked
()
{
//startActivity(new Intent(LoginScreen.this, HomeScreen.class));
callLoginAPI
();
callLoginAPI
();
}
}
...
@@ -178,7 +176,9 @@ public class LoginScreen extends Activity {
...
@@ -178,7 +176,9 @@ public class LoginScreen extends Activity {
if
(
syncStatus
==
SyncStatus
.
SUCCESS
)
{
if
(
syncStatus
==
SyncStatus
.
SUCCESS
)
{
new
UserApiDetails
().
execute
(
userName
);
new
UserApiDetails
().
execute
(
userName
);
}
else
{
}
else
{
Toast
.
makeText
(
LoginScreen
.
this
,
"Invalid username and password"
,
Toast
.
LENGTH_SHORT
).
show
();
errorMessage
.
setVisibility
(
View
.
VISIBLE
);
errorMessage
.
setText
(
"Invalid username and password"
);
//Toast.makeText(LoginScreen.this, "Invalid username and password", Toast.LENGTH_SHORT).show();
}
}
}
}
...
...
app/src/main/java/com/vsoft/uoflservicenow/utils/DialogUtils.java
View file @
f646c386
package
com
.
vsoft
.
uoflservicenow
.
utils
;
package
com
.
vsoft
.
uoflservicenow
.
utils
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.app.AlertDialog
;
import
android.content.DialogInterface
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.support.v7.app.AlertDialog
;
import
android.view.ContextThemeWrapper
;
import
android.view.ContextThemeWrapper
;
import
com.vsoft.uoflservicenow.R
;
import
com.vsoft.uoflservicenow.R
;
/**
/**
* Created by
npadhy
on 9/7/2016.
* Created by
krishna
on 9/7/2016.
*/
*/
public
class
DialogUtils
{
public
class
DialogUtils
{
private
static
AlertDialog
alertDialog
;
public
static
void
showNoConnectionDialog
(
final
Activity
activity
)
{
public
static
void
showNoConnectionDialog
(
final
Activity
activity
)
{
try
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
alertDialog
==
null
)
{
AlertDialog
.
Builder
alertDialogBuilder
=
new
AlertDialog
.
Builder
(
AlertDialog
.
Builder
alertDialogBuilder
=
new
AlertDialog
.
Builder
(
new
ContextThemeWrapper
(
activity
,
new
ContextThemeWrapper
(
activity
,
android
.
R
.
style
.
Theme_Holo
));
android
.
R
.
style
.
Theme_Holo
));
...
@@ -37,29 +28,17 @@ public class DialogUtils {
...
@@ -37,29 +28,17 @@ public class DialogUtils {
public
void
onClick
(
public
void
onClick
(
DialogInterface
dialog
,
DialogInterface
dialog
,
int
id
)
{
int
id
)
{
activity
activity
.
startActivity
(
new
Intent
(
android
.
provider
.
Settings
.
ACTION_SETTINGS
));
.
startActivity
(
new
Intent
(
android
.
provider
.
Settings
.
ACTION_SETTINGS
));
alertDialog
=
null
;
}
}
})
})
.
setNegativeButton
(
.
setNegativeButton
(
activity
.
getString
(
R
.
string
.
cancel
),
activity
.
getString
(
R
.
string
.
cancel
),
new
DialogInterface
.
OnClickListener
()
{
new
DialogInterface
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
DialogInterface
dialog
,
int
which
)
{
alertDialog
=
null
;
}
}
});
});
alertDialog
=
alertDialogBuilder
.
create
();
AlertDialog
alertDialog
=
alertDialogBuilder
.
create
();
alertDialog
.
show
();
alertDialog
.
show
();
}
}
}
});
}
catch
(
Exception
e
)
{
}
}
}
}
app/src/main/res/layout/activity_login.xml
View file @
f646c386
...
@@ -35,7 +35,6 @@
...
@@ -35,7 +35,6 @@
android:layout_marginLeft=
"20dp"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"20dp"
android:layout_marginRight=
"20dp"
android:padding=
"10dp"
android:padding=
"10dp"
android:text=
""
android:drawableLeft=
"@mipmap/ic_user_icon"
android:drawableLeft=
"@mipmap/ic_user_icon"
android:singleLine=
"true"
/>
android:singleLine=
"true"
/>
<EditText
<EditText
...
@@ -47,7 +46,6 @@
...
@@ -47,7 +46,6 @@
android:drawableLeft=
"@mipmap/ic_password_icon"
android:drawableLeft=
"@mipmap/ic_password_icon"
android:inputType=
"textPassword"
android:inputType=
"textPassword"
android:padding=
"10dp"
android:padding=
"10dp"
android:text=
""
android:layout_marginLeft=
"20dp"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"20dp"
android:layout_marginRight=
"20dp"
android:singleLine=
"true"
/>
android:singleLine=
"true"
/>
...
@@ -68,6 +66,19 @@
...
@@ -68,6 +66,19 @@
android:text=
"@string/login_screen_login_string"
android:text=
"@string/login_screen_login_string"
android:textAlignment=
"center"
/>
android:textAlignment=
"center"
/>
<TextView
android:id=
"@+id/errormessage"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"10dp"
android:textColor=
"@color/error_color"
android:textSize=
"@dimen/small_text_size"
android:text=
""
android:gravity=
"center"
android:visibility=
"gone"
android:layout_gravity=
"center_horizontal"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</ScrollView>
...
...
app/src/main/res/layout/home_screen_adapter.xml
View file @
f646c386
...
@@ -7,8 +7,10 @@
...
@@ -7,8 +7,10 @@
android:layout_marginBottom=
"10dp"
android:layout_marginBottom=
"10dp"
card_view:cardBackgroundColor=
"@color/item_gb_color"
card_view:cardBackgroundColor=
"@color/item_gb_color"
card_view:cardCornerRadius=
"8dp"
card_view:cardCornerRadius=
"8dp"
card_view:cardElevation=
"3sp"
card_view:cardElevation=
"10dp"
card_view:cardUseCompatPadding=
"true"
>
card_view:cardUseCompatPadding=
"true"
>
<RelativeLayout
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
app/src/main/res/values/strings.xml
View file @
f646c386
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
<string
name=
"rejected"
>
Rejected
</string>
<string
name=
"rejected"
>
Rejected
</string>
<string
name=
"user_error"
>
Please
Enter UserN
ame
</string>
<string
name=
"user_error"
>
Please
enter usern
ame
</string>
<string
name=
"pasw_error"
>
Please
Enter P
assword
</string>
<string
name=
"pasw_error"
>
Please
enter p
assword
</string>
<string
name=
"date_string"
>
%1$s %2$s, %3$s
</string>
<string
name=
"date_string"
>
%1$s %2$s, %3$s
</string>
<string
name=
"date_and_time_string"
>
%1$s:%2$s
</string>
<string
name=
"date_and_time_string"
>
%1$s:%2$s
</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