Commit 84dff289 by Simhachalam ch

Merge branch 'fulton_county_demo' of…

Merge branch 'fulton_county_demo' of https://gitlab.vsoftconsulting.com/kvemulavada/vera_2.1_app into fulton_county_demo
parents 8dc6fa57 43319b33
......@@ -32,6 +32,7 @@ public class OtpApiManager {
otpPostData.setPhone_number(mobileNumber);
otpPostData.setVia("sms");
otpPostData.setCountry_code(Constants.TWILIO_COUNTRY_CODE);
otpPostData.setLn("en");
Call<ResponseBody> call = retrofit.create(OtpApi.class).getOtp(otpPostData);
......@@ -100,6 +101,7 @@ public class OtpApiManager {
Call<ResponseBody> call = retrofit.create(OtpApi.class).validateOtp(mobileNumber,Constants.TWILIO_COUNTRY_CODE,verificationCode,"en");
try {
//Retrofit synchronous call
Response<ResponseBody> response = call.execute();
......
......@@ -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();
......
......@@ -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);
......
......@@ -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>{
......
......@@ -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();
}
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout 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
......@@ -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"
......
......@@ -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
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout 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
The file could not be displayed because it is too large.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment