Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uBus
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chiara Veronica Señires
uBus
Commits
ec6e6690
Commit
ec6e6690
authored
Nov 08, 2015
by
ejcris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Searching bus schedules - Starting terminal and Destination only
parent
a9b16be7
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
229 additions
and
61 deletions
+229
-61
ActionBarAttempt.java
...ava/com/example/pearlsantos/project/ActionBarAttempt.java
+1
-1
Confirmation.java
...in/java/com/example/pearlsantos/project/Confirmation.java
+9
-11
Login_Screen.java
...in/java/com/example/pearlsantos/project/Login_Screen.java
+47
-22
ReservingSeats.java
.../java/com/example/pearlsantos/project/ReservingSeats.java
+8
-6
SearchFragment.java
.../java/com/example/pearlsantos/project/SearchFragment.java
+158
-21
fragment_search.xml
...-7-15/Project/app/src/main/res/layout/fragment_search.xml
+6
-0
No files found.
mobile-app/11-7-15/Project/app/src/main/java/com/example/pearlsantos/project/ActionBarAttempt.java
View file @
ec6e6690
...
@@ -166,7 +166,7 @@ public class ActionBarAttempt extends AppCompatActivity {
...
@@ -166,7 +166,7 @@ public class ActionBarAttempt extends AppCompatActivity {
switch
(
position
){
switch
(
position
){
case
0
:
case
0
:
Fragment
fa
=
new
SearchFragment
();
fragment
=
new
SearchFragment
();
break
;
break
;
case
1
:
case
1
:
fragment
=
new
Schedules
();
fragment
=
new
Schedules
();
...
...
mobile-app/11-7-15/Project/app/src/main/java/com/example/pearlsantos/project/Confirmation.java
View file @
ec6e6690
...
@@ -48,7 +48,7 @@ public class Confirmation extends Dialog{
...
@@ -48,7 +48,7 @@ public class Confirmation extends Dialog{
t
=
busSchedule
.
getString
(
"to"
,
""
).
trim
();
t
=
busSchedule
.
getString
(
"to"
,
""
).
trim
();
dT
=
busSchedule
.
getString
(
"depTime"
,
""
).
trim
();
dT
=
busSchedule
.
getString
(
"depTime"
,
""
).
trim
();
sA
=
busSchedule
.
getString
(
"seatsAvailable"
,
""
).
trim
();
sA
=
busSchedule
.
getString
(
"seatsAvailable"
,
""
).
trim
();
//
c = busSchedule.getString("cost", "").trim();
c
=
busSchedule
.
getString
(
"cost"
,
""
).
trim
();
nOS
=
busSchedule
.
getString
(
"noOfSeats"
,
""
).
trim
();
nOS
=
busSchedule
.
getString
(
"noOfSeats"
,
""
).
trim
();
a
=
busSchedule
.
getString
(
"arrival"
,
""
).
trim
();
a
=
busSchedule
.
getString
(
"arrival"
,
""
).
trim
();
}
}
...
@@ -59,7 +59,6 @@ public class Confirmation extends Dialog{
...
@@ -59,7 +59,6 @@ public class Confirmation extends Dialog{
TextView
from
=
(
TextView
)
findViewById
(
R
.
id
.
from
);
TextView
from
=
(
TextView
)
findViewById
(
R
.
id
.
from
);
TextView
to
=
(
TextView
)
findViewById
(
R
.
id
.
to
);
TextView
to
=
(
TextView
)
findViewById
(
R
.
id
.
to
);
TextView
depTime
=
(
TextView
)
findViewById
(
R
.
id
.
depTime
);
TextView
depTime
=
(
TextView
)
findViewById
(
R
.
id
.
depTime
);
TextView
seatsAvailable
=
(
TextView
)
findViewById
(
R
.
id
.
seatsAvailable
);
TextView
purchase
=
(
TextView
)
findViewById
(
R
.
id
.
purchase
);
TextView
purchase
=
(
TextView
)
findViewById
(
R
.
id
.
purchase
);
TextView
noOfSeats
=(
TextView
)
findViewById
(
R
.
id
.
noOfSeats
);
TextView
noOfSeats
=(
TextView
)
findViewById
(
R
.
id
.
noOfSeats
);
TextView
seatsPurchased
=(
TextView
)
findViewById
(
R
.
id
.
seatsPurchased
);
TextView
seatsPurchased
=(
TextView
)
findViewById
(
R
.
id
.
seatsPurchased
);
...
@@ -70,7 +69,6 @@ public class Confirmation extends Dialog{
...
@@ -70,7 +69,6 @@ public class Confirmation extends Dialog{
from
.
setText
(
f
);
from
.
setText
(
f
);
to
.
setText
(
t
);
to
.
setText
(
t
);
depTime
.
setText
(
dT
);
depTime
.
setText
(
dT
);
seatsAvailable
.
setText
(
sA
);
arrival
.
setText
(
a
);
arrival
.
setText
(
a
);
totalCost
=
Double
.
parseDouble
(
c
)*
Double
.
parseDouble
(
nOS
);
totalCost
=
Double
.
parseDouble
(
c
)*
Double
.
parseDouble
(
nOS
);
purchase
.
setText
(
Double
.
toString
(
totalCost
));
purchase
.
setText
(
Double
.
toString
(
totalCost
));
...
@@ -132,14 +130,14 @@ public class Confirmation extends Dialog{
...
@@ -132,14 +130,14 @@ public class Confirmation extends Dialog{
}
}
});
});
Button
cancel
=
(
Button
)
findViewById
(
R
.
id
.
cancel
);
//
Button cancel = (Button) findViewById(R.id.cancel);
cancel
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
//
cancel.setOnClickListener(new View.OnClickListener() {
//
@Override
//
@Override
public
void
onClick
(
View
v
)
{
//
public void onClick(View v) {
cancel
();
//
cancel();
}
//
}
});
//
});
}
}
}
}
mobile-app/11-7-15/Project/app/src/main/java/com/example/pearlsantos/project/Login_Screen.java
View file @
ec6e6690
package
com
.
example
.
pearlsantos
.
project
;
package
com
.
example
.
pearlsantos
.
project
;
import
android.app.ProgressDialog
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.support.v7.app.ActionBar
;
import
android.support.v7.app.ActionBar
;
import
android.support.v7.app.AppCompatActivity
;
import
android.support.v7.app.AppCompatActivity
;
...
@@ -19,6 +20,7 @@ import com.parse.ParseUser;
...
@@ -19,6 +20,7 @@ import com.parse.ParseUser;
public
class
Login_Screen
extends
AppCompatActivity
{
public
class
Login_Screen
extends
AppCompatActivity
{
//public final static String EXTRA_MESSAGE = ;
//public final static String EXTRA_MESSAGE = ;
String
name
,
password
;
String
name
,
password
;
ProgressDialog
progress
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
@@ -35,6 +37,13 @@ public class Login_Screen extends AppCompatActivity {
...
@@ -35,6 +37,13 @@ public class Login_Screen extends AppCompatActivity {
submit
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
submit
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
final
ProgressDialog
ringProgressDialog
=
ProgressDialog
.
show
(
Login_Screen
.
this
,
"Maaring maghintay lamang ..."
,
"Logging in ..."
,
true
);
ringProgressDialog
.
setCancelable
(
true
);
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
EditText
n
=
(
EditText
)
findViewById
(
R
.
id
.
name
);
EditText
n
=
(
EditText
)
findViewById
(
R
.
id
.
name
);
name
=
n
.
getText
().
toString
();
name
=
n
.
getText
().
toString
();
...
@@ -49,15 +58,30 @@ public class Login_Screen extends AppCompatActivity {
...
@@ -49,15 +58,30 @@ public class Login_Screen extends AppCompatActivity {
//String message = editText.getText().toString();
//String message = editText.getText().toString();
//intent.putExtra(EXTRA_MESSAGE, message);
//intent.putExtra(EXTRA_MESSAGE, message);
startActivity
(
intent
);
startActivity
(
intent
);
ringProgressDialog
.
dismiss
();
finish
();
finish
();
}
else
{
}
else
{
//Log.d(e, "What happened?");
//Log.d(e, "What happened?");
Toast
.
makeText
(
Login_Screen
.
this
,
"Name and phone number combination "
+
Toast
.
makeText
(
Login_Screen
.
this
,
"Name and phone number combination "
+
"does not exist"
,
Toast
.
LENGTH_LONG
).
show
();
"does not exist"
,
Toast
.
LENGTH_LONG
).
show
();
ringProgressDialog
.
dismiss
();
}
}
}
}
});
});
Thread
.
sleep
(
10000
);
}
catch
(
Exception
e
)
{
}
ringProgressDialog
.
dismiss
();
}
}).
start
();
}
}
});
});
...
@@ -94,4 +118,5 @@ public class Login_Screen extends AppCompatActivity {
...
@@ -94,4 +118,5 @@ public class Login_Screen extends AppCompatActivity {
startActivity
(
intent
);
startActivity
(
intent
);
}
}
}
}
mobile-app/11-7-15/Project/app/src/main/java/com/example/pearlsantos/project/ReservingSeats.java
View file @
ec6e6690
...
@@ -18,7 +18,8 @@ import android.widget.Toast;
...
@@ -18,7 +18,8 @@ import android.widget.Toast;
public
class
ReservingSeats
extends
Dialog
{
public
class
ReservingSeats
extends
Dialog
{
SharedPreferences
busSchedule
;
SharedPreferences
busSchedule
;
EditText
noOfSeats
;
EditText
noOfSeats
;
String
bN
,
pN
,
f
,
t
,
dT
,
sA
,
c
,
nOS
,
a
;
String
sA
;
int
nOS
;
NumberPicker
tens
;
NumberPicker
tens
;
NumberPicker
ones
;
NumberPicker
ones
;
...
@@ -31,6 +32,7 @@ public class ReservingSeats extends Dialog {
...
@@ -31,6 +32,7 @@ public class ReservingSeats extends Dialog {
{
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
requestWindowFeature
(
Window
.
FEATURE_CUSTOM_TITLE
);
requestWindowFeature
(
Window
.
FEATURE_CUSTOM_TITLE
);
setContentView
(
R
.
layout
.
activity_reserving_seats
);
busSchedule
=
getContext
().
getSharedPreferences
(
"bus"
,
Context
.
MODE_PRIVATE
);
busSchedule
=
getContext
().
getSharedPreferences
(
"bus"
,
Context
.
MODE_PRIVATE
);
// if(busSchedule!=null){
// if(busSchedule!=null){
// bN = busSchedule.getString("busNum", "").trim();
// bN = busSchedule.getString("busNum", "").trim();
...
@@ -56,7 +58,6 @@ public class ReservingSeats extends Dialog {
...
@@ -56,7 +58,6 @@ public class ReservingSeats extends Dialog {
ones
.
setWrapSelectorWheel
(
true
);
ones
.
setWrapSelectorWheel
(
true
);
setContentView
(
R
.
layout
.
activity_reserving_seats
);
// noOfSeats = (EditText) findViewById(R.id.noOfSeats);
// noOfSeats = (EditText) findViewById(R.id.noOfSeats);
// noOfSeats.setText("1");
// noOfSeats.setText("1");
...
@@ -69,12 +70,13 @@ public class ReservingSeats extends Dialog {
...
@@ -69,12 +70,13 @@ public class ReservingSeats extends Dialog {
NumberPicker
tensSeats
=
(
NumberPicker
)
findViewById
(
R
.
id
.
numberPicker
);
NumberPicker
tensSeats
=
(
NumberPicker
)
findViewById
(
R
.
id
.
numberPicker
);
NumberPicker
unitSeats
=
(
NumberPicker
)
findViewById
(
R
.
id
.
numberPicker2
);
NumberPicker
unitSeats
=
(
NumberPicker
)
findViewById
(
R
.
id
.
numberPicker2
);
int
nOS1
=
(
tensSeats
.
getValue
()*
10
)
+
unitSeats
.
getValue
();
nOS
=
(
tensSeats
.
getValue
()*
10
)
+
unitSeats
.
getValue
();
int
remainingSeats
=
Integer
.
parseInt
(
sA
)
-
nOS
1
;
int
remainingSeats
=
Integer
.
parseInt
(
sA
)
-
nOS
;
if
(
remainingSeats
>
0
)
{
if
(
remainingSeats
>
0
)
{
SharedPreferences
.
Editor
edit
=
busSchedule
.
edit
();
SharedPreferences
.
Editor
edit
=
busSchedule
.
edit
();
edit
.
putString
(
"noOfSeats"
,
noOfSeats
.
getText
().
toString
().
trim
());
edit
.
putString
(
"noOfSeats"
,
Integer
.
toString
(
nOS
).
trim
());
edit
.
putString
(
"seatsAvailable"
,
Integer
.
toString
(
remainingSeats
).
trim
());
edit
.
commit
();
edit
.
commit
();
Confirmation
confirm
=
new
Confirmation
(
getContext
());
Confirmation
confirm
=
new
Confirmation
(
getContext
());
confirm
.
show
();
confirm
.
show
();
...
...
mobile-app/11-7-15/Project/app/src/main/java/com/example/pearlsantos/project/SearchFragment.java
View file @
ec6e6690
package
com
.
example
.
pearlsantos
.
project
;
package
com
.
example
.
pearlsantos
.
project
;
import
android.app.ProgressDialog
;
import
android.app.TimePickerDialog
;
import
android.app.TimePickerDialog
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.content.SharedPreferences
;
import
android.support.v4.app.DialogFragment
;
import
android.support.v4.app.DialogFragment
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.Fragment
;
...
@@ -13,17 +16,24 @@ import android.util.Log;
...
@@ -13,17 +16,24 @@ import android.util.Log;
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.AdapterView
;
import
android.widget.ArrayAdapter
;
import
android.widget.ArrayAdapter
;
import
android.widget.BaseAdapter
;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.DigitalClock
;
import
android.widget.DigitalClock
;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
import
android.widget.ListView
;
import
android.widget.Spinner
;
import
android.widget.Spinner
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.parse.FindCallback
;
import
com.parse.FindCallback
;
import
com.parse.LogInCallback
;
import
com.parse.ParseException
;
import
com.parse.ParseException
;
import
com.parse.ParseObject
;
import
com.parse.ParseObject
;
import
com.parse.ParseQuery
;
import
com.parse.ParseQuery
;
import
com.parse.ParseUser
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -32,7 +42,7 @@ import java.util.List;
...
@@ -32,7 +42,7 @@ import java.util.List;
* A placeholder fragment containing a simple view.
* A placeholder fragment containing a simple view.
*/
*/
public
class
SearchFragment
extends
Fragment
{
public
class
SearchFragment
extends
Fragment
{
SharedPreferences
tim
e
;
SharedPreferences
busSchedul
e
;
View
rootView
;
View
rootView
;
Spinner
s
;
Spinner
s
;
public
SearchFragment
()
{
public
SearchFragment
()
{
...
@@ -64,9 +74,16 @@ public class SearchFragment extends Fragment {
...
@@ -64,9 +74,16 @@ public class SearchFragment extends Fragment {
searchFor
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
searchFor
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
time
=
getContext
().
getSharedPreferences
(
"bus"
,
getContext
().
MODE_PRIVATE
);
final
ProgressDialog
ringProgressDialog
=
ProgressDialog
.
show
(
getContext
(),
String
hour
=
time
.
getString
(
"hourOfDay"
,
""
);
"Maaring maghintay lamang ..."
,
"Kinukuha ang talaan ng bus ..."
,
true
);
String
minute
=
time
.
getString
(
"minute"
,
""
);
ringProgressDialog
.
setCancelable
(
true
);
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
busSchedule
=
getContext
().
getSharedPreferences
(
"bus"
,
getContext
().
MODE_PRIVATE
);
String
hour
=
busSchedule
.
getString
(
"hourOfDay"
,
""
);
String
minute
=
busSchedule
.
getString
(
"minute"
,
""
);
EditText
from
=
(
EditText
)
rootView
.
findViewById
(
R
.
id
.
fromSearch
);
EditText
from
=
(
EditText
)
rootView
.
findViewById
(
R
.
id
.
fromSearch
);
String
fromSearch
=
from
.
getText
().
toString
().
trim
();
String
fromSearch
=
from
.
getText
().
toString
().
trim
();
...
@@ -81,6 +98,7 @@ public class SearchFragment extends Fragment {
...
@@ -81,6 +98,7 @@ public class SearchFragment extends Fragment {
query
.
orderByAscending
(
"departure"
);
query
.
orderByAscending
(
"departure"
);
query
.
whereContains
(
"startingTerminal"
,
fromSearch
);
query
.
whereContains
(
"startingTerminal"
,
fromSearch
);
query
.
whereContains
(
"destination"
,
toSearch
);
query
.
whereContains
(
"destination"
,
toSearch
);
if
(!(
bC
.
equals
(
"None"
)))
query
.
whereContains
(
"busCompany"
,
bC
);
query
.
whereContains
(
"busCompany"
,
bC
);
// query.whereContains("departure", hour);
// query.whereContains("departure", hour);
// query.whereContains("arrival", minute);
// query.whereContains("arrival", minute);
...
@@ -88,13 +106,60 @@ public class SearchFragment extends Fragment {
...
@@ -88,13 +106,60 @@ public class SearchFragment extends Fragment {
query
.
findInBackground
(
new
FindCallback
<
ParseObject
>()
{
query
.
findInBackground
(
new
FindCallback
<
ParseObject
>()
{
public
void
done
(
List
<
ParseObject
>
bC
,
ParseException
e
)
{
public
void
done
(
List
<
ParseObject
>
bC
,
ParseException
e
)
{
if
(
e
==
null
)
{
if
(
e
==
null
)
{
Log
.
d
(
"score"
,
"Retrieved "
+
bC
.
size
()
+
" scores"
);
ListView
lv
=
(
ListView
)
rootView
.
findViewById
(
R
.
id
.
schedule
);
SampleCustomAdapter
adapter2
=
new
SampleCustomAdapter
(
bC
);
lv
.
setTextFilterEnabled
(
true
);
lv
.
setAdapter
(
adapter2
);
lv
.
setOnItemClickListener
(
new
AdapterView
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
AdapterView
<?>
arg0
,
View
arg1
,
int
arg2
,
long
arg3
)
{
SharedPreferences
.
Editor
edit2
=
busSchedule
.
edit
();
//System.out.println(adapter.getObjectIDOfItem());
// edit2.putString("ID", adapter.getObjectIDOfItem());
// TextView busNum = (TextView) rootView.findViewById(R.id.busNum);
// TextView plateNum = (TextView) rootView.findViewById(R.id.plateNum);
TextView
from
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
from
);
TextView
to
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
to
);
TextView
depTime
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
depTime
);
TextView
seatsAvailable
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
seatsAvailable
);
TextView
cost
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
cost
);
TextView
arrival
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
arrTime
);
SharedPreferences
.
Editor
edit
=
busSchedule
.
edit
();
// edit.putString("busNum", busNum.getText().toString().trim());
// edit.putString("plateNum", plateNum.getText().toString().trim());
edit
.
putString
(
"from"
,
from
.
getText
().
toString
().
trim
());
edit
.
putString
(
"to"
,
to
.
getText
().
toString
().
trim
());
edit
.
putString
(
"depTime"
,
depTime
.
getText
().
toString
().
trim
());
edit
.
putString
(
"seatsAvailable"
,
seatsAvailable
.
getText
().
toString
().
trim
());
edit
.
putString
(
"cost"
,
cost
.
getText
().
toString
().
trim
());
edit
.
putString
(
"arrival"
,
arrival
.
getText
().
toString
().
trim
());
edit
.
commit
();
ReservingSeats
dialog
=
new
ReservingSeats
(
rootView
.
getContext
());
dialog
.
show
();
}
});
}
else
{
}
else
{
Log
.
d
(
"score"
,
"Error: "
+
e
.
getMessage
());
}
}
}
}
});
});
Thread
.
sleep
(
10000
);
}
catch
(
Exception
e
)
{
}
ringProgressDialog
.
dismiss
();
}
}).
start
();
}
}
...
@@ -117,7 +182,79 @@ public class SearchFragment extends Fragment {
...
@@ -117,7 +182,79 @@ public class SearchFragment extends Fragment {
}
}
private
class
SampleCustomAdapter
extends
BaseAdapter
{
private
List
<
ParseObject
>
internalList
;
public
SampleCustomAdapter
(
List
<
ParseObject
>
contacts
)
{
internalList
=
contacts
;
}
@Override
public
int
getCount
()
{
// TODO Auto-generated method stub
return
internalList
.
size
();
}
@Override
public
Object
getItem
(
int
index
)
{
// TODO Auto-generated method stub
return
internalList
.
get
(
index
);
}
@Override
public
long
getItemId
(
int
position
)
{
// TODO Auto-generated method stub
return
position
;
}
public
View
getView
(
int
position
,
View
convertView
,
ViewGroup
parent
)
{
// NOTE: you can only do this if you have access to the Activity object
// which is why this is an inner class
//LayoutInflater inflater = getLayoutInflater();
LayoutInflater
inflater
=
(
LayoutInflater
)
getContext
().
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
View
view
;
System
.
out
.
println
(
parent
.
getClass
().
getName
());
System
.
out
.
println
(
position
);
if
(
convertView
==
null
)
{
view
=
inflater
.
inflate
(
R
.
layout
.
schedule_list
,
null
);
}
else
{
view
=
convertView
;
}
// extract the views to be populated
// TextView busNum = (TextView) view.findViewById(R.id.busNum);
// TextView plateNum = (TextView) view.findViewById(R.id.plateNum);
ImageView
companyLogo
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
busCompanyLogo
);
TextView
from
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
from
);
TextView
to
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
to
);
TextView
depTime
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
depTime
);
TextView
seatsAvailable
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
seatsAvailable
);
TextView
cost
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
cost
);
TextView
arrival
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
arrTime
);
// extract the object that will fill these
ParseObject
contact
=
internalList
.
get
(
position
);
// busNum.setText(contact.getString("busCompany"));
// plateNum.setText(contact.getString("busPlate"));
// companyLogo.setImageBitmap();
from
.
setText
(
contact
.
getString
(
"startingTerminal"
));
to
.
setText
(
contact
.
getString
(
"destination"
));
depTime
.
setText
(
contact
.
getString
(
"departure"
));
seatsAvailable
.
setText
(
contact
.
getString
(
"seatsAmount"
));
cost
.
setText
(
contact
.
getString
(
"ticketPrice"
));
arrival
.
setText
(
contact
.
getString
(
"arrival"
));
// return the view
return
view
;
}
}
}
}
mobile-app/11-7-15/Project/app/src/main/res/layout/fragment_search.xml
View file @
ec6e6690
...
@@ -107,5 +107,11 @@
...
@@ -107,5 +107,11 @@
</LinearLayout>
</LinearLayout>
<ListView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:id=
"@+id/schedule"
android:layout_gravity=
"center_horizontal"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment