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
315ea97d
Commit
315ea97d
authored
Oct 15, 2015
by
ejcris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New edits to ListViewActivity
parent
2720e31c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
33 deletions
+30
-33
app.iml
mobile-app/Project/app/app.iml
+1
-0
ListViewActivity.java
...ain/java/com/example/elysi_000/ubus/ListViewActivity.java
+29
-33
No files found.
mobile-app/Project/app/app.iml
View file @
315ea97d
...
...
@@ -91,6 +91,7 @@
<orderEntry
type=
"jdk"
jdkName=
"Android API 23 Platform"
jdkType=
"Android SDK"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"library"
exported=
""
name=
"appcompat-v7-23.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"parse-android-1.10.3"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"support-v4-23.0.1"
level=
"project"
/>
<orderEntry
type=
"library"
exported=
""
name=
"support-annotations-23.0.1"
level=
"project"
/>
</component>
...
...
mobile-app/uBus/app/src/main/java/com/example/elysi_000/ubus/ListViewActivity.java
View file @
315ea97d
...
...
@@ -46,32 +46,11 @@ public class ListViewActivity extends ListActivity {
// testObject.saveInBackground();
ParseQuery
<
ParseObject
>
query
=
ParseQuery
.
getQuery
(
"BusSchedule"
);
query
.
orderByAscending
(
"busName"
);
query
.
findInBackground
(
new
FindCallback
<
ParseObject
>()
{
public
void
done
(
List
<
ParseObject
>
schedule
,
ParseException
e
)
{
if
(
e
==
null
)
{
Log
.
d
(
"Brand"
,
"Retrieved "
+
schedule
.
size
()
+
" Brands"
);
for
(
ParseObject
s
:
schedule
)
{
//BusSchedule lol = new BusSchedule(s.get("busName"), s.get("plateNum"),)
// use s.get('columnName') to access the properties of the Deals object.
}
}
else
{
}
}
});
// ArrayList<BusSchedule> sampleList = new ArrayList<BusSchedule>();
// for(int i=0; i<10; i++){
// BusSchedule sample = new BusSchedule("Bus1", "UXC 123", "Manila",
// "Malolos", "4:00PM", 30, 7.50);
// sampleList.add(sample);
// }
busSchedule
=
getSharedPreferences
(
"bus"
,
Context
.
MODE_PRIVATE
);
SampleCustomAdapter
adapter
=
new
SampleCustomAdapter
(
samplelist
);
SampleCustomAdapter
adapter
=
new
SampleCustomAdapter
(
samplelist
);
setListAdapter
(
adapter
);
ListView
lv
=
(
ListView
)
findViewById
(
android
.
R
.
id
.
list
);
...
...
@@ -107,6 +86,23 @@ public class ListViewActivity extends ListActivity {
}
});
}
else
{
}
}
});
// ArrayList<BusSchedule> sampleList = new ArrayList<BusSchedule>();
// for(int i=0; i<10; i++){
// BusSchedule sample = new BusSchedule("Bus1", "UXC 123", "Manila",
// "Malolos", "4:00PM", 30, 7.50);
// sampleList.add(sample);
// }
busSchedule
=
getSharedPreferences
(
"bus"
,
Context
.
MODE_PRIVATE
);
load
=
100.00
;
TextView
setLoad
=
(
TextView
)
findViewById
(
R
.
id
.
load
);
...
...
@@ -116,9 +112,9 @@ public class ListViewActivity extends ListActivity {
}
private
class
SampleCustomAdapter
extends
BaseAdapter
{
private
ArrayList
<
BusSchedule
>
internalList
;
private
List
<
ParseObject
>
internalList
;
public
SampleCustomAdapter
(
ArrayList
<
BusSchedule
>
contacts
)
public
SampleCustomAdapter
(
List
<
ParseObject
>
contacts
)
{
internalList
=
contacts
;
}
...
...
@@ -174,15 +170,15 @@ public class ListViewActivity extends ListActivity {
TextView
cost
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
cost
);
// extract the object that will fill these
BusSchedule
contact
=
internalList
.
get
(
position
);
busNum
.
setText
(
contact
.
get
BusNum
(
));
plateNum
.
setText
(
contact
.
get
PlateNum
(
));
from
.
setText
(
contact
.
get
From
(
));
to
.
setText
(
contact
.
get
To
(
));
depTime
.
setText
(
contact
.
get
DepTime
(
));
seatsAvailable
.
setText
(
Integer
.
toString
(
contact
.
getSeatsAvailable
()
));
cost
.
setText
(
Double
.
toString
(
contact
.
getCost
()
));
ParseObject
contact
=
internalList
.
get
(
position
);
busNum
.
setText
(
contact
.
get
String
(
"busCompany"
));
plateNum
.
setText
(
contact
.
get
String
(
"busPlate"
));
from
.
setText
(
contact
.
get
String
(
"startingTerminal"
));
to
.
setText
(
contact
.
get
String
(
"destination"
));
depTime
.
setText
(
contact
.
get
String
(
"departure"
));
seatsAvailable
.
setText
(
contact
.
getString
(
"seatsAmount"
));
cost
.
setText
(
contact
.
getCost
(
"ticketPrice"
));
// return the view
...
...
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