Commit e32c5559 authored by Pearl Jen Santos's avatar Pearl Jen Santos

Updated project as per EJ's request: included a new user option

parent 88035dc1
......@@ -10,7 +10,11 @@
android:theme="@style/AppTheme" >
<activity
android:name=".Login_Screen"
android:label="@string/app_name" >
android:label="@string/app_name"
android:parentActivityName=".SignUp" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".SignUp" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......@@ -26,13 +30,15 @@
android:value=".Login_Screen" />
</activity>
<activity
android:name=".ChangeInfoFragment"
android:label="@string/title_activity_change_info_fragment" >
</activity>
<activity
android:name=".PastTrips"
android:label="@string/title_activity_past_trips" >
android:name=".SignUp"
android:label="Sign Up"
android:parentActivityName=".Login_Screen" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".Login_Screen" />
</activity>
</application>
</manifest>
package com.example.pearlsantos.project;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class About extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_about, container, false);
return rootView;
}
}
package com.example.pearlsantos.project;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.TextView;
public class Help extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_about, container, false);
return rootView;
}
}
......@@ -50,4 +50,13 @@ public class Login_Screen extends AppCompatActivity {
startActivity(intent);
}
public void newUser(View view){
Intent intent = new Intent(this, SignUp.class);
//EditText editText = (EditText) findViewById(R.id.name);
//String message = editText.getText().toString();
//intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);
}
}
......@@ -5,12 +5,14 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class PastTrips extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_pasttrips, container, false);
return rootView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_pasttrips, container, false);
return rootView;
}
}
......@@ -4,25 +4,24 @@ import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.widget.DrawerLayout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
/**
* A simple {@link Fragment} subclass.
* Activities that contain this fragment must implement the
* {@link Schedules.OnFragmentInteractionListener} interface
* to handle interaction events.
* Use the {@link Schedules#newInstance} factory method to
* create an instance of this fragment.
*/
public class Schedules extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_schedules, container, false);
View rootView = inflater.inflate(R.layout.fragment_schedules, container, false);
return rootView;
}
}
......
package com.example.pearlsantos.project;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
/**
* Created by Pearl Santos on 10/15/2015.
*/
public class SignUp extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sign_up);
ActionBar actionBar = getSupportActionBar();
actionBar.setTitle("Sign Up");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_action_bar_attempt, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
public void okay(View view){
Intent intent = new Intent(this, Login_Screen.class);
//EditText editText = (EditText) findViewById(R.id.name);
//String message = editText.getText().toString();
//intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);
}
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:id="@+id/container"
tools:context="com.example.pearlsantos.project.ActionBarAttempt">
<ViewAnimator
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/viewAnimator"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
android:layout_height="match_parent">
<!-- The main content view -->
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- The navigation drawer -->
<ListView android:id="@+id/left_drawer"
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>
......@@ -9,13 +9,22 @@
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".Login_Screen"
>
<LinearLayout
android:layout_width="263dp"
android:layout_height="236dp"
android:layout_weight="0.5"
android:layout_gravity="center">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/logo"
android:id="@+id/imageView"
android:layout_gravity="center"
/>
</LinearLayout>
<ImageView
android:layout_width="234dp"
android:layout_height="258dp"
android:src="@mipmap/logo"
android:id="@+id/imageView"
android:layout_gravity="center" />
<TextView
android:layout_width="wrap_content"
......@@ -63,7 +72,8 @@
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_weight="3">
<Button
......@@ -72,7 +82,17 @@
android:layout_gravity="center"
android:text="SUBMIT"
android:onClick="submit"
android:layout_weight="2"
android:id="@+id/submit" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="NEW USER"
android:onClick="newUser"
android:layout_weight="2"
android:id="@+id/newUser" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<!--The layout for the person's profile-->
<LinearLayout
android:id="@+id/profileLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:orientation="horizontal"
android:layout_marginTop="0dp"
android:background="?android:attr/activatedBackgroundIndicator"
>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/userImage"
android:src="@mipmap/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
/>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="#fff"
android:background="?android:attr/activatedBackgroundIndicator"
android:minHeight="?android:attr/listPreferredItemHeightSmall"/>
<TextView
android:id="@+id/user_UserName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center"
android:text="Name"/>
<TextView
android:id="@+id/user_UserNumber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center"
android:text="Number"/>
</LinearLayout>
</LinearLayout>
<!--The layout for the item list-->
<LinearLayout
android:id="@+id/itemLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:minHeight="55dp"
android:orientation="vertical"
>
<TextView
android:id="@+id/itemName"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="2"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center"
android:text="Name"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="1dp"
android:layout_marginTop="1dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#DADADC"
></View>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.pearlsantos.project.Help">
<TextView android:id="@android:id/empty" android:layout_width="match_parent"
android:layout_height="match_parent" android:gravity="center" android:text="Coming soon" />
</FrameLayout>
......@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:orientation="vertical"
>
<!--
......@@ -12,19 +12,49 @@
fragment_layout_three.xml
**********************************************************************
-->
<ImageView
android:id="@+id/frag1_icon"
android:layout_width="wrap_content"
<LinearLayout
android:orientation="vertical"
android:layout_height="wrap_content"
/>
android:layout_width="match_parent"
android:layout_weight="1">
<TextView
android:gravity="center"
android:id="@+id/frag1_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Hi, Hello"/>
android:text="Change Info"/>
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_weight="1">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text="Name"
android:ems="20"
android:id="@+id/editText" />
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_weight="1">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/editText2"
android:ems="20"
android:text="Number" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:orientation="vertical"
>
<!--
......@@ -13,11 +13,6 @@
**********************************************************************
-->
<ImageView
android:id="@+id/frag2_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/frag2_text"
......@@ -25,7 +20,13 @@
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Hello, how are you?"/>
android:text="Past Trips"/>
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/listView2"
android:layout_weight="1" />
</LinearLayout>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
<?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">
<!-- The main content view -->
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- The navigation drawer -->
<ListView android:id="@+id/left_drawer"
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>
android:layout_height="match_parent"
android:orientation="vertical"
>
<!--
**************************IMPORTANT***********************************
change this id attribute values as "frag2_icon" and "frag2_text" for
fragment_layout_two.xml and "frag3_icon" and "frag3_text" for
fragment_layout_three.xml
**********************************************************************
-->
<TextView
android:id="@+id/frag3_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Available Schedules"/>
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/listView"
android:layout_gravity="center_vertical"
android:layout_weight="1" />
</LinearLayout>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/text3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="#fff"
android:background="?android:attr/activatedBackgroundIndicator"
android:minHeight="?android:attr/listPreferredItemHeightSmall"/>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:textColor="#fff"
android:background="?android:attr/activatedBackgroundIndicator"
android:minHeight="?android:attr/listPreferredItemHeightSmall"/>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="center"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".Login_Screen"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="New User"
android:layout_gravity="center"
android:id="@+id/textView"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:layout_weight="2"/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/name"
android:text="Name"
android:layout_weight="2"
android:layout_gravity="center_horizontal" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="phone"
android:text="Cellphone Number"
android:ems="10"
android:id="@+id/phone"
android:layout_weight="2"
android:layout_gravity="center_horizontal" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_weight="3">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="OK"
android:onClick="okay"
android:id="@+id/submit" />
</LinearLayout>
</LinearLayout>
......@@ -9,10 +9,6 @@
android:icon="@mipmap/ic_search"
android:orderInCategory="100"
app:showAsAction="always" />
<item android:id="@+id/action_profile"
android:title="Profile"
android:orderInCategory="100"
app:showAsAction="never" />
<item android:id="@+id/action_aboutUs"
android:title="About Us"
android:orderInCategory="100"
......
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.pearlsantos.project.Profile">
tools:context="com.example.pearlsantos.project.About">
<item android:id="@+id/action_settings" android:title="@string/action_settings"
android:orderInCategory="100" app:showAsAction="never" />
</menu>
<resources>
<!--
Layout alias to replace the single-pane version of the layout with a
two-pane version on Large screens.
For more on layout aliases, see:
http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
-->
<item name="fragment_item" type="layout">@layout/fragment_about</item>
</resources>
\ No newline at end of file
<resources>
<!--
Layout alias to replace the single-pane version of the layout with a
two-pane version on Large screens.
For more on layout aliases, see:
http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
-->
<item name="fragment_item" type="layout">@layout/fragment_about</item>
</resources>
\ No newline at end of file
<resources>
<!--
Layout alias to replace the single-pane version of the layout with a
two-pane version on Large screens.
For more on layout aliases, see:
http://developer.android.com/training/multiscreen/screensizes.html#TaskUseAliasFilters
-->
<item name="fragment_item" type="layout">@layout/sign_up</item>
</resources>
\ No newline at end of file
......@@ -5,6 +5,18 @@
<string name="action_settings">Settings</string>
<string name="title_activity_home_screen">HomeScreen</string>
<string name="title_activity_action_bar_attempt">ActionBarAttempt</string>
<string name="drawer_open">open</string>
<string name="drawer_close">close</string>
<string-array name="options">
<item>Schedules</item>
<item>Change Info</item>
<item>View Past Trips</item>
</string-array>
<string-array name="list">
<item>Sched1</item>
<item>Sched2</item>
</string-array>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment