Commit 42df940d by HABI SHAIK

resolved dependency issue and added alert instead of toast in login screen

parent e1d947da
...@@ -124,6 +124,7 @@ dependencies { ...@@ -124,6 +124,7 @@ dependencies {
implementation ('com.google.firebase:firebase-messaging:15.0.2') { implementation ('com.google.firebase:firebase-messaging:15.0.2') {
exclude group: 'com.google.firebase', module: 'firebase-iid' exclude group: 'com.google.firebase', module: 'firebase-iid'
} }
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.android.support.constraint:constraint-layout:1.1.3'
......
...@@ -269,12 +269,12 @@ public class LoginScreen extends Activity { ...@@ -269,12 +269,12 @@ public class LoginScreen extends Activity {
} }
finish(); finish();
} else { } else {
Toast.makeText(LoginScreen.this, R.string.user_detail_not_available, Toast.LENGTH_LONG).show(); Util.simpleAlert(LoginScreen.this,getResources().getString(R.string.user_detail_not_available));
} }
} else if (syncStatus == API_FAIL_USER_LOGIN) { } else if (syncStatus == API_FAIL_USER_LOGIN) {
Toast.makeText(LoginScreen.this, R.string.login_screen_invalid_username_and_password_string, Toast.LENGTH_LONG).show(); Util.simpleAlert(LoginScreen.this,getResources().getString(R.string.login_screen_invalid_username_and_password_string));
} else if (syncStatus == API_FAIL_USER_DETAIL) { } else if (syncStatus == API_FAIL_USER_DETAIL) {
Toast.makeText(LoginScreen.this, R.string.failed_to_fetch_user_detail_string, Toast.LENGTH_LONG).show(); Util.simpleAlert(LoginScreen.this,getResources().getString(R.string.failed_to_fetch_user_detail_string));
} }
} }
} }
......
package com.vsoft.servicenow.utils; package com.vsoft.servicenow.utils;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface;
import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.media.AudioManager; import android.media.AudioManager;
...@@ -8,6 +9,7 @@ import android.media.MediaPlayer; ...@@ -8,6 +9,7 @@ import android.media.MediaPlayer;
import android.media.RingtoneManager; import android.media.RingtoneManager;
import android.net.Uri; import android.net.Uri;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.text.Html; import android.text.Html;
import android.text.InputType; import android.text.InputType;
import android.text.Spanned; import android.text.Spanned;
...@@ -922,6 +924,19 @@ public class Util { ...@@ -922,6 +924,19 @@ public class Util {
return textView; return textView;
} }
public static void simpleAlert(Context context,String msg) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setMessage(msg)
.setCancelable(false)
.setPositiveButton(R.string.ok_string, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
public static String getDefaultDate() { public static String getDefaultDate() {
Calendar c = Calendar.getInstance(); Calendar c = Calendar.getInstance();
SimpleDateFormat df = new SimpleDateFormat("dd MMM, yyyy"); SimpleDateFormat df = new SimpleDateFormat("dd MMM, yyyy");
......
...@@ -8,9 +8,9 @@ buildscript { ...@@ -8,9 +8,9 @@ buildscript {
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.1.2' classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.1.0' classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
......
#Mon Apr 30 19:16:01 IST 2018 #Wed Jan 09 12:34:55 IST 2019
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
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