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
cb7cc48d
authored
Oct 01, 2019
by
Simhachalam ch
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixed naviagation and otp validation issues
parent
a93642ba
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
18 deletions
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/ui/SplashScreen.java
app/src/main/res/layout/activity_otp_validation.xml
app/src/main/java/com/vsoft/vera/ui/ADALActivity.java
View file @
cb7cc48d
...
...
@@ -160,7 +160,7 @@ public class ADALActivity extends AppCompatActivity {
}
});
CheckLoginValues
();
//
CheckLoginValues();
callGraphButton
=
(
Button
)
findViewById
(
R
.
id
.
callGraph
);
signOutButton
=
(
Button
)
findViewById
(
R
.
id
.
clearCache
);
login_with_otp
=
(
Button
)
findViewById
(
R
.
id
.
login_with_otp
);
...
...
@@ -244,10 +244,14 @@ public class ADALActivity extends AppCompatActivity {
if
(
requestCode
==
Constants
.
LOGIN_SCREEN_REQUEST_CODE
)
{
setResult
(
Constants
.
LOGIN_SCREEN_REQUEST_CODE
,
new
Intent
());
}
else
{
startActivity
(
new
Intent
(
ADALActivity
.
this
,
HomeScreen
.
class
));
Intent
homeIntent
=
new
Intent
(
ADALActivity
.
this
,
HomeScreen
.
class
);
homeIntent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
startActivity
(
homeIntent
);
}
}
else
{
startActivity
(
new
Intent
(
ADALActivity
.
this
,
HomeScreen
.
class
));
Intent
homeIntent
=
new
Intent
(
ADALActivity
.
this
,
HomeScreen
.
class
);
homeIntent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
startActivity
(
homeIntent
);
}
isLogin
=
true
;
finish
();
...
...
@@ -690,10 +694,14 @@ public class ADALActivity extends AppCompatActivity {
startActivity
(
new
Intent
(
ADALActivity
.
this
,
ChatActivity
.
class
));
}
else
{
startActivity
(
new
Intent
(
ADALActivity
.
this
,
HomeScreen
.
class
));
Intent
homeIntent
=
new
Intent
(
ADALActivity
.
this
,
HomeScreen
.
class
);
homeIntent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
startActivity
(
homeIntent
);
}
}
else
{
startActivity
(
new
Intent
(
ADALActivity
.
this
,
HomeScreen
.
class
));
Intent
homeIntent
=
new
Intent
(
ADALActivity
.
this
,
HomeScreen
.
class
);
homeIntent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
startActivity
(
homeIntent
);
}
//
}
else
{
...
...
app/src/main/java/com/vsoft/vera/ui/OtpValidationActivity.java
View file @
cb7cc48d
...
...
@@ -81,13 +81,13 @@ public class OtpValidationActivity extends Activity {
ButterKnife
.
bind
(
this
);
mApplication
=
(
CatalogueApplication
)
getApplication
();
new
LoginDetailsSendToServer
().
execute
();
//
new LoginDetailsSendToServer().execute();
}
@OnClick
(
R
.
id
.
otp_screen_text_view
)
void
onLoginClicked
()
{
//
callOtpAPI();
callOtpAPI
();
}
...
...
@@ -124,10 +124,7 @@ public class OtpValidationActivity extends Activity {
String
optCode
=
mOTPEditText
.
getText
().
toString
().
trim
();
if
(
TextUtils
.
isEmpty
(
optCode
))
{
mOTPEditText
.
setError
(
getResources
().
getString
(
R
.
string
.
otp_error
));
}
if
(!
TextUtils
.
isEmpty
(
phoneString
)
)
{
}
else
{
KeyboardUtil
.
hideKeyboard
(
OtpValidationActivity
.
this
);
if
(
mApplication
.
isNetConnected
())
{
...
...
@@ -138,6 +135,7 @@ public class OtpValidationActivity extends Activity {
DialogUtils
.
showNoConnectionDialog
(
OtpValidationActivity
.
this
);
}
}
}
...
...
@@ -427,10 +425,14 @@ public class OtpValidationActivity extends Activity {
if
(
requestCode
==
Constants
.
LOGIN_SCREEN_REQUEST_CODE
)
{
startActivity
(
new
Intent
(
OtpValidationActivity
.
this
,
ChatActivity
.
class
));
}
else
{
startActivity
(
new
Intent
(
OtpValidationActivity
.
this
,
HomeScreen
.
class
));
Intent
homeIntent
=
new
Intent
(
OtpValidationActivity
.
this
,
HomeScreen
.
class
);
homeIntent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
startActivity
(
homeIntent
);
}
}
else
{
startActivity
(
new
Intent
(
OtpValidationActivity
.
this
,
HomeScreen
.
class
));
Intent
homeIntent
=
new
Intent
(
OtpValidationActivity
.
this
,
HomeScreen
.
class
);
homeIntent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
startActivity
(
homeIntent
);
}
finish
();
}
else
{
...
...
app/src/main/java/com/vsoft/vera/ui/SplashScreen.java
View file @
cb7cc48d
...
...
@@ -6,6 +6,8 @@ import android.graphics.drawable.Drawable;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.support.v4.content.LocalBroadcastManager
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.view.Window
;
import
android.widget.LinearLayout
;
...
...
@@ -24,6 +26,8 @@ import org.json.JSONException;
import
org.json.JSONObject
;
import
com.microsoft.appcenter.AppCenter
;
import
com.microsoft.appcenter.crashes.Crashes
;
import
com.vsoft.vera.utils.Constants
;
import
com.vsoft.vera.utils.PrefManager
;
import
butterknife.ButterKnife
;
...
...
@@ -59,7 +63,19 @@ public class SplashScreen extends Activity {
ButterKnife
.
bind
(
this
);
startThread
();
}
private
void
CheckLoginValues
()
{
String
sysId
=
PrefManager
.
getSharedPref
(
SplashScreen
.
this
,
PrefManager
.
PREFERENCE_USER_SYS_ID
);
if
(!
TextUtils
.
isEmpty
(
sysId
))
{
/*Send broadcast to start SyncService*/
Intent
intent
=
new
Intent
(
Constants
.
APPLICATION_BROADCAST_INTENT
);
intent
.
putExtra
(
Constants
.
APPLICATION_BROADCAST_DATA_ACTION
,
Constants
.
ACTION_SYNC
);
LocalBroadcastManager
.
getInstance
(
SplashScreen
.
this
).
sendBroadcast
(
intent
);
startActivity
(
new
Intent
(
SplashScreen
.
this
,
HomeScreen
.
class
));
}
else
{
startActivity
(
new
Intent
(
SplashScreen
.
this
,
ADALActivity
.
class
));
}
}
private
void
startThread
()
{
new
Handler
().
postDelayed
(
new
Runnable
()
{
...
...
@@ -72,9 +88,9 @@ public class SplashScreen extends Activity {
public
void
run
()
{
// This method will be executed once the timer is over
// Start your app main activity
Intent
i
=
new
Intent
(
SplashScreen
.
this
,
ADALActivity
.
class
);
startActivity
(
i
);
//
Intent i = new Intent(SplashScreen.this, ADALActivity.class);
//
startActivity(i);
CheckLoginValues
();
// close this activity
finish
();
}
...
...
app/src/main/res/layout/activity_otp_validation.xml
View file @
cb7cc48d
...
...
@@ -41,7 +41,7 @@
<RelativeLayout
android:id=
"@+id/phone_validate_layout"
android:layout_width=
"match_parent"
android:visibility=
"
gon
e"
android:visibility=
"
visibl
e"
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