Commit 4d6ac4dc by Kunj Gupta

Code review.

parent ef377686
Showing with 103 additions and 598 deletions
...@@ -5,7 +5,6 @@ import android.view.LayoutInflater; ...@@ -5,7 +5,6 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uofl_catalogue.R;
...@@ -18,14 +17,11 @@ import java.util.List; ...@@ -18,14 +17,11 @@ import java.util.List;
* Created by kunj on 11/8/16. * Created by kunj on 11/8/16.
*/ */
public class CatalogueCategoryAdapter extends BaseAdapter { public class CatalogueCategoryAdapter extends BaseAdapter {
private Context mContext;
private final List<Catalogue> mCatalogueList = new ArrayList<>(0); private final List<Catalogue> mCatalogueList = new ArrayList<>(0);
private LayoutInflater mInflater; private LayoutInflater mInflater;
public CatalogueCategoryAdapter(Context context) { public CatalogueCategoryAdapter(Context context) {
mContext = context; mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mInflater = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
} }
public void setCatalogueList(List<Catalogue> catalogueList) { public void setCatalogueList(List<Catalogue> catalogueList) {
...@@ -86,6 +82,5 @@ public class CatalogueCategoryAdapter extends BaseAdapter { ...@@ -86,6 +82,5 @@ public class CatalogueCategoryAdapter extends BaseAdapter {
static class ViewHolder { static class ViewHolder {
private TextView titleTextView; private TextView titleTextView;
private TextView desTextView; private TextView desTextView;
private ImageView imageView;
} }
} }
\ No newline at end of file
...@@ -5,7 +5,6 @@ import android.view.LayoutInflater; ...@@ -5,7 +5,6 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uofl_catalogue.R;
...@@ -18,14 +17,11 @@ import java.util.List; ...@@ -18,14 +17,11 @@ import java.util.List;
* Created by kunj on 11/8/16. * Created by kunj on 11/8/16.
*/ */
public class CatalogueCategoryItemAdapter extends BaseAdapter { public class CatalogueCategoryItemAdapter extends BaseAdapter {
private Context mContext;
private final List<CatalogueItem> mCatalogueItemList = new ArrayList<>(0); private final List<CatalogueItem> mCatalogueItemList = new ArrayList<>(0);
private LayoutInflater mInflater; private LayoutInflater mInflater;
public CatalogueCategoryItemAdapter(Context context) { public CatalogueCategoryItemAdapter(Context context) {
mContext = context; mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mInflater = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
} }
public void setCatalogueItemList(List<CatalogueItem> catalogueItemList) { public void setCatalogueItemList(List<CatalogueItem> catalogueItemList) {
...@@ -85,6 +81,5 @@ public class CatalogueCategoryItemAdapter extends BaseAdapter { ...@@ -85,6 +81,5 @@ public class CatalogueCategoryItemAdapter extends BaseAdapter {
static class ViewHolder { static class ViewHolder {
private TextView nameTextView; private TextView nameTextView;
private TextView desTextView; private TextView desTextView;
private ImageView imageView;
} }
} }
\ No newline at end of file
...@@ -17,14 +17,11 @@ import java.util.List; ...@@ -17,14 +17,11 @@ import java.util.List;
* Created by kunj on 11/8/16. * Created by kunj on 11/8/16.
*/ */
public class MyIncidentsAdapter extends BaseAdapter { public class MyIncidentsAdapter extends BaseAdapter {
private Context mContext;
private final List<Incident> mIncidentList = new ArrayList<>(0); private final List<Incident> mIncidentList = new ArrayList<>(0);
private LayoutInflater mInflater; private LayoutInflater mInflater;
public MyIncidentsAdapter(Context context) { public MyIncidentsAdapter(Context context) {
mContext = context; mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mInflater = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
} }
public void setIncidentList(List<Incident> incidentList) { public void setIncidentList(List<Incident> incidentList) {
......
...@@ -3,7 +3,6 @@ package com.vsoft.uofl_catalogue.adapters; ...@@ -3,7 +3,6 @@ package com.vsoft.uofl_catalogue.adapters;
import android.content.Context; import android.content.Context;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.GradientDrawable;
import android.support.v4.content.ContextCompat;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -12,7 +11,6 @@ import android.widget.ImageView; ...@@ -12,7 +11,6 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uofl_catalogue.R;
import com.vsoft.uofl_catalogue.db.models.Catalogue;
import com.vsoft.uofl_catalogue.db.models.MyRequest; import com.vsoft.uofl_catalogue.db.models.MyRequest;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -22,14 +20,11 @@ import java.util.List; ...@@ -22,14 +20,11 @@ import java.util.List;
* Created by kvemulavada on 8/30/2016. * Created by kvemulavada on 8/30/2016.
*/ */
public class MyRequestAdapter extends BaseAdapter { public class MyRequestAdapter extends BaseAdapter {
private Context mContext;
private final List<MyRequest> mReqList = new ArrayList<>(0); private final List<MyRequest> mReqList = new ArrayList<>(0);
private LayoutInflater mInflater; private LayoutInflater mInflater;
public MyRequestAdapter(Context context) { public MyRequestAdapter(Context context) {
mContext = context; mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mInflater = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
} }
public void setRequestList(List<MyRequest> myreqList) { public void setRequestList(List<MyRequest> myreqList) {
...@@ -78,7 +73,7 @@ public class MyRequestAdapter extends BaseAdapter { ...@@ -78,7 +73,7 @@ public class MyRequestAdapter extends BaseAdapter {
MyRequest req = mReqList.get(position); MyRequest req = mReqList.get(position);
holder.number.setText(req.getNumber()); holder.number.setText(req.getNumber());
String dueDate="Due : "+req.getDueDate(); String dueDate="Due : "+ req.getDueDate();
holder.dueDate.setText(dueDate); holder.dueDate.setText(dueDate);
holder.shotrDescription.setText(req.getShotrDescription()); holder.shotrDescription.setText(req.getShotrDescription());
holder.approval.setText(req.getApproval()); holder.approval.setText(req.getApproval());
...@@ -88,7 +83,6 @@ public class MyRequestAdapter extends BaseAdapter { ...@@ -88,7 +83,6 @@ public class MyRequestAdapter extends BaseAdapter {
((GradientDrawable)holder.statusIndicator.getBackground()).setColor(Color.parseColor("#FFB400")); ((GradientDrawable)holder.statusIndicator.getBackground()).setColor(Color.parseColor("#FFB400"));
//holder.statusIndicator.setBackgroundColor(Color.parseColor("#FFB400")); //holder.statusIndicator.setBackgroundColor(Color.parseColor("#FFB400"));
} else if (req.getApproval().equalsIgnoreCase("not requested")) { } else if (req.getApproval().equalsIgnoreCase("not requested")) {
((GradientDrawable)holder.statusIndicator.getBackground()).setColor(Color.parseColor("#5CE1ED")); ((GradientDrawable)holder.statusIndicator.getBackground()).setColor(Color.parseColor("#5CE1ED"));
// holder.statusIndicator.setBackgroundColor(Color.parseColor("#5CE1ED")); // holder.statusIndicator.setBackgroundColor(Color.parseColor("#5CE1ED"));
} else if (req.getApproval().equalsIgnoreCase("approved")) { } else if (req.getApproval().equalsIgnoreCase("approved")) {
......
...@@ -8,8 +8,6 @@ import com.google.gson.annotations.SerializedName; ...@@ -8,8 +8,6 @@ import com.google.gson.annotations.SerializedName;
*/ */
public class Catalogue { public class Catalogue {
private long id = -1;
@SerializedName("title") @SerializedName("title")
@Expose @Expose
private String title; private String title;
...@@ -20,16 +18,6 @@ public class Catalogue { ...@@ -20,16 +18,6 @@ public class Catalogue {
@Expose @Expose
private String sysId; private String sysId;
private int syncDirty;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
/** /**
* *
* @return * @return
...@@ -84,68 +72,6 @@ public class Catalogue { ...@@ -84,68 +72,6 @@ public class Catalogue {
this.sysId = sysId; this.sysId = sysId;
} }
public int getSyncDirty() {
return syncDirty;
}
public void setSyncDirty(int syncDirty) {
this.syncDirty = syncDirty;
}
public static final class CatalogueBuilder {
private long id = -1;
private String title;
private String description;
private String sysId;
private int syncDirty;
private CatalogueBuilder() {
}
public static CatalogueBuilder aCatalogue() {
return new CatalogueBuilder();
}
public CatalogueBuilder setId(long id) {
this.id = id;
return this;
}
public CatalogueBuilder setTitle(String title) {
this.title = title;
return this;
}
public CatalogueBuilder setDescription(String description) {
this.description = description;
return this;
}
public CatalogueBuilder setSysId(String sysId) {
this.sysId = sysId;
return this;
}
public CatalogueBuilder setSyncDirty(int syncDirty) {
this.syncDirty = syncDirty;
return this;
}
public CatalogueBuilder but() {
return aCatalogue().setId(id).setTitle(title).setDescription(description).setSysId(sysId).setSyncDirty(syncDirty);
}
public Catalogue build() {
Catalogue catalogue = new Catalogue();
catalogue.setId(id);
catalogue.setTitle(title);
catalogue.setDescription(description);
catalogue.setSysId(sysId);
catalogue.setSyncDirty(syncDirty);
return catalogue;
}
}
public static class Json { public static class Json {
public static final String URL_PARAM_CATALOGUE_SYSPRM_QUERY_VALUE = "sc_catalog"; public static final String URL_PARAM_CATALOGUE_SYSPRM_QUERY_VALUE = "sc_catalog";
} }
...@@ -153,11 +79,9 @@ public class Catalogue { ...@@ -153,11 +79,9 @@ public class Catalogue {
@Override @Override
public String toString() { public String toString() {
return "Catalogue{" + return "Catalogue{" +
"id=" + id +
", title='" + title + '\'' + ", title='" + title + '\'' +
", description='" + description + '\'' + ", description='" + description + '\'' +
", sysId='" + sysId + '\'' + ", sysId='" + sysId + '\'' +
", syncDirty=" + syncDirty +
'}'; '}';
} }
} }
...@@ -8,9 +8,6 @@ import com.google.gson.annotations.SerializedName; ...@@ -8,9 +8,6 @@ import com.google.gson.annotations.SerializedName;
*/ */
public class CatalogueItem { public class CatalogueItem {
private long id = -1;
private long catalogue_id = -1;
@SerializedName("short_description") @SerializedName("short_description")
@Expose @Expose
private String shortDescription; private String shortDescription;
...@@ -23,23 +20,6 @@ public class CatalogueItem { ...@@ -23,23 +20,6 @@ public class CatalogueItem {
@SerializedName("sys_id") @SerializedName("sys_id")
@Expose @Expose
private String sysId; private String sysId;
private int syncDirty;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getCatalogueId() {
return catalogue_id;
}
public void setCatalogueId(long catalogueId) {
this.catalogue_id = catalogueId;
}
/** /**
* *
...@@ -113,83 +93,6 @@ public class CatalogueItem { ...@@ -113,83 +93,6 @@ public class CatalogueItem {
this.sysId = sysId; this.sysId = sysId;
} }
public int getSyncDirty() {
return syncDirty;
}
public void setSyncDirty(int syncDirty) {
this.syncDirty = syncDirty;
}
public static final class CatalogueItemBuilder {
private long id = -1;
private long catalogue_id = -1;
private String shortDescription;
private String description;
private String name;
private String sysId;
private int syncDirty;
private CatalogueItemBuilder() {
}
public static CatalogueItemBuilder aCatalogueItem() {
return new CatalogueItemBuilder();
}
public CatalogueItemBuilder setId(long id) {
this.id = id;
return this;
}
public CatalogueItemBuilder setCatalogueId(long catalogueId) {
this.catalogue_id = catalogueId;
return this;
}
public CatalogueItemBuilder setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
return this;
}
public CatalogueItemBuilder setDescription(String description) {
this.description = description;
return this;
}
public CatalogueItemBuilder setName(String name) {
this.name = name;
return this;
}
public CatalogueItemBuilder setSysId(String sysId) {
this.sysId = sysId;
return this;
}
public CatalogueItemBuilder setSyncDirty(int syncDirty) {
this.syncDirty = syncDirty;
return this;
}
public CatalogueItemBuilder but() {
return aCatalogueItem().setId(id).setCatalogueId(catalogue_id).setShortDescription(shortDescription).setDescription(description).setName(name).setSysId(sysId).setSyncDirty(syncDirty);
}
public CatalogueItem build() {
CatalogueItem catalogueItem = new CatalogueItem();
catalogueItem.setId(id);
catalogueItem.setCatalogueId(catalogue_id);
catalogueItem.setShortDescription(shortDescription);
catalogueItem.setDescription(description);
catalogueItem.setName(name);
catalogueItem.setSysId(sysId);
catalogueItem.setSyncDirty(syncDirty);
return catalogueItem;
}
}
public static class Json { public static class Json {
public static final String URL_PARAM_CATALOGUE_SYSPRM_QUERY_VALUE = "category"; public static final String URL_PARAM_CATALOGUE_SYSPRM_QUERY_VALUE = "category";
public static final String SYS_ID = "sys_id"; public static final String SYS_ID = "sys_id";
...@@ -198,13 +101,10 @@ public class CatalogueItem { ...@@ -198,13 +101,10 @@ public class CatalogueItem {
@Override @Override
public String toString() { public String toString() {
return "CatalogueItem{" + return "CatalogueItem{" +
"id=" + id +
", catalogue_id=" + catalogue_id +
", shortDescription='" + shortDescription + '\'' + ", shortDescription='" + shortDescription + '\'' +
", description='" + description + '\'' + ", description='" + description + '\'' +
", name='" + name + '\'' + ", name='" + name + '\'' +
", sysId='" + sysId + '\'' + ", sysId='" + sysId + '\'' +
", syncDirty=" + syncDirty +
'}'; '}';
} }
} }
...@@ -17,7 +17,6 @@ import java.util.List; ...@@ -17,7 +17,6 @@ import java.util.List;
* Created by Kunj on 12/8/16. * Created by Kunj on 12/8/16.
*/ */
public class CatalogueVariable { public class CatalogueVariable {
private long id = -1;
private long catalogue_item_id = -1; private long catalogue_item_id = -1;
@SerializedName("name") @SerializedName("name")
...@@ -43,17 +42,8 @@ public class CatalogueVariable { ...@@ -43,17 +42,8 @@ public class CatalogueVariable {
// @Expose // @Expose
private ViewType type; private ViewType type;
private int syncDirty;
private List<VariableChoice> mVariableChoiceList; private List<VariableChoice> mVariableChoiceList;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getCatalogueItemId() { public long getCatalogueItemId() {
return catalogue_item_id; return catalogue_item_id;
} }
...@@ -158,14 +148,6 @@ public class CatalogueVariable { ...@@ -158,14 +148,6 @@ public class CatalogueVariable {
this.referenceTable = referenceTable; this.referenceTable = referenceTable;
} }
public int getSyncDirty() {
return syncDirty;
}
public void setSyncDirty(int syncDirty) {
this.syncDirty = syncDirty;
}
public List<VariableChoice> getVariableChoiceList() { public List<VariableChoice> getVariableChoiceList() {
return mVariableChoiceList; return mVariableChoiceList;
} }
...@@ -217,95 +199,6 @@ public class CatalogueVariable { ...@@ -217,95 +199,6 @@ public class CatalogueVariable {
this.setType(ViewType.from(viewType)); this.setType(ViewType.from(viewType));
} }
public static final class CatalogueVariableBuilder {
private long id = -1;
private long catalogue_item_id = -1;
private String name;
private String questionText;
private String sysId;
private boolean mandatory;
private boolean isNoneRequired;
private String referenceTable;
private ViewType type;
private int syncDirty;
private CatalogueVariableBuilder() {
}
public static CatalogueVariableBuilder aCatalogueVariable() {
return new CatalogueVariableBuilder();
}
public CatalogueVariableBuilder setId(long id) {
this.id = id;
return this;
}
public CatalogueVariableBuilder setCatalogueItemId(long catalogue_item_id) {
this.catalogue_item_id = catalogue_item_id;
return this;
}
public CatalogueVariableBuilder setName(String name) {
this.name = name;
return this;
}
public CatalogueVariableBuilder setQuestionText(String questionText) {
this.questionText = questionText;
return this;
}
public CatalogueVariableBuilder setSysId(String sysId) {
this.sysId = sysId;
return this;
}
public CatalogueVariableBuilder setMandatory(boolean mandatory) {
this.mandatory = mandatory;
return this;
}
public CatalogueVariableBuilder setNoneRequired(boolean isNoneRequired) {
this.isNoneRequired = isNoneRequired;
return this;
}
public CatalogueVariableBuilder setReferenceTable(String referenceTable) {
this.referenceTable = referenceTable;
return this;
}
public CatalogueVariableBuilder setType(ViewType type) {
this.type = type;
return this;
}
public CatalogueVariableBuilder setSyncDirty(int syncDirty) {
this.syncDirty = syncDirty;
return this;
}
public CatalogueVariableBuilder but() {
return aCatalogueVariable().setId(id).setCatalogueItemId(catalogue_item_id).setName(name).setQuestionText(questionText).setSysId(sysId).setMandatory(mandatory).setNoneRequired(isNoneRequired).setReferenceTable(referenceTable).setType(type).setSyncDirty(syncDirty);
}
public CatalogueVariable build() {
CatalogueVariable catalogueVariable = new CatalogueVariable();
catalogueVariable.setId(id);
catalogueVariable.setCatalogueItemId(catalogue_item_id);
catalogueVariable.setName(name);
catalogueVariable.setQuestionText(questionText);
catalogueVariable.setSysId(sysId);
catalogueVariable.setMandatory(mandatory);
catalogueVariable.setNoneRequired(isNoneRequired);
catalogueVariable.setReferenceTable(referenceTable);
catalogueVariable.setType(type);
catalogueVariable.setSyncDirty(syncDirty);
return catalogueVariable;
}
}
public static class Json { public static class Json {
public static final String SYS_ID = "sys_id"; public static final String SYS_ID = "sys_id";
public static final String TYPE = "type"; public static final String TYPE = "type";
...@@ -314,7 +207,6 @@ public class CatalogueVariable { ...@@ -314,7 +207,6 @@ public class CatalogueVariable {
@Override @Override
public String toString() { public String toString() {
return "CatalogueVariable{" + return "CatalogueVariable{" +
"id=" + id +
", catalogue_item_id=" + catalogue_item_id + ", catalogue_item_id=" + catalogue_item_id +
", name='" + name + '\'' + ", name='" + name + '\'' +
", questionText='" + questionText + '\'' + ", questionText='" + questionText + '\'' +
...@@ -323,7 +215,6 @@ public class CatalogueVariable { ...@@ -323,7 +215,6 @@ public class CatalogueVariable {
", isNoneRequired=" + isNoneRequired + ", isNoneRequired=" + isNoneRequired +
", referenceTable='" + referenceTable + '\'' + ", referenceTable='" + referenceTable + '\'' +
", type=" + type + ", type=" + type +
", syncDirty=" + syncDirty +
", mVariableChoiceList=" + mVariableChoiceList + ", mVariableChoiceList=" + mVariableChoiceList +
'}'; '}';
} }
......
...@@ -72,53 +72,6 @@ public class Incident { ...@@ -72,53 +72,6 @@ public class Incident {
this.setImpact(Impact.from(impact)); this.setImpact(Impact.from(impact));
} }
public static final class IncidentBuilder {
private String number;
private String shortDescription;
private String openedAt;
private Impact impact;
private IncidentBuilder() {
}
public static IncidentBuilder anIncident() {
return new IncidentBuilder();
}
public IncidentBuilder setNumber(String number) {
this.number = number;
return this;
}
public IncidentBuilder setShortDescription(String shortDescription) {
this.shortDescription = shortDescription;
return this;
}
public IncidentBuilder setOpenedAt(String openedAt) {
this.openedAt = openedAt;
return this;
}
public IncidentBuilder setImpact(Impact impact) {
this.impact = impact;
return this;
}
public IncidentBuilder but() {
return anIncident().setNumber(number).setShortDescription(shortDescription).setOpenedAt(openedAt).setImpact(impact);
}
public Incident build() {
Incident incident = new Incident();
incident.setNumber(number);
incident.setShortDescription(shortDescription);
incident.setOpenedAt(openedAt);
incident.setImpact(impact);
return incident;
}
}
public static class Json { public static class Json {
public static final String IMPACT = "impact"; public static final String IMPACT = "impact";
public static final String OPENED_AT = "opened_at"; public static final String OPENED_AT = "opened_at";
......
...@@ -24,8 +24,6 @@ public class MyRequest { ...@@ -24,8 +24,6 @@ public class MyRequest {
@Expose @Expose
String approval; String approval;
public String getNumber() { public String getNumber() {
return number; return number;
} }
......
...@@ -6,7 +6,6 @@ import com.google.gson.annotations.SerializedName; ...@@ -6,7 +6,6 @@ import com.google.gson.annotations.SerializedName;
public class VariableChoice { public class VariableChoice {
private long id;
private long variable_id; private long variable_id;
@SerializedName("text") @SerializedName("text")
...@@ -22,14 +21,6 @@ public class VariableChoice { ...@@ -22,14 +21,6 @@ public class VariableChoice {
@Expose @Expose
private float misc; private float misc;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getVariableId() { public long getVariableId() {
return variable_id; return variable_id;
} }
...@@ -104,72 +95,9 @@ public class VariableChoice { ...@@ -104,72 +95,9 @@ public class VariableChoice {
public static final String URL_PARAM_VARIABLE_CHOICE_SYSPRM_QUERY_VALUE = "question"; public static final String URL_PARAM_VARIABLE_CHOICE_SYSPRM_QUERY_VALUE = "question";
} }
public static final class VariableChoiceBuilder {
private long id;
private long variable_id;
private String text;
private String value;
private int order;
private float misc;
private VariableChoiceBuilder() {
}
public static VariableChoiceBuilder aVariableChoice() {
return new VariableChoiceBuilder();
}
public VariableChoiceBuilder setId(long id) {
this.id = id;
return this;
}
public VariableChoiceBuilder setVariableId(long variable_id) {
this.variable_id = variable_id;
return this;
}
public VariableChoiceBuilder setText(String text) {
this.text = text;
return this;
}
public VariableChoiceBuilder setValue(String value) {
this.value = value;
return this;
}
public VariableChoiceBuilder setOrder(int order) {
this.order = order;
return this;
}
public VariableChoiceBuilder setMisc(float misc) {
this.misc = misc;
return this;
}
public VariableChoiceBuilder but() {
return aVariableChoice().setId(id).setVariableId(variable_id).setText(text).setValue(value).setOrder(order).setMisc(misc);
}
public VariableChoice build() {
VariableChoice variableChoice = new VariableChoice();
variableChoice.setId(id);
variableChoice.setVariableId(variable_id);
variableChoice.setText(text);
variableChoice.setValue(value);
variableChoice.setOrder(order);
variableChoice.setMisc(misc);
return variableChoice;
}
}
@Override @Override
public String toString() { public String toString() {
return "VariableChoice{" + return "VariableChoice{" +
"id=" + id +
", variable_id=" + variable_id + ", variable_id=" + variable_id +
", text='" + text + '\'' + ", text='" + text + '\'' +
", value='" + value + '\'' + ", value='" + value + '\'' +
......
...@@ -50,7 +50,6 @@ public class SelectReferenceDialog extends DialogFragment { ...@@ -50,7 +50,6 @@ public class SelectReferenceDialog extends DialogFragment {
@BindView(R.id.dialog_title) TextView mTitleTextView; @BindView(R.id.dialog_title) TextView mTitleTextView;
@BindView(R.id.dialog_edit_text) EditText mEditText; @BindView(R.id.dialog_edit_text) EditText mEditText;
private ArrayAdapter<String> mAdapter;
private ReferenceListener mListener; private ReferenceListener mListener;
private Unbinder mUnbinder; private Unbinder mUnbinder;
private List<Reference> mReferenceList; private List<Reference> mReferenceList;
...@@ -178,11 +177,11 @@ public class SelectReferenceDialog extends DialogFragment { ...@@ -178,11 +177,11 @@ public class SelectReferenceDialog extends DialogFragment {
progressDialog.dismiss(); progressDialog.dismiss();
} }
if(syncStatus == SyncStatus.SUCCESS) { if(syncStatus == SyncStatus.SUCCESS) {
mAdapter = new ArrayAdapter(getActivity(), ArrayAdapter<String> adapter = new ArrayAdapter(getActivity(),
android.R.layout.simple_list_item_1, android.R.layout.simple_list_item_1,
android.R.id.text1, android.R.id.text1,
getReferenceForDisplay()); getReferenceForDisplay());
mListView.setAdapter(mAdapter); mListView.setAdapter(adapter);
} else { } else {
showErrorDialog(R.string.failed_to_fetch_reference_string); showErrorDialog(R.string.failed_to_fetch_reference_string);
} }
......
...@@ -39,9 +39,8 @@ public class CatalogueItemScreen extends AppCompatActivity { ...@@ -39,9 +39,8 @@ public class CatalogueItemScreen extends AppCompatActivity {
@BindView(R.id.catalogue_item_screen_list_view) ListView mListView; @BindView(R.id.catalogue_item_screen_list_view) ListView mListView;
@BindView(R.id.catalogue_item_screen_empty_text_view) TextView mEmptyTextView; @BindView(R.id.catalogue_item_screen_empty_text_view) TextView mEmptyTextView;
private String mCatalogueSysId, mCatalogueTitle; private String mCatalogueSysId;
private List<CatalogueItem> mCatalogueItemList; private List<CatalogueItem> mCatalogueItemList;
private CatalogueApplication mApplication;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -51,9 +50,9 @@ public class CatalogueItemScreen extends AppCompatActivity { ...@@ -51,9 +50,9 @@ public class CatalogueItemScreen extends AppCompatActivity {
setContentView(R.layout.catalogue_item_screen); setContentView(R.layout.catalogue_item_screen);
ButterKnife.bind(this); ButterKnife.bind(this);
mApplication = (CatalogueApplication) getApplication(); CatalogueApplication application = (CatalogueApplication) getApplication();
mCatalogueSysId = getIntent().getExtras().getString(Constants.DATA_KEY_SYS_ID); mCatalogueSysId = getIntent().getExtras().getString(Constants.DATA_KEY_SYS_ID);
mCatalogueTitle = getIntent().getExtras().getString(Constants.DATA_KEY_CATALOGUE_TITLE); String catalogueTitle = getIntent().getExtras().getString(Constants.DATA_KEY_CATALOGUE_TITLE);
if (mCatalogueSysId == null) { if (mCatalogueSysId == null) {
CatalogueLog.e("CatalogueItemScreen: mCatalogueSysId is null"); CatalogueLog.e("CatalogueItemScreen: mCatalogueSysId is null");
...@@ -64,12 +63,12 @@ public class CatalogueItemScreen extends AppCompatActivity { ...@@ -64,12 +63,12 @@ public class CatalogueItemScreen extends AppCompatActivity {
if(actionBar != null) { if(actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setElevation(0); actionBar.setElevation(0);
actionBar.setTitle(mCatalogueTitle); actionBar.setTitle(catalogueTitle);
actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowTitleEnabled(true);
} }
if(mApplication.isNetConnected()) { if(application.isNetConnected()) {
new FetchCatalogueItem().execute(); new FetchCatalogueItem().execute();
} else { } else {
showErrorDialog(R.string.internet_validation_string); showErrorDialog(R.string.internet_validation_string);
...@@ -90,15 +89,13 @@ public class CatalogueItemScreen extends AppCompatActivity { ...@@ -90,15 +89,13 @@ public class CatalogueItemScreen extends AppCompatActivity {
@Override @Override
protected SyncStatus doInBackground(String... params) { protected SyncStatus doInBackground(String... params) {
SyncStatus syncStatus = CatalogueItemApiManager.getCatalogueItems(mCatalogueSysId, new GetCatalogueItemApiListener() { return CatalogueItemApiManager.getCatalogueItems(mCatalogueSysId, new GetCatalogueItemApiListener() {
@Override @Override
public void onDoneApiCall(List<CatalogueItem> catalogueItemList) { public void onDoneApiCall(List<CatalogueItem> catalogueItemList) {
CatalogueLog.e("Data: catalogueItemList: "+catalogueItemList); CatalogueLog.e("Data: catalogueItemList: "+catalogueItemList);
mCatalogueItemList = catalogueItemList; mCatalogueItemList = catalogueItemList;
} }
}); });
return syncStatus;
} }
@Override @Override
......
...@@ -38,7 +38,6 @@ public class CatalogueScreen extends AppCompatActivity { ...@@ -38,7 +38,6 @@ public class CatalogueScreen extends AppCompatActivity {
@BindView(R.id.catalogue_screen_list_view) ListView mListView; @BindView(R.id.catalogue_screen_list_view) ListView mListView;
private List<Catalogue> mCatalogueList; private List<Catalogue> mCatalogueList;
private CatalogueApplication mApplication;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -48,7 +47,7 @@ public class CatalogueScreen extends AppCompatActivity { ...@@ -48,7 +47,7 @@ public class CatalogueScreen extends AppCompatActivity {
setContentView(R.layout.catalogue_screen); setContentView(R.layout.catalogue_screen);
ButterKnife.bind(this); ButterKnife.bind(this);
mApplication = (CatalogueApplication) getApplication(); CatalogueApplication application = (CatalogueApplication) getApplication();
setSupportActionBar(mToolbar); setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
...@@ -60,7 +59,7 @@ public class CatalogueScreen extends AppCompatActivity { ...@@ -60,7 +59,7 @@ public class CatalogueScreen extends AppCompatActivity {
actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowTitleEnabled(true);
} }
if(mApplication.isNetConnected()) { if(application.isNetConnected()) {
new FetchCatalogue().execute(); new FetchCatalogue().execute();
} else { } else {
showErrorDialog(R.string.internet_validation_string); showErrorDialog(R.string.internet_validation_string);
...@@ -81,15 +80,13 @@ public class CatalogueScreen extends AppCompatActivity { ...@@ -81,15 +80,13 @@ public class CatalogueScreen extends AppCompatActivity {
@Override @Override
protected SyncStatus doInBackground(String... params) { protected SyncStatus doInBackground(String... params) {
SyncStatus syncStatus = CatalogueApiManager.getCatalogues(new GetCatalogueApiListener() { return CatalogueApiManager.getCatalogues(new GetCatalogueApiListener() {
@Override @Override
public void onDoneApiCall(List<Catalogue> catalogueList) { public void onDoneApiCall(List<Catalogue> catalogueList) {
CatalogueLog.e("Data: catalogueList: "+catalogueList); CatalogueLog.e("Data: catalogueList: "+catalogueList);
mCatalogueList = catalogueList; mCatalogueList = catalogueList;
} }
}); });
return syncStatus;
} }
@Override @Override
......
...@@ -462,8 +462,7 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -462,8 +462,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
@Override @Override
protected SyncStatus doInBackground(String... params) { protected SyncStatus doInBackground(String... params) {
SyncStatus syncStatus = CatalogueVariableApiManager.submitVariableForm(mCatalogueItemSysId, mJsonArray); return CatalogueVariableApiManager.submitVariableForm(mCatalogueItemSysId, mJsonArray);
return syncStatus;
} }
@Override @Override
......
package com.vsoft.uofl_catalogue.ui; package com.vsoft.uofl_catalogue.ui;
import android.app.Activity; import android.app.Activity;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.widget.GridView; import android.widget.GridView;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uofl_catalogue.R;
import com.vsoft.uofl_catalogue.adapters.HomeScreenAdapter; import com.vsoft.uofl_catalogue.adapters.HomeScreenAdapter;
import com.vsoft.uofl_catalogue.utils.PrefManager;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
...@@ -19,18 +16,13 @@ import butterknife.OnItemClick; ...@@ -19,18 +16,13 @@ import butterknife.OnItemClick;
* Created by Kunj on 11/8/16. * Created by Kunj on 11/8/16.
*/ */
public class HomeScreen extends Activity { public class HomeScreen extends Activity {
private String firstName,lastName,sysId;
@BindView(R.id.home_screen_grid_view) GridView mGridView; @BindView(R.id.home_screen_grid_view) GridView mGridView;
@Override
@Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.home_screen); setContentView(R.layout.home_screen);
SharedPreferences sharedPreferences = getSharedPreferences(PrefManager.PREFERENCES_USER_VALUES_KEY, Context.MODE_PRIVATE);
firstName = sharedPreferences.getString(PrefManager.PREFERENCES_FIRST_NAME, "");
lastName = sharedPreferences.getString(PrefManager.PREFERENCE_LAST_NAME, "");
sysId = sharedPreferences.getString(PrefManager.PREFERENCE_SYS_ID, "");
ButterKnife.bind(this); ButterKnife.bind(this);
mGridView.setAdapter(new HomeScreenAdapter(this, getResources().getStringArray(R.array.home_screen_array),getResources().obtainTypedArray(R.array.home_screen_icon_array))); mGridView.setAdapter(new HomeScreenAdapter(this, getResources().getStringArray(R.array.home_screen_array),getResources().obtainTypedArray(R.array.home_screen_icon_array)));
......
...@@ -9,12 +9,9 @@ import android.widget.EditText; ...@@ -9,12 +9,9 @@ import android.widget.EditText;
import android.widget.Toast; import android.widget.Toast;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uofl_catalogue.R;
import com.vsoft.uofl_catalogue.api.listeners.get.GetMyRequestApiListener;
import com.vsoft.uofl_catalogue.api.listeners.get.GetUserApiListener; import com.vsoft.uofl_catalogue.api.listeners.get.GetUserApiListener;
import com.vsoft.uofl_catalogue.api.managers.LoginApiManger; import com.vsoft.uofl_catalogue.api.managers.LoginApiManger;
import com.vsoft.uofl_catalogue.api.managers.MyRequestApiManager;
import com.vsoft.uofl_catalogue.api.managers.UserApiManager; import com.vsoft.uofl_catalogue.api.managers.UserApiManager;
import com.vsoft.uofl_catalogue.db.models.MyRequest;
import com.vsoft.uofl_catalogue.db.models.UserApiValues; import com.vsoft.uofl_catalogue.db.models.UserApiValues;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uofl_catalogue.enums.SyncStatus;
import com.vsoft.uofl_catalogue.utils.PrefManager; import com.vsoft.uofl_catalogue.utils.PrefManager;
...@@ -36,15 +33,12 @@ public class LoginScreen extends Activity { ...@@ -36,15 +33,12 @@ public class LoginScreen extends Activity {
@BindView(R.id.login_screen_password_edit_text) @BindView(R.id.login_screen_password_edit_text)
EditText password; EditText password;
private List<UserApiValues> mUserDetails; private List<UserApiValues> mUserDetails;
private PrefManager prefManager;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.login_screen); setContentView(R.layout.login_screen);
prefManager = PrefManager.getInstance();
prefManager.init(LoginScreen.this);
ButterKnife.bind(this); ButterKnife.bind(this);
} }
...@@ -74,9 +68,7 @@ public class LoginScreen extends Activity { ...@@ -74,9 +68,7 @@ public class LoginScreen extends Activity {
String clientSecret = "oklj6znxv3o9jmyn2mlp"; String clientSecret = "oklj6znxv3o9jmyn2mlp";
userName = params[0];//"a0kuma18"; userName = params[0];//"a0kuma18";
String password = params[1];//"v$0ftA$win"; String password = params[1];//"v$0ftA$win";
SyncStatus syncStatus = LoginApiManger.submitLoginValues(grantType, clientId, clientSecret, userName, password); return LoginApiManger.submitLoginValues(grantType, clientId, clientSecret, userName, password);
return syncStatus;
} }
@Override @Override
...@@ -108,14 +100,12 @@ public class LoginScreen extends Activity { ...@@ -108,14 +100,12 @@ public class LoginScreen extends Activity {
@Override @Override
protected SyncStatus doInBackground(String... params) { protected SyncStatus doInBackground(String... params) {
String userName=params[0]; String userName=params[0];
SyncStatus syncStatus = UserApiManager.getUserDetailResponse(userName,new GetUserApiListener() { return UserApiManager.getUserDetailResponse(userName,new GetUserApiListener() {
@Override @Override
public void onDoneApiCall(List<UserApiValues> userValues) { public void onDoneApiCall(List<UserApiValues> userValues) {
mUserDetails = userValues; mUserDetails = userValues;
} }
}); });
return syncStatus;
} }
@Override @Override
......
...@@ -34,7 +34,6 @@ public class MyIncidentScreen extends AppCompatActivity { ...@@ -34,7 +34,6 @@ public class MyIncidentScreen extends AppCompatActivity {
@BindView(R.id.tool_bar_view) Toolbar mToolbar; @BindView(R.id.tool_bar_view) Toolbar mToolbar;
@BindView(R.id.my_incidents_screen_list_view) ListView mListView; @BindView(R.id.my_incidents_screen_list_view) ListView mListView;
private CatalogueApplication mApplication;
private List<Incident> mIncidentList; private List<Incident> mIncidentList;
@Override @Override
...@@ -45,7 +44,7 @@ public class MyIncidentScreen extends AppCompatActivity { ...@@ -45,7 +44,7 @@ public class MyIncidentScreen extends AppCompatActivity {
setContentView(R.layout.my_incidents_screen); setContentView(R.layout.my_incidents_screen);
ButterKnife.bind(this); ButterKnife.bind(this);
mApplication = (CatalogueApplication) getApplication(); CatalogueApplication application = (CatalogueApplication) getApplication();
setSupportActionBar(mToolbar); setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
...@@ -57,7 +56,7 @@ public class MyIncidentScreen extends AppCompatActivity { ...@@ -57,7 +56,7 @@ public class MyIncidentScreen extends AppCompatActivity {
actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowTitleEnabled(true);
} }
if(mApplication.isNetConnected()) { if(application.isNetConnected()) {
new FetchIncident().execute(); new FetchIncident().execute();
} else { } else {
showErrorDialog(R.string.internet_validation_string); showErrorDialog(R.string.internet_validation_string);
...@@ -103,15 +102,13 @@ public class MyIncidentScreen extends AppCompatActivity { ...@@ -103,15 +102,13 @@ public class MyIncidentScreen extends AppCompatActivity {
@Override @Override
protected SyncStatus doInBackground(String... params) { protected SyncStatus doInBackground(String... params) {
SyncStatus syncStatus = IncidentApiManager.getIncident(new GetIncidentApiListener() { return IncidentApiManager.getIncident(new GetIncidentApiListener() {
@Override @Override
public void onDoneApiCall(List<Incident> incidentList) { public void onDoneApiCall(List<Incident> incidentList) {
CatalogueLog.e("Data: incidentList: "+incidentList); CatalogueLog.e("Data: incidentList: "+incidentList);
mIncidentList = incidentList; mIncidentList = incidentList;
} }
}); });
return syncStatus;
} }
@Override @Override
......
...@@ -31,8 +31,7 @@ public class MyRequestActivity extends AppCompatActivity { ...@@ -31,8 +31,7 @@ public class MyRequestActivity extends AppCompatActivity {
@BindView(R.id.request_screen_list_view) @BindView(R.id.request_screen_list_view)
ListView mListView; ListView mListView;
private List<MyRequest> mMyrequestList; private List<MyRequest> mMyRequestList;
private CatalogueApplication mApplication;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -42,7 +41,7 @@ public class MyRequestActivity extends AppCompatActivity { ...@@ -42,7 +41,7 @@ public class MyRequestActivity extends AppCompatActivity {
setContentView(R.layout.request_list_screen); setContentView(R.layout.request_list_screen);
ButterKnife.bind(this); ButterKnife.bind(this);
mApplication = (CatalogueApplication) getApplication(); CatalogueApplication application = (CatalogueApplication) getApplication();
setSupportActionBar(mToolbar); setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar(); ActionBar actionBar = getSupportActionBar();
...@@ -55,7 +54,7 @@ public class MyRequestActivity extends AppCompatActivity { ...@@ -55,7 +54,7 @@ public class MyRequestActivity extends AppCompatActivity {
actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowTitleEnabled(true);
} }
if(mApplication.isNetConnected()) { if(application.isNetConnected()) {
new FetchMyRequestData().execute(); new FetchMyRequestData().execute();
} else { } else {
showErrorDialog(R.string.internet_validation_string); showErrorDialog(R.string.internet_validation_string);
...@@ -76,14 +75,12 @@ public class MyRequestActivity extends AppCompatActivity { ...@@ -76,14 +75,12 @@ public class MyRequestActivity extends AppCompatActivity {
@Override @Override
protected SyncStatus doInBackground(String... params) { protected SyncStatus doInBackground(String... params) {
SyncStatus syncStatus = MyRequestApiManager.getMyrequests(new GetMyRequestApiListener() { return MyRequestApiManager.getMyrequests(new GetMyRequestApiListener() {
@Override @Override
public void onDoneApiCall(List<MyRequest> requestList) { public void onDoneApiCall(List<MyRequest> requestList) {
mMyrequestList = requestList; mMyRequestList = requestList;
} }
}); });
return syncStatus;
} }
@Override @Override
...@@ -93,8 +90,8 @@ public class MyRequestActivity extends AppCompatActivity { ...@@ -93,8 +90,8 @@ public class MyRequestActivity extends AppCompatActivity {
progressDialog.dismiss(); progressDialog.dismiss();
} }
if(syncStatus == SyncStatus.SUCCESS) { if(syncStatus == SyncStatus.SUCCESS) {
if(mMyrequestList!=null) if(mMyRequestList !=null)
setData(mMyrequestList); setData(mMyRequestList);
} else { } else {
showErrorDialog(R.string.failed_to_fetch_catalogue_category_string); showErrorDialog(R.string.failed_to_fetch_catalogue_category_string);
} }
......
...@@ -121,8 +121,7 @@ public class ReportIncidentScreen extends AppCompatActivity { ...@@ -121,8 +121,7 @@ public class ReportIncidentScreen extends AppCompatActivity {
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();
} }
SyncStatus syncStatus = IncidentApiManager.submitIncidentForm(incidentJsonObject.toString()); return IncidentApiManager.submitIncidentForm(incidentJsonObject.toString());
return syncStatus;
} }
@Override @Override
......
...@@ -53,7 +53,7 @@ public class PrefManager { ...@@ -53,7 +53,7 @@ public class PrefManager {
editor.putString(PREFERENCES_FIRST_NAME, firstname); editor.putString(PREFERENCES_FIRST_NAME, firstname);
editor.putString(PREFERENCE_LAST_NAME, lastname); editor.putString(PREFERENCE_LAST_NAME, lastname);
editor.putString(PREFERENCE_SYS_ID, sysid); editor.putString(PREFERENCE_SYS_ID, sysid);
editor.commit(); editor.apply();
} }
......
...@@ -225,16 +225,14 @@ public class Util { ...@@ -225,16 +225,14 @@ public class Util {
public static String getDefaultDate() { public static String getDefaultDate() {
Calendar c = Calendar.getInstance(); Calendar c = Calendar.getInstance();
SimpleDateFormat df = new SimpleDateFormat("dd MMM, yyyy", Locale.US); SimpleDateFormat df = new SimpleDateFormat("dd MMM, yyyy", Locale.US);
String formattedDate = df.format(c.getTime()); return df.format(c.getTime());
return formattedDate;
} }
public static String getDefaultTime() { public static String getDefaultTime() {
Calendar c = Calendar.getInstance(); Calendar c = Calendar.getInstance();
int hour = c.get(Calendar.HOUR_OF_DAY); int hour = c.get(Calendar.HOUR_OF_DAY);
int min = c.get(Calendar.MINUTE); int min = c.get(Calendar.MINUTE);
String time = (hour < 10 ? ("0" + hour) : hour) + ":" + (min < 10 ? ("0" + min) : min); return (hour < 10 ? ("0" + hour) : hour) + ":" + (min < 10 ? ("0" + min) : min);
return time;
} }
public static long getDateFromString(String strDate) { public static long getDateFromString(String strDate) {
......
...@@ -11,9 +11,6 @@ ...@@ -11,9 +11,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="0dp" android:layout_margin="0dp"
android:background="@android:color/white" android:background="@android:color/white"
android:contentInsetEnd="0dp"
android:contentInsetRight="0dp"
android:contentInsetStart="0dp"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
android:padding="0dp" android:padding="0dp"
app:contentInsetEnd="0dp" app:contentInsetEnd="0dp"
......
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
android:background="@android:color/white" android:background="@android:color/white"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
android:padding="0dp" android:padding="0dp"
android:contentInsetEnd="0dp"
android:contentInsetRight="0dp"
android:contentInsetStart="0dp"
app:contentInsetEnd="0dp" app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
app:contentInsetRight="0dp" app:contentInsetRight="0dp"
......
...@@ -12,9 +12,6 @@ ...@@ -12,9 +12,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="0dp" android:layout_margin="0dp"
android:background="@android:color/white" android:background="@android:color/white"
android:contentInsetEnd="0dp"
android:contentInsetRight="0dp"
android:contentInsetStart="0dp"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
android:padding="0dp" android:padding="0dp"
app:contentInsetEnd="0dp" app:contentInsetEnd="0dp"
......
...@@ -31,6 +31,6 @@ ...@@ -31,6 +31,6 @@
android:layout_below="@+id/home_screen_adapter_image_view" android:layout_below="@+id/home_screen_adapter_image_view"
android:gravity="center" android:gravity="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="@dimen/large_text_size" /> android:textSize="@dimen/extra_normal_text_size" />
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
...@@ -12,9 +12,6 @@ ...@@ -12,9 +12,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="0dp" android:layout_margin="0dp"
android:background="@android:color/white" android:background="@android:color/white"
android:contentInsetEnd="0dp"
android:contentInsetRight="0dp"
android:contentInsetStart="0dp"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
android:padding="0dp" android:padding="0dp"
app:contentInsetEnd="0dp" app:contentInsetEnd="0dp"
...@@ -35,7 +32,7 @@ ...@@ -35,7 +32,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/ic_login_background" android:background="@drawable/ic_login_background">
>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginTop="@dimen/login_screen_layout_margin_top" android:layout_marginBottom="@dimen/login_screen_layout_margin_bottom"
android:layout_marginLeft="@dimen/login_screen_layout_margin_left" android:layout_marginLeft="@dimen/login_screen_layout_margin_left"
android:layout_marginRight="@dimen/login_screen_layout_margin_right" android:layout_marginRight="@dimen/login_screen_layout_margin_right"
android:layout_marginBottom="@dimen/login_screen_layout_margin_bottom" android:layout_marginTop="@dimen/login_screen_layout_margin_top"
android:orientation="vertical"> android:orientation="vertical">
<EditText <EditText
android:id="@+id/login_screen_username_edit_text" android:id="@+id/login_screen_username_edit_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/username_under_bg_box"
android:layout_marginLeft="@dimen/login_screen_margin_left" android:layout_marginLeft="@dimen/login_screen_margin_left"
android:layout_marginRight="@dimen/login_screen_margin_right" android:layout_marginRight="@dimen/login_screen_margin_right"
android:background="@drawable/username_under_bg_box"
android:drawableLeft="@mipmap/ic_user_icon" android:drawableLeft="@mipmap/ic_user_icon"
android:text="a0kuma18"
android:hint="@string/login_screen_user_name_string" android:hint="@string/login_screen_user_name_string"
android:lines="1" android:lines="1"
android:singleLine="true" android:singleLine="true"
android:text="a0kuma18"
android:textCursorDrawable="@null" /> android:textCursorDrawable="@null" />
<EditText <EditText
android:id="@+id/login_screen_password_edit_text" android:id="@+id/login_screen_password_edit_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/login_screen_password_string"
android:inputType="textPassword"
android:lines="1"
android:text="v$0ftA$win"
android:background="@drawable/username_under_bg_box"
android:layout_marginLeft="@dimen/login_screen_margin_left" android:layout_marginLeft="@dimen/login_screen_margin_left"
android:layout_marginRight="@dimen/login_screen_margin_right" android:layout_marginRight="@dimen/login_screen_margin_right"
android:background="@drawable/username_under_bg_box"
android:drawableLeft="@mipmap/ic_password_icon" android:drawableLeft="@mipmap/ic_password_icon"
android:hint="@string/login_screen_password_string"
android:inputType="textPassword"
android:lines="1"
android:singleLine="true" android:singleLine="true"
android:textCursorDrawable="@null"/> android:text="v$0ftA$win"
android:textCursorDrawable="@null" />
<TextView <TextView
android:id="@+id/login_screen_login_text_view" android:id="@+id/login_screen_login_text_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/login_screen_margin_left"
android:layout_marginRight="@dimen/login_screen_margin_right"
android:layout_marginTop="@dimen/login_screen_login_bottom" android:layout_marginTop="@dimen/login_screen_login_bottom"
android:background="@drawable/login_bg" android:background="@drawable/login_bg"
android:paddingBottom="@dimen/normal_margin" android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin" android:paddingTop="@dimen/normal_margin"
android:text="@string/login_screen_login_string" android:text="@string/login_screen_login_string"
android:textAlignment="center" android:textAlignment="center"
android:layout_marginLeft="@dimen/login_screen_margin_left"
android:layout_marginRight="@dimen/login_screen_margin_right"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="@dimen/extra_normal_text_size" /> android:textSize="@dimen/extra_normal_text_size" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
...@@ -5,13 +5,6 @@ ...@@ -5,13 +5,6 @@
android:padding="@dimen/small_margin"> android:padding="@dimen/small_margin">
<TextView <TextView
android:id="@+id/my_incident_adapter_number_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/extra_normal_text_size"
android:textStyle="bold" />
<TextView
android:id="@+id/my_incident_adapter_date_tv" android:id="@+id/my_incident_adapter_date_tv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -19,6 +12,17 @@ ...@@ -19,6 +12,17 @@
android:textSize="@dimen/normal_text_size" /> android:textSize="@dimen/normal_text_size" />
<TextView <TextView
android:id="@+id/my_incident_adapter_number_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lines="1"
android:singleLine="true"
android:ellipsize="end"
android:layout_toLeftOf="@id/my_incident_adapter_date_tv"
android:textSize="@dimen/normal_text_size"
android:textStyle="bold" />
<TextView
android:id="@+id/my_incident_adapter_short_des_tv" android:id="@+id/my_incident_adapter_short_des_tv"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
android:background="@android:color/white" android:background="@android:color/white"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
android:padding="0dp" android:padding="0dp"
android:contentInsetEnd="0dp"
android:contentInsetRight="0dp"
android:contentInsetStart="0dp"
app:contentInsetEnd="0dp" app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
app:contentInsetRight="0dp" app:contentInsetRight="0dp"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#ffffff"> android:background="#ffffff"
android:orientation="vertical"
android:padding="@dimen/normal_margin">
<TextView <TextView
android:id="@+id/dueDate"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Large Text" android:layout_alignParentRight="true"
android:id="@+id/number" android:textSize="@dimen/normal_text_size" />
android:textSize="20dp"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="15dp"
android:layout_marginLeft="15dp"/>
<TextView <TextView
android:layout_width="wrap_content" android:id="@+id/number"
android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Large Text" android:layout_toLeftOf="@id/dueDate"
android:id="@+id/dueDate" android:singleLine="true"
android:textColor="#8e8e8e" android:lines="1"
android:textSize="15dp" android:ellipsize="end"
android:layout_marginTop="15dp" android:textSize="@dimen/normal_text_size"
android:layout_below="@+id/number" android:textStyle="bold" />
android:layout_marginRight="15dp"
android:layout_alignParentRight="true"
android:layout_alignBaseline="@+id/number"
/>
<TextView <TextView
android:id="@+id/shotrDescription"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Large Text" android:layout_below="@id/number"
android:id="@+id/shotrDescription" android:layout_marginTop="@dimen/normal_margin"
android:textSize="20dp" android:layout_marginBottom="@dimen/normal_margin"
android:textColor="#000000" android:textColor="@android:color/black"
android:textStyle="bold" android:textSize="@dimen/normal_text_size"
android:layout_marginTop="15dp" android:textStyle="bold" />
android:layout_below="@+id/number"
android:layout_alignLeft="@+id/number"
android:layout_alignStart="@+id/number" />
<ImageView <ImageView
android:layout_width="15dp"
android:layout_height="15dp"
android:id="@+id/approval_image" android:id="@+id/approval_image"
android:background="@drawable/circle" android:layout_width="@dimen/my_request_approval_image_width"
android:layout_alignTop="@+id/approval" android:layout_height="@dimen/my_request_approval_image_height"
android:layout_alignLeft="@+id/shotrDescription" android:layout_below="@id/shotrDescription"
android:layout_alignStart="@+id/shotrDescription" android:background="@drawable/circle"/>
android:layout_marginBottom="15dp"/>
<TextView <TextView
android:id="@+id/approval"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Large Text" android:layout_below="@id/shotrDescription"
android:id="@+id/approval" android:layout_marginLeft="@dimen/small_margin"
android:textSize="15dp" android:layout_toRightOf="@id/approval_image"
android:textColor="#8e8e8e" android:textSize="@dimen/normal_text_size" />
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:layout_toRightOf="@+id/approval_image"
android:layout_below="@+id/shotrDescription"/>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
android:background="@android:color/white" android:background="@android:color/white"
android:minHeight="?attr/actionBarSize" android:minHeight="?attr/actionBarSize"
android:padding="0dp" android:padding="0dp"
android:contentInsetEnd="0dp"
android:contentInsetRight="0dp"
android:contentInsetStart="0dp"
app:contentInsetEnd="0dp" app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp" app:contentInsetLeft="0dp"
app:contentInsetRight="0dp" app:contentInsetRight="0dp"
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
<color name="name_null_view_color">#88FFA500</color> <color name="name_null_view_color">#88FFA500</color>
<color name="view_not_implemented_color">#88ff0000</color> <color name="view_not_implemented_color">#88ff0000</color>
<color name="login_screen_login_button_bg_color">@color/colorPrimary</color>
<color name="home_screen_bg_color">@color/colorPrimary</color> <color name="home_screen_bg_color">@color/colorPrimary</color>
<color name="screen_bg_color">#c0cfd1</color> <color name="screen_bg_color">#c0cfd1</color>
......
...@@ -2,35 +2,34 @@ ...@@ -2,35 +2,34 @@
<resources> <resources>
<!--Margins--> <!--Margins-->
<dimen name="small_margin">5dp</dimen> <dimen name="small_margin">5dp</dimen>
<dimen name="normal_margin">5dp</dimen> <dimen name="normal_margin">10dp</dimen>
<dimen name="large_margin">10dp</dimen> <dimen name="large_margin">15dp</dimen>
<!--Text size--> <!--Text size-->
<dimen name="small_text_size">12sp</dimen> <dimen name="small_text_size">12sp</dimen>
<dimen name="normal_text_size">16sp</dimen> <dimen name="normal_text_size">16sp</dimen>
<dimen name="extra_normal_text_size">24sp</dimen> <dimen name="extra_normal_text_size">20sp</dimen>
<dimen name="large_text_size">20sp</dimen> <dimen name="large_text_size">24sp</dimen>
<dimen name="catalogue_category_and_item_list_view_divider_height">5dp</dimen> <dimen name="catalogue_category_and_item_list_view_divider_height">5dp</dimen>
<dimen name="list_view_divider_height">1dp</dimen> <dimen name="list_view_divider_height">1dp</dimen>
<!--Home Screen--> <!--Home Screen-->
<dimen name="home_screen_item_height">120dp</dimen>
<dimen name="home_screen_image_margin">10dp</dimen> <dimen name="home_screen_image_margin">10dp</dimen>
<dimen name="home_screen_image_height">70dp</dimen> <dimen name="home_screen_image_height">70dp</dimen>
<dimen name="list_item_height">100dp</dimen> <dimen name="list_item_height">100dp</dimen>
<!--Login Screen-->
<!--Login Screen-->
<dimen name="login_screen_margin_left">20dp</dimen> <dimen name="login_screen_margin_left">20dp</dimen>
<dimen name="login_screen_margin_right">20dp</dimen> <dimen name="login_screen_margin_right">20dp</dimen>
<dimen name="login_screen_margin_top">2dp</dimen>
<dimen name="login_screen_login_bottom">15dp</dimen> <dimen name="login_screen_login_bottom">15dp</dimen>
<dimen name="login_screen_layout_margin_left">20dp</dimen> <dimen name="login_screen_layout_margin_left">20dp</dimen>
<dimen name="login_screen_layout_margin_right">20dp</dimen> <dimen name="login_screen_layout_margin_right">20dp</dimen>
<dimen name="login_screen_layout_margin_bottom">35dp</dimen> <dimen name="login_screen_layout_margin_bottom">35dp</dimen>
<dimen name="login_screen_layout_margin_top">10dp</dimen> <dimen name="login_screen_layout_margin_top">10dp</dimen>
<!--Spinner Item height-->
<dimen name="spinner_item_height">40dp</dimen> <!--My Request screen-->
<dimen name="my_request_approval_image_height">15dp</dimen>
<dimen name="my_request_approval_image_width">15dp</dimen>
</resources> </resources>
\ No newline at end of file
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
<string name="failed_to_fetch_catalogue_category_string">Failed to fetch Catalogue Category.</string> <string name="failed_to_fetch_catalogue_category_string">Failed to fetch Catalogue Category.</string>
<string name="failed_to_fetch_catalogue_category_items_string">Failed to fetch Catalogue Category Items.</string> <string name="failed_to_fetch_catalogue_category_items_string">Failed to fetch Catalogue Category Items.</string>
<string name="failed_to_fetch_catalogue_form_string">Failed to fetch Form.</string> <string name="failed_to_fetch_catalogue_form_string">Failed to fetch Form.</string>
<string name="failed_to_fetch_variable_choice_string">Failed to fetch Choice Items.</string>
<string name="failed_to_fetch_reference_string">Failed to fetch References.</string> <string name="failed_to_fetch_reference_string">Failed to fetch References.</string>
<string name="failed_to_submit_form_string">Failed to submit form.</string> <string name="failed_to_submit_form_string">Failed to submit form.</string>
<string name="failed_to_fetch_incident_string">Failed to fetch Incident.</string> <string name="failed_to_fetch_incident_string">Failed to fetch Incident.</string>
......
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