Commit 050a4e05 by Kunj Gupta

UOFLMA-36: Incident form is created.

parent 6d67ba57
......@@ -34,6 +34,10 @@
android:name=".ui.CatalogueVariableScreen"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize"/>
<activity
android:name=".ui.ReportIncidentScreen"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize"/>
</application>
</manifest>
......@@ -30,7 +30,9 @@ public class HomeScreen extends Activity {
@OnItemClick(R.id.home_screen_grid_view)
void gridViewItemClicked(int position) {
if(position == 1) {
if(position == 0) {
startActivity(new Intent(HomeScreen.this, ReportIncidentScreen.class));
} else if(position == 1) {
startActivity(new Intent(HomeScreen.this, CatalogueScreen.class));
}
}
......
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);
}
}
<?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:contentInsetEnd="0dp"
android:contentInsetRight="0dp"
android:contentInsetStart="0dp"
android:minHeight="?attr/actionBarSize"
android:padding="0dp"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/normal_margin"
android:background="@android:color/white"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/normal_margin"
android:text="@string/incident_form_top_text_string"
android:textSize="@dimen/normal_text_size" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/normal_margin"
android:layout_marginTop="@dimen/normal_margin"
android:text="@string/incident_form_impact_text_string"
android:textSize="@dimen/normal_text_size"
android:textStyle="bold" />
<Spinner
android:id="@+id/incident_impact_spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/normal_margin"
android:paddingTop="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/normal_margin"
android:text="@string/incident_form_describe_your_issue_text_string"
android:textSize="@dimen/normal_text_size"
android:textStyle="bold" />
<EditText
android:id="@+id/incident_describe_issue_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/normal_margin"
android:layout_marginLeft="@dimen/normal_margin"
android:layout_marginRight="@dimen/normal_margin"
android:background="@drawable/list_view_item_bg_with_border"
android:gravity="start"
android:padding="@dimen/small_margin"
android:lines="4" />
<TextView
android:id="@+id/incident_submit_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginRight="@dimen/normal_margin"
android:background="@drawable/submit_button_bg_with_border"
android:paddingBottom="@dimen/normal_margin"
android:paddingLeft="@dimen/large_margin"
android:paddingRight="@dimen/large_margin"
android:paddingTop="@dimen/normal_margin"
android:text="@string/submit_string"
android:textColor="@android:color/white" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -7,4 +7,10 @@
<item>My Requests</item>
<item>My Dashboard</item>
</string-array>
<string-array name="incident_impact_array">
<item>-None-</item>
<item>High</item>
<item>Medium</item>
<item>Low</item>
</string-array>
</resources>
\ No newline at end of file
......@@ -41,4 +41,10 @@
<!--Catalogue Screen-->
<string name="catalogue_category_string">Catalogue Category</string>
<!--Incident screen-->
<string name="incident_form_report_incident_text_string">Report Incident</string>
<string name="incident_form_top_text_string">Create an Incident record to report and request assistance with an issue you are having\n\nRequest assistance with an issue you are having. An incident record will be created and managed through to successful resolution. You will also be notified of progress.</string>
<string name="incident_form_impact_text_string">Impact</string>
<string name="incident_form_describe_your_issue_text_string">Please Describe Your Issue below</string>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment