Commit 8735f2dd by Krishna Vemulavada

login and myrequest issues reloved

parents 748fe433 32b7d4f9
Showing with 889 additions and 943 deletions
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'android-apt' apply plugin: 'android-apt'
android { android {
...@@ -15,11 +30,11 @@ android { ...@@ -15,11 +30,11 @@ android {
buildToolsVersion "24.0.1" buildToolsVersion "24.0.1"
defaultConfig { defaultConfig {
applicationId "com.vsoft.uofl_catalogue" applicationId "com.vsoft.uoflservicenow"
minSdkVersion 9 minSdkVersion 9
targetSdkVersion 24 targetSdkVersion 24
versionCode 1 versionCode 1
versionName "0.0.3" versionName "0.0.4"
multiDexEnabled true multiDexEnabled true
} }
buildTypes { buildTypes {
...@@ -48,4 +63,8 @@ dependencies { ...@@ -48,4 +63,8 @@ dependencies {
apt 'com.jakewharton:butterknife-compiler:8.2.1' apt 'com.jakewharton:butterknife-compiler:8.2.1'
compile 'com.android.support:cardview-v7:24.1.1' compile 'com.android.support:cardview-v7:24.1.1'
compile 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:1.0.1' compile 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:1.0.1'
compile 'com.google.android.gms:play-services-analytics:9.2.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') {
transitive = true;
}
} }
{
"project_info": {
"project_number": "593992849158",
"project_id": "uofl-servicenow-android"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:593992849158:android:84f481659dc7e412",
"android_client_info": {
"package_name": "com.vsoft.uoflservicenow"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBEzc7fo12bQLx8CkogSGIb2j-vivdbJNg"
}
],
"services": {
"analytics_service": {
"status": 2,
"analytics_property": {
"tracking_id": "UA-83545030-1"
}
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 1
}
}
}
],
"configuration_version": "1"
}
\ No newline at end of file
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vsoft.uofl_catalogue"> package="com.vsoft.uoflservicenow">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
...@@ -42,14 +42,14 @@ ...@@ -42,14 +42,14 @@
android:screenSize="xlarge" /> android:screenSize="xlarge" />
</compatible-screens> </compatible-screens>
<application <application
android:name=".CatalogueApplication" android:name="com.vsoft.uoflservicenow.CatalogueApplication"
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity <activity
android:name=".ui.LoginScreen" android:name="com.vsoft.uoflservicenow.ui.LoginScreen"
android:label="@string/app_name" android:label="@string/app_name"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustPan"> android:windowSoftInputMode="stateHidden|adjustPan">
...@@ -59,28 +59,30 @@ ...@@ -59,28 +59,30 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".ui.HomeScreen" android:name="com.vsoft.uoflservicenow.ui.HomeScreen"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.CatalogueScreen" android:name="com.vsoft.uoflservicenow.ui.CatalogueScreen"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.CatalogueItemScreen" android:name="com.vsoft.uoflservicenow.ui.CatalogueItemScreen"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.CatalogueVariableScreen" android:name="com.vsoft.uoflservicenow.ui.CatalogueVariableScreen"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize" /> android:windowSoftInputMode="stateHidden|adjustResize" />
<activity <activity
android:name=".ui.ReportIncidentScreen" android:name="com.vsoft.uoflservicenow.ui.ReportIncidentScreen"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize"/> android:windowSoftInputMode="stateHidden|adjustResize"/>
<activity <activity
android:name=".ui.MyRequestActivity" android:name="com.vsoft.uoflservicenow.ui.MyRequestActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait" />
/>
<activity <activity
android:name=".ui.MyIncidentScreen" android:name="com.vsoft.uoflservicenow.ui.MyIncidentScreen"
android:screenOrientation="portrait"/> android:screenOrientation="portrait"/>
<meta-data
android:name="io.fabric.ApiKey"
android:value="2b0a6e9db28d607fbcf71b8b25f1a0795e3f5b22" />
</application> </application>
</manifest> </manifest>
package com.vsoft.uofl_catalogue.enums;
/**
* @since 1.0
* @author Kunj on 30/8/16.
*
*/
public enum Impact {
UNKNOWN (-1),
HIGH (1),
MEDIUM (2),
LOW (3);
int id;
Impact(int id) {
this.id = id;
}
public static int getSyncStatus(Impact status) {
return status.id;
}
public int getId() {
return this.id;
}
public static Impact from(int id) {
for(int i = 0; i< Impact.values().length; i++) {
Impact impact = Impact.values()[i];
if(impact.id == id)
return Impact.values()[i];
}
return UNKNOWN;
}
}
package com.vsoft.uofl_catalogue.ui;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import com.vsoft.uofl_catalogue.CatalogueApplication;
import com.vsoft.uofl_catalogue.R;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created by kunj on 30/8/16.
*/
public class ReportIncidentScreen extends AppCompatActivity {
@BindView(R.id.tool_bar_view) Toolbar mToolbar;
@BindView(R.id.incident_impact_spinner) Spinner mImpactSpinner;
private CatalogueApplication mApplication;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.incidents_form_screen);
ButterKnife.bind(this);
mApplication = (CatalogueApplication) getApplication();
setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar();
if(actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setElevation(0);
actionBar.setTitle(R.string.incident_form_report_incident_text_string);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(true);
}
// Creating adapter for spinner
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, getResources().getStringArray(R.array.incident_impact_array));
// Drop down layout style - list view with radio button
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// attaching data adapter to spinner
mImpactSpinner.setAdapter(dataAdapter);
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
if (menuItem.getItemId() == android.R.id.home) {
finish();
}
return super.onOptionsItemSelected(menuItem);
}
}
package com.vsoft.uofl_catalogue; package com.vsoft.uoflservicenow;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.net.NetworkInfo; import android.net.NetworkInfo;
import com.crashlytics.android.Crashlytics;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;
import io.fabric.sdk.android.Fabric;
public class CatalogueApplication extends Application { public class CatalogueApplication extends Application {
private ConnectivityManager mConMgr; private ConnectivityManager mConMgr;
private static Context mContext; private static Context mContext;
private Tracker mTracker;
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
Fabric.with(this, new Crashlytics());
mContext = getApplicationContext(); mContext = getApplicationContext();
} }
...@@ -21,6 +28,15 @@ public class CatalogueApplication extends Application { ...@@ -21,6 +28,15 @@ public class CatalogueApplication extends Application {
return mContext; return mContext;
} }
synchronized public Tracker getDefaultTracker() {
if (mTracker == null) {
GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
// To enable debug logging use: adb shell setprop log.tag.GAv4 DEBUG
mTracker = analytics.newTracker(R.xml.global_tracker);
}
return mTracker;
}
public boolean isNetConnected() { public boolean isNetConnected() {
if(mConMgr==null) if(mConMgr==null)
mConMgr = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); mConMgr = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
......
package com.vsoft.uofl_catalogue.adapters; package com.vsoft.uoflservicenow.adapters;
import android.content.Context; import android.content.Context;
import android.view.LayoutInflater; 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.uoflservicenow.R;
import com.vsoft.uofl_catalogue.db.models.Catalogue; import com.vsoft.uoflservicenow.db.models.Catalogue;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -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
package com.vsoft.uofl_catalogue.adapters; package com.vsoft.uoflservicenow.adapters;
import android.content.Context; import android.content.Context;
import android.view.LayoutInflater; 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.uoflservicenow.R;
import com.vsoft.uofl_catalogue.db.models.CatalogueItem; import com.vsoft.uoflservicenow.db.models.CatalogueItem;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -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
package com.vsoft.uofl_catalogue.adapters; package com.vsoft.uoflservicenow.adapters;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
...@@ -9,7 +9,7 @@ import android.widget.BaseAdapter; ...@@ -9,7 +9,7 @@ import android.widget.BaseAdapter;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uoflservicenow.R;
/** /**
* Created by kunj on 18/8/16. * Created by kunj on 18/8/16.
......
package com.vsoft.uofl_catalogue.adapters; package com.vsoft.uoflservicenow.adapters;
import android.content.Context; import android.content.Context;
import android.view.LayoutInflater; import android.view.LayoutInflater;
...@@ -7,8 +7,8 @@ import android.view.ViewGroup; ...@@ -7,8 +7,8 @@ import android.view.ViewGroup;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.TextView; import android.widget.TextView;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uoflservicenow.R;
import com.vsoft.uofl_catalogue.db.models.Incident; import com.vsoft.uoflservicenow.db.models.Incident;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -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) {
......
package com.vsoft.uofl_catalogue.adapters; package com.vsoft.uoflservicenow.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;
...@@ -11,9 +10,8 @@ import android.widget.BaseAdapter; ...@@ -11,9 +10,8 @@ import android.widget.BaseAdapter;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uoflservicenow.R;
import com.vsoft.uofl_catalogue.db.models.Catalogue; import com.vsoft.uoflservicenow.db.models.MyRequest;
import com.vsoft.uofl_catalogue.db.models.MyRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -22,14 +20,12 @@ import java.util.List; ...@@ -22,14 +20,12 @@ 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;
Context mContext;
public MyRequestAdapter(Context context) { public MyRequestAdapter(Context context) {
mContext = context; mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mInflater = (LayoutInflater) mContext mContext=context;
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
} }
public void setRequestList(List<MyRequest> myreqList) { public void setRequestList(List<MyRequest> myreqList) {
...@@ -78,7 +74,7 @@ public class MyRequestAdapter extends BaseAdapter { ...@@ -78,7 +74,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());
......
package com.vsoft.uofl_catalogue.api; package com.vsoft.uoflservicenow.api;
import java.io.IOException; import java.io.IOException;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
......
package com.vsoft.uofl_catalogue.api; package com.vsoft.uoflservicenow.api;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Base64; import android.util.Base64;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import java.io.IOException; import java.io.IOException;
import okhttp3.Interceptor; import okhttp3.Interceptor;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
......
package com.vsoft.uofl_catalogue.api.interfaces; package com.vsoft.uoflservicenow.api.interfaces;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import okhttp3.ResponseBody; import okhttp3.ResponseBody;
import retrofit2.Call; import retrofit2.Call;
......
package com.vsoft.uofl_catalogue.api.interfaces; package com.vsoft.uoflservicenow.api.interfaces;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import okhttp3.ResponseBody; import okhttp3.ResponseBody;
import retrofit2.Call; import retrofit2.Call;
......
package com.vsoft.uofl_catalogue.api.interfaces; package com.vsoft.uoflservicenow.api.interfaces;
import com.vsoft.uofl_catalogue.db.models.CatalogueItem; import com.vsoft.uoflservicenow.db.models.CatalogueItem;
import com.vsoft.uofl_catalogue.db.models.CatalogueVariable; import com.vsoft.uoflservicenow.db.models.CatalogueVariable;
import com.vsoft.uofl_catalogue.db.models.Reference; import com.vsoft.uoflservicenow.db.models.Reference;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import okhttp3.ResponseBody; import okhttp3.ResponseBody;
import retrofit2.Call; import retrofit2.Call;
......
package com.vsoft.uofl_catalogue.api.interfaces; package com.vsoft.uoflservicenow.api.interfaces;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import okhttp3.ResponseBody; import okhttp3.ResponseBody;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET; import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query; import retrofit2.http.Query;
...@@ -18,6 +20,10 @@ public interface IncidentApi { ...@@ -18,6 +20,10 @@ public interface IncidentApi {
@GET(Constants.URL_GET_INCIDENTS) @GET(Constants.URL_GET_INCIDENTS)
Call<ResponseBody> getIncident(@Query(Constants.URL_PARAM_SYSPRM_QUERY) String sysParmQuery, Call<ResponseBody> getIncident(@Query(Constants.URL_PARAM_SYSPRM_QUERY) String sysParmQuery,
@Query(Constants.URL_PARAM_SYSPRM_LIMIT) String sysParmLimits); @Query(Constants.URL_PARAM_SYSPRM_LIMIT) String sysParmLimits);
// Post Incident API
@POST(Constants.URL_POST_INCIDENT)
Call<ResponseBody> submitIncident(@Body String incidentJson);
} }
package com.vsoft.uofl_catalogue.api.interfaces; package com.vsoft.uoflservicenow.api.interfaces;
import com.vsoft.uofl_catalogue.db.models.CatalogueItem; import com.vsoft.uoflservicenow.db.models.LoginItem;
import com.vsoft.uofl_catalogue.db.models.CatalogueVariable; import com.vsoft.uoflservicenow.utils.Constants;
import com.vsoft.uofl_catalogue.db.models.LoginItem;
import com.vsoft.uofl_catalogue.db.models.Reference;
import com.vsoft.uofl_catalogue.utils.Constants;
import okhttp3.ResponseBody; import okhttp3.ResponseBody;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field; import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded; import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST; import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;
/** /**
......
package com.vsoft.uofl_catalogue.api.interfaces; package com.vsoft.uoflservicenow.api.interfaces;
import com.vsoft.uofl_catalogue.db.models.CatalogueItem; import com.vsoft.uoflservicenow.utils.Constants;
import com.vsoft.uofl_catalogue.db.models.CatalogueVariable;
import com.vsoft.uofl_catalogue.db.models.Reference;
import com.vsoft.uofl_catalogue.utils.Constants;
import okhttp3.ResponseBody; import okhttp3.ResponseBody;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET; import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query; import retrofit2.http.Query;
import retrofit2.http.Url;
/** /**
......
package com.vsoft.uofl_catalogue.api.interfaces; package com.vsoft.uoflservicenow.api.interfaces;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import okhttp3.ResponseBody; import okhttp3.ResponseBody;
import retrofit2.Call; import retrofit2.Call;
......
package com.vsoft.uofl_catalogue.api.listeners.get; package com.vsoft.uoflservicenow.api.listeners.get;
import com.vsoft.uofl_catalogue.db.models.Catalogue; import com.vsoft.uoflservicenow.db.models.Catalogue;
import java.util.List; import java.util.List;
......
package com.vsoft.uofl_catalogue.api.listeners.get; package com.vsoft.uoflservicenow.api.listeners.get;
import com.vsoft.uofl_catalogue.db.models.CatalogueItem; import com.vsoft.uoflservicenow.db.models.CatalogueItem;
import java.util.List; import java.util.List;
......
package com.vsoft.uofl_catalogue.api.listeners.get; package com.vsoft.uoflservicenow.api.listeners.get;
import com.vsoft.uofl_catalogue.db.models.CatalogueVariable; import com.vsoft.uoflservicenow.db.models.CatalogueVariable;
import java.util.List; import java.util.List;
......
package com.vsoft.uofl_catalogue.api.listeners.get; package com.vsoft.uoflservicenow.api.listeners.get;
import com.vsoft.uofl_catalogue.db.models.Incident; import com.vsoft.uoflservicenow.db.models.Incident;
import java.util.List; import java.util.List;
......
package com.vsoft.uofl_catalogue.api.listeners.get; package com.vsoft.uoflservicenow.api.listeners.get;
import com.vsoft.uofl_catalogue.db.models.Catalogue; import com.vsoft.uoflservicenow.db.models.MyRequest;
import com.vsoft.uofl_catalogue.db.models.MyRequest;
import java.util.List; import java.util.List;
......
package com.vsoft.uofl_catalogue.api.listeners.get; package com.vsoft.uoflservicenow.api.listeners.get;
import com.vsoft.uofl_catalogue.db.models.Reference; import com.vsoft.uoflservicenow.db.models.Reference;
import java.util.List; import java.util.List;
......
package com.vsoft.uofl_catalogue.api.listeners.get; package com.vsoft.uoflservicenow.api.listeners.get;
import com.vsoft.uofl_catalogue.db.models.MyRequest; import com.vsoft.uoflservicenow.db.models.UserApiValues;
import com.vsoft.uofl_catalogue.db.models.UserApiValues;
import java.util.List; import java.util.List;
......
package com.vsoft.uofl_catalogue.api.listeners.get; package com.vsoft.uoflservicenow.api.listeners.get;
import com.vsoft.uofl_catalogue.db.models.VariableChoice; import com.vsoft.uoflservicenow.db.models.VariableChoice;
import java.util.List; import java.util.List;
......
package com.vsoft.uofl_catalogue.api.managers; package com.vsoft.uoflservicenow.api.managers;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
...@@ -6,13 +6,13 @@ import com.google.gson.JsonDeserializationContext; ...@@ -6,13 +6,13 @@ import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer; import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonParseException; import com.google.gson.JsonParseException;
import com.vsoft.uofl_catalogue.api.RestClient; import com.vsoft.uoflservicenow.api.RestClient;
import com.vsoft.uofl_catalogue.api.interfaces.CatalogueCategoryApi; import com.vsoft.uoflservicenow.api.interfaces.CatalogueCategoryApi;
import com.vsoft.uofl_catalogue.db.models.Catalogue; import com.vsoft.uoflservicenow.db.models.Catalogue;
import com.vsoft.uofl_catalogue.api.listeners.get.GetCatalogueApiListener; import com.vsoft.uoflservicenow.api.listeners.get.GetCatalogueApiListener;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.utils.CatalogueLog; import com.vsoft.uoflservicenow.utils.CatalogueLog;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
......
package com.vsoft.uofl_catalogue.api.managers; package com.vsoft.uoflservicenow.api.managers;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
...@@ -6,13 +6,13 @@ import com.google.gson.JsonDeserializationContext; ...@@ -6,13 +6,13 @@ import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer; import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonParseException; import com.google.gson.JsonParseException;
import com.vsoft.uofl_catalogue.api.RestClient; import com.vsoft.uoflservicenow.api.RestClient;
import com.vsoft.uofl_catalogue.api.interfaces.CatalogueCategoryItemApi; import com.vsoft.uoflservicenow.api.interfaces.CatalogueCategoryItemApi;
import com.vsoft.uofl_catalogue.api.listeners.get.GetCatalogueItemApiListener; import com.vsoft.uoflservicenow.api.listeners.get.GetCatalogueItemApiListener;
import com.vsoft.uofl_catalogue.db.models.CatalogueItem; import com.vsoft.uoflservicenow.db.models.CatalogueItem;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.utils.CatalogueLog; import com.vsoft.uoflservicenow.utils.CatalogueLog;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
...@@ -40,6 +40,7 @@ public class CatalogueItemApiManager { ...@@ -40,6 +40,7 @@ public class CatalogueItemApiManager {
stringBuilder.append(CatalogueItem.Json.URL_PARAM_CATALOGUE_SYSPRM_QUERY_VALUE); stringBuilder.append(CatalogueItem.Json.URL_PARAM_CATALOGUE_SYSPRM_QUERY_VALUE);
stringBuilder.append("="); stringBuilder.append("=");
stringBuilder.append(catalogueSysId); stringBuilder.append(catalogueSysId);
stringBuilder.append("^active=true");
CatalogueLog.d("CatalogueItemApiManager: getCatalogueItems: request parameter: "+stringBuilder.toString()); CatalogueLog.d("CatalogueItemApiManager: getCatalogueItems: request parameter: "+stringBuilder.toString());
final Retrofit retrofit = RestClient.getInitializedRestAdapter(Constants.API_AUTH_PARAM_USER_NAME, Constants.API_AUTH_PARAM_PASSWORD); final Retrofit retrofit = RestClient.getInitializedRestAdapter(Constants.API_AUTH_PARAM_USER_NAME, Constants.API_AUTH_PARAM_PASSWORD);
......
package com.vsoft.uofl_catalogue.api.managers; package com.vsoft.uoflservicenow.api.managers;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
...@@ -6,13 +6,13 @@ import com.google.gson.JsonDeserializationContext; ...@@ -6,13 +6,13 @@ import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer; import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonParseException; import com.google.gson.JsonParseException;
import com.vsoft.uofl_catalogue.api.RestClient; import com.vsoft.uoflservicenow.api.RestClient;
import com.vsoft.uofl_catalogue.api.interfaces.CatalogueVariableApi; import com.vsoft.uoflservicenow.api.interfaces.CatalogueVariableApi;
import com.vsoft.uofl_catalogue.api.listeners.get.GetCatalogueVariableApiListener; import com.vsoft.uoflservicenow.api.listeners.get.GetCatalogueVariableApiListener;
import com.vsoft.uofl_catalogue.db.models.CatalogueVariable; import com.vsoft.uoflservicenow.db.models.CatalogueVariable;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.utils.CatalogueLog; import com.vsoft.uoflservicenow.utils.CatalogueLog;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
......
package com.vsoft.uofl_catalogue.api.managers; package com.vsoft.uoflservicenow.api.managers;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
...@@ -6,13 +6,13 @@ import com.google.gson.JsonDeserializationContext; ...@@ -6,13 +6,13 @@ import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer; import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonParseException; import com.google.gson.JsonParseException;
import com.vsoft.uofl_catalogue.api.RestClient; import com.vsoft.uoflservicenow.api.RestClient;
import com.vsoft.uofl_catalogue.api.interfaces.IncidentApi; import com.vsoft.uoflservicenow.api.interfaces.IncidentApi;
import com.vsoft.uofl_catalogue.api.listeners.get.GetIncidentApiListener; import com.vsoft.uoflservicenow.api.listeners.get.GetIncidentApiListener;
import com.vsoft.uofl_catalogue.db.models.Incident; import com.vsoft.uoflservicenow.db.models.Incident;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.utils.CatalogueLog; import com.vsoft.uoflservicenow.utils.CatalogueLog;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
...@@ -124,4 +124,26 @@ public class IncidentApiManager { ...@@ -124,4 +124,26 @@ public class IncidentApiManager {
return SyncStatus.FAIL; return SyncStatus.FAIL;
} }
} }
public static SyncStatus submitIncidentForm(String incidentJsonString) {
CatalogueLog.d("submitIncidentForm: incidentJson" + incidentJsonString);
final Retrofit retrofit = RestClient.getInitializedRestAdapter(Constants.API_AUTH_PARAM_USER_NAME, Constants.API_AUTH_PARAM_PASSWORD);
Call<ResponseBody> call = retrofit.create(IncidentApi.class).submitIncident(incidentJsonString);
try {
//Retrofit synchronous call
Response<ResponseBody> response = call.execute();
if (response.isSuccessful()) {
return SyncStatus.SUCCESS;
} else {
return SyncStatus.FAIL;
}
} catch (IOException e) {
CatalogueLog.e("IncidentApiManager: submitIncidentForm: IOException: ", e);
return SyncStatus.FAIL;
} catch (NullPointerException e){
CatalogueLog.e("IncidentApiManager: submitIncidentForm: IOException: ", e);
return SyncStatus.FAIL;
}
}
} }
\ No newline at end of file
package com.vsoft.uofl_catalogue.api.managers; package com.vsoft.uoflservicenow.api.managers;
import com.vsoft.uofl_catalogue.api.RestClient; import com.vsoft.uoflservicenow.api.RestClient;
import com.vsoft.uofl_catalogue.api.interfaces.LoginApi; import com.vsoft.uoflservicenow.api.interfaces.LoginApi;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.utils.CatalogueLog; import com.vsoft.uoflservicenow.utils.CatalogueLog;
import java.io.IOException; import java.io.IOException;
......
package com.vsoft.uofl_catalogue.api.managers; package com.vsoft.uoflservicenow.api.managers;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
...@@ -6,13 +6,13 @@ import com.google.gson.JsonDeserializationContext; ...@@ -6,13 +6,13 @@ import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer; import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonParseException; import com.google.gson.JsonParseException;
import com.vsoft.uofl_catalogue.api.RestClient; import com.vsoft.uoflservicenow.api.RestClient;
import com.vsoft.uofl_catalogue.api.interfaces.MyRequestApi; import com.vsoft.uoflservicenow.api.interfaces.MyRequestApi;
import com.vsoft.uofl_catalogue.api.listeners.get.GetMyRequestApiListener; import com.vsoft.uoflservicenow.api.listeners.get.GetMyRequestApiListener;
import com.vsoft.uofl_catalogue.db.models.MyRequest; import com.vsoft.uoflservicenow.db.models.MyRequest;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.utils.CatalogueLog; import com.vsoft.uoflservicenow.utils.CatalogueLog;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
......
package com.vsoft.uofl_catalogue.api.managers; package com.vsoft.uoflservicenow.api.managers;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
...@@ -6,16 +6,12 @@ import com.google.gson.JsonDeserializationContext; ...@@ -6,16 +6,12 @@ import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer; import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonParseException; import com.google.gson.JsonParseException;
import com.vsoft.uofl_catalogue.api.RestClient; import com.vsoft.uoflservicenow.api.RestClient;
import com.vsoft.uofl_catalogue.api.interfaces.MyRequestApi; import com.vsoft.uoflservicenow.api.interfaces.UserApi;
import com.vsoft.uofl_catalogue.api.interfaces.UserApi; import com.vsoft.uoflservicenow.api.listeners.get.GetUserApiListener;
import com.vsoft.uofl_catalogue.api.listeners.get.GetMyRequestApiListener; import com.vsoft.uoflservicenow.db.models.UserApiValues;
import com.vsoft.uofl_catalogue.api.listeners.get.GetUserApiListener; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.db.models.MyRequest; import com.vsoft.uoflservicenow.utils.Constants;
import com.vsoft.uofl_catalogue.db.models.UserApiValues;
import com.vsoft.uofl_catalogue.enums.SyncStatus;
import com.vsoft.uofl_catalogue.utils.CatalogueLog;
import com.vsoft.uofl_catalogue.utils.Constants;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
......
package com.vsoft.uofl_catalogue.api.managers; package com.vsoft.uoflservicenow.api.managers;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
...@@ -6,15 +6,15 @@ import com.google.gson.JsonDeserializationContext; ...@@ -6,15 +6,15 @@ import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer; import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonParseException; import com.google.gson.JsonParseException;
import com.vsoft.uofl_catalogue.api.RestClient; import com.vsoft.uoflservicenow.api.RestClient;
import com.vsoft.uofl_catalogue.api.interfaces.CatalogueVariableApi; import com.vsoft.uoflservicenow.api.interfaces.CatalogueVariableApi;
import com.vsoft.uofl_catalogue.api.listeners.get.GetReferenceApiListener; import com.vsoft.uoflservicenow.api.listeners.get.GetReferenceApiListener;
import com.vsoft.uofl_catalogue.api.listeners.get.GetVariableChoiceApiListener; import com.vsoft.uoflservicenow.api.listeners.get.GetVariableChoiceApiListener;
import com.vsoft.uofl_catalogue.db.models.Reference; import com.vsoft.uoflservicenow.db.models.Reference;
import com.vsoft.uofl_catalogue.db.models.VariableChoice; import com.vsoft.uoflservicenow.db.models.VariableChoice;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.utils.CatalogueLog; import com.vsoft.uoflservicenow.utils.CatalogueLog;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
......
package com.vsoft.uofl_catalogue.db.models; package com.vsoft.uoflservicenow.db.models;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
...@@ -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 +
'}'; '}';
} }
} }
package com.vsoft.uofl_catalogue.db.models; package com.vsoft.uoflservicenow.db.models;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
...@@ -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 +
'}'; '}';
} }
} }
package com.vsoft.uofl_catalogue.db.models; package com.vsoft.uoflservicenow.db.models;
import android.content.Context; import android.content.Context;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uoflservicenow.R;
import com.vsoft.uofl_catalogue.enums.ViewType; import com.vsoft.uoflservicenow.enums.ViewType;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
...@@ -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 +
'}'; '}';
} }
......
package com.vsoft.uofl_catalogue.db.models; package com.vsoft.uoflservicenow.db.models;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import com.vsoft.uofl_catalogue.enums.Impact; import com.vsoft.uoflservicenow.enums.Impact;
import com.vsoft.uofl_catalogue.utils.Util; import com.vsoft.uoflservicenow.utils.Util;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
...@@ -72,56 +72,12 @@ public class Incident { ...@@ -72,56 +72,12 @@ 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";
public static final String SHORT_DESCRIPTION = "short_description";
public static final String CALLER_ID = "caller_id";
public static final String OPENED_ID = "opened_by";
} }
@Override @Override
......
package com.vsoft.uofl_catalogue.db.models; package com.vsoft.uoflservicenow.db.models;
/** /**
* Created by kvemulavada on 8/29/2016. * Created by kvemulavada on 8/29/2016.
......
package com.vsoft.uofl_catalogue.db.models; package com.vsoft.uoflservicenow.db.models;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
...@@ -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;
} }
......
package com.vsoft.uofl_catalogue.db.models; package com.vsoft.uoflservicenow.db.models;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
......
package com.vsoft.uofl_catalogue.db.models; package com.vsoft.uoflservicenow.db.models;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
......
package com.vsoft.uofl_catalogue.db.models; package com.vsoft.uoflservicenow.db.models;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; 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 + '\'' +
......
package com.vsoft.uofl_catalogue.dialog; package com.vsoft.uoflservicenow.dialog;
import android.app.Dialog; import android.app.Dialog;
import android.app.ProgressDialog; import android.app.ProgressDialog;
...@@ -20,15 +20,15 @@ import android.widget.EditText; ...@@ -20,15 +20,15 @@ import android.widget.EditText;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import com.vsoft.uofl_catalogue.CatalogueApplication; import com.vsoft.uoflservicenow.CatalogueApplication;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uoflservicenow.R;
import com.vsoft.uofl_catalogue.api.listeners.get.GetReferenceApiListener; import com.vsoft.uoflservicenow.api.listeners.get.GetReferenceApiListener;
import com.vsoft.uofl_catalogue.api.managers.VariableChoiceApiManager; import com.vsoft.uoflservicenow.api.managers.VariableChoiceApiManager;
import com.vsoft.uofl_catalogue.db.models.Reference; import com.vsoft.uoflservicenow.db.models.Reference;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.listeners.ReferenceListener; import com.vsoft.uoflservicenow.listeners.ReferenceListener;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import com.vsoft.uofl_catalogue.utils.Util; import com.vsoft.uoflservicenow.utils.Util;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -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);
} }
......
package com.vsoft.uoflservicenow.enums;
/**
* @since 1.0
* @author Kunj on 30/8/16.
*
*/
public enum Impact {
UNKNOWN (-1, "unknown", "-1"),
HIGH (1, "High", "1"),
MEDIUM (2, "Medium", "2"),
LOW (3, "Low", "3");
private int id;
private String displayString;
private String serverString;
Impact(int id, String displayString, String serverString) {
this.id = id;
this.displayString = displayString;
this.serverString = serverString;
}
/* getters */
public static int getId(Impact impact) {
return impact.id;
}
public int getId() {
return this.id;
}
public static String getDisplayString(Impact impact) {
return impact.displayString;
}
public String getDisplayString() {
return this.displayString;
}
public String getServerString() {
return serverString;
}
public void setServerString(String serverString) {
this.serverString = serverString;
}
public static Impact from(int id) {
for(int i = 0; i< Impact.values().length; i++) {
Impact impact = Impact.values()[i];
if(impact.id == id)
return Impact.values()[i];
}
return UNKNOWN;
}
public static Impact from(String string) {
for(int i = 0; i< Impact.values().length; i++) {
Impact impact = Impact.values()[i];
if(impact.displayString.equals(string))
return Impact.values()[i];
}
return UNKNOWN;
}
}
package com.vsoft.uofl_catalogue.enums; package com.vsoft.uoflservicenow.enums;
/** /**
* @since 1.0 * @since 1.0
......
package com.vsoft.uofl_catalogue.enums; package com.vsoft.uoflservicenow.enums;
public enum ViewType { public enum ViewType {
UNKNOWN (-1, "unknown"), UNKNOWN (-1, "unknown"),
...@@ -37,16 +37,16 @@ public enum ViewType { ...@@ -37,16 +37,16 @@ public enum ViewType {
} }
/* getters */ /* getters */
public static int getId(ViewType expenseType) { public static int getId(ViewType viewType) {
return expenseType.id; return viewType.id;
} }
public int getId() { public int getId() {
return this.id; return this.id;
} }
public static String getDisplayString(ViewType expenseType) { public static String getDisplayString(ViewType viewType) {
return expenseType.displayString; return viewType.displayString;
} }
public String getDisplayString() { public String getDisplayString() {
...@@ -55,8 +55,8 @@ public enum ViewType { ...@@ -55,8 +55,8 @@ public enum ViewType {
public static ViewType from(int id) { public static ViewType from(int id) {
for(int i = 0; i< ViewType.values().length; i++) { for(int i = 0; i< ViewType.values().length; i++) {
ViewType expenseType = ViewType.values()[i]; ViewType viewType = ViewType.values()[i];
if(expenseType.id == id) if(viewType.id == id)
return ViewType.values()[i]; return ViewType.values()[i];
} }
return UNKNOWN; return UNKNOWN;
...@@ -64,8 +64,8 @@ public enum ViewType { ...@@ -64,8 +64,8 @@ public enum ViewType {
public static ViewType from(String string) { public static ViewType from(String string) {
for(int i = 0; i< ViewType.values().length; i++) { for(int i = 0; i< ViewType.values().length; i++) {
ViewType expenseType = ViewType.values()[i]; ViewType viewType = ViewType.values()[i];
if(expenseType.displayString.equals(string)) if(viewType.displayString.equals(string))
return ViewType.values()[i]; return ViewType.values()[i];
} }
return UNKNOWN; return UNKNOWN;
......
package com.vsoft.uofl_catalogue.listeners; package com.vsoft.uoflservicenow.listeners;
import com.vsoft.uofl_catalogue.db.models.Reference; import com.vsoft.uoflservicenow.db.models.Reference;
/** /**
* Created by Kunj on 10/8/16. * Created by Kunj on 10/8/16.
......
package com.vsoft.uofl_catalogue.ui; package com.vsoft.uoflservicenow.ui;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
...@@ -15,15 +15,17 @@ import android.widget.AdapterView; ...@@ -15,15 +15,17 @@ import android.widget.AdapterView;
import android.widget.ListView; import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import com.vsoft.uofl_catalogue.CatalogueApplication; import com.google.android.gms.analytics.Tracker;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uoflservicenow.CatalogueApplication;
import com.vsoft.uofl_catalogue.adapters.CatalogueCategoryItemAdapter; import com.vsoft.uoflservicenow.R;
import com.vsoft.uofl_catalogue.api.listeners.get.GetCatalogueItemApiListener; import com.vsoft.uoflservicenow.adapters.CatalogueCategoryItemAdapter;
import com.vsoft.uofl_catalogue.api.managers.CatalogueItemApiManager; import com.vsoft.uoflservicenow.api.listeners.get.GetCatalogueItemApiListener;
import com.vsoft.uofl_catalogue.db.models.CatalogueItem; import com.vsoft.uoflservicenow.api.managers.CatalogueItemApiManager;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.db.models.CatalogueItem;
import com.vsoft.uofl_catalogue.utils.CatalogueLog; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.CatalogueLog;
import com.vsoft.uoflservicenow.utils.Constants;
import com.vsoft.uoflservicenow.utils.Util;
import java.util.List; import java.util.List;
...@@ -39,9 +41,8 @@ public class CatalogueItemScreen extends AppCompatActivity { ...@@ -39,9 +41,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 +52,9 @@ public class CatalogueItemScreen extends AppCompatActivity { ...@@ -51,9 +52,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 +65,16 @@ public class CatalogueItemScreen extends AppCompatActivity { ...@@ -64,12 +65,16 @@ 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()) { Tracker tracker = application.getDefaultTracker();
// Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString());
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 +95,13 @@ public class CatalogueItemScreen extends AppCompatActivity { ...@@ -90,15 +95,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
......
package com.vsoft.uofl_catalogue.ui; package com.vsoft.uoflservicenow.ui;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
...@@ -14,15 +14,17 @@ import android.view.View; ...@@ -14,15 +14,17 @@ import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ListView; import android.widget.ListView;
import com.vsoft.uofl_catalogue.CatalogueApplication; import com.google.android.gms.analytics.Tracker;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uoflservicenow.CatalogueApplication;
import com.vsoft.uofl_catalogue.adapters.CatalogueCategoryAdapter; import com.vsoft.uoflservicenow.R;
import com.vsoft.uofl_catalogue.api.listeners.get.GetCatalogueApiListener; import com.vsoft.uoflservicenow.adapters.CatalogueCategoryAdapter;
import com.vsoft.uofl_catalogue.api.managers.CatalogueApiManager; import com.vsoft.uoflservicenow.api.listeners.get.GetCatalogueApiListener;
import com.vsoft.uofl_catalogue.db.models.Catalogue; import com.vsoft.uoflservicenow.api.managers.CatalogueApiManager;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.db.models.Catalogue;
import com.vsoft.uofl_catalogue.utils.CatalogueLog; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.CatalogueLog;
import com.vsoft.uoflservicenow.utils.Constants;
import com.vsoft.uoflservicenow.utils.Util;
import java.util.List; import java.util.List;
...@@ -38,7 +40,6 @@ public class CatalogueScreen extends AppCompatActivity { ...@@ -38,7 +40,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 +49,7 @@ public class CatalogueScreen extends AppCompatActivity { ...@@ -48,7 +49,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 +61,11 @@ public class CatalogueScreen extends AppCompatActivity { ...@@ -60,7 +61,11 @@ public class CatalogueScreen extends AppCompatActivity {
actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowTitleEnabled(true);
} }
if(mApplication.isNetConnected()) { Tracker tracker = application.getDefaultTracker();
// Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString());
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 +86,13 @@ public class CatalogueScreen extends AppCompatActivity { ...@@ -81,15 +86,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
......
package com.vsoft.uofl_catalogue.ui; package com.vsoft.uoflservicenow.ui;
import android.app.DatePickerDialog; import android.app.DatePickerDialog;
import android.app.ProgressDialog; import android.app.ProgressDialog;
...@@ -24,24 +24,25 @@ import android.widget.RelativeLayout; ...@@ -24,24 +24,25 @@ import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.TimePicker; import android.widget.TimePicker;
import com.vsoft.uofl_catalogue.CatalogueApplication; import com.google.android.gms.analytics.Tracker;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uoflservicenow.CatalogueApplication;
import com.vsoft.uofl_catalogue.api.listeners.get.GetCatalogueVariableApiListener; import com.vsoft.uoflservicenow.R;
import com.vsoft.uofl_catalogue.api.listeners.get.GetVariableChoiceApiListener; import com.vsoft.uoflservicenow.api.listeners.get.GetCatalogueVariableApiListener;
import com.vsoft.uofl_catalogue.api.managers.CatalogueVariableApiManager; import com.vsoft.uoflservicenow.api.listeners.get.GetVariableChoiceApiListener;
import com.vsoft.uofl_catalogue.api.managers.VariableChoiceApiManager; import com.vsoft.uoflservicenow.api.managers.CatalogueVariableApiManager;
import com.vsoft.uofl_catalogue.db.models.CatalogueVariable; import com.vsoft.uoflservicenow.api.managers.VariableChoiceApiManager;
import com.vsoft.uofl_catalogue.db.models.Reference; import com.vsoft.uoflservicenow.db.models.CatalogueVariable;
import com.vsoft.uofl_catalogue.db.models.VariableChoice; import com.vsoft.uoflservicenow.db.models.Reference;
import com.vsoft.uofl_catalogue.dialog.SelectReferenceDialog; import com.vsoft.uoflservicenow.db.models.VariableChoice;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.dialog.SelectReferenceDialog;
import com.vsoft.uofl_catalogue.enums.ViewType; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.listeners.ReferenceListener; import com.vsoft.uoflservicenow.enums.ViewType;
import com.vsoft.uofl_catalogue.ui.supportviews.DateAndTimePickerFragment; import com.vsoft.uoflservicenow.listeners.ReferenceListener;
import com.vsoft.uofl_catalogue.utils.CatalogueLog; import com.vsoft.uoflservicenow.ui.supportviews.DateAndTimePickerFragment;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.CatalogueLog;
import com.vsoft.uofl_catalogue.utils.TagObject; import com.vsoft.uoflservicenow.utils.Constants;
import com.vsoft.uofl_catalogue.utils.Util; import com.vsoft.uoflservicenow.utils.TagObject;
import com.vsoft.uoflservicenow.utils.Util;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
...@@ -102,6 +103,10 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -102,6 +103,10 @@ public class CatalogueVariableScreen extends AppCompatActivity {
actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowTitleEnabled(true);
} }
Tracker tracker = mApplication.getDefaultTracker();
// Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString());
if(mApplication.isNetConnected()) { if(mApplication.isNetConnected()) {
new FetchCatalogueVariable().execute(); new FetchCatalogueVariable().execute();
} else { } else {
...@@ -462,8 +467,7 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -462,8 +467,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.uoflservicenow.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.content.res.TypedArray;
import android.os.Bundle; import android.os.Bundle;
import android.widget.GridView; import android.widget.GridView;
import com.vsoft.uofl_catalogue.R; import com.google.android.gms.analytics.Tracker;
import com.vsoft.uofl_catalogue.adapters.HomeScreenAdapter; import com.vsoft.uoflservicenow.CatalogueApplication;
import com.vsoft.uofl_catalogue.utils.PrefManager; import com.vsoft.uoflservicenow.R;
import com.vsoft.uoflservicenow.adapters.HomeScreenAdapter;
import com.vsoft.uoflservicenow.utils.Util;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
...@@ -19,21 +20,26 @@ import butterknife.OnItemClick; ...@@ -19,21 +20,26 @@ 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)));
CatalogueApplication application = (CatalogueApplication) getApplication();
Tracker tracker = application.getDefaultTracker();
// Send initial screen view hit.
Util.sendScreenName(tracker, getString(R.string.home_screen_string));
String[] gridValuesArray = getResources().getStringArray(R.array.home_screen_array);
TypedArray gridViewIcons = getResources().obtainTypedArray(R.array.home_screen_icon_array);
HomeScreenAdapter adapter = new HomeScreenAdapter(this, gridValuesArray, gridViewIcons);
mGridView.setAdapter(adapter);
} }
@OnItemClick(R.id.home_screen_grid_view) @OnItemClick(R.id.home_screen_grid_view)
......
package com.vsoft.uofl_catalogue.ui; package com.vsoft.uoflservicenow.ui;
import android.app.Activity; import android.app.Activity;
import android.app.ProgressDialog; import android.app.ProgressDialog;
...@@ -12,16 +12,16 @@ import android.widget.EditText; ...@@ -12,16 +12,16 @@ import android.widget.EditText;
import android.widget.ScrollView; import android.widget.ScrollView;
import android.widget.Toast; import android.widget.Toast;
import com.vsoft.uofl_catalogue.R; import com.google.android.gms.analytics.Tracker;
import com.vsoft.uofl_catalogue.api.listeners.get.GetMyRequestApiListener; import com.vsoft.uoflservicenow.CatalogueApplication;
import com.vsoft.uofl_catalogue.api.listeners.get.GetUserApiListener; import com.vsoft.uoflservicenow.R;
import com.vsoft.uofl_catalogue.api.managers.LoginApiManger; import com.vsoft.uoflservicenow.api.listeners.get.GetUserApiListener;
import com.vsoft.uofl_catalogue.api.managers.MyRequestApiManager; import com.vsoft.uoflservicenow.api.managers.LoginApiManger;
import com.vsoft.uofl_catalogue.api.managers.UserApiManager; import com.vsoft.uoflservicenow.api.managers.UserApiManager;
import com.vsoft.uofl_catalogue.db.models.MyRequest; import com.vsoft.uoflservicenow.db.models.UserApiValues;
import com.vsoft.uofl_catalogue.db.models.UserApiValues; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.utils.PrefManager;
import com.vsoft.uofl_catalogue.utils.PrefManager; import com.vsoft.uoflservicenow.utils.Util;
import net.yslibrary.android.keyboardvisibilityevent.KeyboardVisibilityEvent; import net.yslibrary.android.keyboardvisibilityevent.KeyboardVisibilityEvent;
import net.yslibrary.android.keyboardvisibilityevent.KeyboardVisibilityEventListener; import net.yslibrary.android.keyboardvisibilityevent.KeyboardVisibilityEventListener;
...@@ -55,6 +55,7 @@ public class LoginScreen extends Activity { ...@@ -55,6 +55,7 @@ public class LoginScreen extends Activity {
setContentView(R.layout.activity_login); setContentView(R.layout.activity_login);
prefManager = PrefManager.getInstance(); prefManager = PrefManager.getInstance();
prefManager.init(LoginScreen.this); prefManager.init(LoginScreen.this);
ButterKnife.bind(this);
CheckLoginValues(); CheckLoginValues();
KeyboardVisibilityEvent.setEventListener(LoginScreen.this, new KeyboardVisibilityEventListener() { KeyboardVisibilityEvent.setEventListener(LoginScreen.this, new KeyboardVisibilityEventListener() {
...@@ -71,7 +72,10 @@ public class LoginScreen extends Activity { ...@@ -71,7 +72,10 @@ public class LoginScreen extends Activity {
} }
}); });
ButterKnife.bind(this); CatalogueApplication application = (CatalogueApplication) getApplication();
Tracker tracker = application.getDefaultTracker();
// Send initial screen view hit.
Util.sendScreenName(tracker, getString(R.string.login_screen_string));
} }
private void CheckLoginValues() { private void CheckLoginValues() {
...@@ -127,9 +131,7 @@ public class LoginScreen extends Activity { ...@@ -127,9 +131,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
...@@ -140,7 +142,6 @@ public class LoginScreen extends Activity { ...@@ -140,7 +142,6 @@ public class LoginScreen extends Activity {
} }
if (syncStatus == SyncStatus.SUCCESS) { if (syncStatus == SyncStatus.SUCCESS) {
new UserApiDetails().execute(userName); new UserApiDetails().execute(userName);
//startActivity(new Intent(LoginScreen.this, HomeScreen.class));
} else { } else {
Toast.makeText(LoginScreen.this, "Invalid username and password", Toast.LENGTH_SHORT).show(); Toast.makeText(LoginScreen.this, "Invalid username and password", Toast.LENGTH_SHORT).show();
} }
...@@ -161,14 +162,12 @@ public class LoginScreen extends Activity { ...@@ -161,14 +162,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
......
package com.vsoft.uofl_catalogue.ui; package com.vsoft.uoflservicenow.ui;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
...@@ -11,14 +11,16 @@ import android.support.v7.widget.Toolbar; ...@@ -11,14 +11,16 @@ import android.support.v7.widget.Toolbar;
import android.view.MenuItem; import android.view.MenuItem;
import android.widget.ListView; import android.widget.ListView;
import com.vsoft.uofl_catalogue.CatalogueApplication; import com.google.android.gms.analytics.Tracker;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uoflservicenow.CatalogueApplication;
import com.vsoft.uofl_catalogue.adapters.MyIncidentsAdapter; import com.vsoft.uoflservicenow.R;
import com.vsoft.uofl_catalogue.api.listeners.get.GetIncidentApiListener; import com.vsoft.uoflservicenow.adapters.MyIncidentsAdapter;
import com.vsoft.uofl_catalogue.api.managers.IncidentApiManager; import com.vsoft.uoflservicenow.api.listeners.get.GetIncidentApiListener;
import com.vsoft.uofl_catalogue.db.models.Incident; import com.vsoft.uoflservicenow.api.managers.IncidentApiManager;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.db.models.Incident;
import com.vsoft.uofl_catalogue.utils.CatalogueLog; import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uoflservicenow.utils.CatalogueLog;
import com.vsoft.uoflservicenow.utils.Util;
import java.util.List; import java.util.List;
...@@ -34,7 +36,6 @@ public class MyIncidentScreen extends AppCompatActivity { ...@@ -34,7 +36,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 +46,7 @@ public class MyIncidentScreen extends AppCompatActivity { ...@@ -45,7 +46,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 +58,11 @@ public class MyIncidentScreen extends AppCompatActivity { ...@@ -57,7 +58,11 @@ public class MyIncidentScreen extends AppCompatActivity {
actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowTitleEnabled(true);
} }
if(mApplication.isNetConnected()) { Tracker tracker = application.getDefaultTracker();
// Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString());
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 +108,13 @@ public class MyIncidentScreen extends AppCompatActivity { ...@@ -103,15 +108,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
......
package com.vsoft.uofl_catalogue.ui; package com.vsoft.uoflservicenow.ui;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
...@@ -10,13 +10,17 @@ import android.support.v7.app.AppCompatActivity; ...@@ -10,13 +10,17 @@ 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.widget.ListView; import android.widget.ListView;
import com.vsoft.uofl_catalogue.CatalogueApplication;
import com.vsoft.uofl_catalogue.R; import com.google.android.gms.analytics.Tracker;
import com.vsoft.uofl_catalogue.adapters.MyRequestAdapter; import com.vsoft.uoflservicenow.CatalogueApplication;
import com.vsoft.uofl_catalogue.api.listeners.get.GetMyRequestApiListener; import com.vsoft.uoflservicenow.R;
import com.vsoft.uofl_catalogue.api.managers.MyRequestApiManager; import com.vsoft.uoflservicenow.adapters.MyRequestAdapter;
import com.vsoft.uofl_catalogue.db.models.MyRequest; import com.vsoft.uoflservicenow.api.listeners.get.GetMyRequestApiListener;
import com.vsoft.uofl_catalogue.enums.SyncStatus; import com.vsoft.uoflservicenow.api.managers.MyRequestApiManager;
import com.vsoft.uoflservicenow.db.models.MyRequest;
import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uoflservicenow.utils.Util;
import java.util.List; import java.util.List;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
...@@ -31,8 +35,7 @@ public class MyRequestActivity extends AppCompatActivity { ...@@ -31,8 +35,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 +45,7 @@ public class MyRequestActivity extends AppCompatActivity { ...@@ -42,7 +45,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 +58,11 @@ public class MyRequestActivity extends AppCompatActivity { ...@@ -55,7 +58,11 @@ public class MyRequestActivity extends AppCompatActivity {
actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowTitleEnabled(true);
} }
if(mApplication.isNetConnected()) { Tracker tracker = application.getDefaultTracker();
// Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString());
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 +83,12 @@ public class MyRequestActivity extends AppCompatActivity { ...@@ -76,14 +83,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 +98,8 @@ public class MyRequestActivity extends AppCompatActivity { ...@@ -93,8 +98,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);
} }
......
package com.vsoft.uoflservicenow.ui;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import com.google.android.gms.analytics.Tracker;
import com.vsoft.uoflservicenow.CatalogueApplication;
import com.vsoft.uoflservicenow.R;
import com.vsoft.uoflservicenow.api.managers.IncidentApiManager;
import com.vsoft.uoflservicenow.db.models.Incident;
import com.vsoft.uoflservicenow.enums.Impact;
import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uoflservicenow.utils.PrefManager;
import com.vsoft.uoflservicenow.utils.Util;
import org.json.JSONException;
import org.json.JSONObject;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* Created by kunj on 30/8/16.
*/
public class ReportIncidentScreen extends AppCompatActivity {
@BindView(R.id.tool_bar_view) Toolbar mToolbar;
@BindView(R.id.incident_impact_spinner) Spinner mImpactSpinner;
@BindView(R.id.incident_short_description_edit_text) EditText mShortDesEditText;
@BindView(R.id.incident_impact_error_tv) TextView mImpactErrorTextView;
@BindView(R.id.incident_short_des_error_tv) TextView mShortDesErrorTextView;
private CatalogueApplication mApplication;
private Impact mImpact;
private String mShortDescription;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.incidents_form_screen);
ButterKnife.bind(this);
mApplication = (CatalogueApplication) getApplication();
setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar();
if(actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setElevation(0);
actionBar.setTitle(R.string.incident_form_report_incident_text_string);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(true);
}
Tracker tracker = mApplication.getDefaultTracker();
// Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString());
// Creating adapter for spinner
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, getResources().getStringArray(R.array.incident_impact_array));
// Drop down layout style - list view with radio button
dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// attaching data adapter to spinner
mImpactSpinner.setAdapter(dataAdapter);
}
@OnClick(R.id.incident_submit_text_view)
void submitOnClicked(View view) {
if(mApplication.isNetConnected()) {
if (!hasValidateForm()) {
SharedPreferences sharedPreferences = getSharedPreferences(PrefManager.PREFERENCES_USER_VALUES_KEY, Context.MODE_PRIVATE);
String userSysId = sharedPreferences.getString(PrefManager.PREFERENCE_SYS_ID, "");
if(!userSysId.isEmpty()) {
Util.hideSoftKeyboard(ReportIncidentScreen.this, view);
new submitIncident().execute(userSysId);
} else {
showErrorDialog(R.string.failed_to_submit_form_string);
}
}
} else {
showErrorDialog(R.string.internet_validation_string);
}
}
class submitIncident extends AsyncTask<String, Void, SyncStatus> {
private ProgressDialog progressDialog;
@Override
protected void onPreExecute() {
super.onPreExecute();
progressDialog = new ProgressDialog(ReportIncidentScreen.this);
progressDialog.setMessage(getString(R.string.loading_string));
progressDialog.show();
progressDialog.setCancelable(false);
}
@Override
protected SyncStatus doInBackground(String... params) {
String userSysId = params[0];
JSONObject incidentJsonObject = new JSONObject();
try {
incidentJsonObject.put(Incident.Json.IMPACT, mImpact.getServerString());
incidentJsonObject.put(Incident.Json.SHORT_DESCRIPTION, mShortDescription);
incidentJsonObject.put(Incident.Json.OPENED_AT, userSysId);
incidentJsonObject.put(Incident.Json.CALLER_ID, userSysId);
} catch (JSONException e) {
e.printStackTrace();
}
return IncidentApiManager.submitIncidentForm(incidentJsonObject.toString());
}
@Override
protected void onPostExecute(SyncStatus syncStatus) {
super.onPostExecute(syncStatus);
if(progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
}
if(syncStatus == SyncStatus.SUCCESS) {
finish();
} else {
showErrorDialog(R.string.failed_to_submit_form_string);
}
}
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
if (menuItem.getItemId() == android.R.id.home) {
finish();
}
return super.onOptionsItemSelected(menuItem);
}
private boolean hasValidateForm() {
boolean hasError = false;
/*Get all edit text values in member variables*/
getAllFromValues();
if (mImpact != Impact.UNKNOWN) {
mImpactErrorTextView.setVisibility(View.GONE);
} else {
hasError = true;
mImpactErrorTextView.setVisibility(View.VISIBLE);
}
if (!TextUtils.isEmpty(mShortDescription)) {
mShortDesErrorTextView.setVisibility(View.GONE);
} else {
hasError = true;
mShortDesErrorTextView.setVisibility(View.VISIBLE);
}
return hasError;
}
private void getAllFromValues() {
/*Form values*/
mImpact = Impact.from((String) mImpactSpinner.getSelectedItem());
mShortDescription = mShortDesEditText.getText().toString();
}
private void showErrorDialog(int message) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(message)
.setCancelable(false)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
AlertDialog alert = builder.create();
alert.show();
}
}
package com.vsoft.uofl_catalogue.ui.supportviews; package com.vsoft.uoflservicenow.ui.supportviews;
import android.app.DatePickerDialog; import android.app.DatePickerDialog;
import android.app.TimePickerDialog; import android.app.TimePickerDialog;
...@@ -11,8 +11,8 @@ import android.widget.DatePicker; ...@@ -11,8 +11,8 @@ import android.widget.DatePicker;
import android.widget.TextView; import android.widget.TextView;
import android.widget.TimePicker; import android.widget.TimePicker;
import com.vsoft.uofl_catalogue.R; import com.vsoft.uoflservicenow.R;
import com.vsoft.uofl_catalogue.utils.Constants; import com.vsoft.uoflservicenow.utils.Constants;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
......
package com.vsoft.uofl_catalogue.utils; package com.vsoft.uoflservicenow.utils;
/** /**
* @since 1.0 * @since 1.0
......
package com.vsoft.uofl_catalogue.utils; package com.vsoft.uoflservicenow.utils;
import android.util.Log; import android.util.Log;
......
package com.vsoft.uofl_catalogue.utils; package com.vsoft.uoflservicenow.utils;
import com.vsoft.uofl_catalogue.BuildConfig; import com.vsoft.uoflservicenow.BuildConfig;
/** /**
* @author Kunj on 11/8/16. * @author Kunj on 11/8/16.
...@@ -126,4 +126,5 @@ public class Constants { ...@@ -126,4 +126,5 @@ public class Constants {
public static final String URL_GET_USERDETAILS = API_PATH + "sys_user"; public static final String URL_GET_USERDETAILS = API_PATH + "sys_user";
/*Incident API */ /*Incident API */
public static final String URL_GET_INCIDENTS = API_PATH + "incident"; public static final String URL_GET_INCIDENTS = API_PATH + "incident";
public static final String URL_POST_INCIDENT = API_PATH + "incident";
} }
package com.vsoft.uofl_catalogue.utils; package com.vsoft.uoflservicenow.utils;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
...@@ -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();
} }
......
package com.vsoft.uofl_catalogue.utils; package com.vsoft.uoflservicenow.utils;
/** /**
* Created by Kunj on 18/8/16. * Created by Kunj on 18/8/16.
......
package com.vsoft.uofl_catalogue.utils; package com.vsoft.uoflservicenow.utils;
import android.content.Context; import android.content.Context;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
...@@ -18,11 +18,13 @@ import android.widget.RadioGroup; ...@@ -18,11 +18,13 @@ import android.widget.RadioGroup;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
import com.vsoft.uofl_catalogue.R; import com.google.android.gms.analytics.HitBuilders;
import com.vsoft.uofl_catalogue.db.models.CatalogueVariable; import com.google.android.gms.analytics.Tracker;
import com.vsoft.uofl_catalogue.db.models.Reference; import com.vsoft.uoflservicenow.R;
import com.vsoft.uofl_catalogue.db.models.VariableChoice; import com.vsoft.uoflservicenow.db.models.CatalogueVariable;
import com.vsoft.uofl_catalogue.enums.ViewType; import com.vsoft.uoflservicenow.db.models.Reference;
import com.vsoft.uoflservicenow.db.models.VariableChoice;
import com.vsoft.uoflservicenow.enums.ViewType;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -225,16 +227,14 @@ public class Util { ...@@ -225,16 +227,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) {
...@@ -285,6 +285,12 @@ public class Util { ...@@ -285,6 +285,12 @@ public class Util {
return dateFormat.format(date.getTime()); return dateFormat.format(date.getTime());
} }
/*Record a screen view hit for the visible*/
public static void sendScreenName(Tracker tracker, String name) {
tracker.setScreenName(name);
tracker.send(new HitBuilders.ScreenViewBuilder().build());
}
public static void hideSoftKeyboard(Context context, View view) { public static void hideSoftKeyboard(Context context, View view) {
InputMethodManager imm =(InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); InputMethodManager imm =(InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0); imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ScrollView <ScrollView
android:id="@+id/login_scroll" android:id="@+id/login_scroll"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -14,51 +15,54 @@ ...@@ -14,51 +15,54 @@
android:scrollbarStyle="insideOverlay" android:scrollbarStyle="insideOverlay"
android:animateLayoutChanges="true" android:animateLayoutChanges="true"
> >
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
> >
<ImageView <ImageView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/ic_login_banner" android:background="@drawable/ic_login_banner"
/> />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/login_layout_bg" android:background="@drawable/ic_login_layout_bg"
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:background="@drawable/username_under_bg_box"
android:hint="@string/login_screen_user_name_string" android:hint="Username"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:padding="10dp" android:padding="10dp"
android:text=""
android:drawableLeft="@mipmap/ic_user_icon" android:drawableLeft="@mipmap/ic_user_icon"
android:singleLine="true"
android:textCursorDrawable="@null"/> android:singleLine="true" />
<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:background="@drawable/username_under_bg_box" android:background="@drawable/username_under_bg_box"
android:hint="@string/login_screen_password_string" android:hint="Password"
android:text=""
android:drawableLeft="@mipmap/ic_password_icon" android:drawableLeft="@mipmap/ic_password_icon"
android:inputType="textPassword" android:inputType="textPassword"
android:padding="10dp" android:padding="10dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:textCursorDrawable="@null" android:singleLine="true" />
android:singleLine="true"
/>
<TextView <TextView
...@@ -68,14 +72,11 @@ ...@@ -68,14 +72,11 @@
android:layout_gravity="left" android:layout_gravity="left"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:paddingBottom="@dimen/normal_margin" android:padding="10dp"
android:paddingTop="@dimen/normal_margin"
android:background="@drawable/login_bg" android:background="@drawable/login_bg"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:text="Sign in" android:text="@string/login_screen_login_string"
android:textColor="@android:color/white"
android:textSize="@dimen/extra_normal_text_size"
android:textAlignment="center" android:textAlignment="center"
/> />
......
...@@ -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/homescreen_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
...@@ -63,6 +60,15 @@ ...@@ -63,6 +60,15 @@
android:paddingBottom="@dimen/small_margin"/> android:paddingBottom="@dimen/small_margin"/>
<TextView <TextView
android:id="@+id/incident_impact_error_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/error_string"
android:visibility="gone"
android:layout_marginLeft="@dimen/normal_margin"
android:textColor="@color/error_color"/>
<TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/normal_margin" android:layout_margin="@dimen/normal_margin"
...@@ -71,7 +77,7 @@ ...@@ -71,7 +77,7 @@
android:textStyle="bold" /> android:textStyle="bold" />
<EditText <EditText
android:id="@+id/incident_describe_issue_edit_text" android:id="@+id/incident_short_description_edit_text"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/normal_margin" android:layout_marginBottom="@dimen/normal_margin"
...@@ -83,6 +89,15 @@ ...@@ -83,6 +89,15 @@
android:lines="4" /> android:lines="4" />
<TextView <TextView
android:id="@+id/incident_short_des_error_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/error_string"
android:visibility="gone"
android:layout_marginLeft="@dimen/normal_margin"
android:textColor="@color/error_color"/>
<TextView
android:id="@+id/incident_submit_text_view" android:id="@+id/incident_submit_text_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
<?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="@drawable/ic_login_background">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/login_screen_layout_margin_bottom"
android:layout_marginLeft="@dimen/login_screen_layout_margin_left"
android:layout_marginRight="@dimen/login_screen_layout_margin_right"
android:layout_marginTop="@dimen/login_screen_layout_margin_top"
android:orientation="vertical">
<EditText
android:id="@+id/login_screen_username_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/login_screen_margin_left"
android:layout_marginRight="@dimen/login_screen_margin_right"
android:background="@drawable/username_under_bg_box"
android:drawableLeft="@mipmap/ic_user_icon"
android:hint="@string/login_screen_user_name_string"
android:lines="1"
android:singleLine="true"
android:text="a0kuma18"
android:textCursorDrawable="@null" />
<EditText
android:id="@+id/login_screen_password_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/login_screen_margin_left"
android:layout_marginRight="@dimen/login_screen_margin_right"
android:background="@drawable/username_under_bg_box"
android:drawableLeft="@mipmap/ic_password_icon"
android:hint="@string/login_screen_password_string"
android:inputType="textPassword"
android:lines="1"
android:singleLine="true"
android:text="v$0ftA$win"
android:textCursorDrawable="@null" />
<TextView
android:id="@+id/login_screen_login_text_view"
android:layout_width="match_parent"
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:background="@drawable/login_bg"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="@dimen/extra_normal_text_size" />
</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/number"
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:id="@+id/number"
android:textSize="@dimen/ruquest_descps_text_size"
android:textStyle="bold"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="@dimen/my_request_left"
android:layout_marginTop="@dimen/my_request_top" android:layout_marginTop="@dimen/my_request_top"
android:layout_marginLeft="@dimen/my_request_left"/> android:text="Large Text"
android:textSize="@dimen/ruquest_descps_text_size"
android:textStyle="bold" />
<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:layout_alignBaseline="@+id/number"
android:layout_alignParentRight="true"
android:layout_below="@+id/number"
android:layout_marginRight="@dimen/my_request_top"
android:layout_marginTop="@dimen/my_request_top"
android:text="Large Text" android:text="Large Text"
android:id="@+id/dueDate"
android:textColor="#8e8e8e" android:textColor="#8e8e8e"
android:textSize="@dimen/ruquest_descps_text_size" android:textSize="@dimen/ruquest_descps_text_size"
android:visibility="gone" android:visibility="gone" />
android:layout_marginTop="@dimen/my_request_top"
android:layout_below="@+id/number"
android:layout_marginRight="@dimen/my_request_top"
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:layout_alignLeft="@+id/number"
android:layout_alignStart="@+id/number"
android:layout_below="@+id/number"
android:layout_marginTop="@dimen/my_request_top"
android:text="Large Text" android:text="Large Text"
android:id="@+id/shotrDescription"
android:textSize="@dimen/ruquest_descps_text_size"
android:textColor="#000000" android:textColor="#000000"
android:textStyle="bold" android:textSize="@dimen/ruquest_descps_text_size"
android:layout_marginTop="@dimen/my_request_top" android:textStyle="bold" />
android:layout_below="@+id/number"
android:layout_alignLeft="@+id/number"
android:layout_alignStart="@+id/number" />
<ImageView <ImageView
android:id="@+id/approval_image"
android:layout_width="@dimen/my_request_top" android:layout_width="@dimen/my_request_top"
android:layout_height="@dimen/my_request_top" android:layout_height="@dimen/my_request_top"
android:id="@+id/approval_image"
android:background="@drawable/circle"
android:layout_alignTop="@+id/approval"
android:layout_marginTop="@dimen/my_request_text_bottom"
android:layout_alignLeft="@+id/shotrDescription" android:layout_alignLeft="@+id/shotrDescription"
android:layout_alignStart="@+id/shotrDescription" android:layout_alignStart="@+id/shotrDescription"
android:layout_marginBottom="@dimen/my_request_top"/> android:layout_alignTop="@+id/approval"
android:layout_marginBottom="@dimen/my_request_top"
android:layout_marginTop="@dimen/my_request_text_bottom"
android:background="@drawable/circle" />
<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:textSize="@dimen/ruquest_status_text_size"
android:textColor="#8e8e8e"
android:layout_marginLeft="@dimen/my_request_right" android:layout_marginLeft="@dimen/my_request_right"
android:layout_marginTop="@dimen/my_request_new_top" android:layout_marginTop="@dimen/my_request_new_top"
android:layout_toRightOf="@+id/approval_image" android:layout_toRightOf="@+id/approval_image"
android:layout_below="@+id/shotrDescription"/> android:text="Large Text"
android:textColor="#8e8e8e"
android:textSize="@dimen/ruquest_status_text_size" />
</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>
......
...@@ -4,21 +4,24 @@ ...@@ -4,21 +4,24 @@
<dimen name="large_text_size">18sp</dimen> <dimen name="large_text_size">18sp</dimen>
<!--Text size-->
<dimen name="small_text_size">12sp</dimen>
<dimen name="normal_text_size">16sp</dimen>
<dimen name="extra_normal_text_size">20sp</dimen>
<dimen name="homescreen_text_size">18sp</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>
...@@ -44,10 +47,7 @@ ...@@ -44,10 +47,7 @@
<dimen name="elevation_margin">4dp</dimen> <dimen name="elevation_margin">4dp</dimen>
<!--Text size--> <!--Text size-->
<dimen name="small_text_size">12sp</dimen>
<dimen name="below_normal_text_size">14sp</dimen> <dimen name="below_normal_text_size">14sp</dimen>
<dimen name="normal_text_size">16sp</dimen>
<dimen name="extra_normal_text_size">18sp</dimen>
<dimen name="ruquest_status_text_size">15sp</dimen> <dimen name="ruquest_status_text_size">15sp</dimen>
<dimen name="ruquest_descps_text_size">18sp</dimen> <dimen name="ruquest_descps_text_size">18sp</dimen>
...@@ -85,4 +85,10 @@ ...@@ -85,4 +85,10 @@
<dimen name="expense_details_refresh_button_width">40dp</dimen> <dimen name="expense_details_refresh_button_width">40dp</dimen>
<dimen name="expense_details_refresh_button_height">40dp</dimen> <dimen name="expense_details_refresh_button_height">40dp</dimen>
=======
<!--My Request screen-->
<dimen name="my_request_approval_image_height">15dp</dimen>
<dimen name="my_request_approval_image_width">15dp</dimen>
>>>>>>> 32b7d4f976a19b786b41f856760d0e25b09812f8
</resources> </resources>
\ No newline at end of file
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
<string name="none_string">-None-</string> <string name="none_string">-None-</string>
<string name="search_for_reference_string">Reference</string> <string name="search_for_reference_string">Reference</string>
<string name="internet_validation_string">Please connect to internet and try again.</string> <string name="internet_validation_string">Please connect to internet and try again.</string>
<string name="home_screen_string">Home 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>
...@@ -33,7 +35,6 @@ ...@@ -33,7 +35,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>
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Replace placeholder ID with your tracking ID -->
<string name="ga_trackingId">UA-83545030-1</string>
<!-- Enable automatic activity tracking -->
<bool name="ga_autoActivityTracking">true</bool>
<!-- Enable automatic exception tracking -->
<bool name="ga_reportUncaughtExceptions">true</bool>
</resources>
\ No newline at end of file
...@@ -7,6 +7,7 @@ buildscript { ...@@ -7,6 +7,7 @@ buildscript {
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.1.3' classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
......
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