Commit 7fe592f1 by Kunj Gupta

UOFLMA-72: Code review.

parent 10d3f43a
......@@ -22,7 +22,8 @@ import java.util.List;
public class MyRequestAdapter extends BaseAdapter {
private final List<MyRequest> mReqList = new ArrayList<>(0);
private LayoutInflater mInflater;
Context mContext;
private Context mContext;
public MyRequestAdapter(Context context) {
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mContext=context;
......
......@@ -11,6 +11,7 @@ import com.vsoft.uoflservicenow.api.interfaces.UserApi;
import com.vsoft.uoflservicenow.api.listeners.get.GetUserApiListener;
import com.vsoft.uoflservicenow.db.models.UserApiValues;
import com.vsoft.uoflservicenow.enums.SyncStatus;
import com.vsoft.uoflservicenow.utils.CatalogueLog;
import com.vsoft.uoflservicenow.utils.Constants;
import org.json.JSONArray;
......@@ -54,6 +55,7 @@ public class UserApiManager {
try {
value = json.getAsLong();
} catch (NumberFormatException e) {
CatalogueLog.d("UserApiManager: getUserDetailResponse: deserialize: long.class: NumberFormatException: ");
}
return value;
}
......@@ -65,6 +67,7 @@ public class UserApiManager {
try {
value = json.getAsInt();
} catch (NumberFormatException e) {
CatalogueLog.d("UserApiManager: getUserDetailResponse: deserialize: int.class: NumberFormatException: ");
}
return value;
}
......@@ -76,6 +79,7 @@ public class UserApiManager {
try {
value = json.getAsFloat();
} catch (NumberFormatException e) {
CatalogueLog.d("UserApiManager: getUserDetailResponse: deserialize: float.class: NumberFormatException: ");
}
return value;
}
......
......@@ -519,7 +519,7 @@ public class CatalogueVariableScreen extends AppCompatActivity {
alert.show();
}
public String getMonth(int month) {
private String getMonth(int month) {
return Constants.month[month];
}
......
......@@ -3,7 +3,6 @@ package com.vsoft.uoflservicenow.ui;
import android.content.Intent;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.GridView;
......@@ -34,14 +33,6 @@ public class HomeScreen extends AppCompatActivity {
ButterKnife.bind(this);
CatalogueApplication application = (CatalogueApplication) getApplication();
setSupportActionBar(mToolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setElevation(0);
actionBar.setTitle("");
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(true);
}
Tracker tracker = application.getDefaultTracker();
// Send initial screen view hit.
......
......@@ -128,7 +128,7 @@ public class LoginScreen extends Activity {
@Override
protected SyncStatus doInBackground(String... params) {
SyncStatus syncStatus = null;
SyncStatus syncStatus;
userName = params[0];//"a0kuma18";
String password = params[1];//"v$0ftA$win";
syncStatus = LoginApiManger.submitLoginValues(Constants.GRANT_TYPE, Constants.CLIENT_ID, Constants
......
......@@ -32,10 +32,8 @@ import butterknife.ButterKnife;
*/
public class MyRequestActivity extends AppCompatActivity {
@BindView(R.id.tool_bar_view)
Toolbar mToolbar;
@BindView(R.id.request_screen_list_view)
ListView mListView;
@BindView(R.id.tool_bar_view) Toolbar mToolbar;
@BindView(R.id.request_screen_list_view) ListView mListView;
private List<MyRequest> mMyRequestList;
......
......@@ -21,12 +21,12 @@ import butterknife.Unbinder;
public class DateAndTimePickerFragment extends DialogFragment {
private DatePickerDialog.OnDateSetListener mOnDateSetListener;
private TimePickerDialog.OnTimeSetListener mOnTimeSetListener;
@BindView(R.id.date_picker) DatePicker mDatePicker;
@BindView(R.id.time_picker) TimePicker mTimePicker;
@BindView(R.id.date_and_time_title_text_view) TextView mTitle;
private DatePickerDialog.OnDateSetListener mOnDateSetListener;
private TimePickerDialog.OnTimeSetListener mOnTimeSetListener;
private Unbinder unbinder;
public DateAndTimePickerFragment(){
......
......@@ -52,8 +52,8 @@ public class Constants {
private static final String API_PATH_PRODUCTION = "/api/now/table/";
private static final String API_PATH_TEST = "/api/now/table/";
public static final int BUILD_TYPE_DEBUG = 1;
public static final int BUILD_TYPE_RELEASE = 2;
private static final int BUILD_TYPE_DEBUG = 1;
private static final int BUILD_TYPE_RELEASE = 2;
private static final String API_PATH = (BUILD_TYPE_RELEASE == BuildConfig.BUILD_TYPE_INT
? API_PATH_PRODUCTION
......
......@@ -12,7 +12,7 @@ public class PrefManager {
private static volatile PrefManager pSelf = null;
String TAG = PrefManager.class.getSimpleName();
public SharedPreferences sharedPref = null;
private SharedPreferences sharedPref = null;
private SharedPreferences.Editor editor = null;
//Login Preferences
......@@ -21,8 +21,6 @@ public class PrefManager {
public static final String PREFERENCE_LAST_NAME = "lastName";
public static final String PREFERENCE_SYS_ID = "sysId";
public static PrefManager getInstance(){
if(pSelf == null){
synchronized(PrefManager.class){
......
......@@ -71,7 +71,7 @@ public class Util {
rg.setOrientation(RadioGroup.HORIZONTAL);//or RadioGroup.VERTICAL
for(int i = 0; i < 5; i++){
radioButtons[i] = new RadioButton(context);
radioButtons[i].setText("" +(i+1));
radioButtons[i].setText(String.format(context.getString(R.string.variable_form_radio_text_string), (i+1)));
rg.addView(radioButtons[i]);
}
linearLayout.addView(rg);
......@@ -190,8 +190,10 @@ public class Util {
RadioGroup radioGroup = (RadioGroup) linearLayout.getChildAt(i);
int radioButtonID = radioGroup.getCheckedRadioButtonId();
RadioButton radioButton = (RadioButton)radioGroup.findViewById(radioButtonID);
if(radioButton != null) {
return radioButton.getText().toString();
}
}
case CHECK_BOX:
CheckBox checkBox = (CheckBox) view;
return checkBox.isChecked() ? "1" : "0";
......
......@@ -30,10 +30,10 @@
android:layout_marginRight="@dimen/extra_large_margin"
android:background="@drawable/username_under_bg_box"
android:drawableLeft="@mipmap/ic_user_icon"
android:hint="Username"
android:hint="@string/username_string"
android:lines="1"
android:padding="@dimen/normal_margin"
android:singleLine="true"
android:lines="1"/>
android:singleLine="true" />
<EditText
android:id="@+id/login_screen_password_edit_text"
......@@ -43,27 +43,27 @@
android:layout_marginRight="@dimen/extra_large_margin"
android:background="@drawable/username_under_bg_box"
android:drawableLeft="@mipmap/ic_password_icon"
android:hint="Password"
android:hint="@string/password_string"
android:inputType="textPassword"
android:lines="1"
android:padding="@dimen/normal_margin"
android:singleLine="true"
android:lines="1"/>
android:singleLine="true" />
<TextView
android:id="@+id/login_screen_login_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="@dimen/normal_margin"
android:layout_marginBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingBottom="@dimen/normal_margin"
android:textColor="@android:color/white"
android:background="@drawable/login_bg"
android:layout_marginLeft="@dimen/extra_large_margin"
android:layout_marginRight="@dimen/extra_large_margin"
android:textSize="@dimen/large_text_size"
android:text="@string/login_screen_login_string"/>
android:layout_marginTop="@dimen/normal_margin"
android:background="@drawable/login_bg"
android:gravity="center"
android:paddingBottom="@dimen/normal_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/login_screen_login_string"
android:textColor="@android:color/white"
android:textSize="@dimen/large_text_size" />
</LinearLayout>
</LinearLayout>
</ScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/tool_bar_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:background="@android:color/white"
android:minHeight="?attr/actionBarSize"
android:padding="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp" />
<include layout="@layout/toolbar"/>
<FrameLayout
android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/screen_bg_color">
style="@style/LightBackgroundStyle">
<android.support.v7.widget.Toolbar
android:id="@+id/tool_bar_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:background="@android:color/white"
android:minHeight="?attr/actionBarSize"
android:padding="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"/>
<include layout="@layout/toolbar"/>
<ListView
android:id="@+id/catalogue_screen_list_view"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="10">
<android.support.v7.widget.Toolbar
android:id="@+id/tool_bar_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:background="@android:color/white"
android:minHeight="?attr/actionBarSize"
android:padding="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp" />
<include layout="@layout/toolbar"/>
<LinearLayout
android:layout_width="match_parent"
......
......@@ -8,23 +8,21 @@
card_view:cardBackgroundColor="@color/item_gb_color"
card_view:cardCornerRadius="8dp"
card_view:cardElevation="10dp"
card_view:cardUseCompatPadding="true"
>
card_view:cardUseCompatPadding="true">
<RelativeLayout
android:layout_width="match_parent"
android:background="@color/item_gb_color"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_margin="@dimen/small_margin"
android:background="@color/item_gb_color"
android:orientation="vertical">
<ImageView
android:layout_margin="@dimen/home_screen_image_margin"
android:id="@+id/home_screen_adapter_image_view"
android:layout_width="@dimen/home_screen_image_height"
android:layout_height="@dimen/home_screen_image_height"
android:layout_centerHorizontal="true" />
android:layout_centerHorizontal="true"
android:layout_margin="@dimen/home_screen_image_margin" />
<TextView
android:id="@+id/home_screen_adapter_text_view"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/screen_bg_color"
android:orientation="vertical">
android:orientation="vertical"
style="@style/LightBackgroundStyle">
<android.support.v7.widget.Toolbar
android:id="@+id/tool_bar_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:background="@android:color/white"
android:minHeight="?attr/actionBarSize"
android:padding="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp" />
<include layout="@layout/toolbar"/>
<LinearLayout
android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/screen_bg_color">
style="@style/LightBackgroundStyle">
<android.support.v7.widget.Toolbar
android:id="@+id/tool_bar_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:background="@android:color/white"
android:minHeight="?attr/actionBarSize"
android:padding="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"/>
<include layout="@layout/toolbar"/>
<ListView
android:id="@+id/my_incidents_screen_list_view"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/screen_bg_color"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/tool_bar_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:background="@android:color/white"
android:minHeight="?attr/actionBarSize"
android:padding="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"/>
<include layout="@layout/toolbar" />
<ListView
android:id="@+id/request_screen_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:layout_margin="@dimen/normal_margin"
android:background="@android:color/white"
android:divider="#8e8e8e"
android:dividerHeight="0.5dp"
android:padding="10dp"
android:padding="@dimen/normal_margin"
android:scrollbars="none" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tool_bar_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:minHeight="?attr/actionBarSize"
android:padding="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
style="@style/WhiteBackgroundStyle"/>
\ No newline at end of file
......@@ -38,10 +38,14 @@
<string name="login_screen_invalid_usernane_and_password_string">Invalid UserName and Password</string>
<string name="user_error">Please Enter UserName</string>
<string name="pasw_error">Please Enter Password</string>
<string name="username_string">Username</string>
<string name="password_string">Password</string>
<!--Variable Screen-->
<string name="variable_form_misc_info_string">%1$s [add %2$s]</string>
<string name="variable_form_reference_dialog_title_string">Search \'%s\'</string>
<string name="variable_form_radio_text_string">%d</string>
<!--Catalogue Item Screen-->
<string name="no_catalogue_item_string">No Catalogue Items&#8230;</string>
......
......@@ -22,6 +22,10 @@
<item name="android:background">@android:color/white</item>
</style>
<style name="LightBackgroundStyle" parent="@style/Theme.AppCompat">
<item name="android:background">@color/screen_bg_color</item>
</style>
<style name="DatePickerCustomDialog" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@android:color/white</item>
<item name="android:windowIsFloating">true</item>
......
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