Commit 48cbd1ba by Kunj Gupta

Added two new features -

Get all pending approvals list.
Update pending approval with Approve and Reject state.
parent 7208b9b9
Showing with 746 additions and 14 deletions
......@@ -109,6 +109,7 @@ dependencies {
compile 'com.android.support:support-media-compat:27.1.0'
compile 'com.android.support:support-v4:27.1.0'
compile 'com.google.firebase:firebase-messaging:12.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
}
apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
package com.vsoft.servicenow.adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Picasso;
import com.vsoft.servicenow.R;
import com.vsoft.servicenow.db.models.HRCase;
import com.vsoft.servicenow.db.models.PendingApprovals;
import com.vsoft.servicenow.utils.Constants;
import com.vsoft.servicenow.utils.Util;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Kunj on 26/04/18.
*/
public class PendingApprovalsAdapter extends BaseAdapter {
private final List<PendingApprovals> mPendingApprovalsList = new ArrayList<>(0);
private LayoutInflater mInflater;
private Context mContext;
public PendingApprovalsAdapter(Context context) {
mContext = context;
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
public void setPendingApprovalsList(List<PendingApprovals> pendingApprovalsList) {
mPendingApprovalsList.clear();
if(pendingApprovalsList!=null)
mPendingApprovalsList.addAll(pendingApprovalsList);
notifyDataSetChanged();
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return mPendingApprovalsList.size();
}
@Override
public PendingApprovals getItem(int position) {
// TODO Auto-generated method stub
return mPendingApprovalsList.get(position);
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
ViewHolder holder;
if (convertView == null) {
convertView = mInflater.inflate(R.layout.pending_approvals_adapter, parent, false);
holder = new ViewHolder();
holder.sysApproval = convertView.findViewById(R.id.pending_approval_adapter_sysapproval);
holder.taskType = convertView.findViewById(R.id.pending_approval_adapter_task_type);
holder.shortDes = convertView.findViewById(R.id.pending_approval_adapter_short_des);
holder.openedFor = convertView.findViewById(R.id.pending_approval_adapter_opened_for);
holder.openedAt = convertView.findViewById(R.id.pending_approval_adapter_opened_at);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
PendingApprovals pendingApprovals = mPendingApprovalsList.get(position);
holder.sysApproval.setText(pendingApprovals.getSysapproval());
holder.taskType.setText(pendingApprovals.getTaskType());
holder.shortDes.setText(pendingApprovals.getShortDescription());
holder.openedFor.setText(pendingApprovals.getOpenedBy());
holder.openedAt.setText(Util.getDateTimePendingApprovalFromString(pendingApprovals.getOpenedAt()));
return convertView;
}
static class ViewHolder {
private TextView sysApproval, taskType, shortDes, openedFor, openedAt;
}
}
\ No newline at end of file
package com.vsoft.servicenow.api.interfaces;
import com.vsoft.servicenow.utils.Constants;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
/**
* @since 1.0
* @author Created by Kunj on 26/04/2018.
*
*/
public interface PendingApprovalsApi {
String APPROVER = "approver";
String STATE = "state";
String STATE_VALUE = "requested";
String PUT_STATE_JSON_OBJECT_NAME = "state";
String PUT_COMMENT_JSON_OBJECT_NAME = "comments";
String PUT_STATE_APPROVED = "approved";
String PUT_STATE_REJECTED = "rejected";
String SYS_ID_OF_APPROVAL_RECORD = "sys_id_of_approval_record";
// Get All Pending Approvals API
@GET(Constants.URL_GET_ALL_PENDING_APPROVALS)
Call<ResponseBody> getAllPendingApprovals(@Query(APPROVER) String userSysId,
@Query(STATE) String stateValue);
@PUT(Constants.URL_PUT_PENDING_APPROVAL_STATE)
Call<ResponseBody> updatePendingApprovalState(@Path(SYS_ID_OF_APPROVAL_RECORD) String sysId,
@Body String stateBody);
}
......@@ -9,7 +9,6 @@ import retrofit2.http.GET;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.Url;
/**
......@@ -24,7 +23,7 @@ public interface UserApi {
@GET(Constants.URL_GET_USERDETAILS)
Call<ResponseBody> getuserDetails(@Query(Constants.URL_PARAM_SYSPRM_USERNAME) String sysparmQuery);
@PUT(Constants.URL_PUT_DEVICE_REGISTERATION)
@PUT(Constants.URL_PUT_DEVICE_REGISTRATION)
Call<ResponseBody> putDeviceRegistration(@Path("user_sys_id") String userSysId, @Body String body);
}
......
package com.vsoft.servicenow.api.listeners.get;
import com.vsoft.servicenow.db.models.PendingApprovals;
import java.util.List;
/**
* @since 1.0
* @author Created by Kunj on 26/04/2018.
*
*/
public interface GetPendingApprovalsApiListener {
void onDoneApiCall(List<PendingApprovals> pendingApprovalsList);
void onFailApiCall();
}
package com.vsoft.servicenow.api.listeners.put;
/**
* @since 1.0
* @author Created by Kunj on 26/04/2018.
*
*/
public interface PutPendingApprovalApiListener {
void onDoneApiCall();
void onFailApiCall();
}
......@@ -29,6 +29,7 @@ public interface DBConstants {
String TABLE_HR_CASE_VARIABLE_CHOICES = "hr_case_variable_choices";
String TABLE_MY_HR_CASE_REQUEST = "hr_case_requests";
String TABLE_MY_HR_CASE_REQUEST_OPENED_BY = "hr_case_request_opened_by";
String TABLE_PENDING_APPROVALS = "pending_approval";
String ID = "_id";
String SYS_ID = "sys_id";
......@@ -650,4 +651,34 @@ public interface DBConstants {
int INDEX_MY_HR_CASE_REQUEST_OPENED_BY_SYNC_DIRTY = 3;
int MY_HR_CASE_REQUEST_OPENED_BY_COLUMN_COUNT = 4;
/**
* TABLE_PENDING_APPROVALS table
*/
String PENDING_APPROVALS_ID = ID;
String PENDING_APPROVALS_SYS_ID = SYS_ID;
String PENDING_APPROVALS_APPROVER = "approver";
String PENDING_APPROVALS_SYS_APPROVAL = "sys_approval";
String PENDING_APPROVALS_TASK_TYPE = "task_type";
String PENDING_APPROVALS_OPENED_FOR = "opened_for";
String PENDING_APPROVALS_SHORT_DESCRIPTION = "short_description";
String PENDING_APPROVALS_OPENED_BY = "opened_by";
String PENDING_APPROVALS_OPENED_AT = "opened_at";
String PENDING_APPROVALS_SYNC_DIRTY = SYNC_DIRTY;
/**
* TABLE_PENDING_APPROVALS table. *Use these only if you fetch all columns*
*/
int INDEX_PENDING_APPROVALS_ID = 0;
int INDEX_PENDING_APPROVALS_SYS_ID = 1;
int INDEX_PENDING_APPROVALS_APPROVER = 2;
int INDEX_PENDING_APPROVALS_SYS_APPROVAL = 3;
int INDEX_PENDING_APPROVALS_TASK_TYPE = 4;
int INDEX_PENDING_APPROVALS_OPENED_FOR = 5;
int INDEX_PENDING_APPROVALS_SHORT_DESCRIPTION = 6;
int INDEX_PENDING_APPROVALS_OPENED_BY = 7;
int INDEX_PENDING_APPROVALS_OPENED_AT = 8;
int INDEX_PENDING_APPROVALS_SYNC_DIRTY = 9;
int PENDING_APPROVALS_COLUMN_COUNT = 10;
}
\ No newline at end of file
......@@ -62,6 +62,8 @@ public class DBManager extends SQLiteOpenHelper implements DBConstants {
createMyHRCaseRequestTable(db);
createMyHRCaseRequestOpenedByTable(db);
}
createPendingApprovalsTable(db);
}
@Override
......@@ -359,4 +361,18 @@ public class DBManager extends SQLiteOpenHelper implements DBConstants {
+ MY_HR_CASE_REQUEST_OPENED_BY_SYNC_DIRTY + " integer default " + SYNC_FLAG_NONE + ");");
}
private void createPendingApprovalsTable(SQLiteDatabase db) {
db.execSQL("create table " + TABLE_PENDING_APPROVALS + "("
+ PENDING_APPROVALS_ID + " integer primary key autoincrement, "
+ PENDING_APPROVALS_SYS_ID + " text, "
+ PENDING_APPROVALS_APPROVER + " text, "
+ PENDING_APPROVALS_SYS_APPROVAL + " text, "
+ PENDING_APPROVALS_TASK_TYPE + " text, "
+ PENDING_APPROVALS_OPENED_FOR + " text, "
+ PENDING_APPROVALS_SHORT_DESCRIPTION + " text, "
+ PENDING_APPROVALS_OPENED_BY + " text, "
+ PENDING_APPROVALS_OPENED_AT + " real, "
+ PENDING_APPROVALS_SYNC_DIRTY + " integer default " + SYNC_FLAG_NONE + ");");
}
}
package com.vsoft.servicenow.db.models;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.vsoft.servicenow.utils.Util;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Created by Kunj on 26/04/2018.
*/
public class PendingApprovals {
private long id = -1;
@SerializedName("sys_id")
@Expose
private String sysId;
@SerializedName("approver")
@Expose
private String approver;
@SerializedName("sysapproval")
@Expose
private String sysapproval;
@SerializedName("taskType")
@Expose
private String taskType;
@SerializedName("opened_for")
@Expose
private String openedFor;
@SerializedName("short_description")
@Expose
private String shortDescription;
@SerializedName("opened_by")
@Expose
private String openedBy;
@SerializedName("opened_at")
// @Expose
private long openedAt;
private int syncDirty;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getSysId() {
return sysId;
}
public void setSysId(String sysId) {
this.sysId = sysId;
}
public static PendingApprovalsBuilder newPendingApprovalsBuilder() {
return new PendingApprovalsBuilder();
}
public String getApprover() {
return approver;
}
public void setApprover(String approver) {
this.approver = approver;
}
public String getSysapproval() {
return sysapproval;
}
public void setSysapproval(String sysapproval) {
this.sysapproval = sysapproval;
}
public String getTaskType() {
return taskType;
}
public void setTaskType(String taskType) {
this.taskType = taskType;
}
public String getOpenedFor() {
return openedFor;
}
public void setOpenedFor(String openedFor) {
this.openedFor = openedFor;
}
public String getShortDescription() {
return shortDescription;
}
public void setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
}
public String getOpenedBy() {
return openedBy;
}
public void setOpenedBy(String openedBy) {
this.openedBy = openedBy;
}
public long getOpenedAt() {
return openedAt;
}
public void setOpenedAt(long openedAt) {
this.openedAt = openedAt;
}
public int getSyncDirty() {
return syncDirty;
}
public void setSyncDirty(int syncDirty) {
this.syncDirty = syncDirty;
}
public void parseJson(JSONObject jsonObject) {
String dueDate = null;
try {
dueDate = jsonObject.getString(Json.OPENED_AT);
} catch (JSONException e) {
e.printStackTrace();
}
this.setOpenedAt(Util.getDateTimeForMyIncidentFromString(dueDate));
}
public static class Json {
public static final String OPENED_AT = "opened_at";
}
public static final class PendingApprovalsBuilder {
private long id;
private String sysId;
private String approver;
private String sysapproval;
private String taskType;
private String openedFor;
private String shortDescription;
private String openedBy;
private long openedAt;
private int syncDirty;
private PendingApprovalsBuilder() {
}
public static PendingApprovalsBuilder aPendingApproval() {
return new PendingApprovalsBuilder();
}
public PendingApprovalsBuilder setId(long val) {
id = val;
return this;
}
public PendingApprovalsBuilder setSysId(String val) {
sysId = val;
return this;
}
public PendingApprovalsBuilder setApprover(String val) {
approver = val;
return this;
}
public PendingApprovalsBuilder setSysapproval(String val) {
sysapproval = val;
return this;
}
public PendingApprovalsBuilder setTaskType(String val) {
taskType = val;
return this;
}
public PendingApprovalsBuilder setOpenedFor(String val) {
openedFor = val;
return this;
}
public PendingApprovalsBuilder setShortDescription(String val) {
shortDescription = val;
return this;
}
public PendingApprovalsBuilder setOpenedBy(String val) {
openedBy = val;
return this;
}
public PendingApprovalsBuilder setOpenedAt(long val) {
openedAt = val;
return this;
}
public PendingApprovalsBuilder setSyncDirty(int val) {
syncDirty = val;
return this;
}
public PendingApprovals build() {
PendingApprovals pendingApprovals = new PendingApprovals();
pendingApprovals.setId(id);
pendingApprovals.setSysId(sysId);
pendingApprovals.setSysapproval(sysapproval);
pendingApprovals.setApprover(approver);
pendingApprovals.setOpenedAt(openedAt);
pendingApprovals.setOpenedBy(openedBy);
pendingApprovals.setOpenedFor(openedFor);
pendingApprovals.setShortDescription(shortDescription);
pendingApprovals.setTaskType(taskType);
pendingApprovals.setSyncDirty(syncDirty);
return pendingApprovals;
}
}
@Override
public String toString() {
return "PendingApprovals{" +
"id=" + id +
", sysId='" + sysId + '\'' +
", approver='" + approver + '\'' +
", sysapproval='" + sysapproval + '\'' +
", taskType='" + taskType + '\'' +
", openedFor='" + openedFor + '\'' +
", shortDescription='" + shortDescription + '\'' +
", openedBy='" + openedBy + '\'' +
", openedAt=" + openedAt +
", syncDirty=" + syncDirty +
'}';
}
}
package com.vsoft.servicenow.menu;
import android.os.Parcel;
import android.os.Parcelable;
import com.vsoft.servicenow.ui.PendingApprovalsActivity;
/**
* Created by Kunj on 26/04/2018.
*/
public class ApprovalsMenuItemData extends HomeScreenMenuItemData implements Parcelable {
protected ApprovalsMenuItemData() {
}
protected ApprovalsMenuItemData(Parcel in) {
super(in);
}
public static final Creator<ApprovalsMenuItemData> CREATOR = new Creator<ApprovalsMenuItemData>() {
@Override
public ApprovalsMenuItemData createFromParcel(Parcel in) {
return new ApprovalsMenuItemData(in);
}
@Override
public ApprovalsMenuItemData[] newArray(int size) {
return new ApprovalsMenuItemData[size];
}
};
@Override
public void writeToParcel(Parcel dest, int flags) {
super.writeToParcel(dest, flags);
}
@Override
public int describeContents() {
return 0;
}
public static class Builder extends HomeScreenMenuItemData.Builder<Builder> {
public Builder() {
item = new ApprovalsMenuItemData();
setActivity(PendingApprovalsActivity.class);
}
}
}
......@@ -7,32 +7,22 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.GridView;
import com.google.android.gms.analytics.Tracker;
import com.vsoft.servicenow.AppConfig;
import com.vsoft.servicenow.BuildConfig;
import com.vsoft.servicenow.CatalogueApplication;
import com.vsoft.servicenow.MenuProvider;
import com.vsoft.servicenow.R;
import com.vsoft.servicenow.adapters.HomeScreenAdapter;
import com.vsoft.servicenow.api.interfaces.LoginApi;
import com.vsoft.servicenow.api.listeners.get.GetCatalogueApiListener;
import com.vsoft.servicenow.api.listeners.put.PutLogoutApiListener;
import com.vsoft.servicenow.api.managers.CatalogueApiManager;
import com.vsoft.servicenow.api.managers.LoginApiManager;
import com.vsoft.servicenow.db.managers.CatalogueManager;
import com.vsoft.servicenow.db.models.Catalogue;
import com.vsoft.servicenow.enums.SyncStatus;
import com.vsoft.servicenow.menu.HomeScreenMenuItemData;
import com.vsoft.servicenow.utils.CatalogueLog;
import com.vsoft.servicenow.utils.Constants;
import com.vsoft.servicenow.utils.PrefManager;
import com.vsoft.servicenow.utils.Util;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
......
......@@ -2,6 +2,7 @@ package com.vsoft.servicenow.utils;
import com.vsoft.servicenow.BuildConfig;
import com.vsoft.servicenow.AppConfig;
import com.vsoft.servicenow.api.interfaces.PendingApprovalsApi;
/**
* @author Kunj on 11/8/16.
......@@ -148,7 +149,7 @@ public class Constants {
/*Login API */
public static final String URL_POST_LOGIN_ITEM = "/oauth_token.do";
public static final String URL_REFRESH_LOGIN = URL_POST_LOGIN_ITEM;
public static final String URL_PUT_DEVICE_REGISTERATION = "api/now/table/sys_user/{user_sys_id}";
public static final String URL_PUT_DEVICE_REGISTRATION = "api/now/table/sys_user/{user_sys_id}";
public static final String URL_GET_USERDETAILS = API_PATH + "sys_user";
public static final String URL_PUT_LOGOUT = "/api/vsng2/uofl_mobile/logout";
......@@ -192,7 +193,10 @@ public class Constants {
/*Get All My HRCase*/
public static final String URL_GET_MY_HR_CASE = API_PATH + "hr_case";
// https://vsoftconsultingdev.service-now.com/api/now/table/hr_case?opened_by=debf86ee4f1852005ee63d728110c7c7
/*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_PUT_PENDING_APPROVAL_STATE = API_PATH + "sysapproval_approver/{" + PendingApprovalsApi.SYS_ID_OF_APPROVAL_RECORD + "}";
/**
* Chat Server URL
......
......@@ -998,6 +998,11 @@ public class Util {
return 0;
}
public static String getDateTimePendingApprovalFromString(long timeStamp) {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM, yyyy");
return dateFormat.format(timeStamp);
}
public static void createDynamicTableForIncidentFormValues() {
StringBuilder queryString = new StringBuilder();
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/pending_approval_dialog_title_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:gravity="center"
android:paddingBottom="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@android:color/black"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/view"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@android:color/black"
app:layout_constraintTop_toBottomOf="@+id/pending_approval_dialog_title_text_view" />
<TextView
android:id="@+id/pending_approval_dialog_message_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@android:color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view" />
<EditText
android:id="@+id/pending_approval_dialog_comment_edit_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:ems="10"
android:gravity="start"
android:hint="@string/pending_approval_dialog_comment_hint_text"
android:inputType="textMultiLine|textCapSentences"
android:lines="3"
android:singleLine="false"
android:textColor="@android:color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pending_approval_dialog_message_text_view" />
<TextView
android:id="@+id/pending_approval_dialog_comment_error_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="@string/error_string"
android:textColor="#ff0000"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pending_approval_dialog_comment_edit_view" />
<Button
android:id="@+id/pending_approval_dialog_approve_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="@string/pending_approvals_approve_string"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pending_approval_dialog_comment_error_text_view"
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.3" />
<Button
android:id="@+id/pending_approval_dialog_cancel_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
android:text="@string/cancel"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pending_approval_dialog_comment_error_text_view"
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.3" />
<Button
android:id="@+id/pending_approval_dialog_reject_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="@string/pending_approvals_reject_string"
app:layout_constraintEnd_toStartOf="@+id/pending_approval_dialog_cancel_button"
app:layout_constraintStart_toEndOf="@+id/pending_approval_dialog_approve_button"
app:layout_constraintTop_toBottomOf="@+id/pending_approval_dialog_comment_error_text_view"
app:layout_constraintWidth_default="percent"
app:layout_constraintWidth_percent="0.3" />
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/list_view_item_bg_with_border">
<TextView
android:id="@+id/pending_approval_adapter_sysapproval"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="@android:color/black"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/pending_approval_adapter_task_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="@android:color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/pending_approval_adapter_short_des"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="@android:color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pending_approval_adapter_sysapproval" />
<TextView
android:id="@+id/pending_approval_adapter_opened_for"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="@android:color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pending_approval_adapter_short_des" />
<TextView
android:id="@+id/pending_approval_adapter_opened_at"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="@android:color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pending_approval_adapter_short_des" />
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?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="match_parent"
android:background="@color/screen_bg_color"
android:orientation="vertical">
<include layout="@layout/toolbar_with_refresh_option" />
<ListView
android:id="@+id/pending_approvals_screen_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/normal_margin"
android:background="@android:color/white"
android:dividerHeight="10dp"
android:divider="@android:color/white"
android:padding="@dimen/normal_margin"
android:scrollbars="none" />
</LinearLayout>
\ No newline at end of file
......@@ -40,6 +40,8 @@
<string name="failed_to_fetch_hr_case_category_string">Failed to fetch HR Case Category.</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>
<string name="failed_to_fetch_pending_approvals_string">Failed to fetch Pending Approvals.</string>
<string name="failed_to_update_pending_approvals_string">Failed to update Pending Approvals.</string>
<!--Login Screen-->
<string name="prompt_relogin_login_expired">Login expired, please login again&#8230;</string>
......@@ -177,4 +179,13 @@
<!--MY All HRCase Screen-->
<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>
<!--HRCase Screen-->
<string name="pending_approvals_string">Pending Approvals</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_string">Approve</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_approval_dialog_comment_hint_text">Comments</string>
</resources>
......@@ -32,6 +32,10 @@
android:name="com.vsoft.servicenow.ui.MyHRCaseActivity"
android:screenOrientation="portrait"/>
<activity
android:name="com.vsoft.servicenow.ui.PendingApprovalsActivity"
android:screenOrientation="portrait"/>
<service android:name=".service.NotificationInstanceIdService"
android:exported="false">
<intent-filter>
......
package com.vsoft.servicenow;
import com.vsoft.servicenow.menu.ApprovalsMenuItemData;
import com.vsoft.servicenow.menu.ChatMenuItemData;
import com.vsoft.servicenow.menu.CreateHRCaseMenuItemData;
import com.vsoft.servicenow.menu.HomeScreenMenuItemData;
......@@ -50,6 +51,10 @@ public class MenuProvider {
new NotificationMenuItemData.Builder()
.setTitle(R.string.home_screen_notification_title)
.setMenuIconResId(R.string.home_screen_notification_icon)
.build(),
new ApprovalsMenuItemData.Builder()
.setTitle(R.string.home_screen_approvals_title)
.setMenuIconResId(R.string.home_screen_approvals_icon)
.build()
);
}
......@@ -26,5 +26,8 @@
<string name="home_screen_notification_title">Notifications</string>
<string name="home_screen_notification_icon">notifications</string>
<string name="home_screen_approvals_title">Approvals</string>
<string name="home_screen_approvals_icon">approvals</string>
<!--End-->
</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