logout issue reslove

parent 0b9ca7bc
......@@ -72,7 +72,7 @@ android {
vportal {
applicationId "com.vsoft.vera.vportal"
versionCode 1
versionName "0.1.4"
versionName "0.1.5"
}
}
}
......
......@@ -83,6 +83,7 @@ public class ADALActivity extends AppCompatActivity {
private static final int API_SUCCESS_USER_DETAIL = 3;
private static final int API_FAIL_USER_DETAIL = 4;
private List<UserApiValues> mUserDetails;
private ProgressDialog mProgressDlg;
/* Azure AD Constants */
/* Authority is in the form of https://login.microsoftonline.com/yourtenant.onmicrosoft.com */
......@@ -140,6 +141,7 @@ public class ADALActivity extends AppCompatActivity {
setContentView(R.layout.adal_main);
mainLayt = (LinearLayout) findViewById(R.id.activity_main);
logo_banner = findViewById(R.id.logo_banner);
Glide.with(this).load(R.drawable.fulton_bg).into(new SimpleTarget<Drawable>() {
@Override
public void onResourceReady(Drawable resource, Transition<? super Drawable> transition) {
......@@ -162,14 +164,16 @@ public class ADALActivity extends AppCompatActivity {
callGraphButton = (Button) findViewById(R.id.callGraph);
signOutButton = (Button) findViewById(R.id.clearCache);
login_with_otp = (Button) findViewById(R.id.login_with_otp);
logo_banner = findViewById(R.id.logo_banner);
callGraphButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (NetworkConnectivity.haveNetworkConnection(ADALActivity.this)) {
onCallGraphClicked();
} else {
DialogUtils.showNoConnectionDialog(ADALActivity .this);
}
......@@ -275,6 +279,12 @@ public class ADALActivity extends AppCompatActivity {
}
private void callGraphAPI() {
mProgressDlg = new ProgressDialog(ADALActivity.this);
mProgressDlg.setMessage(getString(R.string.loading_string));
mProgressDlg.show();
mProgressDlg.setCancelable(false);
Log.d(TAG, "Starting volley request to graph");
/* Make sure we have a token to send to graph */
......@@ -292,6 +302,7 @@ public class ADALActivity extends AppCompatActivity {
parameters,new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
mProgressDlg.dismiss();
/* Successfully called graph, process data and send to UI */
Log.d(TAG, "Response: " + response.toString());
JSONObject root = null;
......@@ -315,6 +326,7 @@ public class ADALActivity extends AppCompatActivity {
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
mProgressDlg.dismiss();
Log.d(TAG, "Error: " + error.toString());
}
}) {
......@@ -361,10 +373,8 @@ public class ADALActivity extends AppCompatActivity {
private void updateSuccessUI() {
// Called on success from /me endpoint
// Removed call Graph API button and paint Sign out
callGraphButton.setVisibility(View.GONE);
signOutButton.setVisibility(View.GONE);
login_with_otp.setVisibility(View.GONE);
logo_banner.setVisibility(View.GONE);
findViewById(R.id.welcome).setVisibility(View.GONE);
((TextView) findViewById(R.id.welcome)).setText("Welcome, " +
mAuthResult.getUserInfo().getGivenName());
......@@ -412,10 +422,9 @@ 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;
......
......@@ -11,8 +11,10 @@ import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
......@@ -43,9 +45,12 @@ import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
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.github.nkzawa.emitter.Emitter;
import com.github.nkzawa.socketio.client.Socket;
import com.vsoft.vera.CatalogueApplication;
......@@ -174,6 +179,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
private static final String HTTPS = "https://";
private static final String HTTP = "http://";
private LinearLayout mainLayt;
@Override
......@@ -181,6 +187,15 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
super.onCreate(savedInstanceState);
setContentView(R.layout.chat_activity);
mainLayt = (LinearLayout) findViewById(R.id.chat_activity_main);
Glide.with(this).load(R.drawable.chat_back_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);
}
}
});
mLoggedInUserSysId = PrefManager.getSharedPref(this, PrefManager.PREFERENCE_USER_SYS_ID);
mLoggedInUsername = PrefManager.getSharedPref(this, PrefManager.PREFERENCE_USER_FIRST_NAME);
......
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main_login"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbarStyle="insideOverlay">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="@dimen/normal_margin"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
android:background="@drawable/ic_login_banner" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="100dp"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/login_with_sso"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/normal_margin"
android:layout_marginLeft="@dimen/extra_large_margin"
android:layout_marginRight="@dimen/extra_large_margin"
android:layout_marginTop="30dp"
android:background="@drawable/login_bg"
android:gravity="center"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:text="Login with ADAL"
android:textColor="@android:color/white"
android:textSize="@dimen/large_text_size" />
<TextView
android:id="@+id/login_with_otp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/normal_margin"
android:layout_marginLeft="@dimen/extra_large_margin"
android:layout_marginRight="@dimen/extra_large_margin"
android:layout_marginTop="30dp"
android:background="@drawable/login_bg"
android:gravity="center"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:text="Login with otp"
android:textColor="@android:color/white"
android:textSize="@dimen/large_text_size" />
</LinearLayout>
</LinearLayout>
</ScrollView>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
......@@ -2,8 +2,8 @@
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/LightBackgroundStyle"
android:id="@+id/chat_activity_main"
android:layout_width="match_parent"
android:background="@drawable/chat_back_bg"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.ChatActivity">
......
The file could not be displayed because it is too large.
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"0.1.4","enabled":true,"outputFile":"app-vportal-staging.apk","fullName":"vportalStaging","baseName":"vportal-staging"},"path":"app-vportal-staging.apk","properties":{}}]
\ No newline at end of file
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"0.1.5","enabled":true,"outputFile":"app-vportal-staging.apk","fullName":"vportalStaging","baseName":"vportal-staging"},"path":"app-vportal-staging.apk","properties":{}}]
\ No newline at end of file
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