vera 2.1 stable build for demo

parent bf298ac3
Showing with 2249 additions and 206 deletions
......@@ -33,11 +33,10 @@ android {
}
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.vsoft.servicenow"
minSdkVersion 15
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "0.0.1"
......@@ -125,8 +124,12 @@ dependencies {
exclude group: 'com.google.firebase', module: 'firebase-iid'
}
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 '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
implementation 'com.numetriclabz.numandroidcharts:numandroidcharts:1.0.9'
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--Home Screen-->
<!--home Screen-->
<dimen name="home_screen_image_height">150dp</dimen>
<dimen name="splash_screen_logo_margin">20dp</dimen>
......
<resources>
<string name="app_name">Arrow</string>
<!--Home Screen Option-->
<!--home Screen Option-->
<!--Start-->
<string name="home_screen_report_incident_title">Report Incident</string>
<string name="home_screen_report_incident_icon">report_incident</string>
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--Home Screen-->
<!--home Screen-->
<dimen name="home_screen_image_height">150dp</dimen>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">Citrix ServiceNow</string>
<!--Home Screen Option-->
<!--home Screen Option-->
<!--Start-->
<string name="home_screen_report_incident_title">Report Incident</string>
<string name="home_screen_report_incident_icon">report_incident</string>
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--Home Screen-->
<!--home Screen-->
<dimen name="home_screen_image_height">150dp</dimen>
<dimen name="splash_screen_logo_margin">20dp</dimen>
......
<resources>
<string name="app_name">GE Appliances</string>
<!--Home Screen Option-->
<!--home Screen Option-->
<!--Start-->
<string name="home_screen_report_incident_title">Report Incident</string>
<string name="home_screen_report_incident_icon">report_incident</string>
......
......@@ -8,6 +8,13 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<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
android:name="com.vsoft.servicenow.CatalogueApplication"
android:allowBackup="false"
......@@ -57,9 +64,20 @@
<activity
android:name="com.vsoft.servicenow.ui.MyIncidentScreen"
android:screenOrientation="portrait" />
<activity android:name=".ui.InAppWebViewActivity"/>
<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
android:name="io.fabric.ApiKey"
android:value="2b0a6e9db28d607fbcf71b8b25f1a0795e3f5b22" />
......
......@@ -14,6 +14,8 @@ import android.util.Log;
import android.widget.Toast;
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.Socket;
import com.google.android.gms.analytics.GoogleAnalytics;
......@@ -143,9 +145,15 @@ public class CatalogueApplication extends MultiDexApplication {
return netInfo != null && netInfo.isConnected();
}
public void initializeSocket() {
public void initializeSocket() {
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) {
throw new RuntimeException(e);
}
......
package com.vsoft.servicenow.adapters;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.support.v7.widget.RecyclerView;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.JavascriptInterface;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.RequestManager;
import com.vsoft.servicenow.R;
import com.vsoft.servicenow.db.models.ChatBotHistory;
import com.vsoft.servicenow.ui.MyIncidentScreen;
import com.vsoft.servicenow.utils.Constants;
import com.vsoft.servicenow.utils.PrefManager;
import com.vsoft.servicenow.utils.Util;
import java.io.File;
import java.util.List;
......@@ -21,43 +36,58 @@ public class ChatMessageAdapter extends RecyclerView.Adapter<ChatMessageAdapter.
private List<ChatBotHistory> mMessages;
private int[] mUsernameColors;
private Context mContext;
public ChatMessageAdapter(Context context, List<ChatBotHistory> messages) {
public ChatMessageAdapterListener chatMessageClickLister;
public ChatMessageAdapter(Context context, List<ChatBotHistory> messages,ChatMessageAdapter.ChatMessageAdapterListener chatMessageClickListener) {
mMessages = messages;
mContext = context;
mUsernameColors = context.getResources().getIntArray(R.array.username_colors);
chatMessageClickLister = chatMessageClickListener;
}
public interface ChatMessageAdapterListener {
void imageViewOnClick(String bitMap);
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View v = LayoutInflater
.from(parent.getContext())
.inflate(R.layout.item_message, parent, false);
.inflate(R.layout.item_message_new, parent, false);
return new ViewHolder(v);
}
@Override
public void onBindViewHolder(ViewHolder viewHolder, int position) {
ChatBotHistory chatBotHistory = mMessages.get(position);
viewHolder.setMessage(chatBotHistory.getUserName(), chatBotHistory.getMessage());
viewHolder.setMessage(chatBotHistory);
if(chatBotHistory.getUserName() != null) {
viewHolder.setUsername(chatBotHistory.getUserName());
viewHolder.setUsername(chatBotHistory.getUserName(),chatBotHistory.getMessage(),chatBotHistory.getImagUrl());
}
}
@Override
public long getItemId(int position) {
return super.getItemId(position);
}
@Override
public int getItemCount() {
return mMessages.size();
}
@Override
public int getItemViewType(int position) {
return -1;
return position;
}
public class ViewHolder extends RecyclerView.ViewHolder {
private TextView mUsernameView, mHrNameView;
private TextView mUserMessageView, mHRMessageView;
private LinearLayout user_image_lyt,hr_image_lyt;
private ImageView hr_send_image ,user_image;
private de.hdodenhof.circleimageview.CircleImageView user_icon, mHrImageView;
private RelativeLayout user_text_layt,hr_text_layt;
private RelativeLayout mHRContainerLayout;
private WebView webView;
private TextView viewAllBT;
public ViewHolder(View itemView) {
super(itemView);
......@@ -66,39 +96,197 @@ public class ChatMessageAdapter extends RecyclerView.Adapter<ChatMessageAdapter.
mHrNameView = (TextView) itemView.findViewById(R.id.hr_username);
mUserMessageView = (TextView) itemView.findViewById(R.id.user_message);
mHRMessageView = (TextView) itemView.findViewById(R.id.hr_message);
user_image_lyt = itemView.findViewById(R.id.user_image_lyt);
hr_image_lyt = itemView.findViewById(R.id.hr_image_lyt);
hr_send_image = itemView.findViewById(R.id.hr_send_image);
user_image = itemView.findViewById(R.id.user_image);
user_icon = itemView.findViewById(R.id.user_icon);
mHrImageView = itemView.findViewById(R.id.hr_image_view);
viewAllBT = itemView.findViewById(R.id.view_all);
user_text_layt = itemView.findViewById(R.id.user_text_layt);
hr_text_layt = itemView.findViewById(R.id.hr_text_layt);
mHRContainerLayout = (RelativeLayout) itemView.findViewById(R.id.hr_container_layout);
webView = itemView.findViewById(R.id.webview);
user_image.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
int pos = getAdapterPosition();
ChatBotHistory chatBotHistory = mMessages.get(pos);
String imageURl = chatBotHistory.getImagUrl();
chatMessageClickLister.imageViewOnClick(imageURl);
}
});
viewAllBT.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(mContext, MyIncidentScreen.class);
mContext.startActivity(intent);
}
});
}
public void setUsername(String username) {
public void setUsername(String username,String message,String imageUrl) {
if(mUsernameView != null && mHrNameView != null) {
if (username.equals(PrefManager.getSharedPref(mContext, PrefManager.PREFERENCE_USER_FIRST_NAME))) {
mUsernameView.setVisibility(View.VISIBLE);
mHrNameView.setVisibility(View.GONE);
mUsernameView.setText(username);
mUsernameView.setTextColor(getUsernameColor(username));
// mUsernameView.setVisibility(View.GONE);
// mHrNameView.setVisibility(View.GONE);
// mUsernameView.setText(username);
// mUsernameView.setTextColor(getUsernameColor(username));
if (imageUrl != null && !imageUrl.isEmpty()) {
if (message.isEmpty()) {
user_text_layt.setVisibility(View.VISIBLE);
user_icon.setVisibility(View.VISIBLE);
}
user_image_lyt.setVisibility(View.VISIBLE);
/*bmImg = BitmapFactory.decodeFile(imageUrl);
user_image.setImageBitmap(bmImg);*/
File file = new File(imageUrl);
Uri imageUri = Uri.fromFile(file);
Glide.with(mContext)
.load(imageUri)
.into(user_image);
}
} else {
mUsernameView.setVisibility(View.GONE);
mHrNameView.setVisibility(View.VISIBLE);
mHrNameView.setText(username);
mHrNameView.setTextColor(getUsernameColor(username));
// mUsernameView.setVisibility(View.GONE);
// mHrNameView.setVisibility(View.GONE);
// mHrNameView.setText(username);
// mHrNameView.setTextColor(getUsernameColor(username));
if (message.isEmpty()) {
mHRMessageView.setVisibility(View.GONE);
mUserMessageView.setVisibility(View.GONE);
user_icon.setVisibility(View.GONE);
hr_text_layt.setVisibility(View.GONE);
webView.setVisibility(View.GONE);
viewAllBT.setVisibility(View.GONE);
}
if (imageUrl != null && !imageUrl.isEmpty()) {
hr_image_lyt.setVisibility(View.VISIBLE);
Uri uri = Uri.parse(imageUrl);
// new AsyncTaskLoadImage().execute(imageUrl);
RequestManager requestManager = Glide.with(mContext);
RequestBuilder requestBuilder = requestManager.load(uri);
requestBuilder.into(hr_send_image);
} else {
hr_image_lyt.setVisibility(View.GONE);
}
}
}
}
public void setMessage(String userName, String message) {
public void setMessage(ChatBotHistory chatBotHistory ) {
String userName = chatBotHistory.getUserName();
String message = chatBotHistory.getMessage();
if(userName != null) {
if(mUserMessageView != null && mHRMessageView != null) {
if (userName.equals(PrefManager.getSharedPref(mContext, PrefManager.PREFERENCE_USER_FIRST_NAME))) {
mUserMessageView.setVisibility(View.VISIBLE);
if (message != null && message.length() > 0 && !message.isEmpty()) {
mUserMessageView.setVisibility(View.VISIBLE);
user_icon.setVisibility(View.VISIBLE);
user_text_layt.setVisibility(View.VISIBLE);
mHRMessageView.setVisibility(View.GONE);
mHRContainerLayout.setVisibility(View.GONE);
viewAllBT.setVisibility(View.GONE);
mUserMessageView.setMovementMethod(LinkMovementMethod.getInstance());
mUserMessageView.setText(Util.fromHtml(message));
}else {
mUserMessageView.setVisibility(View.GONE);
user_icon.setVisibility(View.GONE);
mHRContainerLayout.setVisibility(View.GONE);
mHRMessageView.setVisibility(View.GONE);
user_text_layt.setVisibility(View.GONE);
viewAllBT.setVisibility(View.GONE);
}
/* mUserMessageView.setVisibility(View.VISIBLE);
mHRMessageView.setVisibility(View.GONE);
user_icon.setVisibility(View.VISIBLE);
mUserMessageView.setMovementMethod(LinkMovementMethod.getInstance());
mUserMessageView.setText(Util.fromHtml(message));
mUserMessageView.setText(Util.fromHtml(message));*/
} else {
mUserMessageView.setVisibility(View.GONE);
if (message.length() > 0 && !message.isEmpty()) {
mUserMessageView.setVisibility(View.GONE);
user_icon.setVisibility(View.GONE);
mHRContainerLayout.setVisibility(View.VISIBLE);
if (message.contains(Constants.HTML_TABLE_TAG_TEXT)) {
hr_text_layt.setVisibility(View.GONE);
webView.setVisibility(View.VISIBLE);
mHRMessageView.setVisibility(View.GONE);
webView.getSettings().setJavaScriptEnabled(true);
webView.addJavascriptInterface(new WebAppInterface(mContext),"android");
webView.loadData(message, "text/html", "utf-8");
}else if(message.contains("following incidents:")) {
hr_text_layt.setVisibility(View.VISIBLE);
mHRMessageView.setVisibility(View.VISIBLE);
viewAllBT.setVisibility(View.VISIBLE);
mHRMessageView.setMovementMethod(LinkMovementMethod.getInstance());
mHRMessageView.setText(Util.fromHtml(message));
}else{
hr_text_layt.setVisibility(View.VISIBLE);
mHRMessageView.setVisibility(View.VISIBLE);
viewAllBT.setVisibility(View.GONE);
mHRMessageView.setMovementMethod(LinkMovementMethod.getInstance());
mHRMessageView.setText(Util.fromHtml(message));
}
} else {
mUserMessageView.setVisibility(View.GONE);
user_icon.setVisibility(View.GONE);
mHRMessageView.setVisibility(View.GONE);
hr_text_layt.setVisibility(View.GONE);
}
/* mUserMessageView.setVisibility(View.GONE);
mHRMessageView.setVisibility(View.VISIBLE);
mHRMessageView.setMovementMethod(LinkMovementMethod.getInstance());
mHRMessageView.setText(Util.fromHtml(message));
mHRMessageView.setText(Util.fromHtml(message));*/
}
}
}else {
}
}
private class WebAppInterface {
Context mContext;
WebAppInterface(Context c) {
mContext = c;
}
@JavascriptInterface
public void showDate(String toast) {
// calendarDate = toast;
new Handler().post(new Runnable() {
@Override
public void run() {
// clearChatAlertDialouge(toast);
// Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
// createdDialog().show();
}
});
}
}
......
......@@ -155,6 +155,7 @@ public interface DBConstants {
String INCIDENT_NUMBER = "number";
String INCIDENT_SHORT_DESCRIPTION = "short_description";
String INCIDENT_OPENED_AT = "opened_at";
String INCIDENT_SYS_ID = "sys_id";
String INCIDENT_IMPACT = "impact";
String INCIDENT_SYNC_DIRTY = SYNC_DIRTY;
......@@ -165,10 +166,12 @@ public interface DBConstants {
int INDEX_INCIDENT_NUMBER = 1;
int INDEX_INCIDENT_SHORT_DESCRIPTION = 2;
int INDEX_INCIDENT_OPENED_AT = 3;
int INDEX_INCIDENT_IMPACT = 4;
int INDEX_INCIDENT_SYNC_DIRTY = 5;
int INDEX_INCIDENT_SYS_ID = 4;
int INDEX_INCIDENT_IMPACT = 5;
int INCIDENT_COLUMN_COUNT = 6;
int INDEX_INCIDENT_SYNC_DIRTY = 6;
int INCIDENT_COLUMN_COUNT = 7;
/**
* MyRequest table
......@@ -386,6 +389,7 @@ public interface DBConstants {
String CHAT_BOT_HISTORY_ID = ID;
String CHAT_BOT_HISTORY_USER_ID = "user_id";
String CHAT_BOT_HISTORY_MESSAGE = "message";
String CHAT_BOT_HISTORY_IMAGE = "image";
String CHAT_BOT_HISTORY_TIME_STAMP = "timestamp";
/**
......@@ -394,11 +398,12 @@ public interface DBConstants {
int INDEX_CHAT_BOT_HISTORY_ID = 0;
int INDEX_CHAT_BOT_HISTORY_USER_ID = 1;
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.
*/
int CHAT_BOT_HISTORY_COLUMN_COUNT = 4;
int CHAT_BOT_HISTORY_COLUMN_COUNT = 5;
/**
* ChatBot User table
......
......@@ -135,6 +135,7 @@ public class DBManager extends SQLiteOpenHelper implements DBConstants {
+ INCIDENT_NUMBER + " text, "
+ INCIDENT_SHORT_DESCRIPTION + " text, "
+ INCIDENT_OPENED_AT + " real, "
+ INCIDENT_SYS_ID + " text, "
+ INCIDENT_IMPACT + " integer, "
+ INCIDENT_SYNC_DIRTY + " integer default " + SYNC_FLAG_NONE + ");");
}
......@@ -239,6 +240,7 @@ public class DBManager extends SQLiteOpenHelper implements DBConstants {
+ CHAT_BOT_HISTORY_ID + " integer primary key autoincrement, "
+ CHAT_BOT_HISTORY_USER_ID + " integer, "
+ CHAT_BOT_HISTORY_MESSAGE + " text, "
+ CHAT_BOT_HISTORY_IMAGE + " text, "
+ CHAT_BOT_HISTORY_TIME_STAMP + " real"
+ ");");
}
......
......@@ -28,14 +28,16 @@ public class ChatBotHistoryManager implements DBConstants {
}
}
public static int delete(ChatBotHistory chatBotHistory) {
public static int delete() {
SQLiteDatabase db = CatalogueApplication.getDatabase();
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;
}
public static int update(ChatBotHistory chatBotHistory) {
return update(chatBotHistory, null);
}
......@@ -53,6 +55,8 @@ public class ChatBotHistoryManager implements DBConstants {
contentValues.put(CHAT_BOT_HISTORY_USER_ID, chatBotHistory.getUserId());
} else if (CHAT_BOT_HISTORY_MESSAGE.equals(columnName)) {
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)) {
contentValues.put(CHAT_BOT_HISTORY_TIME_STAMP, chatBotHistory.getTimestamp());
}
......@@ -106,6 +110,7 @@ public class ChatBotHistoryManager implements DBConstants {
builder.setId(c.getLong(INDEX_CHAT_BOT_HISTORY_ID));
builder.setUserId(c.getInt(INDEX_CHAT_BOT_HISTORY_USER_ID));
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));
}
......@@ -113,6 +118,7 @@ public class ChatBotHistoryManager implements DBConstants {
ContentValues cv = new ContentValues(CHAT_BOT_HISTORY_COLUMN_COUNT - 1);
cv.put(CHAT_BOT_HISTORY_USER_ID, chatBotHistory.getUserId());
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());
return cv;
}
......
......@@ -64,7 +64,9 @@ public class MyIncidentsManager implements DBConstants {
contentValues.put(INCIDENT_SHORT_DESCRIPTION, incident.getShortDescription());
} else if (INCIDENT_OPENED_AT.equals(columnName)) {
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()));
}
}
......@@ -199,6 +201,7 @@ public class MyIncidentsManager implements DBConstants {
builder.setNumber(c.getString(INDEX_INCIDENT_NUMBER));
builder.setShortDescription(c.getString(INDEX_INCIDENT_SHORT_DESCRIPTION));
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.setSyncDirty(c.getInt(INDEX_INCIDENT_SYNC_DIRTY));
}
......@@ -208,6 +211,7 @@ public class MyIncidentsManager implements DBConstants {
cv.put(INCIDENT_NUMBER, incident.getNumber());
cv.put(INCIDENT_SHORT_DESCRIPTION, incident.getShortDescription());
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_SYNC_DIRTY, incident.getSyncDirty());
return cv;
......
......@@ -9,6 +9,7 @@ public class ChatBotHistory {
private long userId;
private String message;
private long timestamp;
private String imagUrl;
private String userName;
public long getId() {
......@@ -18,6 +19,14 @@ public class ChatBotHistory {
public void setId(long id) {
this.id = id;
}
public String getImagUrl() {
return imagUrl;
}
public void setImagUrl(String imagUrl) {
this.imagUrl = imagUrl;
}
public long getUserId() {
return userId;
......@@ -57,6 +66,7 @@ public class ChatBotHistory {
private String userName;
private String message;
private long timestamp;
private String imagUrl;
private ChatBotBuilder() {
}
......@@ -69,7 +79,10 @@ public class ChatBotHistory {
id = val;
return this;
}
public ChatBotBuilder setImagUrl(String imagUrl) {
this.imagUrl = imagUrl;
return this;
}
public ChatBotBuilder setUserId(long val) {
userId = val;
return this;
......@@ -101,6 +114,7 @@ public class ChatBotHistory {
chatBotHistory.setUserName(userName);
chatBotHistory.setMessage(message);
chatBotHistory.setTimestamp(timestamp);
chatBotHistory.setImagUrl(imagUrl);
return chatBotHistory;
}
}
......@@ -112,6 +126,7 @@ public class ChatBotHistory {
", userId=" + userId +
", message='" + message + '\'' +
", timestamp=" + timestamp +
", imageURL="+ imagUrl+
'}';
}
}
......@@ -16,9 +16,14 @@ public class Incident {
@SerializedName("number")
@Expose
private String number;
@SerializedName("short_description")
@Expose
private String shortDescription;
@SerializedName("sys_id")
@Expose
private String IncedintSysId;
@SerializedName("opened_at")
// @Expose
private long openedAt;
......@@ -26,6 +31,7 @@ public class Incident {
// @Expose
private Impact impact;
private int syncDirty;
public long getId() {
......@@ -60,6 +66,14 @@ public class Incident {
this.shortDescription = shortDescription;
}
public void setIncedintSysId(String incedintSysId) {
IncedintSysId = incedintSysId;
}
public String getIncedintSysId() {
return IncedintSysId;
}
public String getNumber() {
return number;
}
......@@ -109,8 +123,11 @@ public class Incident {
private long openedAt;
// @Expose
private Impact impact;
private String IncedintSysId;
private int syncDirty;
private IncidentBuilder() {
}
......@@ -142,14 +159,17 @@ public class Incident {
this.impact = impact;
return this;
}
public IncidentBuilder setIncedintSysId(String incedintSysId) {
this.IncedintSysId = incedintSysId;
return this;
}
public IncidentBuilder setSyncDirty(int syncDirty) {
this.syncDirty = syncDirty;
return this;
}
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() {
......@@ -158,6 +178,7 @@ public class Incident {
incident.setNumber(number);
incident.setShortDescription(shortDescription);
incident.setOpenedAt(openedAt);
incident.setIncedintSysId(IncedintSysId);
incident.setImpact(impact);
incident.setSyncDirty(syncDirty);
return incident;
......@@ -165,11 +186,13 @@ public class Incident {
}
public static class Json {
public static final String INCIDENT_SYS_ID = "sys_id";
public static final String IMPACT = "impact";
public static final String OPENED_AT = "opened_at";
public static final String SHORT_DESCRIPTION = "short_description";
public static final String CALLER_ID = "caller_id";
public static final String NUMBER = "number";
}
@Override
......@@ -179,6 +202,7 @@ public class Incident {
", number='" + number + '\'' +
", shortDescription='" + shortDescription + '\'' +
", openedAt=" + openedAt +
", SysId=" + IncedintSysId +
", impact=" + impact +
", syncDirty=" + syncDirty +
'}';
......
......@@ -259,6 +259,8 @@ public class SyncService extends IntentService {
incidentJsonObject.put(Incident.Json.SHORT_DESCRIPTION, incident.getShortDescription());
incidentJsonObject.put(Incident.Json.OPENED_AT, userSysId);
incidentJsonObject.put(Incident.Json.CALLER_ID, userSysId);
incidentJsonObject.put(Incident.Json.INCIDENT_SYS_ID, incident.getIncedintSysId());
} catch (JSONException e) {
e.printStackTrace();
}
......
package com.vsoft.servicenow.ui;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.provider.MediaStore;
import android.speech.tts.TextToSpeech;
import android.speech.tts.UtteranceProgressListener;
import android.support.v7.app.ActionBar;
......@@ -14,7 +21,12 @@ import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
......@@ -22,9 +34,11 @@ import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import com.github.nkzawa.emitter.Emitter;
import com.github.nkzawa.socketio.client.Socket;
import com.vsoft.servicenow.CatalogueApplication;
......@@ -42,16 +56,34 @@ import com.vsoft.servicenow.speechRecognizer.OnDSListener;
import com.vsoft.servicenow.speechRecognizer.OnDSPermissionsListener;
import com.vsoft.servicenow.utils.CatalogueLog;
import com.vsoft.servicenow.utils.Constants;
import com.vsoft.servicenow.utils.DialogUtils;
import com.vsoft.servicenow.utils.GenerateRandomString;
import com.vsoft.servicenow.utils.PermissionService;
import com.vsoft.servicenow.utils.PrefManager;
import com.vsoft.servicenow.utils.Util;
import com.vsoft.servicenow.utils.ZoomableImageView;
import com.wang.avi.AVLoadingIndicatorView;
import org.json.JSONException;
import org.json.JSONObject;
import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import org.opencv.android.Utils;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.imgproc.Imgproc;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* A chat Activity containing messages view and input form.
*/
......@@ -64,23 +96,32 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
private static String UNAUTHORIZED = "unauthorized";
private static String ADD_USER = "add user";
private static String NEW_MESSAGE_USER_EMAIL = "useremail";
private static String NEW_MESSAGE_USER_NAME = "username";
private static String NEW_MESSAGE_MESSAGE = "message";
private static String NEW_MESSAGE_IMAGE = "imageUrl";
private static String IS_END_OF_INTENT = "is_end_of_intent";
private static String NEW_MESSAGE_CAMERA_OPEN = "open_camera";
private final static String CLIENT_MESSAGE_KEY = "message";
private final static String CLIENT_MAIL_KEY = "user_email";
private final static String SESSION_ID_UNIQ = "session_id";
private final static String LOCATION = "location";
private final static String USER_SYSID = "user_sys_id";
private final static String SCANNED_IMAGE = "scanned_image";
private final static String TIME_KEY = "current_time";
private static final int CHECK_CODE = 102;
public static final int TAKE_PHOTO = 1;
private RecyclerView mMessagesView;
private EditText mInputMessageView;
private List<ChatBotHistory> mMessages = new ArrayList<>();
private RecyclerView.Adapter mAdapter;
private String mLoggedInUsername;
private String mLoggedInUserSysId;
private String userSysId;
private Socket mSocket;
private ImageButton sendImageToserv;
String takePictureFilePath = "";
private Speaker speaker;
private Boolean isConnected = false;
......@@ -91,16 +132,19 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
private static int CURRENT_STATE = NONE;
private ImageButton mVoiceButton;
private DroidSpeech droidSpeech;
AVLoadingIndicatorView textDotLoader;
/*According to this flag we'll close the conversation from mobile side. We'll get this flag in chat response*/
private boolean mIsConversationEnd;
private String mNewMessageUtteranceId;
Handler handlerDelayMessage = new Handler();
private static final int SCREEN_OFF = 0;
private static final int SCREEN_ON = 1;
private Bitmap takePhotobitmap = null;
private static final long LISTENING_DIALOG_DISMISS_DELAY_TIME = 10000;
private Boolean opencvEnd = false;
private boolean isBlur = false;
private Mat imageMat;
/**
* These var will to set delay for listing dialog. Previously it will open for infinite time.
......@@ -110,13 +154,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
private static final int LISTENING_DELAY_DONE_STATE = 2;
private static int LISTENING_DELAY_STATE = LISTENING_DELAY_DONE_STATE;
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
if (menuItem.getItemId() == android.R.id.home) {
finish();
}
return super.onOptionsItemSelected(menuItem);
}
@Override
public void onCreate(Bundle savedInstanceState) {
......@@ -126,7 +164,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
mLoggedInUserSysId = PrefManager.getSharedPref(this, PrefManager.PREFERENCE_USER_SYS_ID);
mLoggedInUsername = PrefManager.getSharedPref(this, PrefManager.PREFERENCE_USER_FIRST_NAME);
userSysId = PrefManager.getSharedPref(this, PrefManager.PREFERENCE_USER_SYS_ID);
if(TextUtils.isEmpty(mLoggedInUserSysId) || TextUtils.isEmpty(mLoggedInUsername)) {
CatalogueLog.e("User Sys id or Name is Null");
......@@ -166,14 +204,23 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
mSocket.connect();
checkTTS();
textDotLoader = findViewById(R.id.avi);
mMessagesView = (RecyclerView) findViewById(R.id.messages);
sendImageToserv = (ImageButton) findViewById(R.id.image_button);
mMessagesView.setLayoutManager(new LinearLayoutManager(this));
/*Get all chats from local DB.*/
mMessages = ChatBotHistoryManager.getAllChatBotHistory();
mAdapter = new ChatMessageAdapter(this, mMessages);
mAdapter = new ChatMessageAdapter(this, mMessages, new ChatMessageAdapter.ChatMessageAdapterListener() {
@Override
public void imageViewOnClick(String imagePath) {
shoawUserImagePopupImageAlert(imagePath);
}
});
mMessagesView.setAdapter(mAdapter);
if (mMessages != null && mMessages.size() > 0) textDotLoader.hide();
scrollToBottom();
mInputMessageView = (EditText) findViewById(R.id.message_input);
......@@ -233,6 +280,14 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
attemptSend();
}
});
sendImageToserv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
takePhoto();
}
});
mVoiceButton = (ImageButton) findViewById(R.id.voice_button);
mVoiceButton.setOnClickListener(new View.OnClickListener() {
......@@ -255,11 +310,126 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
mMessagesView.addOnItemTouchListener(mOnItemTouchListener);
}
public void clearChatAlertDialouge() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.home_screen_clear_chat_confirmation_msg_string)
.setCancelable(false)
.setPositiveButton(R.string.ok_string, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if (((CatalogueApplication) getApplication()).isNetConnected()) {
ChatBotHistoryManager.delete();
String generateRandomStrPharma = GenerateRandomString.randomString(30);
PrefManager.setSharedPref(ChatActivity.this, PrefManager.SESSION_ID, generateRandomStrPharma);
} else {
DialogUtils.showNoConnectionDialog(ChatActivity.this);
}
finish();
}
})
.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
private void shoawUserImagePopupImageAlert(String bitMap) {
ImageView manu_close_pop;
ZoomableImageView imageView;
LayoutInflater inflater = LayoutInflater.from(ChatActivity.this);
View dialogLayout = inflater.inflate(R.layout.zoom_image_pop_layout, null);
final android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder
(ChatActivity.this);
builder.setView(dialogLayout);
imageView = (ZoomableImageView) dialogLayout.findViewById(R.id.zoom_image_pharma);
manu_close_pop = (ImageView) dialogLayout.findViewById(R.id.manu_close_pop);
File file = new File(bitMap);
Uri imageUri = Uri.fromFile(file);
Glide.with(this)
.load(imageUri)
.into(imageView);
final android.support.v7.app.AlertDialog customAlertDialog = builder.create();
customAlertDialog.show();
manu_close_pop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
customAlertDialog.dismiss();
}
});
}
/*
* takePhoto - Take the photo from camera.
*
* @return void
* */
private void takePhoto() {
if (PermissionService.getInstance().hasPermission(this, PermissionService.TAKE_PHOTO, null)) {
Log.d(TAG, "takePhoto");
Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (takePhotoIntent.resolveActivity(getPackageManager()) != null) {
File photoFile = createJpgImageFile();
if (photoFile != null) {
takePictureFilePath = photoFile.getAbsolutePath();
takePhotoIntent.putExtra(MediaStore.EXTRA_OUTPUT, Util.getUriFromFile(this, photoFile));
startActivityForResult(takePhotoIntent, TAKE_PHOTO);
}
}
}
}
public static File createJpgImageFile() {
try {
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmssSSS").format(new Date());
String imageFileName = "JPEG_" + timeStamp;
File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
File image = File.createTempFile(imageFileName, ".jpeg", storageDir);
return image;
} catch (IOException e) {
return null;
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.more_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
switch (menuItem.getItemId()) {
case R.id.more_menu_clear:
clearChatAlertDialouge();
return true;
case android.R.id.home:
// todo: goto back activity from here
finish();
return true;
/*case R.id.voice_menu_icon:
return true;
case R.id.text_menu_icon:
return true;*/
default:
return super.onOptionsItemSelected(menuItem);
}
}
/**
* this message calls when we will add send and receive message in chat screen.
*/
private void addMessage(String username, String message) {
if(username.isEmpty() || message.isEmpty())
private void addMessage(String username, String message,String imageUrl) {
if(username.isEmpty())
return;
long userLocalId;
......@@ -268,25 +438,53 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
} else {
userLocalId = ChatBotUserManager.getChatBotUsersLocalId(ChatBotUser.CHAT_BOT_SYS_ID);
}
ChatBotHistory chatBotHistory = ChatBotHistory.ChatBotBuilder.aChatBotHistory()
.setMessage(message)
.setUserId(userLocalId)
.setUserName(username)
.setTimestamp(System.currentTimeMillis()).build();
ChatBotHistoryManager.save(chatBotHistory);
if(CURRENT_STATE == VOICE_STATE && !username.equals(mLoggedInUsername)) {
if(droidSpeech != null) {
droidSpeech.closeDroidSpeechOperations();
if(imageUrl != null && !imageUrl.isEmpty()){
ChatBotHistory chatBotHistory = ChatBotHistory.ChatBotBuilder.aChatBotHistory()
.setMessage(message)
.setUserId(userLocalId)
.setUserName(username)
.setImagUrl(imageUrl)
.setTimestamp(System.currentTimeMillis()).build();
ChatBotHistoryManager.save(chatBotHistory);
if(CURRENT_STATE == VOICE_STATE && !username.equals(mLoggedInUsername)) {
if(droidSpeech != null) {
droidSpeech.closeDroidSpeechOperations();
}
if(speaker != null) {
speaker.allow(true);
speaker.speak(message, mNewMessageUtteranceId);
}
}
if(speaker != null) {
speaker.allow(true);
speaker.speak(message, mNewMessageUtteranceId);
mMessages.add(chatBotHistory);
mAdapter.notifyItemInserted(mMessages.size() - 1);
}else {
ChatBotHistory chatBotHistory = ChatBotHistory.ChatBotBuilder.aChatBotHistory()
.setMessage(message)
.setUserId(userLocalId)
.setUserName(username)
.setImagUrl("")
.setTimestamp(System.currentTimeMillis()).build();
ChatBotHistoryManager.save(chatBotHistory);
if(CURRENT_STATE == VOICE_STATE && !username.equals(mLoggedInUsername)) {
if(droidSpeech != null) {
droidSpeech.closeDroidSpeechOperations();
}
if(speaker != null) {
speaker.allow(true);
speaker.speak(message, mNewMessageUtteranceId);
}
}
mMessages.add(chatBotHistory);
mAdapter.notifyItemInserted(mMessages.size() - 1);
}
mMessages.add(chatBotHistory);
mAdapter.notifyItemInserted(mMessages.size() - 1);
scrollToBottom();
}
......@@ -296,7 +494,7 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
private void attemptSend() {
if (null == mLoggedInUsername) return;
if (!mSocket.connected()) return;
textDotLoader.show();
//Whenever we'll click on send button, running TTS speak should stop
if(speaker != null && speaker.isSpeaking()) {
speaker.stop();
......@@ -309,19 +507,29 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
}
mInputMessageView.setText("");
addMessage(mLoggedInUsername, message);
addMessage(mLoggedInUsername, message,"");
// perform the sending message attempt.
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put(CLIENT_MESSAGE_KEY, message);
jsonObject.put(CLIENT_MAIL_KEY, PrefManager.getSharedPref(this, PrefManager.PREFERENCE_USER_EMAIL_ID));
jsonObject.put(SESSION_ID_UNIQ, PrefManager.getSharedPref(ChatActivity.this, PrefManager.SESSION_ID));
jsonObject.put(LOCATION, "location");
jsonObject.put(USER_SYSID, userSysId);
// jsonObject.put(SCANNED_IMAGE, "");
} catch (JSONException e) {
e.printStackTrace();
}
mSocket.emit(NEW_MESSAGE, jsonObject);
}
@Override
public void onBackPressed() {
super.onBackPressed();
finish();
}
private void scrollToBottom() {
mMessagesView.scrollToPosition(mAdapter.getItemCount() - 1);
}
......@@ -385,14 +593,27 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
runOnUiThread(new Runnable() {
@Override
public void run() {
JSONObject data = (JSONObject) args[0];
handlerDelayMessage.postDelayed(new Runnable() {
@Override
public void run() {
JSONObject data = (JSONObject) args[0];
String username;
String message;
String useremail;
String imageUrl;
String isCameraOpen = null;
try {
useremail = data.getString(NEW_MESSAGE_USER_EMAIL);
username = data.getString(NEW_MESSAGE_USER_NAME);
message = data.getString(NEW_MESSAGE_MESSAGE);
mIsConversationEnd = data.getBoolean(IS_END_OF_INTENT);
mNewMessageUtteranceId = String.valueOf(System.currentTimeMillis());
imageUrl = data.getString(NEW_MESSAGE_IMAGE);
// isCameraOpen = data.getString(NEW_MESSAGE_CAMERA_OPEN);
// if(isCameraOpen.contains("yes")){
// takePhoto();
// }
} catch (JSONException e) {
CatalogueLog.e(e.getMessage());
return;
......@@ -407,8 +628,20 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
.build();
ChatBotUserManager.save(chatBotUser);
}
addMessage(username, message);
addMessage(username, message,"");
}
}
}, 400);
handlerDelayMessage.postDelayed(new Runnable() {
@Override
public void run() {
textDotLoader.hide();
}
}, 300);
}
});
}
......@@ -508,65 +741,207 @@ public class ChatActivity extends AppCompatActivity implements OnDSListener, OnD
@Override
public void onActivityResult(int requestCode, int resultCode,
Intent data) {
if (requestCode == CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
speaker = new Speaker(this);
speaker.getTTS().setOnUtteranceProgressListener(new UtteranceProgressListener() {
@Override
public void onDone(String utteranceId) {
callScreenOnAndOff(SCREEN_OFF);
if (resultCode == RESULT_OK) {
if (requestCode == CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
speaker = new Speaker(this);
speaker.getTTS().setOnUtteranceProgressListener(new UtteranceProgressListener() {
@Override
public void onDone(String utteranceId) {
callScreenOnAndOff(SCREEN_OFF);
/*Start Code
Sometime speaker is not getting stop that's why it is breaking.
* We need to forcefully stop it.*/
long utteranceIdLong = Long.parseLong(utteranceId);
long messageUtteranceId = Long.parseLong(mNewMessageUtteranceId);
if(utteranceIdLong == messageUtteranceId
&& speaker != null && speaker.isSpeaking()) {
speaker.stop();
long utteranceIdLong = Long.parseLong(utteranceId);
long messageUtteranceId = Long.parseLong(mNewMessageUtteranceId);
if (utteranceIdLong == messageUtteranceId
&& speaker != null && speaker.isSpeaking()) {
speaker.stop();
}
/*End Code*/
if (!mIsConversationEnd && (!speaker.isSpeaking() && droidSpeech != null)) {
runOnUiThread(new Runnable() {
@Override
public void run() {
droidSpeech.startDroidSpeechRecognition();
}
});
CURRENT_STATE = VOICE_STATE;
}
}
/*End Code*/
if (!mIsConversationEnd && (!speaker.isSpeaking() && droidSpeech != null)) {
runOnUiThread(new Runnable() {
@Override
public void run() {
droidSpeech.startDroidSpeechRecognition();
}
});
CURRENT_STATE = VOICE_STATE;
@Override
public void onError(String utteranceId) {
}
}
@Override
public void onError(String utteranceId) {
}
@Override
public void onStart(String utteranceId) {
callScreenOnAndOff(SCREEN_ON);
@Override
public void onStart(String utteranceId) {
callScreenOnAndOff(SCREEN_ON);
if (droidSpeech != null) {
droidSpeech.closeDroidSpeechOperations();
if (droidSpeech != null) {
droidSpeech.closeDroidSpeechOperations();
}
}
});
} else {
Intent install = new Intent();
install.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(install);
}
} else if (requestCode == Constants.LOGIN_SCREEN_REQUEST_CODE) {
} else if (requestCode == TAKE_PHOTO) {
if (takePictureFilePath != null && !takePictureFilePath.isEmpty()) {
processImageAsBitmap(takePictureFilePath);
}
}
}
}
public void reTakePhoto() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.error_message);
builder.setMessage(R.string.blur_image)
.setCancelable(false)
.setPositiveButton(R.string.ok_string, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
takePhoto();
}
});
AlertDialog alert = builder.create();
alert.show();
}
private void processImageAsBitmap(String imageFilePath) {
try {
BitmapFactory.Options bitmapOptions = new BitmapFactory.Options();
takePhotobitmap = BitmapFactory.decodeFile(imageFilePath, bitmapOptions);
// setImageOrientation(imageFilePath, bitmap);
if (takePhotobitmap != null) {
opencvProcess(takePhotobitmap);
if (isBlur) {
reTakePhoto();
} else {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
takePhotobitmap.compress(Bitmap.CompressFormat.JPEG, 75, byteArrayOutputStream);
byte[] byteArray = byteArrayOutputStream.toByteArray();
String base64Image = Base64.encodeToString(byteArray, Base64.DEFAULT);
addMessage(mLoggedInUsername, "", takePictureFilePath);
/* if (null == mLoggedInUsername) return;
if (!mSocket.connected()) return;
textDotLoader.show();
// perform the sending message attempt.
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put(CLIENT_MESSAGE_KEY, "");
jsonObject.put(CLIENT_MAIL_KEY, PrefManager.getSharedPref(this, PrefManager.PREFERENCE_USER_EMAIL_ID));
jsonObject.put(SESSION_ID_UNIQ, PrefManager.getSharedPref(ChatActivity.this, PrefManager.SESSION_ID));
jsonObject.put(LOCATION, "location");
jsonObject.put(USER_SYSID, userSysId);
jsonObject.put(SCANNED_IMAGE, base64Image);
} catch (JSONException e) {
e.printStackTrace();
}
mSocket.emit(NEW_MESSAGE, jsonObject);*/
}
} else {
Intent install = new Intent();
install.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(install);
}
} else if(requestCode == Constants.LOGIN_SCREEN_REQUEST_CODE) {
} catch (Exception e) {
e.printStackTrace();
}
}
private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
{
Log.i("OpenCV", "OpenCV loaded successfully");
imageMat=new Mat();
} break;
default:
{
super.onManagerConnected(status);
} break;
}
}
};
private void opencvProcess(Bitmap image) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inDither = true;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
int l = CvType.CV_8UC1; //8-bit grey scale image
Utils.bitmapToMat(image, imageMat);
Mat matImageGrey = new Mat();
Imgproc.cvtColor(imageMat, matImageGrey, Imgproc.COLOR_BGR2GRAY);
Bitmap destImage;
destImage = Bitmap.createBitmap(image);
Mat dst2 = new Mat();
Utils.bitmapToMat(destImage, dst2);
Mat laplacianImage = new Mat();
dst2.convertTo(laplacianImage, l);
Imgproc.Laplacian(matImageGrey, laplacianImage, CvType.CV_8U);
Mat laplacianImage8bit = new Mat();
laplacianImage.convertTo(laplacianImage8bit, l);
Bitmap bmp = Bitmap.createBitmap(laplacianImage8bit.cols(), laplacianImage8bit.rows(), Bitmap.Config.ARGB_8888);
Utils.matToBitmap(laplacianImage8bit, bmp);
int[] pixels = new int[bmp.getHeight() * bmp.getWidth()];
bmp.getPixels(pixels, 0, bmp.getWidth(), 0, 0, bmp.getWidth(), bmp.getHeight());
int maxLap = -16777216; // 16m
for (int pixel : pixels) {
if (pixel > maxLap)
maxLap = pixel;
}
int soglia = -6118750;
if (maxLap <= soglia) {
System.out.println("is blur image");
}
soglia += 6118750;
maxLap += 6118750;
opencvEnd = true;
isBlur = maxLap <= soglia;
}
private void checkTTS() {
Intent check = new Intent();
check.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(check, CHECK_CODE);
}
public void onResume()
{
super.onResume();
if (!OpenCVLoader.initDebug()) {
Log.d("OpenCV", "Internal OpenCV library not found. Using OpenCV Manager for initialization");
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, this, mLoaderCallback);
} else {
Log.d("OpenCV", "OpenCV library found inside package. Using it!");
mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
}
}
RecyclerView.OnItemTouchListener mOnItemTouchListener = new RecyclerView.OnItemTouchListener() {
@Override
public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
......
......@@ -45,9 +45,7 @@ public class HomeScreen extends HandleNotificationActivity {
setContentView(R.layout.home_screen);
ButterKnife.bind(this);
CatalogueApplication application = (CatalogueApplication) getApplication();
Tracker tracker = application.getDefaultTracker();
// Send initial screen view hit.
Util.sendScreenName(tracker, getString(R.string.home_screen_string));
......@@ -164,6 +162,7 @@ public class HomeScreen extends HandleNotificationActivity {
PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_USER_ID, "");
PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_USER_FULL_NAME, "");
PrefManager.setSharedPref(HomeScreen.this, PrefManager.PREFERENCE_USER_EMAIL_ID, "");
PrefManager.setSharedPref(HomeScreen.this, PrefManager.SESSION_ID, "");
Intent loginIntent = new Intent(HomeScreen.this, LoginScreen.class);
loginIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
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;
import android.view.KeyEvent;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.analytics.Tracker;
import com.vsoft.servicenow.CatalogueApplication;
......@@ -27,6 +26,7 @@ import com.vsoft.servicenow.db.models.ChatBotUser;
import com.vsoft.servicenow.db.models.UserApiValues;
import com.vsoft.servicenow.utils.Constants;
import com.vsoft.servicenow.utils.DialogUtils;
import com.vsoft.servicenow.utils.GenerateRandomString;
import com.vsoft.servicenow.utils.KeyboardUtil;
import com.vsoft.servicenow.utils.PrefManager;
import com.vsoft.servicenow.utils.Util;
......@@ -213,6 +213,8 @@ public class LoginScreen extends Activity {
}
if (syncStatus == API_SUCCESS_USER_DETAIL) {
if (mUserDetails != null) {
String generateRandoStrPharma = GenerateRandomString.randomString(30);
PrefManager.setSharedPref(LoginScreen.this, PrefManager.SESSION_ID, generateRandoStrPharma);
String firstName = mUserDetails.get(0).getFirstName();
String lastName = mUserDetails.get(0).getLastName();
String sysid = mUserDetails.get(0).getSysId();
......
......@@ -2,6 +2,8 @@ package com.vsoft.servicenow.ui;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
......@@ -24,6 +26,7 @@ import com.vsoft.servicenow.api.managers.IncidentApiManager;
import com.vsoft.servicenow.db.managers.MyIncidentsManager;
import com.vsoft.servicenow.db.models.Incident;
import com.vsoft.servicenow.enums.SyncStatus;
import com.vsoft.servicenow.utils.Constants;
import com.vsoft.servicenow.utils.DialogUtils;
import com.vsoft.servicenow.utils.Util;
......@@ -98,19 +101,35 @@ public class MyIncidentScreen extends HandleNotificationActivity {
void listViewOnClicked(int 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());
*/
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))
.setCancelable(false)
.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();
}
});
AlertDialog alert = builder.create();
alert.show();
alert.show();*/
}
class FetchIncident extends AsyncTask<String, Void, SyncStatus> {
......
......@@ -152,10 +152,11 @@ public class Constants {
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_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 */
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 */
public static final String URL_GET_CATALOGUE_ITEM = DOMAIN + AppConfig.URL_GET_CATALOGUE_ITEM;
......@@ -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_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_STRING = "urlString";
/*Get All My HRCase*/
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*/
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_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;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.text.SpannableStringBuilder;
import com.vsoft.servicenow.R;
......@@ -56,4 +58,103 @@ public class DialogUtils {
AlertDialog alert = builder.create();
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 {
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_EMAIL_ID = "user_email_id";
public static final String SESSION_ID = "pharma_session_id";
//Chat Server Url
public static final String PREFERENCE_CHAT_SERVER_URL = "chat_server_url";
......
......@@ -8,7 +8,9 @@ import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Build;
import android.support.v4.content.ContextCompat;
import android.support.v4.content.FileProvider;
import android.support.v7.app.AlertDialog;
import android.text.Html;
import android.text.InputType;
......@@ -46,6 +48,7 @@ import com.vsoft.servicenow.menu.ChatMenuItemData;
import com.vsoft.servicenow.menu.CreateHRCaseMenuItemData;
import com.vsoft.servicenow.menu.NotificationMenuItemData;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -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) {
VariableViewContainer container = new VariableViewContainer();
/*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"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/LightBackgroundStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -7,6 +8,10 @@
tools:context=".ui.ChatActivity">
<include layout="@layout/toolbar" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/black"/>
<LinearLayout
android:layout_width="match_parent"
......@@ -19,49 +24,96 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginBottom="@dimen/small_margin"
android:layout_marginBottom="@dimen/normal_margin"
android:scrollbarStyle="outsideOverlay"
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
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/black"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin">
android:orientation="vertical"
android:layout_marginTop="@dimen/small_margin"
android:background="@color/screen_bg_color_white"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<EditText
android:id="@+id/message_input"
android:layout_width="0dp"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/prompt_message"
android:imeActionId="@+id/send"
android:imeActionLabel="@string/action_send"
android:imeOptions="actionSend"
android:inputType="textCapSentences"
android:maxLines="1"
android:singleLine="true" />
android:layout_margin="5dp"
android:orientation="horizontal">
<ImageButton
android:id="@+id/image_button"
android:layout_width="30dp"
android:layout_height="30dp"
android:contentDescription="@string/action_send"
android:visibility="gone"
android:background="@drawable/ic_camera_chat" />
<ImageButton
android:id="@+id/send_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/action_send"
android:src="@android:drawable/ic_menu_send" />
<ImageButton
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="15dp"
android:contentDescription="@string/action_send"
android:background="@drawable/ic_mic_chat"
android:visibility="gone"/>
<ImageButton
android:id="@+id/voice_button"
android:layout_width="wrap_content"
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/action_send"
android:src="@drawable/vera_icon" />
android:orientation="horizontal">
<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>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
style="@style/HomeBackgroundStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#EBEAEA"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/tool_bar_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:background="#303030"
android:minHeight="?attr/actionBarSize"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
......@@ -26,12 +26,12 @@
<ImageView
android:id="@+id/nav_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:src="@drawable/home_icon"
android:tint="@color/tool_bar_image_color" />
android:src="@drawable/home_icon_new"
/>
<TextView
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
......@@ -40,15 +40,15 @@
android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:text="@string/app_name"
android:textColor="@color/tool_bar_title_color" />
android:textColor="@color/screen_bg_color_white" />
<ImageView
android:id="@+id/home_screen_logout_image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/logout_icon"
android:background="@drawable/logout_ic"
android:tint="@color/tool_bar_image_color" />
</RelativeLayout>
......@@ -58,8 +58,10 @@
android:id="@+id/home_screen_grid_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/home_background"
android:horizontalSpacing="@dimen/large_margin"
android:numColumns="2"
android:layout_marginTop="0dp"
android:stretchMode="columnWidth"
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 @@
<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/WhiteBackgroundStyle"
app:theme="@style/ToolbarTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:background="#303030"
android:minHeight="?attr/actionBarSize"
android:padding="0dp"
app:titleTextColor="@color/tool_bar_title_color"
app:titleTextColor="@color/screen_bg_color_white"
app:contentInsetEnd="0dp"
app:contentInsetLeft="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 @@
<color name="home_screen_bg_color">@color/colorPrimary</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="back_button_bg_color">#4f0307</color>
......
......@@ -13,9 +13,10 @@
<dimen name="catalogue_category_and_item_list_view_divider_height">5dp</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_height">150dp</dimen>
<dimen name="home_screen_image_height_new">170dp</dimen>
<dimen name="list_item_height">100dp</dimen>
......
......@@ -111,7 +111,7 @@
<string name="catalogue_user_id">user_id</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>
<!--Notifications-->
......@@ -137,6 +137,8 @@
<!-- messages -->
<string name="message_welcome">Chat with VERA</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-->
<string name="ds_listening">Listening…</string>
......@@ -158,10 +160,10 @@
<item>Insufficient permissions</item>
</string-array>
<!--Home Screen Option-->
<!--home Screen Option-->
<!--Start-->
<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_icon">order_services</string>
......@@ -178,6 +180,9 @@
<string name="home_screen_notification_title">Notifications</string>
<string name="home_screen_notification_icon">notifications</string>
<!--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-->
<string name="hr_case_category_string">HR Case</string>
......
......@@ -23,7 +23,7 @@
</style>
<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 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>
<string name="app_name">UofL ServiceNow</string>
<!--Home Screen Option-->
<!--home Screen Option-->
<!--Start-->
<string name="home_screen_report_incident_title">Report Incident</string>
<string name="home_screen_report_incident_icon">ic_my_incident_icon</string>
......
......@@ -12,8 +12,8 @@ public class AppConfig {
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_ID_DEBUG = "d958eb06b0f3830093781f441d59febc";
public static final String LOGIN_CLIENT_SECRET_DEBUG = "krD*!O}1.8";
public static final String LOGIN_CLIENT_ID_DEBUG = "89cfc0656ce6b30012af8b50316c9376";
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_SECRET_STAGING = "+tPJ@jS<;S";
......@@ -21,42 +21,47 @@ public class AppConfig {
/**
* 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_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
*/
/*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 */
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 */
public static final String URL_GET_VARIABLE = "api/vsng2/uofl_mobile/catalogue_variable_screen";
public static final String URL_GET_UI_POLICY = "/api/vsng2/uofl_mobile/uipolicy";
public static final String URL_GET_VARIABLE_CHOICE = "/api/vsng2/uofl_mobile/question_choice";
public static final String URL_POST_CATALOGUE_ITEM = "api/vsng2/uofl_mobile";
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/x_vsng2_chatbot/uofl_mobile/uipolicy";
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/x_vsng2_chatbot/uofl_mobile";
/*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 */
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 */
public static final String URL_GET_HR_CASE_VARIABLE = "api/vsng2/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_VARIABLE_CHOICE = "/api/vsng2/uofl_mobile/question_choice";
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/x_vsng2_chatbot/uofl_mobile/uipolicy";
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";
/**
* 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_DEBUG = "http://ai.test.vsoftconsulting.com:3000/?env=dev";
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_RELEASE = "http://52.21.5.26:12811/service_discovery";
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://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 @@
<ImageView
android:id="@+id/home_screen_adapter_image_view"
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_marginTop="10dp"
android:layout_marginBottom="5dp"
android:scaleType="centerCrop" />
<TextView
......
......@@ -3,12 +3,12 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#000"
android:orientation="vertical">
<ImageView
android:layout_margin="10dp"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/splash_logo" />
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/splash_screen_logo" />
</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 @@
<!--Toolbar image color-->
<color name="tool_bar_image_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>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<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>
<string name="app_name">VERA</string>
<!--Home Screen Option-->
<!--home Screen Option-->
<!--Start-->
<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_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_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_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_icon">create_hr_case</string>
......@@ -22,7 +22,7 @@
<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_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_icon">notifications</string>
......@@ -31,6 +31,14 @@
<string name="home_screen_approvals_icon">approvals</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-->
</resources>
......@@ -2,4 +2,20 @@
<style name="HomeBackgroundStyle" parent="@style/Theme.AppCompat">
<item name="android:background">@color/home_screen_bg_color</item>
</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>
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 {
maven { url "https://jitpack.io" }
}
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.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
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
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