vera 2.1 stable build for demo

parent bf298ac3
Showing with 1592 additions and 112 deletions
...@@ -33,11 +33,10 @@ android { ...@@ -33,11 +33,10 @@ android {
} }
compileSdkVersion 27 compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig { defaultConfig {
applicationId "com.vsoft.servicenow" applicationId "com.vsoft.servicenow"
minSdkVersion 15 minSdkVersion 21
targetSdkVersion 27 targetSdkVersion 27
versionCode 1 versionCode 1
versionName "0.0.1" versionName "0.0.1"
...@@ -125,8 +124,12 @@ dependencies { ...@@ -125,8 +124,12 @@ dependencies {
exclude group: 'com.google.firebase', module: 'firebase-iid' exclude group: 'com.google.firebase', module: 'firebase-iid'
} }
implementation 'com.google.firebase:firebase-core:16.0.9' implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.wang.avi:library:2.1.3'
implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.quickbirdstudios:opencv:4.1.0'
//static Reports Screen //static Reports Screen
implementation 'com.numetriclabz.numandroidcharts:numandroidcharts:1.0.9' implementation 'com.numetriclabz.numandroidcharts:numandroidcharts:1.0.9'
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!--Home Screen--> <!--home Screen-->
<dimen name="home_screen_image_height">150dp</dimen> <dimen name="home_screen_image_height">150dp</dimen>
<dimen name="splash_screen_logo_margin">20dp</dimen> <dimen name="splash_screen_logo_margin">20dp</dimen>
......
<resources> <resources>
<string name="app_name">Arrow</string> <string name="app_name">Arrow</string>
<!--Home Screen Option--> <!--home Screen Option-->
<!--Start--> <!--Start-->
<string name="home_screen_report_incident_title">Report Incident</string> <string name="home_screen_report_incident_title">Report Incident</string>
<string name="home_screen_report_incident_icon">report_incident</string> <string name="home_screen_report_incident_icon">report_incident</string>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!--Home Screen--> <!--home Screen-->
<dimen name="home_screen_image_height">150dp</dimen> <dimen name="home_screen_image_height">150dp</dimen>
</resources> </resources>
\ No newline at end of file
<resources> <resources>
<string name="app_name">Citrix ServiceNow</string> <string name="app_name">Citrix ServiceNow</string>
<!--Home Screen Option--> <!--home Screen Option-->
<!--Start--> <!--Start-->
<string name="home_screen_report_incident_title">Report Incident</string> <string name="home_screen_report_incident_title">Report Incident</string>
<string name="home_screen_report_incident_icon">report_incident</string> <string name="home_screen_report_incident_icon">report_incident</string>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!--Home Screen--> <!--home Screen-->
<dimen name="home_screen_image_height">150dp</dimen> <dimen name="home_screen_image_height">150dp</dimen>
<dimen name="splash_screen_logo_margin">20dp</dimen> <dimen name="splash_screen_logo_margin">20dp</dimen>
......
<resources> <resources>
<string name="app_name">GE Appliances</string> <string name="app_name">GE Appliances</string>
<!--Home Screen Option--> <!--home Screen Option-->
<!--Start--> <!--Start-->
<string name="home_screen_report_incident_title">Report Incident</string> <string name="home_screen_report_incident_title">Report Incident</string>
<string name="home_screen_report_incident_icon">report_incident</string> <string name="home_screen_report_incident_icon">report_incident</string>
......
...@@ -8,6 +8,13 @@ ...@@ -8,6 +8,13 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-feature
android:name="android.hardware.camera"
android:required="true" />
<uses-permission android:name="android.permission.CAMERA" />
<application <application
android:name="com.vsoft.servicenow.CatalogueApplication" android:name="com.vsoft.servicenow.CatalogueApplication"
android:allowBackup="false" android:allowBackup="false"
...@@ -57,9 +64,20 @@ ...@@ -57,9 +64,20 @@
<activity <activity
android:name="com.vsoft.servicenow.ui.MyIncidentScreen" android:name="com.vsoft.servicenow.ui.MyIncidentScreen"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity android:name=".ui.InAppWebViewActivity"/>
<service android:name=".service.SyncService" /> <service android:name=".service.SyncService" />
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
<meta-data <meta-data
android:name="io.fabric.ApiKey" android:name="io.fabric.ApiKey"
android:value="2b0a6e9db28d607fbcf71b8b25f1a0795e3f5b22" /> android:value="2b0a6e9db28d607fbcf71b8b25f1a0795e3f5b22" />
......
...@@ -14,6 +14,8 @@ import android.util.Log; ...@@ -14,6 +14,8 @@ import android.util.Log;
import android.widget.Toast; import android.widget.Toast;
import com.crashlytics.android.Crashlytics; import com.crashlytics.android.Crashlytics;
import com.github.nkzawa.engineio.client.transports.Polling;
import com.github.nkzawa.engineio.client.transports.WebSocket;
import com.github.nkzawa.socketio.client.IO; import com.github.nkzawa.socketio.client.IO;
import com.github.nkzawa.socketio.client.Socket; import com.github.nkzawa.socketio.client.Socket;
import com.google.android.gms.analytics.GoogleAnalytics; import com.google.android.gms.analytics.GoogleAnalytics;
...@@ -143,9 +145,15 @@ public class CatalogueApplication extends MultiDexApplication { ...@@ -143,9 +145,15 @@ public class CatalogueApplication extends MultiDexApplication {
return netInfo != null && netInfo.isConnected(); return netInfo != null && netInfo.isConnected();
} }
public void initializeSocket() { public void initializeSocket() {
try { try {
mSocket = IO.socket(Constants.CHAT_SERVER_URL); IO.Options options = new IO.Options();
options.forceNew = true;
options.reconnection = true;
options.transports = new String[]{Polling.NAME, WebSocket.NAME};
options.upgrade = true;
mSocket = IO.socket(Constants.CHAT_SERVER_URL,options);
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
......
...@@ -155,6 +155,7 @@ public interface DBConstants { ...@@ -155,6 +155,7 @@ public interface DBConstants {
String INCIDENT_NUMBER = "number"; String INCIDENT_NUMBER = "number";
String INCIDENT_SHORT_DESCRIPTION = "short_description"; String INCIDENT_SHORT_DESCRIPTION = "short_description";
String INCIDENT_OPENED_AT = "opened_at"; String INCIDENT_OPENED_AT = "opened_at";
String INCIDENT_SYS_ID = "sys_id";
String INCIDENT_IMPACT = "impact"; String INCIDENT_IMPACT = "impact";
String INCIDENT_SYNC_DIRTY = SYNC_DIRTY; String INCIDENT_SYNC_DIRTY = SYNC_DIRTY;
...@@ -165,10 +166,12 @@ public interface DBConstants { ...@@ -165,10 +166,12 @@ public interface DBConstants {
int INDEX_INCIDENT_NUMBER = 1; int INDEX_INCIDENT_NUMBER = 1;
int INDEX_INCIDENT_SHORT_DESCRIPTION = 2; int INDEX_INCIDENT_SHORT_DESCRIPTION = 2;
int INDEX_INCIDENT_OPENED_AT = 3; int INDEX_INCIDENT_OPENED_AT = 3;
int INDEX_INCIDENT_IMPACT = 4; int INDEX_INCIDENT_SYS_ID = 4;
int INDEX_INCIDENT_SYNC_DIRTY = 5; int INDEX_INCIDENT_IMPACT = 5;
int INCIDENT_COLUMN_COUNT = 6; int INDEX_INCIDENT_SYNC_DIRTY = 6;
int INCIDENT_COLUMN_COUNT = 7;
/** /**
* MyRequest table * MyRequest table
...@@ -386,6 +389,7 @@ public interface DBConstants { ...@@ -386,6 +389,7 @@ public interface DBConstants {
String CHAT_BOT_HISTORY_ID = ID; String CHAT_BOT_HISTORY_ID = ID;
String CHAT_BOT_HISTORY_USER_ID = "user_id"; String CHAT_BOT_HISTORY_USER_ID = "user_id";
String CHAT_BOT_HISTORY_MESSAGE = "message"; String CHAT_BOT_HISTORY_MESSAGE = "message";
String CHAT_BOT_HISTORY_IMAGE = "image";
String CHAT_BOT_HISTORY_TIME_STAMP = "timestamp"; String CHAT_BOT_HISTORY_TIME_STAMP = "timestamp";
/** /**
...@@ -394,11 +398,12 @@ public interface DBConstants { ...@@ -394,11 +398,12 @@ public interface DBConstants {
int INDEX_CHAT_BOT_HISTORY_ID = 0; int INDEX_CHAT_BOT_HISTORY_ID = 0;
int INDEX_CHAT_BOT_HISTORY_USER_ID = 1; int INDEX_CHAT_BOT_HISTORY_USER_ID = 1;
int INDEX_CHAT_BOT_HISTORY_MESSAGE = 2; int INDEX_CHAT_BOT_HISTORY_MESSAGE = 2;
int INDEX_CHAT_BOT_HISTORY_TIME_STAMP = 3; int INDEX_CHAT_BOT_HISTORY_IMAGE = 3;
int INDEX_CHAT_BOT_HISTORY_TIME_STAMP = 4;
/** /**
* CHAT_BOT_HISTORY_COLUMN_COUNT: Total column count for chatbot table. * CHAT_BOT_HISTORY_COLUMN_COUNT: Total column count for chatbot table.
*/ */
int CHAT_BOT_HISTORY_COLUMN_COUNT = 4; int CHAT_BOT_HISTORY_COLUMN_COUNT = 5;
/** /**
* ChatBot User table * ChatBot User table
......
...@@ -135,6 +135,7 @@ public class DBManager extends SQLiteOpenHelper implements DBConstants { ...@@ -135,6 +135,7 @@ public class DBManager extends SQLiteOpenHelper implements DBConstants {
+ INCIDENT_NUMBER + " text, " + INCIDENT_NUMBER + " text, "
+ INCIDENT_SHORT_DESCRIPTION + " text, " + INCIDENT_SHORT_DESCRIPTION + " text, "
+ INCIDENT_OPENED_AT + " real, " + INCIDENT_OPENED_AT + " real, "
+ INCIDENT_SYS_ID + " text, "
+ INCIDENT_IMPACT + " integer, " + INCIDENT_IMPACT + " integer, "
+ INCIDENT_SYNC_DIRTY + " integer default " + SYNC_FLAG_NONE + ");"); + INCIDENT_SYNC_DIRTY + " integer default " + SYNC_FLAG_NONE + ");");
} }
...@@ -239,6 +240,7 @@ public class DBManager extends SQLiteOpenHelper implements DBConstants { ...@@ -239,6 +240,7 @@ public class DBManager extends SQLiteOpenHelper implements DBConstants {
+ CHAT_BOT_HISTORY_ID + " integer primary key autoincrement, " + CHAT_BOT_HISTORY_ID + " integer primary key autoincrement, "
+ CHAT_BOT_HISTORY_USER_ID + " integer, " + CHAT_BOT_HISTORY_USER_ID + " integer, "
+ CHAT_BOT_HISTORY_MESSAGE + " text, " + CHAT_BOT_HISTORY_MESSAGE + " text, "
+ CHAT_BOT_HISTORY_IMAGE + " text, "
+ CHAT_BOT_HISTORY_TIME_STAMP + " real" + CHAT_BOT_HISTORY_TIME_STAMP + " real"
+ ");"); + ");");
} }
......
...@@ -28,14 +28,16 @@ public class ChatBotHistoryManager implements DBConstants { ...@@ -28,14 +28,16 @@ public class ChatBotHistoryManager implements DBConstants {
} }
} }
public static int delete(ChatBotHistory chatBotHistory) { public static int delete() {
SQLiteDatabase db = CatalogueApplication.getDatabase(); SQLiteDatabase db = CatalogueApplication.getDatabase();
if (db != null) { if (db != null) {
return db.delete(TABLE_CHAT_BOT_HISTORY, CHAT_BOT_HISTORY_ID + "=" + chatBotHistory.getId(), null); return db.delete(TABLE_CHAT_BOT_HISTORY, null, null);
} }
return -1; return -1;
} }
public static int update(ChatBotHistory chatBotHistory) { public static int update(ChatBotHistory chatBotHistory) {
return update(chatBotHistory, null); return update(chatBotHistory, null);
} }
...@@ -53,6 +55,8 @@ public class ChatBotHistoryManager implements DBConstants { ...@@ -53,6 +55,8 @@ public class ChatBotHistoryManager implements DBConstants {
contentValues.put(CHAT_BOT_HISTORY_USER_ID, chatBotHistory.getUserId()); contentValues.put(CHAT_BOT_HISTORY_USER_ID, chatBotHistory.getUserId());
} else if (CHAT_BOT_HISTORY_MESSAGE.equals(columnName)) { } else if (CHAT_BOT_HISTORY_MESSAGE.equals(columnName)) {
contentValues.put(CHAT_BOT_HISTORY_MESSAGE, chatBotHistory.getMessage()); contentValues.put(CHAT_BOT_HISTORY_MESSAGE, chatBotHistory.getMessage());
} else if (CHAT_BOT_HISTORY_IMAGE.equals(columnName)) {
contentValues.put(CHAT_BOT_HISTORY_IMAGE, chatBotHistory.getImagUrl());
} else if (CHAT_BOT_HISTORY_TIME_STAMP.equals(columnName)) { } else if (CHAT_BOT_HISTORY_TIME_STAMP.equals(columnName)) {
contentValues.put(CHAT_BOT_HISTORY_TIME_STAMP, chatBotHistory.getTimestamp()); contentValues.put(CHAT_BOT_HISTORY_TIME_STAMP, chatBotHistory.getTimestamp());
} }
...@@ -106,6 +110,7 @@ public class ChatBotHistoryManager implements DBConstants { ...@@ -106,6 +110,7 @@ public class ChatBotHistoryManager implements DBConstants {
builder.setId(c.getLong(INDEX_CHAT_BOT_HISTORY_ID)); builder.setId(c.getLong(INDEX_CHAT_BOT_HISTORY_ID));
builder.setUserId(c.getInt(INDEX_CHAT_BOT_HISTORY_USER_ID)); builder.setUserId(c.getInt(INDEX_CHAT_BOT_HISTORY_USER_ID));
builder.setMessage(c.getString(INDEX_CHAT_BOT_HISTORY_MESSAGE)); builder.setMessage(c.getString(INDEX_CHAT_BOT_HISTORY_MESSAGE));
builder.setImagUrl(c.getString(INDEX_CHAT_BOT_HISTORY_IMAGE));
builder.setTimestamp(c.getLong(INDEX_CHAT_BOT_HISTORY_TIME_STAMP)); builder.setTimestamp(c.getLong(INDEX_CHAT_BOT_HISTORY_TIME_STAMP));
} }
...@@ -113,6 +118,7 @@ public class ChatBotHistoryManager implements DBConstants { ...@@ -113,6 +118,7 @@ public class ChatBotHistoryManager implements DBConstants {
ContentValues cv = new ContentValues(CHAT_BOT_HISTORY_COLUMN_COUNT - 1); ContentValues cv = new ContentValues(CHAT_BOT_HISTORY_COLUMN_COUNT - 1);
cv.put(CHAT_BOT_HISTORY_USER_ID, chatBotHistory.getUserId()); cv.put(CHAT_BOT_HISTORY_USER_ID, chatBotHistory.getUserId());
cv.put(CHAT_BOT_HISTORY_MESSAGE, chatBotHistory.getMessage()); cv.put(CHAT_BOT_HISTORY_MESSAGE, chatBotHistory.getMessage());
cv.put(CHAT_BOT_HISTORY_IMAGE, chatBotHistory.getImagUrl());
cv.put(CHAT_BOT_HISTORY_TIME_STAMP, chatBotHistory.getTimestamp()); cv.put(CHAT_BOT_HISTORY_TIME_STAMP, chatBotHistory.getTimestamp());
return cv; return cv;
} }
......
...@@ -64,7 +64,9 @@ public class MyIncidentsManager implements DBConstants { ...@@ -64,7 +64,9 @@ public class MyIncidentsManager implements DBConstants {
contentValues.put(INCIDENT_SHORT_DESCRIPTION, incident.getShortDescription()); contentValues.put(INCIDENT_SHORT_DESCRIPTION, incident.getShortDescription());
} else if (INCIDENT_OPENED_AT.equals(columnName)) { } else if (INCIDENT_OPENED_AT.equals(columnName)) {
contentValues.put(INCIDENT_OPENED_AT, incident.getOpenedAt()); contentValues.put(INCIDENT_OPENED_AT, incident.getOpenedAt());
} else if (INCIDENT_IMPACT.equals(columnName)) { } else if (INCIDENT_SYS_ID.equals(columnName)) {
contentValues.put(INCIDENT_SYS_ID, incident.getIncedintSysId());
}else if (INCIDENT_IMPACT.equals(columnName)) {
contentValues.put(INCIDENT_IMPACT, Impact.getId(incident.getImpact())); contentValues.put(INCIDENT_IMPACT, Impact.getId(incident.getImpact()));
} }
} }
...@@ -199,6 +201,7 @@ public class MyIncidentsManager implements DBConstants { ...@@ -199,6 +201,7 @@ public class MyIncidentsManager implements DBConstants {
builder.setNumber(c.getString(INDEX_INCIDENT_NUMBER)); builder.setNumber(c.getString(INDEX_INCIDENT_NUMBER));
builder.setShortDescription(c.getString(INDEX_INCIDENT_SHORT_DESCRIPTION)); builder.setShortDescription(c.getString(INDEX_INCIDENT_SHORT_DESCRIPTION));
builder.setOpenedAt(c.getLong(INDEX_INCIDENT_OPENED_AT)); builder.setOpenedAt(c.getLong(INDEX_INCIDENT_OPENED_AT));
builder.setIncedintSysId(c.getString(INDEX_INCIDENT_SYS_ID));
builder.setImpact(Impact.from(c.getInt(INDEX_INCIDENT_IMPACT))); builder.setImpact(Impact.from(c.getInt(INDEX_INCIDENT_IMPACT)));
builder.setSyncDirty(c.getInt(INDEX_INCIDENT_SYNC_DIRTY)); builder.setSyncDirty(c.getInt(INDEX_INCIDENT_SYNC_DIRTY));
} }
...@@ -208,6 +211,7 @@ public class MyIncidentsManager implements DBConstants { ...@@ -208,6 +211,7 @@ public class MyIncidentsManager implements DBConstants {
cv.put(INCIDENT_NUMBER, incident.getNumber()); cv.put(INCIDENT_NUMBER, incident.getNumber());
cv.put(INCIDENT_SHORT_DESCRIPTION, incident.getShortDescription()); cv.put(INCIDENT_SHORT_DESCRIPTION, incident.getShortDescription());
cv.put(INCIDENT_OPENED_AT, incident.getOpenedAt()); cv.put(INCIDENT_OPENED_AT, incident.getOpenedAt());
cv.put(INCIDENT_SYS_ID, incident.getIncedintSysId());
cv.put(INCIDENT_IMPACT, Impact.getId(incident.getImpact())); cv.put(INCIDENT_IMPACT, Impact.getId(incident.getImpact()));
cv.put(INCIDENT_SYNC_DIRTY, incident.getSyncDirty()); cv.put(INCIDENT_SYNC_DIRTY, incident.getSyncDirty());
return cv; return cv;
......
...@@ -9,6 +9,7 @@ public class ChatBotHistory { ...@@ -9,6 +9,7 @@ public class ChatBotHistory {
private long userId; private long userId;
private String message; private String message;
private long timestamp; private long timestamp;
private String imagUrl;
private String userName; private String userName;
public long getId() { public long getId() {
...@@ -18,6 +19,14 @@ public class ChatBotHistory { ...@@ -18,6 +19,14 @@ public class ChatBotHistory {
public void setId(long id) { public void setId(long id) {
this.id = id; this.id = id;
} }
public String getImagUrl() {
return imagUrl;
}
public void setImagUrl(String imagUrl) {
this.imagUrl = imagUrl;
}
public long getUserId() { public long getUserId() {
return userId; return userId;
...@@ -57,6 +66,7 @@ public class ChatBotHistory { ...@@ -57,6 +66,7 @@ public class ChatBotHistory {
private String userName; private String userName;
private String message; private String message;
private long timestamp; private long timestamp;
private String imagUrl;
private ChatBotBuilder() { private ChatBotBuilder() {
} }
...@@ -69,7 +79,10 @@ public class ChatBotHistory { ...@@ -69,7 +79,10 @@ public class ChatBotHistory {
id = val; id = val;
return this; return this;
} }
public ChatBotBuilder setImagUrl(String imagUrl) {
this.imagUrl = imagUrl;
return this;
}
public ChatBotBuilder setUserId(long val) { public ChatBotBuilder setUserId(long val) {
userId = val; userId = val;
return this; return this;
...@@ -101,6 +114,7 @@ public class ChatBotHistory { ...@@ -101,6 +114,7 @@ public class ChatBotHistory {
chatBotHistory.setUserName(userName); chatBotHistory.setUserName(userName);
chatBotHistory.setMessage(message); chatBotHistory.setMessage(message);
chatBotHistory.setTimestamp(timestamp); chatBotHistory.setTimestamp(timestamp);
chatBotHistory.setImagUrl(imagUrl);
return chatBotHistory; return chatBotHistory;
} }
} }
...@@ -112,6 +126,7 @@ public class ChatBotHistory { ...@@ -112,6 +126,7 @@ public class ChatBotHistory {
", userId=" + userId + ", userId=" + userId +
", message='" + message + '\'' + ", message='" + message + '\'' +
", timestamp=" + timestamp + ", timestamp=" + timestamp +
", imageURL="+ imagUrl+
'}'; '}';
} }
} }
...@@ -16,9 +16,14 @@ public class Incident { ...@@ -16,9 +16,14 @@ public class Incident {
@SerializedName("number") @SerializedName("number")
@Expose @Expose
private String number; private String number;
@SerializedName("short_description") @SerializedName("short_description")
@Expose @Expose
private String shortDescription; private String shortDescription;
@SerializedName("sys_id")
@Expose
private String IncedintSysId;
@SerializedName("opened_at") @SerializedName("opened_at")
// @Expose // @Expose
private long openedAt; private long openedAt;
...@@ -26,6 +31,7 @@ public class Incident { ...@@ -26,6 +31,7 @@ public class Incident {
// @Expose // @Expose
private Impact impact; private Impact impact;
private int syncDirty; private int syncDirty;
public long getId() { public long getId() {
...@@ -60,6 +66,14 @@ public class Incident { ...@@ -60,6 +66,14 @@ public class Incident {
this.shortDescription = shortDescription; this.shortDescription = shortDescription;
} }
public void setIncedintSysId(String incedintSysId) {
IncedintSysId = incedintSysId;
}
public String getIncedintSysId() {
return IncedintSysId;
}
public String getNumber() { public String getNumber() {
return number; return number;
} }
...@@ -109,8 +123,11 @@ public class Incident { ...@@ -109,8 +123,11 @@ public class Incident {
private long openedAt; private long openedAt;
// @Expose // @Expose
private Impact impact; private Impact impact;
private String IncedintSysId;
private int syncDirty; private int syncDirty;
private IncidentBuilder() { private IncidentBuilder() {
} }
...@@ -142,14 +159,17 @@ public class Incident { ...@@ -142,14 +159,17 @@ public class Incident {
this.impact = impact; this.impact = impact;
return this; return this;
} }
public IncidentBuilder setIncedintSysId(String incedintSysId) {
this.IncedintSysId = incedintSysId;
return this;
}
public IncidentBuilder setSyncDirty(int syncDirty) { public IncidentBuilder setSyncDirty(int syncDirty) {
this.syncDirty = syncDirty; this.syncDirty = syncDirty;
return this; return this;
} }
public IncidentBuilder but() { public IncidentBuilder but() {
return anIncident().setId(id).setNumber(number).setShortDescription(shortDescription).setOpenedAt(openedAt).setImpact(impact).setSyncDirty(syncDirty); return anIncident().setId(id).setNumber(number).setShortDescription(shortDescription).setOpenedAt(openedAt).setIncedintSysId(IncedintSysId).setImpact(impact).setSyncDirty(syncDirty);
} }
public Incident build() { public Incident build() {
...@@ -158,6 +178,7 @@ public class Incident { ...@@ -158,6 +178,7 @@ public class Incident {
incident.setNumber(number); incident.setNumber(number);
incident.setShortDescription(shortDescription); incident.setShortDescription(shortDescription);
incident.setOpenedAt(openedAt); incident.setOpenedAt(openedAt);
incident.setIncedintSysId(IncedintSysId);
incident.setImpact(impact); incident.setImpact(impact);
incident.setSyncDirty(syncDirty); incident.setSyncDirty(syncDirty);
return incident; return incident;
...@@ -165,11 +186,13 @@ public class Incident { ...@@ -165,11 +186,13 @@ public class Incident {
} }
public static class Json { public static class Json {
public static final String INCIDENT_SYS_ID = "sys_id";
public static final String IMPACT = "impact"; public static final String IMPACT = "impact";
public static final String OPENED_AT = "opened_at"; public static final String OPENED_AT = "opened_at";
public static final String SHORT_DESCRIPTION = "short_description"; public static final String SHORT_DESCRIPTION = "short_description";
public static final String CALLER_ID = "caller_id"; public static final String CALLER_ID = "caller_id";
public static final String NUMBER = "number"; public static final String NUMBER = "number";
} }
@Override @Override
...@@ -179,6 +202,7 @@ public class Incident { ...@@ -179,6 +202,7 @@ public class Incident {
", number='" + number + '\'' + ", number='" + number + '\'' +
", shortDescription='" + shortDescription + '\'' + ", shortDescription='" + shortDescription + '\'' +
", openedAt=" + openedAt + ", openedAt=" + openedAt +
", SysId=" + IncedintSysId +
", impact=" + impact + ", impact=" + impact +
", syncDirty=" + syncDirty + ", syncDirty=" + syncDirty +
'}'; '}';
......
...@@ -259,6 +259,8 @@ public class SyncService extends IntentService { ...@@ -259,6 +259,8 @@ public class SyncService extends IntentService {
incidentJsonObject.put(Incident.Json.SHORT_DESCRIPTION, incident.getShortDescription()); incidentJsonObject.put(Incident.Json.SHORT_DESCRIPTION, incident.getShortDescription());
incidentJsonObject.put(Incident.Json.OPENED_AT, userSysId); incidentJsonObject.put(Incident.Json.OPENED_AT, userSysId);
incidentJsonObject.put(Incident.Json.CALLER_ID, userSysId); incidentJsonObject.put(Incident.Json.CALLER_ID, userSysId);
incidentJsonObject.put(Incident.Json.INCIDENT_SYS_ID, incident.getIncedintSysId());
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -45,9 +45,7 @@ public class HomeScreen extends HandleNotificationActivity { ...@@ -45,9 +45,7 @@ public class HomeScreen extends HandleNotificationActivity {
setContentView(R.layout.home_screen); setContentView(R.layout.home_screen);
ButterKnife.bind(this); ButterKnife.bind(this);
CatalogueApplication application = (CatalogueApplication) getApplication(); CatalogueApplication application = (CatalogueApplication) getApplication();
Tracker tracker = application.getDefaultTracker(); Tracker tracker = application.getDefaultTracker();
// Send initial screen view hit. // Send initial screen view hit.
Util.sendScreenName(tracker, getString(R.string.home_screen_string)); Util.sendScreenName(tracker, getString(R.string.home_screen_string));
...@@ -164,6 +162,7 @@ public class HomeScreen extends HandleNotificationActivity { ...@@ -164,6 +162,7 @@ public class HomeScreen extends HandleNotificationActivity {
PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_USER_ID, ""); PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_USER_ID, "");
PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_USER_FULL_NAME, ""); PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_USER_FULL_NAME, "");
PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_USER_EMAIL_ID, ""); PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_USER_EMAIL_ID, "");
PrefManager.setSharedPref(HomeScreen.this, PrefManager.SESSION_ID, "");
Intent loginIntent = new Intent(HomeScreen.this, LoginScreen.class); Intent loginIntent = new Intent(HomeScreen.this, LoginScreen.class);
loginIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); loginIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(loginIntent); startActivity(loginIntent);
......
package com.vsoft.servicenow.ui;
import android.app.Activity;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;
import com.vsoft.servicenow.R;
import com.vsoft.servicenow.utils.Constants;
/*
* InAppWebViewActivity is an Activity which is used to display the content in inAppBrowser.
* @author Sreeni Mannem on 05/04/2019
* @version 1.0
* Copyright SallyBeauty (c) 2018
* */
public class InAppWebViewActivity extends AppCompatActivity {
public static final String TAG = InAppWebViewActivity.class.getName();
private WebView webView;
final Activity activity = this;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_inapp_webview);
String url = getIntent().getStringExtra(Constants.URL_STRING);
if (url == null) {
return;
}
final TextView titleTV = findViewById(R.id.webTitleTV);
webView = findViewById(R.id.customWebView);
// WebSettings webSettings = webView.getSettings();
// webSettings.setLoadWithOverviewMode(false);
// webSettings.setUseWideViewPort(false);
// webSettings.setJavaScriptEnabled(true);
// webView.loadUrl(url);
webView.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
}
});
webView.setWebViewClient(new WebViewClient());
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setDatabaseEnabled(true);
webView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
webView.getSettings().setAppCacheEnabled(true);
webView.loadUrl(url);
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
titleTV.setText("Incident Details");
}
});
}
public void goBack(View view) {
/*if(this.webView.canGoBack()) {
this.webView.goBack();
} else*/
finish();
}
}
...@@ -10,7 +10,6 @@ import android.text.TextUtils; ...@@ -10,7 +10,6 @@ import android.text.TextUtils;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.analytics.Tracker; import com.google.android.gms.analytics.Tracker;
import com.vsoft.servicenow.CatalogueApplication; import com.vsoft.servicenow.CatalogueApplication;
...@@ -27,6 +26,7 @@ import com.vsoft.servicenow.db.models.ChatBotUser; ...@@ -27,6 +26,7 @@ import com.vsoft.servicenow.db.models.ChatBotUser;
import com.vsoft.servicenow.db.models.UserApiValues; import com.vsoft.servicenow.db.models.UserApiValues;
import com.vsoft.servicenow.utils.Constants; import com.vsoft.servicenow.utils.Constants;
import com.vsoft.servicenow.utils.DialogUtils; import com.vsoft.servicenow.utils.DialogUtils;
import com.vsoft.servicenow.utils.GenerateRandomString;
import com.vsoft.servicenow.utils.KeyboardUtil; import com.vsoft.servicenow.utils.KeyboardUtil;
import com.vsoft.servicenow.utils.PrefManager; import com.vsoft.servicenow.utils.PrefManager;
import com.vsoft.servicenow.utils.Util; import com.vsoft.servicenow.utils.Util;
...@@ -213,6 +213,8 @@ public class LoginScreen extends Activity { ...@@ -213,6 +213,8 @@ public class LoginScreen extends Activity {
} }
if (syncStatus == API_SUCCESS_USER_DETAIL) { if (syncStatus == API_SUCCESS_USER_DETAIL) {
if (mUserDetails != null) { if (mUserDetails != null) {
String generateRandoStrPharma = GenerateRandomString.randomString(30);
PrefManager.setSharedPref(LoginScreen.this, PrefManager.SESSION_ID, generateRandoStrPharma);
String firstName = mUserDetails.get(0).getFirstName(); String firstName = mUserDetails.get(0).getFirstName();
String lastName = mUserDetails.get(0).getLastName(); String lastName = mUserDetails.get(0).getLastName();
String sysid = mUserDetails.get(0).getSysId(); String sysid = mUserDetails.get(0).getSysId();
......
...@@ -2,6 +2,8 @@ package com.vsoft.servicenow.ui; ...@@ -2,6 +2,8 @@ package com.vsoft.servicenow.ui;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBar;
...@@ -24,6 +26,7 @@ import com.vsoft.servicenow.api.managers.IncidentApiManager; ...@@ -24,6 +26,7 @@ import com.vsoft.servicenow.api.managers.IncidentApiManager;
import com.vsoft.servicenow.db.managers.MyIncidentsManager; import com.vsoft.servicenow.db.managers.MyIncidentsManager;
import com.vsoft.servicenow.db.models.Incident; import com.vsoft.servicenow.db.models.Incident;
import com.vsoft.servicenow.enums.SyncStatus; import com.vsoft.servicenow.enums.SyncStatus;
import com.vsoft.servicenow.utils.Constants;
import com.vsoft.servicenow.utils.DialogUtils; import com.vsoft.servicenow.utils.DialogUtils;
import com.vsoft.servicenow.utils.Util; import com.vsoft.servicenow.utils.Util;
...@@ -98,19 +101,35 @@ public class MyIncidentScreen extends HandleNotificationActivity { ...@@ -98,19 +101,35 @@ public class MyIncidentScreen extends HandleNotificationActivity {
void listViewOnClicked(int position) { void listViewOnClicked(int position) {
Incident incident = mIncidentList.get(position); Incident incident = mIncidentList.get(position);
String messageString = String.format(getResources().getString(R.string.incident_item_text_string),
// https://vsoftconsultinggroupincdemo10.service-now.com/incident.do?sys_id=e3c91a8d132e7300ca3270a76144b098
/*String messageString = String.format(getResources().getString(R.string.incident_item_text_string),
incident.getNumber(), Util.getDateTimeFromLong(incident.getOpenedAt()), incident.getShortDescription()); incident.getNumber(), Util.getDateTimeFromLong(incident.getOpenedAt()), incident.getShortDescription());
*/
AlertDialog.Builder builder = new AlertDialog.Builder(this); String sysId = incident.getIncedintSysId().toString();
String url = Constants.INCIDENT_OPEN_URL+sysId;
// Intent webIntent = new Intent(MyIncidentScreen.this, InAppWebViewActivity.class);
// webIntent.putExtra(Constants.URL_STRING, url);
// webIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// startActivity(webIntent);
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(browserIntent);
/*AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(Html.fromHtml(messageString)) builder.setMessage(Html.fromHtml(messageString))
.setCancelable(false) .setCancelable(false)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) { public void onClick(DialogInterface dialog, int id) {p[
dialog.dismiss(); dialog.dismiss();
} }
}); });
AlertDialog alert = builder.create(); AlertDialog alert = builder.create();
alert.show(); alert.show();*/
} }
class FetchIncident extends AsyncTask<String, Void, SyncStatus> { class FetchIncident extends AsyncTask<String, Void, SyncStatus> {
......
...@@ -152,10 +152,11 @@ public class Constants { ...@@ -152,10 +152,11 @@ public class Constants {
public static final String URL_REFRESH_LOGIN = URL_POST_LOGIN_ITEM; public static final String URL_REFRESH_LOGIN = URL_POST_LOGIN_ITEM;
public static final String URL_PUT_DEVICE_REGISTRATION = "api/now/table/sys_user/{user_sys_id}"; public static final String URL_PUT_DEVICE_REGISTRATION = "api/now/table/sys_user/{user_sys_id}";
public static final String URL_GET_USERDETAILS = API_PATH + "sys_user"; public static final String URL_GET_USERDETAILS = API_PATH + "sys_user";
public static final String URL_PUT_LOGOUT = "/api/vsng2/uofl_mobile/logout"; public static final String URL_PUT_LOGOUT = "/api/x_vsng2_chatbot/uofl_mobile/logout";
/*Catalogue Category API */ /*Catalogue Category API */
public static final String URL_GET_CATALOGUE = DOMAIN + AppConfig.URL_GET_CATALOGUE; public static final String URL_GET_CATALOGUE = DOMAIN + AppConfig.URL_GET_CATALOGUE;
public static final String INCIDENT_OPEN_URL = DOMAIN + AppConfig.INCEDENT_URL;
/*Catalogue Category Items API */ /*Catalogue Category Items API */
public static final String URL_GET_CATALOGUE_ITEM = DOMAIN + AppConfig.URL_GET_CATALOGUE_ITEM; public static final String URL_GET_CATALOGUE_ITEM = DOMAIN + AppConfig.URL_GET_CATALOGUE_ITEM;
...@@ -191,12 +192,14 @@ public class Constants { ...@@ -191,12 +192,14 @@ public class Constants {
public static final String URL_POST_HR_CASE_ITEM = AppConfig.URL_POST_HR_CASE_ITEM; public static final String URL_POST_HR_CASE_ITEM = AppConfig.URL_POST_HR_CASE_ITEM;
public static final String URL_GET_HR_CASE_REFERENCE = API_PATH; public static final String URL_GET_HR_CASE_REFERENCE = API_PATH;
public static final String URL_POST_HR_CASE_ATTACHMENT = DOMAIN + "api/now/v1/attachment/file"; public static final String URL_POST_HR_CASE_ATTACHMENT = DOMAIN + "api/now/v1/attachment/file";
public static final String URL_STRING = "urlString";
/*Get All My HRCase*/ /*Get All My HRCase*/
public static final String URL_GET_MY_HR_CASE = API_PATH + "hr_case"; public static final String URL_GET_MY_HR_CASE = API_PATH + "hr_case";
public static final String HTML_TABLE_TAG_TEXT = "<style";
/*Get All My HRCase*/ /*Get All My HRCase*/
public static final String URL_GET_ALL_PENDING_APPROVALS = DOMAIN + "api/vsng2/uofl_mobile/manager_approval"; public static final String URL_GET_ALL_PENDING_APPROVALS = DOMAIN + "api/x_vsng2_chatbot/uofl_mobile/manager_approval";
public static final String URL_PUT_PENDING_APPROVAL_STATE = API_PATH + "sysapproval_approver/{" + PendingApprovalsApi.SYS_ID_OF_APPROVAL_RECORD + "}"; public static final String URL_PUT_PENDING_APPROVAL_STATE = API_PATH + "sysapproval_approver/{" + PendingApprovalsApi.SYS_ID_OF_APPROVAL_RECORD + "}";
public static final String URL_GET_API_CHAT_SERVER = (BUILD_TYPE_RELEASE == BuildConfig.BUILD_TYPE_INT public static final String URL_GET_API_CHAT_SERVER = (BUILD_TYPE_RELEASE == BuildConfig.BUILD_TYPE_INT
......
package com.vsoft.servicenow.utils;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.vsoft.servicenow.R;
/**
* Created by krishna on 22/04/19.
*/
public class CustomDialog extends Dialog {
public CustomDialog(Context context, int themeResId) {
super(context, themeResId);
}
public static class Builder {
private Context context;
private String message, leftOptionText, rightOptionText;
private SpannableStringBuilder formattedMessage;
private OnClickListener okCL, leftOptionCL, rightOptionCL;
public Builder(Context context) {
this.context = context;
}
public Builder setMessage(String message) {
this.message = message;
return this;
}
public Builder setMessage(int message) {
this.message = context.getString(message);
return this;
}
public Builder setFormattedMessage(SpannableStringBuilder formattedMessage) {
this.formattedMessage = formattedMessage;
return this;
}
public Builder setLeftOptionText(String leftOptionText) {
this.leftOptionText = leftOptionText;
return this;
}
public Builder setRightOptionText(String rightOptionText) {
this.rightOptionText = rightOptionText;
return this;
}
public Builder setLeftOptionText(int leftOptionText) {
this.leftOptionText = context.getString(leftOptionText);
return this;
}
public Builder setRightOptionText(int rightOptionText) {
this.rightOptionText = context.getString(rightOptionText);
return this;
}
public Builder setOkClickListener(OnClickListener okCL) {
this.okCL = okCL;
return this;
}
public Builder setLeftOptionClickListener(OnClickListener leftOptionCL) {
this.leftOptionCL = leftOptionCL;
return this;
}
public Builder setRightOptionClickListener(OnClickListener rightOptionCL) {
this.rightOptionCL = rightOptionCL;
return this;
}
public CustomDialog create() {
if (context == null) {
return null;
}
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.dialog_custom, null);
final CustomDialog dialog = new CustomDialog(context, R.style.CustomLoadingDialog);
TextView customDialogMessageTV = layout.findViewById(R.id.customDialogMessageTV);
if (!TextUtils.isEmpty(message)) {
customDialogMessageTV.setText(message);
} else if (!TextUtils.isEmpty(formattedMessage)) {
customDialogMessageTV.setText(formattedMessage);
}
TextView customDialogOkTV = layout.findViewById(R.id.customDialogOkTV);
if (okCL != null) {
customDialogOkTV.setVisibility(View.VISIBLE);
customDialogOkTV.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
okCL.onClick(dialog, DialogInterface.BUTTON_POSITIVE);
}
});
} else {
customDialogOkTV.setVisibility(View.GONE);
}
TextView customDialogLeftOptionTV = layout.findViewById(R.id.customDialogLeftOptionTV);
if (leftOptionCL != null) {
if (!TextUtils.isEmpty(leftOptionText)) {
customDialogLeftOptionTV.setText(leftOptionText);
}
customDialogLeftOptionTV.setVisibility(View.VISIBLE);
customDialogLeftOptionTV.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
leftOptionCL.onClick(dialog, DialogInterface.BUTTON_POSITIVE);
}
});
} else {
customDialogLeftOptionTV.setVisibility(View.GONE);
}
View customDialogDividerV = layout.findViewById(R.id.customDialogDividerV);
TextView customDialogRightOptionTV = layout.findViewById(R.id.customDialogRightOptionTV);
if (rightOptionCL != null) {
if (!TextUtils.isEmpty(rightOptionText)) {
customDialogRightOptionTV.setText(rightOptionText);
}
customDialogDividerV.setVisibility(View.VISIBLE);
customDialogRightOptionTV.setVisibility(View.VISIBLE);
customDialogRightOptionTV.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
rightOptionCL.onClick(dialog, DialogInterface.BUTTON_NEGATIVE);
}
});
} else {
customDialogDividerV.setVisibility(View.GONE);
customDialogRightOptionTV.setVisibility(View.GONE);
}
dialog.setContentView(layout);
dialog.setCancelable(false);
return dialog;
}
}
}
\ No newline at end of file
package com.vsoft.servicenow.utils; package com.vsoft.servicenow.utils;
import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.text.SpannableStringBuilder;
import com.vsoft.servicenow.R; import com.vsoft.servicenow.R;
...@@ -56,4 +58,103 @@ public class DialogUtils { ...@@ -56,4 +58,103 @@ public class DialogUtils {
AlertDialog alert = builder.create(); AlertDialog alert = builder.create();
alert.show(); alert.show();
} }
public static void showCustomDialog(Context context,
String messageString, String rightOptionString,
DialogInterface.OnClickListener okCL,
DialogInterface.OnClickListener rightOptionCL) {
showCustomDialogRight(context, messageString, rightOptionString, null, null, okCL, rightOptionCL);
}
public static void showCustomDialog(Context context, String messageString) {
showCustomDialogOk(context, messageString, null, null, null);
}
private static void showCustomDialogRight(Context context,
String messageString, String rightOptionString,
Integer messageInteger, Integer rightOptionInteger,
DialogInterface.OnClickListener okCL,
DialogInterface.OnClickListener rightOptionCL) {
CustomDialog.Builder builder = new CustomDialog.Builder(context);
if (messageString != null) {
builder.setMessage(messageString);
} else if (messageInteger != null) {
builder.setMessage(messageInteger);
} else {
builder.setMessage("Error");
}
if (rightOptionString != null) {
builder.setRightOptionText(rightOptionString);
} else if (rightOptionInteger != null) {
builder.setRightOptionText(rightOptionInteger);
}
if (okCL == null) {
builder.setOkClickListener(new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
} else {
builder.setOkClickListener(okCL);
}
if (rightOptionCL == null) {
builder.setRightOptionClickListener(new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
} else {
builder.setRightOptionClickListener(rightOptionCL);
}
CustomDialog customDialog = builder.create();
if (customDialog != null && context instanceof Activity) {
if (!((Activity) context).isFinishing()) {
customDialog.show();
}
}
}
private static void showCustomDialogOk(Context context,
String messageString,
SpannableStringBuilder spannableStringBuilder,
Integer messageInteger,
DialogInterface.OnClickListener okCL) {
CustomDialog.Builder builder = new CustomDialog.Builder(context);
if (messageString != null) {
builder.setMessage(messageString);
} else if (spannableStringBuilder != null) {
builder.setFormattedMessage(spannableStringBuilder);
} else if (messageInteger != null) {
builder.setMessage(messageInteger);
} else {
builder.setMessage("Error");
}
if (okCL == null) {
builder.setOkClickListener(new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
} else {
builder.setOkClickListener(okCL);
}
CustomDialog customDialog = builder.create();
if (customDialog != null && context instanceof Activity) {
if (!((Activity) context).isFinishing()) {
customDialog.show();
}
}
}
} }
package com.vsoft.servicenow.utils;
import java.util.Random;
public class GenerateRandomString {
public static final String DATA = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
public static Random RANDOM = new Random();
public static String randomString(int len) {
StringBuilder sb = new StringBuilder(len);
for (int i = 0; i < len; i++) {
sb.append(DATA.charAt(RANDOM.nextInt(DATA.length())));
}
return sb.toString();
}
}
package com.vsoft.servicenow.utils;
import android.Manifest;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import com.vsoft.servicenow.R;
/**
* Created by krishna on 22/04/19.
*/
public class PermissionService {
public static final int TAKE_PHOTO = 1;
public static final int PICKUP_IMAGE = 2;
public static final int WRITE_STORAGE = 3;
private static PermissionService instance;
private PermissionService() {
}
public synchronized static PermissionService getInstance() {
if (instance == null) {
instance = new PermissionService();
}
return instance;
}
public boolean hasPermission(AppCompatActivity activity, int permissionRequest, String rationale) {
String[] permissions;
switch (permissionRequest) {
case PermissionService.TAKE_PHOTO:
permissions = new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE};
break;
case PermissionService.PICKUP_IMAGE:
permissions = new String[]{Manifest.permission.READ_EXTERNAL_STORAGE};
break;
case PermissionService.WRITE_STORAGE:
permissions = new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE};
break;
default:
permissions = null;
}
if (permissions == null)
return false;
boolean compoundPermissionGranted = true;
for (int i = 0; i < permissions.length; i++) {
compoundPermissionGranted &= ContextCompat.checkSelfPermission(activity, permissions[i]) == PackageManager.PERMISSION_GRANTED;
}
if (!compoundPermissionGranted) {
//TODO: present rationale before requesting for permissions following https://developer.android.com/training/permissions/best-practices.html
ActivityCompat.requestPermissions(activity, permissions, permissionRequest);
return false;
} else {
return true;
}
}
public boolean hasPermissionAct(Activity activity, int permissionRequest, String rationale) {
String[] permissions;
switch (permissionRequest) {
case PermissionService.TAKE_PHOTO:
permissions = new String[]{Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE};
break;
case PermissionService.PICKUP_IMAGE:
permissions = new String[]{Manifest.permission.READ_EXTERNAL_STORAGE};
break;
case PermissionService.WRITE_STORAGE:
permissions = new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE};
break;
default:
permissions = null;
}
if (permissions == null)
return false;
boolean compoundPermissionGranted = true;
for (int i = 0; i < permissions.length; i++) {
compoundPermissionGranted &= ContextCompat.checkSelfPermission(activity, permissions[i]) == PackageManager.PERMISSION_GRANTED;
}
if (!compoundPermissionGranted) {
//TODO: present rationale before requesting for permissions following https://developer.android.com/training/permissions/best-practices.html
ActivityCompat.requestPermissions(activity, permissions, permissionRequest);
return false;
} else {
return true;
}
}
public void manageDeniedPermissions(final AppCompatActivity activity, String[] permissions, String warning) {
boolean shouldGoToSettings = true;
for (int i = 0; i < permissions.length; i++) {
shouldGoToSettings &= !ActivityCompat.shouldShowRequestPermissionRationale(activity, permissions[i]);
}
if (shouldGoToSettings) {
DialogUtils.showCustomDialog(activity, activity.getString(R.string.never_ask_again_permissions_warning), activity.getString(R.string.no), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
goToSettings(activity);
}
}, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
} else {
String message = !TextUtils.isEmpty(warning) ? warning : activity.getString(R.string.default_permissions_warning);
DialogUtils.showCustomDialog(activity, message);
}
}
private void goToSettings(AppCompatActivity activity) {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", activity.getPackageName(), null);
intent.setData(uri);
activity.startActivity(intent);
}
}
...@@ -14,7 +14,7 @@ public class PrefManager { ...@@ -14,7 +14,7 @@ public class PrefManager {
public static final String PREFERENCE_USER_FULL_NAME = "full_name"; public static final String PREFERENCE_USER_FULL_NAME = "full_name";
public static final String PREFERENCE_USER_ID = "user_id"; public static final String PREFERENCE_USER_ID = "user_id";
public static final String PREFERENCE_USER_EMAIL_ID = "user_email_id"; public static final String PREFERENCE_USER_EMAIL_ID = "user_email_id";
public static final String SESSION_ID = "pharma_session_id";
//Chat Server Url //Chat Server Url
public static final String PREFERENCE_CHAT_SERVER_URL = "chat_server_url"; public static final String PREFERENCE_CHAT_SERVER_URL = "chat_server_url";
......
...@@ -8,7 +8,9 @@ import android.media.AudioManager; ...@@ -8,7 +8,9 @@ import android.media.AudioManager;
import android.media.MediaPlayer; import android.media.MediaPlayer;
import android.media.RingtoneManager; import android.media.RingtoneManager;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v4.content.FileProvider;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.text.Html; import android.text.Html;
import android.text.InputType; import android.text.InputType;
...@@ -46,6 +48,7 @@ import com.vsoft.servicenow.menu.ChatMenuItemData; ...@@ -46,6 +48,7 @@ import com.vsoft.servicenow.menu.ChatMenuItemData;
import com.vsoft.servicenow.menu.CreateHRCaseMenuItemData; import com.vsoft.servicenow.menu.CreateHRCaseMenuItemData;
import com.vsoft.servicenow.menu.NotificationMenuItemData; import com.vsoft.servicenow.menu.NotificationMenuItemData;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -91,6 +94,18 @@ public class Util { ...@@ -91,6 +94,18 @@ public class Util {
} }
} }
public static Uri getUriFromFile(Context context, File file) {
if (file != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return FileProvider.getUriForFile(context, context.getPackageName() + ".provider", file);
} else {
return Uri.fromFile(file);
}
} else {
return null;
}
}
public static VariableViewContainer getVariableViewContainer(Context context, CatalogueVariable catalogueVariable, LinearLayout.LayoutParams childLabelViewLayoutParams) { public static VariableViewContainer getVariableViewContainer(Context context, CatalogueVariable catalogueVariable, LinearLayout.LayoutParams childLabelViewLayoutParams) {
VariableViewContainer container = new VariableViewContainer(); VariableViewContainer container = new VariableViewContainer();
/*Label View*/ /*Label View*/
......
package com.vsoft.servicenow.utils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.PointF;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.widget.ImageView;
@SuppressLint("AppCompatCustomView")
public class ZoomableImageView extends ImageView {
private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {
@Override
public boolean onScaleBegin(ScaleGestureDetector detector) {
mode = ZOOM;
return true;
}
@Override
public boolean onScale(ScaleGestureDetector detector) {
float scaleFactor = detector.getScaleFactor();
float newScale = saveScale * scaleFactor;
if (newScale < maxScale && newScale > minScale) {
saveScale = newScale;
float width = getWidth();
float height = getHeight();
right = (originalBitmapWidth * saveScale) - width;
bottom = (originalBitmapHeight * saveScale) - height;
float scaledBitmapWidth = originalBitmapWidth * saveScale;
float scaledBitmapHeight = originalBitmapHeight * saveScale;
if (scaledBitmapWidth <= width || scaledBitmapHeight <= height) {
matrix.postScale(scaleFactor, scaleFactor, width / 2, height / 2);
} else {
matrix.postScale(scaleFactor, scaleFactor, detector.getFocusX(), detector.getFocusY());
}
}
return true;
}
}
static final int NONE = 0;
static final int DRAG = 1;
static final int ZOOM = 2;
static final int CLICK = 3;
private int mode = NONE;
private Matrix matrix = new Matrix();
private PointF last = new PointF();
private PointF start = new PointF();
private float minScale = 0.5f;
private float maxScale = 4f;
private float[] m;
private float redundantXSpace, redundantYSpace;
private float saveScale = 1f;
private float right, bottom, originalBitmapWidth, originalBitmapHeight;
private ScaleGestureDetector mScaleDetector;
public ZoomableImageView(Context context) {
super(context);
init(context);
}
public ZoomableImageView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public ZoomableImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
private void init(Context context) {
super.setClickable(true);
mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
m = new float[9];
setImageMatrix(matrix);
setScaleType(ScaleType.MATRIX);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int bmHeight = getBmHeight();
int bmWidth = getBmWidth();
float width = getMeasuredWidth();
float height = getMeasuredHeight();
//Fit to screen.
float scale = width > height ? height / bmHeight : width / bmWidth;
matrix.setScale(scale, scale);
saveScale = 1f;
originalBitmapWidth = scale * bmWidth;
originalBitmapHeight = scale * bmHeight;
// Center the image
redundantYSpace = (height - originalBitmapHeight);
redundantXSpace = (width - originalBitmapWidth);
matrix.postTranslate(redundantXSpace / 2, redundantYSpace / 2);
setImageMatrix(matrix);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
mScaleDetector.onTouchEvent(event);
matrix.getValues(m);
float x = m[Matrix.MTRANS_X];
float y = m[Matrix.MTRANS_Y];
PointF curr = new PointF(event.getX(), event.getY());
switch (event.getAction()) {
//when one finger is touching
//set the mode to DRAG
case MotionEvent.ACTION_DOWN:
last.set(event.getX(), event.getY());
start.set(last);
mode = DRAG;
break;
//when two fingers are touching
//set the mode to ZOOM
case MotionEvent.ACTION_POINTER_DOWN:
last.set(event.getX(), event.getY());
start.set(last);
mode = ZOOM;
break;
//when a finger moves
//If mode is applicable move image
case MotionEvent.ACTION_MOVE:
//if the mode is ZOOM or
//if the mode is DRAG and already zoomed
if (mode == ZOOM || (mode == DRAG && saveScale > minScale)) {
float deltaX = curr.x - last.x;// x difference
float deltaY = curr.y - last.y;// y difference
float scaleWidth = Math.round(originalBitmapWidth * saveScale);// width after applying current scale
float scaleHeight = Math.round(originalBitmapHeight * saveScale);// height after applying current scale
boolean limitX = false;
boolean limitY = false;
//if scaleWidth is smaller than the views width
//in other words if the image width fits in the view
//limit left and right movement
if (scaleWidth < getWidth() && scaleHeight < getHeight()) {
// don't do anything
}
else if (scaleWidth < getWidth()) {
deltaX = 0;
limitY = true;
}
//if scaleHeight is smaller than the views height
//in other words if the image height fits in the view
//limit up and down movement
else if (scaleHeight < getHeight()) {
deltaY = 0;
limitX = true;
}
//if the image doesnt fit in the width or height
//limit both up and down and left and right
else {
limitX = true;
limitY = true;
}
if (limitY) {
if (y + deltaY > 0) {
deltaY = -y;
} else if (y + deltaY < -bottom) {
deltaY = -(y + bottom);
}
}
if (limitX) {
if (x + deltaX > 0) {
deltaX = -x;
} else if (x + deltaX < -right) {
deltaX = -(x + right);
}
}
//move the image with the matrix
matrix.postTranslate(deltaX, deltaY);
//set the last touch location to the current
last.set(curr.x, curr.y);
}
break;
//first finger is lifted
case MotionEvent.ACTION_UP:
mode = NONE;
int xDiff = (int) Math.abs(curr.x - start.x);
int yDiff = (int) Math.abs(curr.y - start.y);
if (xDiff < CLICK && yDiff < CLICK)
performClick();
break;
// second finger is lifted
case MotionEvent.ACTION_POINTER_UP:
mode = NONE;
break;
}
setImageMatrix(matrix);
invalidate();
return true;
}
public void setMaxZoom(float x) {
maxScale = x;
}
private int getBmWidth() {
Drawable drawable = getDrawable();
if (drawable != null) {
return drawable.getIntrinsicWidth();
}
return 0;
}
private int getBmHeight() {
Drawable drawable = getDrawable();
if (drawable != null) {
return drawable.getIntrinsicHeight();
}
return 0;
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<gradient android:startColor="#94c2ED" android:endColor="#cbcbcb" android:angle="90" />
<corners android:topLeftRadius="25px" android:topRightRadius="0px" android:bottomLeftRadius="25px" android:bottomRightRadius="0px" />
</shape>
</item>
<item>
<shape>
<gradient android:startColor="#BDC3C7" android:endColor="#BDC3C7" android:angle="270" />
<corners android:topLeftRadius="0px" android:topRightRadius="0px" android:bottomLeftRadius="25px" android:bottomRightRadius="25px" />
</shape>
</item>
</selector>
\ No newline at end of file
<vector android:height="30dp" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFFFF" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>
<vector android:height="24dp" android:tint="#666666"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0"/>
<path android:fillColor="#FF000000" android:pathData="M9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2L9,2zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z"/>
</vector>
<vector android:height="24dp" android:tint="#666666"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,14c1.66,0 2.99,-1.34 2.99,-3L15,5c0,-1.66 -1.34,-3 -3,-3S9,3.34 9,5v6c0,1.66 1.34,3 3,3zM17.3,11c0,3 -2.54,5.1 -5.3,5.1S6.7,14 6.7,11L5,11c0,3.41 2.72,6.23 6,6.72L11,21h2v-3.28c3.28,-0.48 6,-3.3 6,-6.72h-1.7z"/>
</vector>
<vector android:height="24dp" android:tint="#1A63A2"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>
</vector>
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/white" />
<stroke
android:width="1dip"
android:color="#fff" />
<corners android:radius="5dip" />
</shape>
\ No newline at end of file
<vector android:height="30dp" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>
<vector android:autoMirrored="true" android:height="24dp"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<gradient android:startColor="#566573" android:endColor="#566573" android:angle="270" />
<corners android:topLeftRadius="25px" android:topRightRadius="5px" android:bottomLeftRadius="5px" android:bottomRightRadius="25px" />
</shape>
</item>
<item>
<shape>
<gradient android:startColor="#566573" android:endColor="#566573" android:angle="270" />
<corners android:topLeftRadius="25px" android:topRightRadius="5px" android:bottomLeftRadius="25px" android:bottomRightRadius="25px" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<gradient android:startColor="#94c2ED" android:endColor="#cbcbcb" android:angle="270" />
<corners android:topLeftRadius="25px" android:topRightRadius="5px" android:bottomLeftRadius="5px" android:bottomRightRadius="25px" />
</shape>
</item>
<item>
<shape>
<gradient android:startColor="#BDC3C7" android:endColor="#BDC3C7" android:angle="270" />
<corners android:topLeftRadius="25px" android:topRightRadius="5px" android:bottomLeftRadius="25px" android:bottomRightRadius="25px" />
</shape>
</item>
</selector>
\ No newline at end of file
<vector android:height="24dp" android:tint="#303030"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f5f5f5"
android:orientation="vertical"
tools:context=".ui.InAppWebViewActivity">
<RelativeLayout
android:id="@+id/webViewHeader"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@android:color/black">
<ImageView
android:id="@+id/backIV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:padding="10dp"
android:onClick="goBack"
android:src="@drawable/ic_arrow_back"
android:tint="@android:color/white" />
<TextView
android:id="@+id/webTitleTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="@android:color/white"
android:textSize="15sp" />
</RelativeLayout>
<WebView
android:id="@+id/customWebView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
<LinearLayout 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:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/LightBackgroundStyle" style="@style/LightBackgroundStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -7,6 +8,10 @@ ...@@ -7,6 +8,10 @@
tools:context=".ui.ChatActivity"> tools:context=".ui.ChatActivity">
<include layout="@layout/toolbar" /> <include layout="@layout/toolbar" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/black"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -19,49 +24,96 @@ ...@@ -19,49 +24,96 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginBottom="@dimen/small_margin" android:layout_marginBottom="@dimen/normal_margin"
android:scrollbarStyle="outsideOverlay" android:scrollbarStyle="outsideOverlay"
android:scrollbars="vertical" /> android:scrollbars="vertical" />
<com.wang.avi.AVLoadingIndicatorView
android:id="@+id/avi"
style="@style/AVLoadingIndicatorView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:visibility="gone"
app:indicatorColor="#03A9F4"
app:indicatorName="BallPulseIndicator" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:background="@android:color/black"/> android:background="@android:color/black"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin" android:layout_marginTop="@dimen/small_margin"
android:paddingRight="@dimen/activity_horizontal_margin"> android:background="@color/screen_bg_color_white"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<EditText <LinearLayout
android:id="@+id/message_input" android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_margin="5dp"
android:hint="@string/prompt_message" android:orientation="horizontal">
android:imeActionId="@+id/send" <ImageButton
android:imeActionLabel="@string/action_send" android:id="@+id/image_button"
android:imeOptions="actionSend" android:layout_width="30dp"
android:inputType="textCapSentences" android:layout_height="30dp"
android:maxLines="1" android:contentDescription="@string/action_send"
android:singleLine="true" /> android:visibility="gone"
android:background="@drawable/ic_camera_chat" />
<ImageButton <ImageButton
android:id="@+id/send_button" android:layout_width="30dp"
android:layout_width="wrap_content" android:layout_height="30dp"
android:layout_height="wrap_content" android:layout_marginLeft="15dp"
android:contentDescription="@string/action_send" android:contentDescription="@string/action_send"
android:src="@android:drawable/ic_menu_send" /> android:background="@drawable/ic_mic_chat"
android:visibility="gone"/>
<ImageButton </LinearLayout>
android:id="@+id/voice_button"
android:layout_width="wrap_content" <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/action_send" android:orientation="horizontal">
android:src="@drawable/vera_icon" /> <EditText
android:id="@+id/message_input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/prompt_message"
android:imeActionId="@+id/send"
android:paddingLeft="4dp"
android:paddingRight="4dp"
android:singleLine="false"
android:isScrollContainer="true"
android:imeActionLabel="@string/action_send"
android:imeOptions="actionSend"
android:inputType="textMultiLine"
tools:ignore="InvalidImeActionId" />
<ImageButton
android:id="@+id/voice_button"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="10dp"
android:contentDescription="@string/action_send"
android:background="@drawable/ic_mic_chat"
android:visibility="visible"/>
<ImageButton
android:id="@+id/send_button"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:layout_marginBottom="7dp"
android:contentDescription="@string/action_send"
android:background="@drawable/ic_send_chat"
android:visibility="visible"/>
</LinearLayout>
</LinearLayout> </LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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" xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/HomeBackgroundStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#EBEAEA"
android:orientation="vertical"> android:orientation="vertical">
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar
android:id="@+id/tool_bar_view" android:id="@+id/tool_bar_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@android:color/white" android:background="#303030"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
app:contentInsetEnd="0dp" app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
...@@ -26,12 +26,12 @@ ...@@ -26,12 +26,12 @@
<ImageView <ImageView
android:id="@+id/nav_back" android:id="@+id/nav_back"
android:layout_width="wrap_content" android:layout_width="30dp"
android:layout_height="wrap_content" android:layout_height="30dp"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:src="@drawable/home_icon" android:src="@drawable/home_icon_new"
android:tint="@color/tool_bar_image_color" /> />
<TextView <TextView
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
...@@ -40,15 +40,15 @@ ...@@ -40,15 +40,15 @@
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:text="@string/app_name" android:text="@string/app_name"
android:textColor="@color/tool_bar_title_color" /> android:textColor="@color/screen_bg_color_white" />
<ImageView <ImageView
android:id="@+id/home_screen_logout_image_view" android:id="@+id/home_screen_logout_image_view"
android:layout_width="wrap_content" android:layout_width="30dp"
android:layout_height="wrap_content" android:layout_height="30dp"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:src="@drawable/logout_icon" android:background="@drawable/logout_ic"
android:tint="@color/tool_bar_image_color" /> android:tint="@color/tool_bar_image_color" />
</RelativeLayout> </RelativeLayout>
...@@ -58,8 +58,10 @@ ...@@ -58,8 +58,10 @@
android:id="@+id/home_screen_grid_view" android:id="@+id/home_screen_grid_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/home_background"
android:horizontalSpacing="@dimen/large_margin" android:horizontalSpacing="@dimen/large_margin"
android:numColumns="2" android:numColumns="2"
android:layout_marginTop="0dp"
android:stretchMode="columnWidth" android:stretchMode="columnWidth"
android:verticalSpacing="@dimen/large_margin" /> android:verticalSpacing="@dimen/large_margin" />
......
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:paddingTop="@dimen/spacing">
<RelativeLayout
android:id="@+id/user_text_layt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:gravity="right"
android:orientation="horizontal"
android:layout_marginLeft="@dimen/chat_margin"
android:layout_marginRight="@dimen/normal_margin"
android:paddingBottom="@dimen/small_margin"
android:paddingTop="@dimen/small_margin" >
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/user_icon"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="@dimen/small_margin"
android:layout_alignParentEnd="true"
android:src="@drawable/ic_person_black"
app:civ_border_color="@color/username8"
app:civ_border_width="1dp"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/user_icon"
android:layout_marginRight="@dimen/small_margin"
android:paddingTop="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin"
android:background="@drawable/chat_text_bg"
android:orientation="vertical">
<TextView
android:id="@+id/user_username"
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:paddingLeft="@dimen/spacing"
android:paddingRight="@dimen/spacing"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textStyle="bold"
android:visibility="gone" />
<TextView
android:id="@+id/user_message"
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/spacing"
android:paddingRight="@dimen/spacing"
android:textColor="#fff" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/user_image_lyt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:visibility="gone"
android:layout_marginRight="@dimen/large_margin"
android:orientation="vertical">
<ImageView
android:id="@+id/user_image"
android:layout_width="300dp"
android:layout_height="300dp" />
</LinearLayout>
<RelativeLayout
android:id="@+id/hr_container_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/small_margin"
android:layout_marginRight="@dimen/chat_margin">
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/hr_image_view"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_alignParentStart="true"
android:layout_marginEnd="@dimen/small_margin"
android:src="@drawable/chat_bort_icon" />
<RelativeLayout
android:id="@+id/hr_text_layt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/hr_image_view"
android:background="@drawable/chat_text_pharmcy_bg"
android:paddingTop="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin">
<TextView
android:id="@+id/hr_username"
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/spacing"
android:paddingRight="@dimen/spacing"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textStyle="bold"
android:visibility="gone" />
<TextView
android:id="@+id/hr_message"
style="?android:textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/hr_username"
android:paddingLeft="@dimen/spacing"
android:paddingRight="@dimen/spacing"
android:text="kdsfdsdsjfds"
android:textColor="?android:textColorPrimary" />
<TextView
android:id="@+id/view_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/view_all_str"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_gravity="left"
android:paddingLeft="10dp"
android:layout_marginLeft="3dp"
style="?android:textAppearanceMedium"
android:gravity="center"
android:visibility="gone"
android:paddingBottom="10dp"
android:textColor="@color/username8"
/>
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/hr_image_lyt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginLeft="@dimen/large_margin"
android:layout_marginRight="@dimen/small_margin"
android:visibility="gone">
<ImageView
android:id="@+id/hr_send_image"
android:layout_width="300dp"
android:layout_height="300dp" />
</LinearLayout>
<RelativeLayout
android:layout_gravity="left"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="20dp"
android:layout_alignParentTop="true"
android:layout_marginTop="10dp"
android:paddingLeft="@dimen/spacing"
android:paddingRight="@dimen/spacing"
android:visibility="gone"/>
</RelativeLayout>
</LinearLayout>
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tool_bar_view" android:id="@+id/tool_bar_view"
style="@style/WhiteBackgroundStyle" app:theme="@style/ToolbarTheme"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="0dp" android:layout_margin="0dp"
android:background="#303030"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
android:padding="0dp" android:padding="0dp"
app:titleTextColor="@color/tool_bar_title_color" app:titleTextColor="@color/screen_bg_color_white"
app:contentInsetEnd="0dp" app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
app:contentInsetRight="0dp" app:contentInsetRight="0dp"
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tool_bar_view"
style="@style/pharmacyBackgroundStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:padding="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/small_margin"
android:layout_marginEnd="@dimen/small_margin">
<ImageView
android:id="@+id/pharmacy_back_icon"
android:layout_gravity="start"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:src="@drawable/ic_arrow_white" />
<TextView android:id="@+id/industry_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/pharmacy_back_icon"
android:textColor="@android:color/white"
android:layout_centerInParent="true"
android:gravity="center"
android:textSize="20sp"
android:textStyle="bold"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:text="@string/message_welcome"/>
</RelativeLayout>
</android.support.v7.widget.Toolbar>
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<color name="home_screen_bg_color">@color/colorPrimary</color> <color name="home_screen_bg_color">@color/colorPrimary</color>
<color name="screen_bg_color">#c2d1d3</color> <color name="screen_bg_color">#c2d1d3</color>
<color name="screen_bg_color_white">#fff</color>
<color name="bg_border_color">#d6d6d6</color> <color name="bg_border_color">#d6d6d6</color>
<color name="back_button_bg_color">#4f0307</color> <color name="back_button_bg_color">#4f0307</color>
......
...@@ -13,9 +13,10 @@ ...@@ -13,9 +13,10 @@
<dimen name="catalogue_category_and_item_list_view_divider_height">5dp</dimen> <dimen name="catalogue_category_and_item_list_view_divider_height">5dp</dimen>
<dimen name="list_view_divider_height">1dp</dimen> <dimen name="list_view_divider_height">1dp</dimen>
<!--Home Screen--> <!--home Screen-->
<dimen name="home_screen_image_margin">10dp</dimen> <dimen name="home_screen_image_margin">10dp</dimen>
<dimen name="home_screen_image_height">150dp</dimen> <dimen name="home_screen_image_height">150dp</dimen>
<dimen name="home_screen_image_height_new">170dp</dimen>
<dimen name="list_item_height">100dp</dimen> <dimen name="list_item_height">100dp</dimen>
......
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
<string name="catalogue_user_id">user_id</string> <string name="catalogue_user_id">user_id</string>
<string name="catalogue_user_email_id">email_address</string> <string name="catalogue_user_email_id">email_address</string>
<!--Home Screen--> <!--home Screen-->
<string name="home_screen_logout_confirmation_msg_string">Are you sure you want to logout?</string> <string name="home_screen_logout_confirmation_msg_string">Are you sure you want to logout?</string>
<!--Notifications--> <!--Notifications-->
...@@ -137,6 +137,8 @@ ...@@ -137,6 +137,8 @@
<!-- messages --> <!-- messages -->
<string name="message_welcome">Chat with VERA</string> <string name="message_welcome">Chat with VERA</string>
<string name="user_action_typing">is typing</string> <string name="user_action_typing">is typing</string>
<string name="view_all_str"><u>View ALL</u></string>
<string name="my_text"><![CDATA[This is an <u>underline</u>]]></string>
<!--Speech Recognizer--> <!--Speech Recognizer-->
<string name="ds_listening">Listening…</string> <string name="ds_listening">Listening…</string>
...@@ -158,10 +160,10 @@ ...@@ -158,10 +160,10 @@
<item>Insufficient permissions</item> <item>Insufficient permissions</item>
</string-array> </string-array>
<!--Home Screen Option--> <!--home Screen Option-->
<!--Start--> <!--Start-->
<string name="home_screen_report_incident_title">Report Incident</string> <string name="home_screen_report_incident_title">Report Incident</string>
<string name="home_screen_report_incident_icon">report_incident</string> <string name="home_screen_report_incident_icon">home_screen_report_incident_icon_new</string>
<string name="home_screen_order_services_title">Order Services</string> <string name="home_screen_order_services_title">Order Services</string>
<string name="home_screen_order_services_icon">order_services</string> <string name="home_screen_order_services_icon">order_services</string>
...@@ -178,6 +180,9 @@ ...@@ -178,6 +180,9 @@
<string name="home_screen_notification_title">Notifications</string> <string name="home_screen_notification_title">Notifications</string>
<string name="home_screen_notification_icon">notifications</string> <string name="home_screen_notification_icon">notifications</string>
<!--End--> <!--End-->
<string name="home_screen_clear_chat_confirmation_msg_string">Are you sure you want to clear the chat?</string>
<string name="blur_image">Image is blur.Please recapture the bill</string>
<string name="error_message">Problem</string>
<!--HRCase Screen--> <!--HRCase Screen-->
<string name="hr_case_category_string">HR Case</string> <string name="hr_case_category_string">HR Case</string>
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</style> </style>
<style name="LightBackgroundStyle" parent="@style/Theme.AppCompat"> <style name="LightBackgroundStyle" parent="@style/Theme.AppCompat">
<item name="android:background">@color/screen_bg_color</item> <item name="android:background">@color/screen_bg_color_white</item>
</style> </style>
<style name="DatePickerCustomDialog" parent="@android:style/Theme.Dialog"> <style name="DatePickerCustomDialog" parent="@android:style/Theme.Dialog">
......
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="."/>
</paths>
\ No newline at end of file
<resources> <resources>
<string name="app_name">UofL ServiceNow</string> <string name="app_name">UofL ServiceNow</string>
<!--Home Screen Option--> <!--home Screen Option-->
<!--Start--> <!--Start-->
<string name="home_screen_report_incident_title">Report Incident</string> <string name="home_screen_report_incident_title">Report Incident</string>
<string name="home_screen_report_incident_icon">ic_my_incident_icon</string> <string name="home_screen_report_incident_icon">ic_my_incident_icon</string>
......
...@@ -12,8 +12,8 @@ public class AppConfig { ...@@ -12,8 +12,8 @@ public class AppConfig {
public static final String LOGIN_CLIENT_ID_RELEASE = "d958eb06b0f3830093781f441d59febc"; public static final String LOGIN_CLIENT_ID_RELEASE = "d958eb06b0f3830093781f441d59febc";
public static final String LOGIN_CLIENT_SECRET_RELEASE = "krD*!O}1.8"; public static final String LOGIN_CLIENT_SECRET_RELEASE = "krD*!O}1.8";
public static final String LOGIN_CLIENT_ID_DEBUG = "d958eb06b0f3830093781f441d59febc"; public static final String LOGIN_CLIENT_ID_DEBUG = "89cfc0656ce6b30012af8b50316c9376";
public static final String LOGIN_CLIENT_SECRET_DEBUG = "krD*!O}1.8"; public static final String LOGIN_CLIENT_SECRET_DEBUG = ")R+)DZh|,T";
public static final String LOGIN_CLIENT_ID_STAGING = "091b5d1ea97cd700e4268b90dd5521ca"; public static final String LOGIN_CLIENT_ID_STAGING = "091b5d1ea97cd700e4268b90dd5521ca";
public static final String LOGIN_CLIENT_SECRET_STAGING = "+tPJ@jS<;S"; public static final String LOGIN_CLIENT_SECRET_STAGING = "+tPJ@jS<;S";
...@@ -21,42 +21,47 @@ public class AppConfig { ...@@ -21,42 +21,47 @@ public class AppConfig {
/** /**
* API Base URL * API Base URL
* */ * */
public static final String DOMAIN_RELEASE = "https://ven01199.service-now.com/"; /* public static final String DOMAIN_RELEASE = "https://ven01199.service-now.com/";
public static final String DOMAIN_DEBUG = "https://vsoftconsultingdev.service-now.com/"; public static final String DOMAIN_DEBUG = "https://vsoftconsultingdev.service-now.com/";
public static final String DOMAIN_STAGING = "https://vsoftconsultingdemo1.service-now.com/"; public static final String DOMAIN_STAGING = "https://vsoftconsultingdemo1.service-now.com/"; */
public static final String DOMAIN_RELEASE = "https://vsoftconsultinggroupincdemo10.service-now.com/";
public static final String DOMAIN_DEBUG = "https://vsoftconsultinggroupincdemo10.service-now.com/";
public static final String DOMAIN_STAGING = "https://vsoftconsultinggroupincdemo10.service-now.com/";
/** /**
* Web services urls * Web services urls
*/ */
/*Catalogue Category API */ /*Catalogue Category API */
public static final String URL_GET_CATALOGUE = "api/vsng2/uofl_mobile/catalogue_screen"; public static final String URL_GET_CATALOGUE = "api/x_vsng2_chatbot/uofl_mobile/catalogue_screen";
public static final String INCEDENT_URL = "incident.do?sys_id=";
/*Catalogue Category Items API */ /*Catalogue Category Items API */
public static final String URL_GET_CATALOGUE_ITEM = "api/vsng2/uofl_mobile/catalog_item"; public static final String URL_GET_CATALOGUE_ITEM = "api/x_vsng2_chatbot/uofl_mobile/catalog_item";
/*Variable form API */ /*Variable form API */
public static final String URL_GET_VARIABLE = "api/vsng2/uofl_mobile/catalogue_variable_screen"; public static final String URL_GET_VARIABLE = "api/x_vsng2_chatbot/uofl_mobile/catalogue_variable_screen";
public static final String URL_GET_UI_POLICY = "/api/vsng2/uofl_mobile/uipolicy"; public static final String URL_GET_UI_POLICY = "/api/x_vsng2_chatbot/uofl_mobile/uipolicy";
public static final String URL_GET_VARIABLE_CHOICE = "/api/vsng2/uofl_mobile/question_choice"; public static final String URL_GET_VARIABLE_CHOICE = "/api/x_vsng2_chatbot/uofl_mobile/question_choice";
public static final String URL_POST_CATALOGUE_ITEM = "api/vsng2/uofl_mobile"; public static final String URL_POST_CATALOGUE_ITEM = "api/x_vsng2_chatbot/uofl_mobile";
/*HRCase Category API */ /*HRCase Category API */
public static final String URL_GET_HR_CASE = "api/vsng2/uofl_mobile/catalogue_screen"; public static final String URL_GET_HR_CASE = "api/x_vsng2_chatbot/uofl_mobile/catalogue_screen";
/*Catalogue Category Items API */ /*Catalogue Category Items API */
public static final String URL_GET_HR_CASE_ITEM = "api/vsng2/uofl_mobile/catalog_item"; public static final String URL_GET_HR_CASE_ITEM = "api/x_vsng2_chatbot/uofl_mobile/catalog_item";
/*HRCase Variable form API */ /*HRCase Variable form API */
public static final String URL_GET_HR_CASE_VARIABLE = "api/vsng2/uofl_mobile/catalogue_variable_screen"; public static final String URL_GET_HR_CASE_VARIABLE = "api/x_vsng2_chatbot/uofl_mobile/catalogue_variable_screen";
public static final String URL_GET_HR_CASE_UI_POLICY = "/api/vsng2/uofl_mobile/uipolicy"; public static final String URL_GET_HR_CASE_UI_POLICY = "/api/x_vsng2_chatbot/uofl_mobile/uipolicy";
public static final String URL_GET_HR_CASE_VARIABLE_CHOICE = "/api/vsng2/uofl_mobile/question_choice"; public static final String URL_GET_HR_CASE_VARIABLE_CHOICE = "/api/x_vsng2_chatbot/uofl_mobile/question_choice";
public static final String URL_POST_HR_CASE_ITEM = "/api/sn_sc/servicecatalog/items/{sys_id}/submit_producer"; public static final String URL_POST_HR_CASE_ITEM = "/api/sn_sc/servicecatalog/items/{sys_id}/submit_producer";
/** /**
* We will hit the below url to get the chat server url. * We will hit the below url to get the chat server url.
* */ * */
public static final String CHAT_SERVER_API_URL_RELEASE = "http://ai.test.vsoftconsulting.com:3000/?env=release"; public static final String CHAT_SERVER_API_URL_RELEASE = "http://52.21.5.26:12811/service_discovery";
public static final String CHAT_SERVER_API_URL_DEBUG = "http://ai.test.vsoftconsulting.com:3000/?env=dev"; public static final String CHAT_SERVER_API_URL_DEBUG = "http://52.21.5.26:12811/service_discovery";
public static final String CHAT_SERVER_API_URL_STAGING = "http://ai.test.vsoftconsulting.com:3000/?env=demo1"; public static final String CHAT_SERVER_API_URL_STAGING = "http://52.21.5.26:12811/service_discovery";
} }
<vector android:height="30dp" android:tint="#FFFFFF"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="20dp"
android:alpha="0.9"
android:background="@drawable/rounded_gray_border_white_fill"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/customDialogMessageTV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:gravity="center"
android:text="Message"
android:textSize="@dimen/m_textsize" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/dialog_view_divider" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal">
<TextView
android:id="@+id/customDialogOkTV"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="@string/ok"
android:textAllCaps="true"
android:textColor="@color/dialog_background"
android:textSize="@dimen/m_textsize" />
<TextView
android:id="@+id/customDialogLeftOptionTV"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="@string/confirm"
android:textColor="@color/dialog_background"
android:textSize="@dimen/m_textsize" />
<View
android:id="@+id/customDialogDividerV"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/dialog_view_divider"
android:visibility="gone" />
<TextView
android:id="@+id/customDialogRightOptionTV"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="@string/go_back"
android:textColor="@color/dialog_background"
android:textSize="@dimen/m_textsize" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
<ImageView <ImageView
android:id="@+id/home_screen_adapter_image_view" android:id="@+id/home_screen_adapter_image_view"
android:layout_width="@dimen/home_screen_image_height" android:layout_width="@dimen/home_screen_image_height"
android:layout_height="@dimen/home_screen_image_height" android:layout_height="@dimen/home_screen_image_height_new"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:scaleType="centerCrop" /> android:scaleType="centerCrop" />
<TextView <TextView
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center" android:layout_gravity="center"
android:background="#000"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <ImageView
android:layout_margin="10dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:src="@drawable/splash_logo" /> android:src="@drawable/splash_screen_logo" />
</FrameLayout> </FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/tool_bar_view"
style="@style/pharmacyBackgroundStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:padding="0dp" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/small_margin"
android:layout_marginEnd="@dimen/small_margin">
<TextView android:id="@+id/industry_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:layout_centerInParent="true"
android:gravity="center"
android:textSize="20sp"
android:textStyle="bold"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:text="VERA"
android:layout_marginLeft="10dp"
/>
<ImageView
android:id="@+id/manu_close_pop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:visibility="visible"
android:background="@drawable/ic_close_white"/>
</RelativeLayout>
</android.support.v7.widget.Toolbar>
<RelativeLayout
android:layout_below="@id/tool_bar_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.vsoft.servicenow.utils.ZoomableImageView
android:id="@+id/zoom_image_pharma"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<item
android:id="@+id/more_menu_clear"
android:icon="@drawable/ic_clear_black"
android:title="Clear Chat" />
</menu>
...@@ -21,4 +21,8 @@ ...@@ -21,4 +21,8 @@
<!--Toolbar image color--> <!--Toolbar image color-->
<color name="tool_bar_image_color">@color/colorPrimaryDark</color> <color name="tool_bar_image_color">@color/colorPrimaryDark</color>
<color name="tool_bar_title_color">@color/colorPrimaryDark</color> <color name="tool_bar_title_color">@color/colorPrimaryDark</color>
<color name="dialog_view_divider">#979797</color>
<color name="dialog_background">#037aff</color>
<color name="tool_bar_color">#303030</color>
</resources> </resources>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<dimen name="home_screen_image_height">150dp</dimen> <dimen name="home_screen_image_height">150dp</dimen>
<dimen name="home_screen_image_height_new">170dp</dimen>
<dimen name="m_textsize">22.5sp</dimen>
</resources> </resources>
<resources> <resources>
<string name="app_name">VERA</string> <string name="app_name">VERA</string>
<!--Home Screen Option--> <!--home Screen Option-->
<!--Start--> <!--Start-->
<string name="home_screen_report_incident_title">Report Incident</string> <string name="home_screen_report_incident_title">Report Incident</string>
<string name="home_screen_report_incident_icon">report_incident</string> <string name="home_screen_report_incident_icon">report_incident_new</string>
<string name="home_screen_order_services_title">Order Services</string> <string name="home_screen_order_services_title">Order Services</string>
<string name="home_screen_order_services_icon">order_services</string> <string name="home_screen_order_services_icon">order_services_new</string>
<string name="home_screen_my_incidents_title">My Incidents</string> <string name="home_screen_my_incidents_title">My Incidents</string>
<string name="home_screen_my_incidents_icon">my_incidents</string> <string name="home_screen_my_incidents_icon">my_incidents_new</string>
<string name="home_screen_my_request_title">My Requests</string> <string name="home_screen_my_request_title">My Requests</string>
<string name="home_screen_my_request_icon">my_requests</string> <string name="home_screen_my_request_icon">my_requests_new</string>
<string name="home_screen_create_hr_case_title">Create HR Case</string> <string name="home_screen_create_hr_case_title">Create HR Case</string>
<string name="home_screen_create_hr_case_icon">create_hr_case</string> <string name="home_screen_create_hr_case_icon">create_hr_case</string>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<string name="home_screen_view_hr_case_icon">view_hr_case</string> <string name="home_screen_view_hr_case_icon">view_hr_case</string>
<string name="home_screen_chat_title">VERA</string> <string name="home_screen_chat_title">VERA</string>
<string name="home_screen_chat_icon">vera</string> <string name="home_screen_chat_icon">vera_new</string>
<string name="home_screen_notification_title">Notifications</string> <string name="home_screen_notification_title">Notifications</string>
<string name="home_screen_notification_icon">notifications</string> <string name="home_screen_notification_icon">notifications</string>
...@@ -31,6 +31,14 @@ ...@@ -31,6 +31,14 @@
<string name="home_screen_approvals_icon">approvals</string> <string name="home_screen_approvals_icon">approvals</string>
<string name="home_screen_reports_title">Reports</string> <string name="home_screen_reports_title">Reports</string>
<string name="home_screen_reports_icon">reports</string> <string name="home_screen_reports_icon">reports_new</string>
<string name="default_permissions_warning">You won\'t be able to use this feature until you grant all the respective permissions</string>
<string name="go_back">Go Back</string>
<string name="never_ask_again_permissions_warning">You may have denied some needed permissions in the past. Would you like to change that?</string>
<string name="no">NO</string>
<string name="confirm">Confirm</string>
<string name="ok">OK</string>
<!--End--> <!--End-->
</resources> </resources>
...@@ -2,4 +2,20 @@ ...@@ -2,4 +2,20 @@
<style name="HomeBackgroundStyle" parent="@style/Theme.AppCompat"> <style name="HomeBackgroundStyle" parent="@style/Theme.AppCompat">
<item name="android:background">@color/home_screen_bg_color</item> <item name="android:background">@color/home_screen_bg_color</item>
</style> </style>
<style name="CustomLoadingDialog" parent="android:style/Theme.Dialog">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
<style name="pharmacyBackgroundStyle" parent="@style/Theme.AppCompat">
<item name="android:background">@color/tool_bar_color</item>
<item name="colorPrimary">@color/tool_bar_color</item>
</style>
<style name="ToolbarTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:textColorPrimary">@color/screen_bg_color_white</item>
<item name="android:textColorSecondary">@color/screen_bg_color_white</item>
<item name="android:textColor">@color/tool_bar_color</item>
<item name="android:color">@color/screen_bg_color_white</item>
</style>`
</resources> </resources>
The file could not be displayed because it is too large.
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"0.0.6","enabled":true,"outputFile":"app-vportal-debug.apk","fullName":"vportalDebug","baseName":"vportal-debug"},"path":"app-vportal-debug.apk","properties":{}}]
\ No newline at end of file
...@@ -8,7 +8,7 @@ buildscript { ...@@ -8,7 +8,7 @@ buildscript {
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.android.tools.build:gradle:3.4.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:4.2.0' classpath 'com.google.gms:google-services:4.2.0'
......
#Wed Jan 09 12:34:55 IST 2019 #Fri Jun 28 17:58:46 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.6-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-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