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
43319b33
authored
Sep 30, 2019
by
Krishna Vemulawada
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add glide to images
parent
e187aa8b
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
111 additions
and
39 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/HomeScreen.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/drawable/fulton_county_logo_home.png
app/src/main/res/layout/activity_otp_validation.xml
app/src/main/res/layout/adal_main.xml
app/src/main/res/layout/home_screen.xml
app/src/vportal/res/layout/splash_screen.xml
app/vportal/staging/app-vportal-staging.apk
app/src/main/java/com/vsoft/vera/api/managers/OtpApiManager.java
View file @
43319b33
...
...
@@ -31,7 +31,7 @@ public class OtpApiManager {
OtpPostData
otpPostData
=
new
OtpPostData
();
otpPostData
.
setPhone_number
(
mobileNumber
);
otpPostData
.
setVia
(
"sms"
);
otpPostData
.
setCountry_code
(
"+1"
);
otpPostData
.
setCountry_code
(
"+
9
1"
);
otpPostData
.
setLn
(
"en"
);
Call
<
ResponseBody
>
call
=
retrofit
.
create
(
OtpApi
.
class
).
getOtp
(
otpPostData
);
...
...
@@ -98,7 +98,7 @@ public class OtpApiManager {
final
Retrofit
retrofit
=
RestClient
.
getInitializedRestAdapterWithOutAuthorizationHeader
();
Call
<
ResponseBody
>
call
=
retrofit
.
create
(
OtpApi
.
class
).
validateOtp
(
mobileNumber
,
"+1"
,
verificationCode
,
"en"
);
Call
<
ResponseBody
>
call
=
retrofit
.
create
(
OtpApi
.
class
).
validateOtp
(
mobileNumber
,
"+
9
1"
,
verificationCode
,
"en"
);
try
{
//Retrofit synchronous call
...
...
app/src/main/java/com/vsoft/vera/ui/ADALActivity.java
View file @
43319b33
...
...
@@ -5,7 +5,9 @@ import android.app.Activity;
import
android.app.ProgressDialog
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.graphics.drawable.Drawable
;
import
android.os.AsyncTask
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Looper
;
...
...
@@ -18,6 +20,7 @@ import android.util.Log;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.android.volley.DefaultRetryPolicy
;
...
...
@@ -27,6 +30,9 @@ import com.android.volley.Response;
import
com.android.volley.VolleyError
;
import
com.android.volley.toolbox.JsonObjectRequest
;
import
com.android.volley.toolbox.Volley
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.request.target.SimpleTarget
;
import
com.bumptech.glide.request.transition.Transition
;
import
com.microsoft.aad.adal.ADALError
;
import
com.microsoft.aad.adal.AuthenticationCallback
;
import
com.microsoft.aad.adal.AuthenticationContext
;
...
...
@@ -51,6 +57,7 @@ import com.vsoft.vera.db.models.UserApiValues;
import
com.vsoft.vera.utils.Constants
;
import
com.vsoft.vera.utils.DialogUtils
;
import
com.vsoft.vera.utils.GenerateRandomString
;
import
com.vsoft.vera.utils.NetworkConnectivity
;
import
com.vsoft.vera.utils.PrefManager
;
import
com.vsoft.vera.utils.Util
;
...
...
@@ -111,6 +118,7 @@ public class ADALActivity extends AppCompatActivity {
/* Telemetry variables */
// Flag to turn event aggregation on/off
private
static
final
boolean
sTelemetryAggregationIsRequired
=
true
;
private
LinearLayout
mainLayt
;
/* Telemetry dispatcher registration */
...
...
@@ -130,6 +138,26 @@ public class ADALActivity extends AppCompatActivity {
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
adal_main
);
mainLayt
=
(
LinearLayout
)
findViewById
(
R
.
id
.
activity_main
);
Glide
.
with
(
this
).
load
(
R
.
drawable
.
fulton_bg
).
into
(
new
SimpleTarget
<
Drawable
>()
{
@Override
public
void
onResourceReady
(
Drawable
resource
,
Transition
<?
super
Drawable
>
transition
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
mainLayt
.
setBackground
(
resource
);
}
}
});
Glide
.
with
(
this
).
load
(
R
.
drawable
.
fulton_county_logo_home
).
into
(
new
SimpleTarget
<
Drawable
>()
{
@Override
public
void
onResourceReady
(
Drawable
resource
,
Transition
<?
super
Drawable
>
transition
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
logo_banner
.
setBackground
(
resource
);
}
}
});
CheckLoginValues
();
callGraphButton
=
(
Button
)
findViewById
(
R
.
id
.
callGraph
);
signOutButton
=
(
Button
)
findViewById
(
R
.
id
.
clearCache
);
...
...
@@ -138,10 +166,13 @@ public class ADALActivity extends AppCompatActivity {
callGraphButton
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
public
void
onClick
(
View
v
)
{
mAuthContext
.
getCache
().
removeAll
();
sIntSignInInvoked
.
set
(
false
);
onCallGraphClicked
();
if
(
NetworkConnectivity
.
haveNetworkConnection
(
ADALActivity
.
this
))
{
onCallGraphClicked
();
}
else
{
DialogUtils
.
showNoConnectionDialog
(
ADALActivity
.
this
);
}
}
});
...
...
@@ -152,7 +183,6 @@ public class ADALActivity extends AppCompatActivity {
// onSignOutClicked();
Intent
intent
=
new
Intent
(
ADALActivity
.
this
,
OtpValidationActivity
.
class
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
|
Intent
.
FLAG_ACTIVITY_CLEAR_TASK
);
startActivity
(
intent
);
}
...
...
@@ -272,9 +302,7 @@ public class ADALActivity extends AppCompatActivity {
/*Send broadcast to start SyncService*/
if
(!
isLogin
){
callGraphButton
.
setVisibility
(
View
.
GONE
);
login_with_otp
.
setVisibility
(
View
.
GONE
);
logo_banner
.
setVisibility
(
View
.
GONE
);
new
LoginDetailsSendToServer
().
execute
();
}
...
...
@@ -343,12 +371,6 @@ public class ADALActivity extends AppCompatActivity {
findViewById
(
R
.
id
.
graphData
).
setVisibility
(
View
.
GONE
);
}
@SuppressLint
(
"SetTextI18n"
)
...
...
@@ -390,8 +412,13 @@ public class ADALActivity extends AppCompatActivity {
}
/* Successfully got a token, call graph now */
Log
.
d
(
TAG
,
"Successfully authenticated"
);
callGraphButton
.
setVisibility
(
View
.
GONE
);
signOutButton
.
setVisibility
(
View
.
GONE
);
login_with_otp
.
setVisibility
(
View
.
GONE
);
logo_banner
.
setVisibility
(
View
.
GONE
);
/* Store the mAuthResult */
mAuthResult
=
authenticationResult
;
/* call graph */
callGraphAPI
();
...
...
app/src/main/java/com/vsoft/vera/ui/HomeScreen.java
View file @
43319b33
...
...
@@ -6,6 +6,7 @@ import android.content.DialogInterface;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.content.pm.PackageManager
;
import
android.graphics.drawable.Drawable
;
import
android.os.AsyncTask
;
import
android.os.Build
;
import
android.os.Bundle
;
...
...
@@ -18,7 +19,11 @@ import android.support.v4.app.ActivityCompat;
import
android.support.v7.app.AlertDialog
;
import
android.support.v7.widget.Toolbar
;
import
android.widget.GridView
;
import
android.widget.LinearLayout
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.request.target.SimpleTarget
;
import
com.bumptech.glide.request.transition.Transition
;
import
com.google.android.gms.analytics.Tracker
;
import
com.microsoft.aad.adal.AuthenticationContext
;
import
com.microsoft.aad.adal.AuthenticationResult
;
...
...
@@ -76,6 +81,7 @@ public class HomeScreen extends HandleNotificationActivity {
private
static
final
int
MSG_INTERACTIVE_SIGN_IN_PROMPT_AUTO
=
1
;
/* Constant to send message to the mAcquireTokenHandler to do acquire token with Prompt.Always */
private
static
final
int
MSG_INTERACTIVE_SIGN_IN_PROMPT_ALWAYS
=
2
;
private
LinearLayout
mainLayt
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -89,6 +95,17 @@ public class HomeScreen extends HandleNotificationActivity {
// Send initial screen view hit.
Util
.
sendScreenName
(
tracker
,
getString
(
R
.
string
.
home_screen_string
));
mainLayt
=
(
LinearLayout
)
findViewById
(
R
.
id
.
home_main_activity
);
Glide
.
with
(
this
).
load
(
R
.
drawable
.
fulton_bg
).
into
(
new
SimpleTarget
<
Drawable
>()
{
@Override
public
void
onResourceReady
(
Drawable
resource
,
Transition
<?
super
Drawable
>
transition
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
mainLayt
.
setBackground
(
resource
);
}
}
});
HomeScreenAdapter
adapter
=
new
HomeScreenAdapter
(
this
,
MenuProvider
.
MENU_ITEMS
);
mGridView
.
setAdapter
(
adapter
);
mAuthContext
=
new
AuthenticationContext
(
getApplicationContext
(),
AUTHORITY
,
false
);
...
...
app/src/main/java/com/vsoft/vera/ui/OtpValidationActivity.java
View file @
43319b33
...
...
@@ -3,17 +3,23 @@ package com.vsoft.vera.ui;
import
android.app.Activity
;
import
android.app.ProgressDialog
;
import
android.content.Intent
;
import
android.graphics.drawable.Drawable
;
import
android.os.AsyncTask
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.v4.content.LocalBroadcastManager
;
import
android.text.TextUtils
;
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
;
import
com.bumptech.glide.request.target.SimpleTarget
;
import
com.bumptech.glide.request.transition.Transition
;
import
com.vsoft.vera.CatalogueApplication
;
import
com.vsoft.vera.R
;
import
com.vsoft.vera.api.listeners.get.GetUserDetailApiListener
;
...
...
@@ -56,12 +62,23 @@ public class OtpValidationActivity extends Activity {
private
static
final
int
API_SUCCESS_USER_DETAIL
=
3
;
private
static
final
int
API_FAIL_USER_DETAIL
=
4
;
private
List
<
UserApiValues
>
mUserDetails
;
private
LinearLayout
mainLayt
;
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_otp_validation
);
mainLayt
=
(
LinearLayout
)
findViewById
(
R
.
id
.
activity_main_lyt
);
Glide
.
with
(
this
).
load
(
R
.
drawable
.
fulton_bg
).
into
(
new
SimpleTarget
<
Drawable
>()
{
@Override
public
void
onResourceReady
(
Drawable
resource
,
Transition
<?
super
Drawable
>
transition
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
mainLayt
.
setBackground
(
resource
);
}
}
});
ButterKnife
.
bind
(
this
);
mApplication
=
(
CatalogueApplication
)
getApplication
();
}
...
...
@@ -183,7 +200,12 @@ public class OtpValidationActivity extends Activity {
}
}
@Override
public
void
onBackPressed
()
{
super
.
onBackPressed
();
finish
();
}
private
class
validateOtp
extends
AsyncTask
<
String
,
Integer
,
String
>{
...
...
app/src/main/java/com/vsoft/vera/ui/SplashScreen.java
View file @
43319b33
...
...
@@ -2,13 +2,19 @@ package com.vsoft.vera.ui;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.graphics.drawable.Drawable
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.util.Log
;
import
android.view.Window
;
import
android.widget.LinearLayout
;
import
com.androidquery.AQuery
;
import
com.androidquery.callback.AjaxStatus
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.request.target.SimpleTarget
;
import
com.bumptech.glide.request.transition.Transition
;
import
com.vsoft.vera.AppConfig
;
import
com.vsoft.vera.R
;
...
...
@@ -25,6 +31,7 @@ public class SplashScreen extends Activity {
// Splash screen timer
private
static
int
SPLASH_TIME_OUT
=
3000
;
private
LinearLayout
mainLayt
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -32,7 +39,15 @@ public class SplashScreen extends Activity {
super
.
onCreate
(
savedInstanceState
);
requestWindowFeature
(
Window
.
FEATURE_NO_TITLE
);
setContentView
(
R
.
layout
.
splash_screen
);
mainLayt
=
(
LinearLayout
)
findViewById
(
R
.
id
.
splash_main_lyt
);
Glide
.
with
(
this
).
load
(
R
.
drawable
.
fulton_splash_screen
).
into
(
new
SimpleTarget
<
Drawable
>()
{
@Override
public
void
onResourceReady
(
Drawable
resource
,
Transition
<?
super
Drawable
>
transition
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
JELLY_BEAN
)
{
mainLayt
.
setBackground
(
resource
);
}
}
});
ButterKnife
.
bind
(
this
);
startThread
();
}
...
...
app/src/main/res/drawable/fulton_county_logo_home.png
0 → 100644
View file @
43319b33
323 KB
app/src/main/res/layout/activity_otp_validation.xml
View file @
43319b33
<?xml version="1.0" encoding="utf-8"?>
<
Relative
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/activity_main"
android:id=
"@+id/activity_main
_lyt
"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/fulton_bg"
android:orientation=
"vertical"
>
<android.support.v7.widget.Toolbar
android:id=
"@+id/tool_bar_view"
...
...
@@ -138,4 +137,4 @@
</RelativeLayout>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/adal_main.xml
View file @
43319b33
...
...
@@ -5,7 +5,6 @@
android:id=
"@+id/activity_main"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@drawable/fulton_bg"
android:orientation=
"vertical"
tools:context=
"com.vsoft.vera.ui.ADALActivity"
>
<android.support.v7.widget.Toolbar
...
...
@@ -50,13 +49,12 @@
android:visibility=
"gone"
/>
<ImageView
android:id=
"@+id/logo_banner"
android:layout_width=
"
wrap_content
"
android:layout_height=
"
wrap_content
"
android:layout_width=
"
200dp
"
android:layout_height=
"
270dp
"
android:visibility=
"visible"
android:layout_marginTop=
"50dp"
android:alpha=
"0.8"
android:layout_marginTop=
"30dp"
android:layout_gravity=
"center_horizontal"
android:background=
"@drawable/fulton_app_logo"
/>
/>
<Button
android:id=
"@+id/callGraph"
...
...
app/src/main/res/layout/home_screen.xml
View file @
43319b33
...
...
@@ -3,7 +3,7 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:
background=
"@drawable/fulton_bg
"
android:
id=
"@+id/home_main_activity
"
android:orientation=
"vertical"
>
<android.support.v7.widget.Toolbar
...
...
app/src/vportal/res/layout/splash_screen.xml
View file @
43319b33
<?xml version="1.0" encoding="utf-8"?>
<
Frame
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
Linear
Layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/splash_main_lyt"
android:layout_gravity=
"center"
android:background=
"@drawable/fulton_splash_screen"
android:orientation=
"vertical"
>
<ImageView
android:layout_gravity=
"center"
android:layout_width=
"200dp"
android:layout_height=
"150dp"
android:visibility=
"gone"
android:background=
"@drawable/fulton_splash_screen"
/>
</FrameLayout>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
app/vportal/staging/app-vportal-staging.apk
View file @
43319b33
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