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
b53825c1
Commit
b53825c1
authored
Oct 17, 2015
by
ejcris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed errors with regards to creating new users.
parent
52e5e686
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
22 deletions
+33
-22
Confirmation.java
...in/java/com/example/pearlsantos/project/Confirmation.java
+4
-3
Login_Screen.java
...in/java/com/example/pearlsantos/project/Login_Screen.java
+4
-4
Schedules.java
.../main/java/com/example/pearlsantos/project/Schedules.java
+4
-7
SignUp.java
...src/main/java/com/example/pearlsantos/project/SignUp.java
+11
-5
activity_login__screen.xml
...roject/app/src/main/res/layout/activity_login__screen.xml
+2
-3
sign_up.xml
...-app/10-16-15/Project/app/src/main/res/layout/sign_up.xml
+8
-0
No files found.
mobile-app/10-16-15/Project/app/src/main/java/com/example/pearlsantos/project/Confirmation.java
View file @
b53825c1
...
@@ -78,9 +78,10 @@ public class Confirmation extends Dialog{
...
@@ -78,9 +78,10 @@ public class Confirmation extends Dialog{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
ParseUser
user
=
ParseUser
.
getCurrentUser
();
ParseUser
user
=
ParseUser
.
getCurrentUser
();
if
(
user
!=
null
)
{
if
(
user
!=
null
)
{
double
load
=
(
double
)
user
.
get
(
"load"
);
String
load
=
user
.
getString
(
"load"
);
if
(
load
>=
totalCost
){
if
(
Double
.
parseDouble
(
load
)>=
totalCost
){
user
.
put
(
"load"
,
load
-
totalCost
);
user
.
put
(
"load"
,
Double
.
parseDouble
(
load
)-
totalCost
);
user
.
saveInBackground
();
//update noOfseats in buses
//update noOfseats in buses
//send receipt
//send receipt
dismiss
();
dismiss
();
...
...
mobile-app/10-16-15/Project/app/src/main/java/com/example/pearlsantos/project/Login_Screen.java
View file @
b53825c1
...
@@ -18,7 +18,7 @@ import com.parse.ParseUser;
...
@@ -18,7 +18,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
,
p
hone
;
String
name
,
p
assword
;
@Override
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
@@ -38,10 +38,10 @@ public class Login_Screen extends AppCompatActivity {
...
@@ -38,10 +38,10 @@ public class Login_Screen extends AppCompatActivity {
EditText
n
=
(
EditText
)
findViewById
(
R
.
id
.
name
);
EditText
n
=
(
EditText
)
findViewById
(
R
.
id
.
name
);
name
=
n
.
getText
().
toString
();
name
=
n
.
getText
().
toString
();
EditText
p
=
(
EditText
)
findViewById
(
R
.
id
.
p
hone
);
EditText
p
=
(
EditText
)
findViewById
(
R
.
id
.
p
assword
);
p
hone
=
p
.
getText
().
toString
();
p
assword
=
p
.
getText
().
toString
();
ParseUser
.
logInInBackground
(
name
,
p
hone
,
new
LogInCallback
()
{
ParseUser
.
logInInBackground
(
name
,
p
assword
,
new
LogInCallback
()
{
public
void
done
(
ParseUser
user
,
ParseException
e
)
{
public
void
done
(
ParseUser
user
,
ParseException
e
)
{
if
(
user
!=
null
)
{
if
(
user
!=
null
)
{
Intent
intent
=
new
Intent
(
Login_Screen
.
this
,
ActionBarAttempt
.
class
);
Intent
intent
=
new
Intent
(
Login_Screen
.
this
,
ActionBarAttempt
.
class
);
...
...
mobile-app/10-16-15/Project/app/src/main/java/com/example/pearlsantos/project/Schedules.java
View file @
b53825c1
...
@@ -33,7 +33,6 @@ public class Schedules extends Fragment {
...
@@ -33,7 +33,6 @@ public class Schedules extends Fragment {
String
load
;
String
load
;
View
rootView
;
View
rootView
;
SampleCustomAdapter
adapter
;
SampleCustomAdapter
adapter
;
List
<
ParseObject
>
schedule
;
ListView
lv
;
ListView
lv
;
public
void
onCreate
(
Bundle
savedInstanceState
)
{
public
void
onCreate
(
Bundle
savedInstanceState
)
{
...
@@ -51,13 +50,10 @@ public class Schedules extends Fragment {
...
@@ -51,13 +50,10 @@ public class Schedules extends Fragment {
ParseQuery
<
ParseObject
>
query
=
ParseQuery
.
getQuery
(
"Schedule"
);
ParseQuery
<
ParseObject
>
query
=
ParseQuery
.
getQuery
(
"Schedule"
);
query
.
findInBackground
(
new
FindCallback
<
ParseObject
>()
{
query
.
findInBackground
(
new
FindCallback
<
ParseObject
>()
{
public
void
done
(
List
<
ParseObject
>
schedule
1
,
ParseException
e
)
{
public
void
done
(
List
<
ParseObject
>
schedule
,
ParseException
e
)
{
if
(
e
==
null
)
{
if
(
e
==
null
)
{
Log
.
d
(
"Brand"
,
"Retrieved "
+
schedule
1
.
size
()
+
" Brands"
);
Log
.
d
(
"Brand"
,
"Retrieved "
+
schedule
.
size
()
+
" Brands"
);
schedule
=
schedule1
;
//ListViewActivity lv = new ListViewActivity();
lv
=
(
ListView
)
rootView
.
findViewById
(
R
.
id
.
list
);
lv
=
(
ListView
)
rootView
.
findViewById
(
R
.
id
.
list
);
SampleCustomAdapter
adapter2
=
new
SampleCustomAdapter
(
schedule
);
SampleCustomAdapter
adapter2
=
new
SampleCustomAdapter
(
schedule
);
...
@@ -70,6 +66,7 @@ public class Schedules extends Fragment {
...
@@ -70,6 +66,7 @@ public class Schedules extends Fragment {
busSchedule
=
rootView
.
getContext
().
getSharedPreferences
(
"bus"
,
Context
.
MODE_PRIVATE
);
busSchedule
=
rootView
.
getContext
().
getSharedPreferences
(
"bus"
,
Context
.
MODE_PRIVATE
);
SharedPreferences
.
Editor
edit2
=
busSchedule
.
edit
();
SharedPreferences
.
Editor
edit2
=
busSchedule
.
edit
();
//System.out.println(adapter.getObjectIDOfItem());
// edit2.putString("ID", adapter.getObjectIDOfItem());
// edit2.putString("ID", adapter.getObjectIDOfItem());
TextView
busNum
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
busNum
);
TextView
busNum
=
(
TextView
)
rootView
.
findViewById
(
R
.
id
.
busNum
);
...
...
mobile-app/10-16-15/Project/app/src/main/java/com/example/pearlsantos/project/SignUp.java
View file @
b53825c1
...
@@ -39,31 +39,37 @@ public class SignUp extends AppCompatActivity {
...
@@ -39,31 +39,37 @@ public class SignUp extends AppCompatActivity {
EditText
n
=
(
EditText
)
findViewById
(
R
.
id
.
name
);
EditText
n
=
(
EditText
)
findViewById
(
R
.
id
.
name
);
String
name
=
n
.
getText
().
toString
();
String
name
=
n
.
getText
().
toString
();
EditText
p
=
(
EditText
)
findViewById
(
R
.
id
.
phone
);
EditText
pa
=
(
EditText
)
findViewById
(
R
.
id
.
password
);
String
phone
=
p
.
getText
().
toString
();
String
password
=
pa
.
getText
().
toString
();
EditText
ph
=
(
EditText
)
findViewById
(
R
.
id
.
phone
);
String
phone
=
ph
.
getText
().
toString
();
ParseUser
user
=
new
ParseUser
();
ParseUser
user
=
new
ParseUser
();
user
.
setUsername
(
name
);
user
.
setUsername
(
name
);
user
.
setPassword
(
phone
);
user
.
setPassword
(
password
);
user
.
put
(
"cellPhone"
,
phone
);
user
.
put
(
"load"
,
"0"
);
user
.
put
(
"load"
,
"0"
);
user
.
signUpInBackground
(
new
SignUpCallback
()
{
user
.
signUpInBackground
(
new
SignUpCallback
()
{
public
void
done
(
ParseException
e
)
{
public
void
done
(
ParseException
e
)
{
if
(
e
==
null
)
{
if
(
e
==
null
)
{
Intent
intent
=
new
Intent
(
SignUp
.
this
,
Login_Screen
.
class
);
Intent
intent
=
new
Intent
(
SignUp
.
this
,
ActionBarAttempt
.
class
);
//EditText editText = (EditText) findViewById(R.id.name);
//EditText editText = (EditText) findViewById(R.id.name);
//String message = editText.getText().toString();
//String message = editText.getText().toString();
//intent.putExtra(EXTRA_MESSAGE, message);
//intent.putExtra(EXTRA_MESSAGE, message);
startActivity
(
intent
);
startActivity
(
intent
);
}
else
{
}
else
{
System
.
out
.
println
(
"DIDN'T WORK"
);
System
.
out
.
println
(
"DIDN'T WORK"
);
// Sign up didn't succeed. Look at the ParseException
// Sign up didn't succeed. Look at the ParseException
Log
.
d
(
"WHAT HAPPENED"
,
e
.
getMessage
());
Log
.
d
(
"WHAT HAPPENED"
,
e
.
getMessage
());
// to figure out what went wrong
Toast
.
makeText
(
SignUp
.
this
,
"No internet connection"
,
Toast
.
LENGTH_LONG
).
show
();
}
}
}
}
});
});
}
}
});
});
}
}
...
...
mobile-app/10-16-15/Project/app/src/main/res/layout/activity_login__screen.xml
View file @
b53825c1
...
@@ -48,10 +48,9 @@
...
@@ -48,10 +48,9 @@
<EditText
<EditText
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:inputType=
"phone"
android:text=
"Password"
android:text=
"Cellphone Number"
android:ems=
"10"
android:ems=
"10"
android:id=
"@+id/p
hone
"
android:id=
"@+id/p
assword
"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:layout_gravity=
"center_horizontal"
/>
android:layout_gravity=
"center_horizontal"
/>
...
...
mobile-app/10-16-15/Project/app/src/main/res/layout/sign_up.xml
View file @
b53825c1
...
@@ -27,6 +27,14 @@
...
@@ -27,6 +27,14 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:id=
"@+id/name"
android:id=
"@+id/name"
android:text=
"Name"
android:text=
"Name"
android:layout_weight=
"2"
/>
<EditText
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:text=
"Password"
android:ems=
"10"
android:id=
"@+id/password"
android:layout_weight=
"2"
android:layout_weight=
"2"
android:layout_gravity=
"center_horizontal"
/>
android:layout_gravity=
"center_horizontal"
/>
...
...
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