Commit bf298ac3 by HABI SHAIK

added webview screen for catalogue item selection, handled getnotification in push notifs

parent f2f40f22
...@@ -104,7 +104,7 @@ dependencies { ...@@ -104,7 +104,7 @@ dependencies {
implementation 'com.squareup.retrofit2:converter-gson:2.3.0' implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1' implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
implementation 'com.jakewharton:butterknife:8.8.1' implementation 'com.jakewharton:butterknife:8.8.1'
implementation ('com.google.android.gms:play-services-analytics:15.0.2') { implementation ('com.google.android.gms:play-services-analytics:16.0.8') {
exclude group: 'com.google.firebase', module: 'firebase-iid' exclude group: 'com.google.firebase', module: 'firebase-iid'
} }
...@@ -121,10 +121,10 @@ dependencies { ...@@ -121,10 +121,10 @@ dependencies {
implementation 'com.android.support:animated-vector-drawable:27.1.1' implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.1' implementation 'com.android.support:support-media-compat:27.1.1'
implementation 'com.android.support:support-v4:27.1.1' implementation 'com.android.support:support-v4:27.1.1'
implementation ('com.google.firebase:firebase-messaging:15.0.2') { implementation ('com.google.firebase:firebase-messaging:17.6.0') {
exclude group: 'com.google.firebase', module: 'firebase-iid' exclude group: 'com.google.firebase', module: 'firebase-iid'
} }
implementation 'com.google.firebase:firebase-core:15.0.2' implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.android.support.constraint:constraint-layout:1.1.3'
......
...@@ -10,12 +10,13 @@ ...@@ -10,12 +10,13 @@
<application <application
android:name="com.vsoft.servicenow.CatalogueApplication" android:name="com.vsoft.servicenow.CatalogueApplication"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:allowBackup="false" android:allowBackup="false"
android:fullBackupContent="false" android:fullBackupContent="false"
tools:replace="allowBackup" android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme"> android:label="@string/app_name"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme"
tools:replace="allowBackup">
<activity <activity
android:name="com.vsoft.servicenow.ui.SplashScreen" android:name="com.vsoft.servicenow.ui.SplashScreen"
android:label="@string/app_name" android:label="@string/app_name"
...@@ -29,7 +30,7 @@ ...@@ -29,7 +30,7 @@
<activity <activity
android:name="com.vsoft.servicenow.ui.LoginScreen" android:name="com.vsoft.servicenow.ui.LoginScreen"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden"/> android:windowSoftInputMode="adjustResize|stateHidden" />
<activity <activity
android:name="com.vsoft.servicenow.ui.HomeScreen" android:name="com.vsoft.servicenow.ui.HomeScreen"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
...@@ -40,19 +41,22 @@ ...@@ -40,19 +41,22 @@
android:name="com.vsoft.servicenow.ui.CatalogueItemScreen" android:name="com.vsoft.servicenow.ui.CatalogueItemScreen"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name="com.vsoft.servicenow.CatalogueWebViewScreen"
android:screenOrientation="portrait" />
<activity
android:name="com.vsoft.servicenow.ui.CatalogueVariableScreen" android:name="com.vsoft.servicenow.ui.CatalogueVariableScreen"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize" /> android:windowSoftInputMode="stateHidden|adjustResize" />
<activity <activity
android:name="com.vsoft.servicenow.ui.ReportIncidentScreen" android:name="com.vsoft.servicenow.ui.ReportIncidentScreen"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize"/> android:windowSoftInputMode="stateHidden|adjustResize" />
<activity <activity
android:name="com.vsoft.servicenow.ui.MyRequestActivity" android:name="com.vsoft.servicenow.ui.MyRequestActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name="com.vsoft.servicenow.ui.MyIncidentScreen" android:name="com.vsoft.servicenow.ui.MyIncidentScreen"
android:screenOrientation="portrait"/> android:screenOrientation="portrait" />
<service android:name=".service.SyncService" /> <service android:name=".service.SyncService" />
......
package com.vsoft.servicenow;
import android.app.ProgressDialog;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.vsoft.servicenow.utils.Constants;
import com.vsoft.servicenow.utils.PrefManager;
import java.util.HashMap;
import java.util.Map;
/**
* Created by habi on 5/24/2019.
*/
public class CatalogueWebViewScreen extends AppCompatActivity {
private WebView wv;
private ProgressDialog progressBar;
String url = "http://vsoftconsultingdev.service-now.com/sp?id=sc_cat_item&sys_id=";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_catalogue_web_view);
wv = (WebView) findViewById(R.id.webview);
Bundle extras = getIntent().getExtras();
String catalogueItemSysId = null;
if (extras != null) {
catalogueItemSysId = extras.getString(Constants.DATA_KEY_SYS_ID);
}
url = url + catalogueItemSysId;
progressBar = new ProgressDialog(CatalogueWebViewScreen.this);
progressBar.setMessage("Loading...");
progressBar.show();
WebSettings webSettings = wv.getSettings();
webSettings.setLoadWithOverviewMode(true);
webSettings.setUseWideViewPort(true);
webSettings.setBuiltInZoomControls(true);
webSettings.setPluginState(WebSettings.PluginState.ON);
webSettings.setDomStorageEnabled(true);
webSettings.setJavaScriptEnabled(true);
wv.setWebViewClient(new myWebClient());
wv.loadUrl(url);
}
public class myWebClient extends WebViewClient {
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// TODO Auto-generated method stub
super.onPageStarted(view, url, favicon);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// TODO Auto-generated method stub
view.loadUrl(url, getCustomHeaders());
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
if (progressBar.isShowing()) {
progressBar.dismiss();
}
}
}
private Map<String, String> getCustomHeaders() {
String authHeader = "Bearer " + PrefManager.getSharedPref(this, PrefManager.PREFERENCE_ACCESS_TOKEN);
Map<String, String> headers = new HashMap<>();
headers.put("Authorization", authHeader);
return headers;
}
}
package com.vsoft.servicenow.service; package com.vsoft.servicenow.service;
import android.app.Notification;
import android.app.NotificationChannel; import android.app.NotificationChannel;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.app.PendingIntent; import android.app.PendingIntent;
...@@ -14,15 +13,11 @@ import android.support.v4.content.LocalBroadcastManager; ...@@ -14,15 +13,11 @@ import android.support.v4.content.LocalBroadcastManager;
import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage; import com.google.firebase.messaging.RemoteMessage;
import com.vsoft.servicenow.CatalogueApplication;
import com.vsoft.servicenow.R; import com.vsoft.servicenow.R;
import com.vsoft.servicenow.db.managers.NotificationsManager;
import com.vsoft.servicenow.db.models.Notifications; import com.vsoft.servicenow.db.models.Notifications;
import com.vsoft.servicenow.ui.NotificationScreen; import com.vsoft.servicenow.ui.MyIncidentScreen;
import com.vsoft.servicenow.ui.PendingApprovalsActivity;
import com.vsoft.servicenow.utils.CatalogueLog; import com.vsoft.servicenow.utils.CatalogueLog;
import com.vsoft.servicenow.utils.Constants; import com.vsoft.servicenow.utils.Constants;
import com.vsoft.servicenow.utils.PrefManager;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
...@@ -36,69 +31,94 @@ import java.util.Map; ...@@ -36,69 +31,94 @@ import java.util.Map;
*/ */
public class NotificationMessagingService extends FirebaseMessagingService { public class NotificationMessagingService extends FirebaseMessagingService {
private static final String MESSAGE_BODY_INCIDENT_TITLE = "Incidents"; private static final String MESSAGE_BODY_INCIDENT_TITLE = "Incidents";
private static final String MESSAGE_BODY_HR_CASE_TITLE = "HR Cases"; private static final String MESSAGE_BODY_HR_CASE_TITLE = "HR Cases";
private static final String MESSAGE_BODY_REQUEST_TITLE = "Order Services"; private static final String MESSAGE_BODY_REQUEST_TITLE = "Order Services";
private static final String MESSAGE_BODY_APPROVALS_TITLE = "My Approvals"; private static final String MESSAGE_BODY_APPROVALS_TITLE = "My Approvals";
private static final String FCM_KEY_TITLE = "title"; private static final String FCM_KEY_TITLE = "title";
private static final String FCM_KEY_BODY = "body"; private static final String FCM_KEY_BODY = "body";
private static final String FCM_KEY_REQUEST_STATE = "state"; private static final String FCM_KEY_DATA = "data";
private static final String FCM_KEY_INCIDENT_PRIORITY = "priority"; private static final String FCM_KEY_REQUEST_STATE = "state";
private static final String FCM_KEY_SHORT_DESCRIPTION = "short_description"; private static final String FCM_KEY_INCIDENT_PRIORITY = "priority";
private static final String FCM_KEY_CREATED_BY = "created_by"; private static final String FCM_KEY_SHORT_DESCRIPTION = "short_description";
private static final String FCM_KEY_MESSAGE_BODY_TITLE = "title"; private static final String FCM_KEY_CREATED_BY = "created_by";
private static final String FCM_KEY_PTO_REQUEST_STATUS = "u_request_status"; private static final String FCM_KEY_MESSAGE_BODY_TITLE = "title";
private static final String FCM_KEY_PTO_REQUEST_STATUS = "u_request_status";
private static final String CHANNEL_ID = "sn_channel";
private static final String CHANNEL_ID = "sn_channel";
/**
* This is default constructor of NotificationMessagingService. /**
*/ * This is default constructor of NotificationMessagingService.
public NotificationMessagingService() { */
public NotificationMessagingService() {
}
}
@Override
public void onMessageReceived(RemoteMessage remoteMessage) { @Override
String userSysId = PrefManager.getSharedPref(CatalogueApplication.getContext(), PrefManager.PREFERENCE_USER_SYS_ID); public void onMessageReceived(RemoteMessage remoteMessage) {
if (userSysId != null && !userSysId.isEmpty()) { // String userSysId = PrefManager.getSharedPref(CatalogueApplication.getContext(), PrefManager.PREFERENCE_USER_SYS_ID);
Map<String, String> dataMap = remoteMessage.getData(); // if (userSysId != null && !userSysId.isEmpty()) {
String title = dataMap.get(FCM_KEY_TITLE); Map<String, String> dataMap = remoteMessage.getData();
CatalogueLog.e("onMessageReceived: dataMap: "+dataMap+", title: "+title); RemoteMessage.Notification notificationMap = remoteMessage.getNotification();
String messageBody = dataMap.get(FCM_KEY_BODY);
String priority = null, shortDes = null, createdBy = null, messageBodyTitle = null, requestState = null, documentId = null, ptoRequestStatus = null; if (dataMap != null) {
try { String title = dataMap.get(FCM_KEY_TITLE);
JSONObject jsonObject = new JSONObject(messageBody); CatalogueLog.e("onMessageReceived: dataMap: " + dataMap + ", title: " + title);
if(!jsonObject.isNull(FCM_KEY_INCIDENT_PRIORITY)) { String messageBody = dataMap.get(FCM_KEY_BODY);
priority = jsonObject.getString(FCM_KEY_INCIDENT_PRIORITY); String priority = null, shortDes = null, createdBy = null, messageBodyTitle = null, requestState = null, documentId = null, ptoRequestStatus = null;
} try {
if(!jsonObject.isNull(FCM_KEY_SHORT_DESCRIPTION)) { JSONObject jsonObject = new JSONObject(messageBody);
shortDes = jsonObject.getString(FCM_KEY_SHORT_DESCRIPTION); if (!jsonObject.isNull(FCM_KEY_INCIDENT_PRIORITY)) {
} priority = jsonObject.getString(FCM_KEY_INCIDENT_PRIORITY);
if(!jsonObject.isNull(FCM_KEY_REQUEST_STATE)) { }
requestState = jsonObject.getString(FCM_KEY_REQUEST_STATE); if (!jsonObject.isNull(FCM_KEY_SHORT_DESCRIPTION)) {
} shortDes = jsonObject.getString(FCM_KEY_SHORT_DESCRIPTION);
if(!jsonObject.isNull(FCM_KEY_CREATED_BY)) { }
createdBy = jsonObject.getString(FCM_KEY_CREATED_BY); if (!jsonObject.isNull(FCM_KEY_REQUEST_STATE)) {
} requestState = jsonObject.getString(FCM_KEY_REQUEST_STATE);
if(!jsonObject.isNull(FCM_KEY_MESSAGE_BODY_TITLE)) { }
messageBodyTitle = jsonObject.getString(FCM_KEY_MESSAGE_BODY_TITLE); if (!jsonObject.isNull(FCM_KEY_CREATED_BY)) {
} createdBy = jsonObject.getString(FCM_KEY_CREATED_BY);
if(!jsonObject.isNull(FCM_KEY_PTO_REQUEST_STATUS)) { }
ptoRequestStatus = jsonObject.getString(FCM_KEY_PTO_REQUEST_STATUS); if (!jsonObject.isNull(FCM_KEY_MESSAGE_BODY_TITLE)) {
} messageBodyTitle = jsonObject.getString(FCM_KEY_MESSAGE_BODY_TITLE);
} catch (JSONException e) { }
e.printStackTrace(); if (!jsonObject.isNull(FCM_KEY_PTO_REQUEST_STATUS)) {
} ptoRequestStatus = jsonObject.getString(FCM_KEY_PTO_REQUEST_STATUS);
}
Notifications newNotification = null; } catch (JSONException e) {
// if(messageBodyTitle.equals(MESSAGE_BODY_INCIDENT_TITLE)) { e.printStackTrace();
newNotification = new Notifications(); }
newNotification.setTitle(title);
newNotification.setShortDescription(shortDes); Notifications newNotification = null;
newNotification.setPriority(ptoRequestStatus); newNotification = new Notifications();
newNotification.setCreated_by(createdBy); newNotification.setTitle(title);
newNotification.setShortDescription(messageBody);
newNotification.setPriority(ptoRequestStatus);
newNotification.setCreated_by(createdBy);
sendNotification(newNotification, messageBodyTitle, null);
} else if (notificationMap != null) {
String title = notificationMap.getTitle();
CatalogueLog.e("onMessageReceived: notificationMap: " + notificationMap + ", title: " + title);
String messageBody = notificationMap.getBody();
String priority = null, shortDes = null, createdBy = null, messageBodyTitle = null, requestState = null, documentId = null, ptoRequestStatus = null;
Notifications newNotification = null;
newNotification = new Notifications();
newNotification.setTitle(title);
newNotification.setShortDescription(messageBody);
sendNotification(newNotification, messageBodyTitle, null);
}
// Notifications newNotification = null;
//// if(messageBodyTitle.equals(MESSAGE_BODY_INCIDENT_TITLE)) {
// newNotification = new Notifications();
// newNotification.setTitle(title);
// newNotification.setShortDescription(messageBody);
// newNotification.setPriority(ptoRequestStatus);
// newNotification.setCreated_by(createdBy);
// NotificationsManager.save(newNotification); // NotificationsManager.save(newNotification);
// } else if(messageBodyTitle.equals(MESSAGE_BODY_REQUEST_TITLE)) { // } else if(messageBodyTitle.equals(MESSAGE_BODY_REQUEST_TITLE)) {
// newNotification = new Notifications(); // newNotification = new Notifications();
...@@ -115,26 +135,26 @@ public class NotificationMessagingService extends FirebaseMessagingService { ...@@ -115,26 +135,26 @@ public class NotificationMessagingService extends FirebaseMessagingService {
// newNotification.setCreated_by(createdBy); // newNotification.setCreated_by(createdBy);
// } // }
sendNotification(newNotification, messageBodyTitle, null); // sendNotification(newNotification, messageBodyTitle, null);
// if(messageBodyTitle.equals(MESSAGE_BODY_APPROVALS_TITLE)) { // if(messageBodyTitle.equals(MESSAGE_BODY_APPROVALS_TITLE)) {
// sendLocalMessage(NotificationMessagingService.this, newNotification, true); // sendLocalMessage(NotificationMessagingService.this, newNotification, true);
// } else { // } else {
// sendLocalMessage(NotificationMessagingService.this, newNotification, false); // sendLocalMessage(NotificationMessagingService.this, newNotification, false);
// } // }
} // }
} }
private void sendLocalMessage(Context context, Notifications notifications, boolean isApproval) { private void sendLocalMessage(Context context, Notifications notifications, boolean isApproval) {
Intent intent = new Intent(Constants.BROADCAST_NOTIFICATION); Intent intent = new Intent(Constants.BROADCAST_NOTIFICATION);
intent.putExtra(Constants.DATA_KEY_NOTIFICATION_TITLE, notifications.getTitle()); intent.putExtra(Constants.DATA_KEY_NOTIFICATION_TITLE, notifications.getTitle());
intent.putExtra(Constants.DATA_KEY_NOTIFICATION_MESSAGE, notifications.getShortDescription()); intent.putExtra(Constants.DATA_KEY_NOTIFICATION_MESSAGE, notifications.getShortDescription());
intent.putExtra(Constants.DATA_KEY_NOTIFICATION_IS_APPROVALS, isApproval); intent.putExtra(Constants.DATA_KEY_NOTIFICATION_IS_APPROVALS, isApproval);
LocalBroadcastManager.getInstance(context).sendBroadcast(intent); LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
} }
private void sendNotification(Notifications notification, String messageBodyTitle, String documentId) { private void sendNotification(Notifications notification, String messageBodyTitle, String documentId) {
String title = null; String title = null;
// Intent newIntent = null; // Intent newIntent = null;
// if(messageBodyTitle.equals(MESSAGE_BODY_APPROVALS_TITLE)) { // if(messageBodyTitle.equals(MESSAGE_BODY_APPROVALS_TITLE)) {
...@@ -156,29 +176,32 @@ public class NotificationMessagingService extends FirebaseMessagingService { ...@@ -156,29 +176,32 @@ public class NotificationMessagingService extends FirebaseMessagingService {
// PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, newIntent, // PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, newIntent,
// PendingIntent.FLAG_ONE_SHOT); // PendingIntent.FLAG_ONE_SHOT);
Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Intent intent = new Intent(this, MyIncidentScreen.class);
String message = "Status: " + notification.getPriority() + "\n" + notification.getShortDescription(); PendingIntent pendingIntent = PendingIntent.getActivity(this, (int) System.currentTimeMillis(),
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, CHANNEL_ID) intent, PendingIntent.FLAG_UPDATE_CURRENT);
.setSmallIcon(R.drawable.notification_icon) // String message = "Status: " + notification.getPriority() + "\n" + notification.getShortDescription();
.setContentTitle(notification.getTitle()) String message = notification.getShortDescription();
.setContentText(message) NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, CHANNEL_ID)
.setAutoCancel(true) .setSmallIcon(R.drawable.notification_icon)
// .setContentIntent(null) .setContentTitle(notification.getTitle())
.setChannelId(CHANNEL_ID) .setContentText(message)
.setStyle(new NotificationCompat.BigTextStyle().bigText(message)) .setAutoCancel(true)
.setSound(defaultSoundUri); .setContentIntent(pendingIntent)
.setChannelId(CHANNEL_ID)
NotificationManager notificationManager = .setStyle(new NotificationCompat.BigTextStyle().bigText(message))
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); .setSound(defaultSoundUri);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
CharSequence name = getString(R.string.app_name);// The user-visible name of the channel. NotificationManager notificationManager =
int importance = NotificationManager.IMPORTANCE_DEFAULT; (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
NotificationChannel mChannel = new NotificationChannel(CHANNEL_ID, name, importance); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
CharSequence name = getString(R.string.app_name);// The user-visible name of the channel.
notificationManager.createNotificationChannel(mChannel); int importance = NotificationManager.IMPORTANCE_DEFAULT;
} NotificationChannel mChannel = new NotificationChannel(CHANNEL_ID, name, importance);
notificationManager.notify(1, notificationBuilder.build()); notificationManager.createNotificationChannel(mChannel);
} }
notificationManager.notify(1, notificationBuilder.build());
}
} }
...@@ -7,7 +7,6 @@ import android.os.AsyncTask; ...@@ -7,7 +7,6 @@ import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
...@@ -19,6 +18,7 @@ import android.widget.TextView; ...@@ -19,6 +18,7 @@ import android.widget.TextView;
import com.google.android.gms.analytics.Tracker; import com.google.android.gms.analytics.Tracker;
import com.vsoft.servicenow.CatalogueApplication; import com.vsoft.servicenow.CatalogueApplication;
import com.vsoft.servicenow.CatalogueWebViewScreen;
import com.vsoft.servicenow.R; import com.vsoft.servicenow.R;
import com.vsoft.servicenow.adapters.CatalogueCategoryItemAdapter; import com.vsoft.servicenow.adapters.CatalogueCategoryItemAdapter;
import com.vsoft.servicenow.api.listeners.get.GetCatalogueItemApiListener; import com.vsoft.servicenow.api.listeners.get.GetCatalogueItemApiListener;
...@@ -191,11 +191,11 @@ public class CatalogueItemScreen extends HandleNotificationActivity { ...@@ -191,11 +191,11 @@ public class CatalogueItemScreen extends HandleNotificationActivity {
public void onItemClick(AdapterView<?> parent, View view, public void onItemClick(AdapterView<?> parent, View view,
int position, long id) { int position, long id) {
CatalogueItem catalogueItem = catalogueItemList.get(position); CatalogueItem catalogueItem = catalogueItemList.get(position);
Intent intent = new Intent(CatalogueItemScreen.this, CatalogueVariableScreen.class); Intent intent = new Intent(CatalogueItemScreen.this, CatalogueWebViewScreen.class);
intent.putExtra(Constants.DATA_KEY_SYS_ID, catalogueItem.getSysId()); intent.putExtra(Constants.DATA_KEY_SYS_ID, catalogueItem.getSysId());
intent.putExtra(Constants.DATA_KEY_CATALOGUE_ITEM_DESCRIPTION, catalogueItem.getDescription()); /*intent.putExtra(Constants.DATA_KEY_CATALOGUE_ITEM_DESCRIPTION, catalogueItem.getDescription());
intent.putExtra(Constants.DATA_KEY_CATALOGUE_ITEM_SHORT_DESCRIPTION, catalogueItem.getShortDescription()); intent.putExtra(Constants.DATA_KEY_CATALOGUE_ITEM_SHORT_DESCRIPTION, catalogueItem.getShortDescription());
intent.putExtra(Constants.DATA_KEY_CATALOGUE_TITLE, catalogueItem.getName()); intent.putExtra(Constants.DATA_KEY_CATALOGUE_TITLE, catalogueItem.getName());*/
startActivity(intent); startActivity(intent);
} }
}); });
......
<?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">
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
\ No newline at end of file
<resources> <resources>
<string name="app_name">V-Portal</string> <string name="app_name">V-Portal</string>
<string name="set_string">Set</string> <string name="set_string">Set</string>
<string name="submit_string">Submit</string> <string name="submit_string">Submit</string>
<string name="back_string">Back</string> <string name="back_string">Back</string>
<string name="error_string">* Required</string> <string name="error_string">* Required</string>
<string name="none_string">-None-</string> <string name="none_string">-None-</string>
<string name="yes_string">Yes</string> <string name="yes_string">Yes</string>
<string name="no_string">No</string> <string name="no_string">No</string>
<string name="ok_string">Ok</string> <string name="ok_string">Ok</string>
<string name="search_for_reference_string">Reference</string> <string name="search_for_reference_string">Reference</string>
<string name="home_screen_string">Home Screen</string> <string name="home_screen_string">Home Screen</string>
<string name="login_screen_string">Login Screen</string> <string name="login_screen_string">Login Screen</string>
<string name="loading_string">Loading&#8230;</string> <string name="loading_string">Loading&#8230;</string>
<string name="select_date_string">Select Date</string> <string name="select_date_string">Select Date</string>
<string name="select_date_and_time_string">Select Date &#038; Time</string> <string name="select_date_and_time_string">Select Date &#038; Time</string>
<string name="name_null_view_string">Not rendering (name not available)</string> <string name="name_null_view_string">Not rendering (name not available)</string>
<string name="view_not_implemented_string">Not Implemented: %s</string> <string name="view_not_implemented_string">Not Implemented: %s</string>
<string name="approved">Approved</string> <string name="approved">Approved</string>
<string name="notrequest">Not Yet Requested</string> <string name="notrequest">Not Yet Requested</string>
<string name="requested">Requested</string> <string name="requested">Requested</string>
<string name="rejected">Rejected</string> <string name="rejected">Rejected</string>
<string name="date_string">%1$s %2$s, %3$d</string> <string name="date_string">%1$s %2$s, %3$d</string>
<string name="date_and_time_string">%1$s:%2$s</string> <string name="date_and_time_string">%1$s:%2$s</string>
<!--Failed to fetch--> <string name="vera_notification_channel_id" translatable="false">vera_fcm_default_channel</string>
<string name="failed_to_fetch_catalogue_category_string">Failed to fetch Catalogue Category.</string> <string name="vera_notification_channel_name" translatable="true">VERA</string>
<string name="failed_to_fetch_my_request_string">Failed to fetch requests</string>
<string name="failed_to_fetch_catalogue_category_items_string">Failed to fetch Catalogue Category Items.</string> <!--Failed to fetch-->
<string name="failed_to_fetch_catalogue_form_string">Failed to fetch Form.</string> <string name="failed_to_fetch_catalogue_category_string">Failed to fetch Catalogue Category.</string>
<string name="failed_to_fetch_reference_string">Failed to fetch References.</string> <string name="failed_to_fetch_my_request_string">Failed to fetch requests</string>
<string name="failed_to_submit_form_string">Failed to submit form.</string> <string name="failed_to_fetch_catalogue_category_items_string">Failed to fetch Catalogue Category Items.</string>
<string name="failed_to_fetch_incident_string">Failed to fetch incidents.</string> <string name="failed_to_fetch_catalogue_form_string">Failed to fetch Form.</string>
<string name="failed_to_fetch_user_detail_string">Failed to fetch User Details.</string> <string name="failed_to_fetch_reference_string">Failed to fetch References.</string>
<string name="failed_to_fetch_hr_case_category_string">Failed to fetch HR Case Category.</string> <string name="failed_to_submit_form_string">Failed to submit form.</string>
<string name="failed_to_fetch_hr_case_items_category_string">Failed to fetch HR Case Category Items.</string> <string name="failed_to_fetch_incident_string">Failed to fetch incidents.</string>
<string name="failed_to_logout_string">Failed to logout.</string> <string name="failed_to_fetch_user_detail_string">Failed to fetch User Details.</string>
<string name="failed_to_fetch_pending_approvals_string">Failed to fetch Pending Approvals.</string> <string name="failed_to_fetch_hr_case_category_string">Failed to fetch HR Case Category.</string>
<string name="failed_to_update_pending_approvals_string">Failed to update Pending Approvals.</string> <string name="failed_to_fetch_hr_case_items_category_string">Failed to fetch HR Case Category Items.</string>
<string name="failed_to_logout_string">Failed to logout.</string>
<!--Login Screen--> <string name="failed_to_fetch_pending_approvals_string">Failed to fetch Pending Approvals.</string>
<string name="prompt_relogin_login_expired">Login expired, please login again&#8230;</string> <string name="failed_to_update_pending_approvals_string">Failed to update Pending Approvals.</string>
<string name="login_screen_login_string">Login</string>
<string name="login_screen_logging_in_loading_string">Logging in&#8230;</string> <!--Login Screen-->
<string name="login_screen_getting_user_detail_loading_string">Getting user details&#8230;</string> <string name="prompt_relogin_login_expired">Login expired, please login again&#8230;</string>
<string name="login_screen_invalid_username_and_password_string">Invalid username and password</string> <string name="login_screen_login_string">Login</string>
<string name="user_detail_not_available">Unable to fetch user details.</string> <string name="login_screen_logging_in_loading_string">Logging in&#8230;</string>
<string name="login_screen_getting_user_detail_loading_string">Getting user details&#8230;</string>
<string name="user_error">Please enter username</string> <string name="login_screen_invalid_username_and_password_string">Invalid username and password</string>
<string name="pasw_error">Please enter password</string> <string name="user_detail_not_available">Unable to fetch user details.</string>
<string name="username_string">Username</string>
<string name="password_string">Password</string> <string name="user_error">Please enter username</string>
<string name="pasw_error">Please enter password</string>
<string name="username_string">Username</string>
<string name="password_string">Password</string>
<!--Variable Screen--> <!--Variable Screen-->
<string name="variable_form_mandatory_toast_string">Fields marked with an asterisk(*) are mandatory.</string> <string name="variable_form_mandatory_toast_string">Fields marked with an asterisk(*) are mandatory.</string>
...@@ -65,11 +68,11 @@ ...@@ -65,11 +68,11 @@
<string name="variable_form_radio_text_string">%d</string> <string name="variable_form_radio_text_string">%d</string>
<string name="variable_form_ui_page_button_label_string">Add Attachment</string> <string name="variable_form_ui_page_button_label_string">Add Attachment</string>
<string name="variable_form_ui_page_no_selected_attachment_string">Not Selected</string> <string name="variable_form_ui_page_no_selected_attachment_string">Not Selected</string>
<string name="custom_setting_storage_permission_dialog_msg_string">To use this feature, please go to Settings -> Apps -> %s -> Permissions and enable \'Storage\' permission</string> <string name="custom_setting_storage_permission_dialog_msg_string">To use this feature, please go to Settings -> Apps -> %s -> Permissions and enable \'Storage\' permission</string>
<string name="variable_form_back_navigation_string">Are you sure you want to navigate away?</string> <string name="variable_form_back_navigation_string">Are you sure you want to navigate away?</string>
<string name="variable_form_order_successful_submission_string">Your Order has been submitted successfully</string> <string name="variable_form_order_successful_submission_string">Your Order has been submitted successfully</string>
<string name="variable_form_reference_no_result_string">No Result</string> <string name="variable_form_reference_no_result_string">No Result</string>
<string name="Variable_form_short_description_anchor_line_break_css"><![CDATA[ <string name="Variable_form_short_description_anchor_line_break_css"><![CDATA[
<style> <style>
a { a {
word-break: break-all; word-break: break-all;
...@@ -77,124 +80,124 @@ ...@@ -77,124 +80,124 @@
</style> </style>
]]></string> ]]></string>
<!--Catalogue Item Screen--> <!--Catalogue Item Screen-->
<string name="no_catalogue_item_string">No Catalogue Items&#8230;</string> <string name="no_catalogue_item_string">No Catalogue Items&#8230;</string>
<!--Catalogue Screen--> <!--Catalogue Screen-->
<string name="catalogue_category_string">Order Services</string> <string name="catalogue_category_string">Order Services</string>
<string name="my_reques_string">My Requests</string> <string name="my_reques_string">My Requests</string>
<!--Incident screen--> <!--Incident screen-->
<string name="incident_form_report_incident_text_string">Report Incident</string> <string name="incident_form_report_incident_text_string">Report Incident</string>
<string name="incident_form_top_text_string">Create an Incident record to report and request assistance with an issue you are having.\n\nAn incident record will be created and managed through to successful resolution. You will also be notified of progress.</string> <string name="incident_form_top_text_string">Create an Incident record to report and request assistance with an issue you are having.\n\nAn incident record will be created and managed through to successful resolution. You will also be notified of progress.</string>
<string name="incident_form_impact_text_string">Impact &lt;font color="#FF0000"&gt;*&lt;/font&gt;</string> <string name="incident_form_impact_text_string">Impact &lt;font color="#FF0000"&gt;*&lt;/font&gt;</string>
<string name="incident_form_incident_successful_submission_string">Incident has been reported successfully</string> <string name="incident_form_incident_successful_submission_string">Incident has been reported successfully</string>
<string name="incident_form_describe_your_issue_text_string">Please Describe Your Issue below &lt;font color="#FF0000"&gt;*&lt;/font&gt;(Max %d)</string> <string name="incident_form_describe_your_issue_text_string">Please Describe Your Issue below &lt;font color="#FF0000"&gt;*&lt;/font&gt;(Max %d)</string>
<string name="incident_item_text_string"><![CDATA[<b>Number: </b>%1$s<br><br><b>Opened: </b>%2$s<br><br><b>Short Description: </b>%3$s]]></string> <string name="incident_item_text_string"><![CDATA[<b>Number: </b>%1$s<br><br><b>Opened: </b>%2$s<br><br><b>Short Description: </b>%3$s]]></string>
<string name="incident_form_short_description_limit_error_text_string">Max limit exceeded by %d</string> <string name="incident_form_short_description_limit_error_text_string">Max limit exceeded by %d</string>
<!--My Incidents--> <!--My Incidents-->
<string name="my_incidents_text_string">My Incidents</string> <string name="my_incidents_text_string">My Incidents</string>
<string name="my_incidents_item_text_string"><![CDATA[<b>Number: </b>%1$s<br><br><b>Item: </b>%2$s<br><br><b>Updated: </b>%3$s<br><br><b>Request: </b>%4$s<br><br><b>Opened by: </b>%5$s<br><br><b>Stage: </b>%6$s]]></string> <string name="my_incidents_item_text_string"><![CDATA[<b>Number: </b>%1$s<br><br><b>Item: </b>%2$s<br><br><b>Updated: </b>%3$s<br><br><b>Request: </b>%4$s<br><br><b>Opened by: </b>%5$s<br><br><b>Stage: </b>%6$s]]></string>
<string name="connection_alert_dialog_title">No Connection Available</string> <string name="connection_alert_dialog_title">No Connection Available</string>
<string name="connection_alert_dialog_message">Please check your device settings to ensure you have a working internet connection.</string> <string name="connection_alert_dialog_message">Please check your device settings to ensure you have a working internet connection.</string>
<string name="cancel">Cancel</string> <string name="cancel">Cancel</string>
<string name="settings">Settings</string> <string name="settings">Settings</string>
<!--Catalogue Variable form screen - key for pre fill value--> <!--Catalogue Variable form screen - key for pre fill value-->
<string name="catalogue_user_full_name">full_name</string> <string name="catalogue_user_full_name">full_name</string>
<string name="catalogue_user_id">user_id</string> <string name="catalogue_user_id">user_id</string>
<string name="catalogue_user_email_id">email_address</string> <string name="catalogue_user_email_id">email_address</string>
<!--Home Screen--> <!--Home Screen-->
<string name="home_screen_logout_confirmation_msg_string">Are you sure you want to logout?</string> <string name="home_screen_logout_confirmation_msg_string">Are you sure you want to logout?</string>
<!--Notifications--> <!--Notifications-->
<string name="notification_screen_action_bar_title_string">Notifications</string> <string name="notification_screen_action_bar_title_string">Notifications</string>
<string name="notification_screen_empty_text_string">No Notifications</string> <string name="notification_screen_empty_text_string">No Notifications</string>
<string name="go_to_notification_string">Go to Notification</string> <string name="go_to_notification_string">Go to Notification</string>
<string name="go_to_approvals_string">Go to Approvals</string> <string name="go_to_approvals_string">Go to Approvals</string>
<string name="notification_status_bar_incident_title_string">New Incident assigned to you</string> <string name="notification_status_bar_incident_title_string">New Incident assigned to you</string>
<string name="notification_status_bar_hr_case_title_string">New HR Case assigned to you</string> <string name="notification_status_bar_hr_case_title_string">New HR Case assigned to you</string>
<string name="notification_status_bar_request_title_string">New Request assigned to you</string> <string name="notification_status_bar_request_title_string">New Request assigned to you</string>
<string name="notification_status_bar_approvals_title_string">New Approval assigned to you</string> <string name="notification_status_bar_approvals_title_string">New Approval assigned to you</string>
<!--Chat Related String--> <!--Chat Related String-->
<string name="chat_activity_label">Vera</string> <string name="chat_activity_label">Vera</string>
<string name="action_send">Send</string> <string name="action_send">Send</string>
<string name="prompt_message">Message</string> <string name="prompt_message">Message</string>
<string name="connect">Connected</string> <string name="connect">Connected</string>
<string name="disconnect">Disconnected, Please check your internet connection</string> <string name="disconnect">Disconnected, Please check your internet connection</string>
<string name="error_connect">Failed to connect</string> <string name="error_connect">Failed to connect</string>
<string name="unauthorized_user">Unauthorized User</string> <string name="unauthorized_user">Unauthorized User</string>
<!-- messages --> <!-- messages -->
<string name="message_welcome">Chat with VERA</string> <string name="message_welcome">Chat with VERA</string>
<string name="user_action_typing">is typing</string> <string name="user_action_typing">is typing</string>
<!--Speech Recognizer--> <!--Speech Recognizer-->
<string name="ds_listening">Listening…</string> <string name="ds_listening">Listening…</string>
<string name="ds_internet_not_enabled">Internet is not enabled</string> <string name="ds_internet_not_enabled">Internet is not enabled</string>
<string name="ds_mic_permissions_required">Please provide microphone permissions</string> <string name="ds_mic_permissions_required">Please provide microphone permissions</string>
<string name="ds_unknown_error">Unknown error</string> <string name="ds_unknown_error">Unknown error</string>
<string name="ds_progress_layout_error">Unable to add speech progress view</string> <string name="ds_progress_layout_error">Unable to add speech progress view</string>
<string name="ds_confirm">Confirm</string> <string name="ds_confirm">Confirm</string>
<string name="ds_retry">Retry</string> <string name="ds_retry">Retry</string>
<string-array name="droid_speech_errors"> <string-array name="droid_speech_errors">
<item>Network Timeout</item> <item>Network Timeout</item>
<item>Network Error</item> <item>Network Error</item>
<item>Audio Error</item> <item>Audio Error</item>
<item>Server Error</item> <item>Server Error</item>
<item>Client Error</item> <item>Client Error</item>
<item>Speech Timeout</item> <item>Speech Timeout</item>
<item>No match</item> <item>No match</item>
<item>Speech Recognizer busy</item> <item>Speech Recognizer busy</item>
<item>Insufficient permissions</item> <item>Insufficient permissions</item>
</string-array> </string-array>
<!--Home Screen Option--> <!--Home Screen Option-->
<!--Start--> <!--Start-->
<string name="home_screen_report_incident_title">Report Incident</string> <string name="home_screen_report_incident_title">Report Incident</string>
<string name="home_screen_report_incident_icon">report_incident</string> <string name="home_screen_report_incident_icon">report_incident</string>
<string name="home_screen_order_services_title">Order Services</string> <string name="home_screen_order_services_title">Order Services</string>
<string name="home_screen_order_services_icon">order_services</string> <string name="home_screen_order_services_icon">order_services</string>
<string name="home_screen_my_incidents_title">My Incidents</string> <string name="home_screen_my_incidents_title">My Incidents</string>
<string name="home_screen_my_incidents_icon">my_incidents</string> <string name="home_screen_my_incidents_icon">my_incidents</string>
<string name="home_screen_my_request_title">My Requests</string> <string name="home_screen_my_request_title">My Requests</string>
<string name="home_screen_my_request_icon">my_requests</string> <string name="home_screen_my_request_icon">my_requests</string>
<string name="home_screen_chat_title">Chatbot</string> <string name="home_screen_chat_title">Chatbot</string>
<string name="home_screen_chat_icon">chatbot</string> <string name="home_screen_chat_icon">chatbot</string>
<string name="home_screen_notification_title">Notifications</string> <string name="home_screen_notification_title">Notifications</string>
<string name="home_screen_notification_icon">notifications</string> <string name="home_screen_notification_icon">notifications</string>
<!--End--> <!--End-->
<!--HRCase Screen--> <!--HRCase Screen-->
<string name="hr_case_category_string">HR Case</string> <string name="hr_case_category_string">HR Case</string>
<!--HRCase Item Screen--> <!--HRCase Item Screen-->
<string name="no_hr_case_item_string">No HR Case Items&#8230;</string> <string name="no_hr_case_item_string">No HR Case Items&#8230;</string>
<!--MY All HRCase Screen--> <!--MY All HRCase Screen-->
<string name="my_hr_case_text_string">View HR Case</string> <string name="my_hr_case_text_string">View HR Case</string>
<string name="my_hr_case_item_text_string"><![CDATA[<b>Number: </b>%1$s<br><br><b>Updated: </b>%2$s<br><br><b>Opened by: </b>%3$s]]></string> <string name="my_hr_case_item_text_string"><![CDATA[<b>Number: </b>%1$s<br><br><b>Updated: </b>%2$s<br><br><b>Opened by: </b>%3$s]]></string>
<!--HRCase Screen--> <!--HRCase Screen-->
<string name="pending_approvals_string">Pending Approvals</string> <string name="pending_approvals_string">Pending Approvals</string>
<string name="no_pending_approvals_string">No Pending Approvals&#8230;</string> <string name="no_pending_approvals_string">No Pending Approvals&#8230;</string>
<string name="pending_approvals_approve_reject_dialog_title_string">Approve/Reject</string> <string name="pending_approvals_approve_reject_dialog_title_string">Approve/Reject</string>
<string name="pending_approvals_approve_string">Approve</string> <string name="pending_approvals_approve_string">Approve</string>
<string name="pending_approvals_reject_string">Reject</string> <string name="pending_approvals_reject_string">Reject</string>
<string name="pending_approvals_dialog_message_string"><![CDATA[%1$s<br><b>Opened For </b>%2$s<br><b>Opened on </b>%3$s]]></string> <string name="pending_approvals_dialog_message_string"><![CDATA[%1$s<br><b>Opened For </b>%2$s<br><b>Opened on </b>%3$s]]></string>
<string name="pending_approval_dialog_comment_hint_text">Comments</string> <string name="pending_approval_dialog_comment_hint_text">Comments</string>
<!--Report Screen--> <!--Report Screen-->
<string name="reports_screen_title_string">Reports</string> <string name="reports_screen_title_string">Reports</string>
</resources> </resources>
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