Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CarRental
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
samuel.boulton
CarRental
Commits
7708fb17
Commit
7708fb17
authored
May 10, 2020
by
samuel.boulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
receipt left to do
parent
512476bc
Changes
42
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
1171 additions
and
181 deletions
+1171
-181
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+8
-1
audiPage.java
app/src/main/java/com/example/carrentalsystem/audiPage.java
+80
-4
audiPay.java
app/src/main/java/com/example/carrentalsystem/audiPay.java
+61
-29
audiReceipt.java
...rc/main/java/com/example/carrentalsystem/audiReceipt.java
+10
-2
audiRefresh.java
...rc/main/java/com/example/carrentalsystem/audiRefresh.java
+16
-3
hondaPage.java
app/src/main/java/com/example/carrentalsystem/hondaPage.java
+73
-2
hondaPay.java
app/src/main/java/com/example/carrentalsystem/hondaPay.java
+54
-29
hondaReceipt.java
...c/main/java/com/example/carrentalsystem/hondaReceipt.java
+34
-0
hondaRefresh.java
...c/main/java/com/example/carrentalsystem/hondaRefresh.java
+9
-0
jaguarPage.java
...src/main/java/com/example/carrentalsystem/jaguarPage.java
+73
-2
jaguarPay.java
app/src/main/java/com/example/carrentalsystem/jaguarPay.java
+53
-29
jaguarReceipt.java
.../main/java/com/example/carrentalsystem/jaguarReceipt.java
+34
-0
jaguarRefresh.java
.../main/java/com/example/carrentalsystem/jaguarRefresh.java
+10
-0
mercPage.java
app/src/main/java/com/example/carrentalsystem/mercPage.java
+72
-2
mercPay.java
app/src/main/java/com/example/carrentalsystem/mercPay.java
+51
-29
mercReceipt.java
...rc/main/java/com/example/carrentalsystem/mercReceipt.java
+34
-0
mercRefresh.java
...rc/main/java/com/example/carrentalsystem/mercRefresh.java
+10
-0
registerPage.java
...c/main/java/com/example/carrentalsystem/registerPage.java
+2
-6
toyotaPage.java
...src/main/java/com/example/carrentalsystem/toyotaPage.java
+70
-2
toyotaPay.java
app/src/main/java/com/example/carrentalsystem/toyotaPay.java
+51
-29
toyotaReceipt.java
.../main/java/com/example/carrentalsystem/toyotaReceipt.java
+34
-0
toyotaRefresh.java
.../main/java/com/example/carrentalsystem/toyotaRefresh.java
+10
-0
activity_audi_page.xml
app/src/main/res/layout/activity_audi_page.xml
+37
-0
activity_audi_pay.xml
app/src/main/res/layout/activity_audi_pay.xml
+3
-2
activity_audi_receipt.xml
app/src/main/res/layout/activity_audi_receipt.xml
+1
-0
activity_audi_refresh.xml
app/src/main/res/layout/activity_audi_refresh.xml
+10
-0
activity_honda_page.xml
app/src/main/res/layout/activity_honda_page.xml
+39
-2
activity_honda_pay.xml
app/src/main/res/layout/activity_honda_pay.xml
+2
-2
activity_honda_receipt.xml
app/src/main/res/layout/activity_honda_receipt.xml
+18
-0
activity_honda_refresh.xml
app/src/main/res/layout/activity_honda_refresh.xml
+10
-0
activity_jaguar_page.xml
app/src/main/res/layout/activity_jaguar_page.xml
+37
-0
activity_jaguar_pay.xml
app/src/main/res/layout/activity_jaguar_pay.xml
+2
-2
activity_jaguar_receipt.xml
app/src/main/res/layout/activity_jaguar_receipt.xml
+18
-0
activity_jaguar_refresh.xml
app/src/main/res/layout/activity_jaguar_refresh.xml
+10
-0
activity_merc_page.xml
app/src/main/res/layout/activity_merc_page.xml
+37
-0
activity_merc_pay.xml
app/src/main/res/layout/activity_merc_pay.xml
+2
-2
activity_merc_receipt.xml
app/src/main/res/layout/activity_merc_receipt.xml
+18
-0
activity_merc_refresh.xml
app/src/main/res/layout/activity_merc_refresh.xml
+10
-0
activity_toyota_page.xml
app/src/main/res/layout/activity_toyota_page.xml
+37
-0
activity_toyota_pay.xml
app/src/main/res/layout/activity_toyota_pay.xml
+2
-2
activity_toyota_receipt.xml
app/src/main/res/layout/activity_toyota_receipt.xml
+19
-0
activity_toyota_refresh.xml
app/src/main/res/layout/activity_toyota_refresh.xml
+10
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
7708fb17
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.example.carrentalsystem"
>
<!-- Required to act as a custom watch face. -->
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<!-- Required for complications to receive complication data and open the provider chooser. -->
<uses-permission
android:name=
"com.google.android.wearable.permission.RECEIVE_COMPLICATION_DATA"
/>
<application
android:allowBackup=
"true"
...
...
@@ -9,7 +12,11 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".audiReceipt"
></activity>
<activity
android:name=
".toyotaReceipt"
></activity>
<activity
android:name=
".mercReceipt"
/>
<activity
android:name=
".jaguarReceipt"
/>
<activity
android:name=
".hondaReceipt"
/>
<activity
android:name=
".audiReceipt"
/>
<activity
android:name=
".toyotaPay"
/>
<activity
android:name=
".mercPay"
/>
<activity
android:name=
".jaguarPay"
/>
...
...
app/src/main/java/com/example/carrentalsystem/audiPage.java
View file @
7708fb17
package
com
.
example
.
carrentalsystem
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.appcompat.app.AppCompatActivity
;
import
androidx.fragment.app.DialogFragment
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.Toast
;
public
class
audiPage
extends
AppCompatActivity
{
import
static
android
.
view
.
View
.
GONE
;
public
class
audiPage
extends
AppCompatActivity
{
Button
mBtn
,
pay
;
String
[]
listItems
;
TextView
mTextView
;
int
hours
=
0
;
Boolean
chkhours
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_audi_page
);
chkhours
=
false
;
mBtn
=
findViewById
(
R
.
id
.
hourBtn
);
mTextView
=
findViewById
(
R
.
id
.
tvDisplayChoice
);
pay
=
findViewById
(
R
.
id
.
pay
);
pay
.
setVisibility
(
View
.
GONE
);
mBtn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
listItems
=
new
String
[]{
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
};
AlertDialog
.
Builder
mBuilder
=
new
AlertDialog
.
Builder
(
audiPage
.
this
);
mBuilder
.
setTitle
(
"How many hours?"
);
mBuilder
.
setSingleChoiceItems
(
listItems
,
-
1
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
i
)
{
mTextView
.
setText
(
listItems
[
i
]);
dialog
.
dismiss
();
chkhours
=
true
;
pay
.
setVisibility
(
View
.
VISIBLE
);
hours
=
Integer
.
valueOf
(
mTextView
.
getText
().
toString
());
}
});
mBuilder
.
setNeutralButton
(
"Cancel"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
i
)
{
}
});
AlertDialog
mDialog
=
mBuilder
.
create
();
mDialog
.
show
();
}
});
}
public
void
home
(
View
v
){
Intent
home
=
new
Intent
(
this
,
chooseCar
.
class
);
startActivity
(
home
);
...
...
@@ -22,8 +76,30 @@ public class audiPage extends AppCompatActivity {
public
void
toPay
(
View
v
){
Intent
toRefresh
=
new
Intent
(
this
,
audiRefresh
.
class
);
startActivity
(
toRefresh
);
if
(
hours
==
1
){
Intent
toRefresh
=
new
Intent
(
this
,
audiRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
2
){
Intent
toRefresh
=
new
Intent
(
this
,
audiRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
3
){
Intent
toRefresh
=
new
Intent
(
this
,
audiRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
4
){
Intent
toRefresh
=
new
Intent
(
this
,
audiRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
5
){
Intent
toRefresh
=
new
Intent
(
this
,
audiRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
6
){
Intent
toRefresh
=
new
Intent
(
this
,
audiRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
}
}
app/src/main/java/com/example/carrentalsystem/audiPay.java
View file @
7708fb17
...
...
@@ -18,6 +18,13 @@ public class audiPay extends AppCompatActivity {
private
double
totalB4Discount
=
0
;
EditText
a1
;
TextView
finalTV
,
p
;
TextView
carTotal
;
int
carTotalSum
,
hoursPay
;
boolean
chk
;
double
change
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -26,18 +33,32 @@ public class audiPay extends AppCompatActivity {
Intent
intent
=
getIntent
();
double
itemTotal
=
intent
.
getDoubleExtra
(
"ITEM_TOTAL"
,
0.00
);
hoursPay
=
intent
.
getIntExtra
(
"hoursRefresh"
,
0
);
carTotal
=
findViewById
(
R
.
id
.
carTotal
);
carTotalSum
=
8
*
hoursPay
;
carTotal
.
setText
(
carTotalSum
+
""
);
TextView
itemTotalViewText
=
findViewById
(
R
.
id
.
itemTotal
);
itemTotalViewText
.
setText
(
Double
.
toString
(
itemTotal
));
double
totalB4Discount
=
itemTotal
+
8
;
double
totalB4Discount
=
itemTotal
+
carTotalSum
;
TextView
sum
=
findViewById
(
R
.
id
.
totalTotal
);
sum
.
setText
(
Double
.
toString
(
totalB4Discount
));
final
TextView
finalTV
=
(
TextView
)
findViewById
(
R
.
id
.
total
);
p
=
(
TextView
)
findViewById
(
R
.
id
.
p
);
p
.
setVisibility
(
View
.
GONE
);
finalTV
=
(
TextView
)
findViewById
(
R
.
id
.
total
);
finalTV
.
setVisibility
(
View
.
GONE
);
chk
=
false
;
final
Random
myRandom
=
new
Random
();
final
Button
btnGenerate
=
(
Button
)
findViewById
(
R
.
id
.
generate
);
...
...
@@ -50,6 +71,8 @@ public class audiPay extends AppCompatActivity {
Toast
.
makeText
(
audiPay
.
this
,
"Your discount: "
+
dis
+
"%"
,
Toast
.
LENGTH_SHORT
).
show
();
btnGenerate
.
setVisibility
(
View
.
GONE
);
finalTV
.
setVisibility
(
View
.
VISIBLE
);
p
.
setVisibility
(
View
.
VISIBLE
);
chk
=
true
;
}
});
...
...
@@ -62,42 +85,51 @@ public class audiPay extends AppCompatActivity {
a1
=
(
EditText
)
findViewById
(
R
.
id
.
userAmount
);
/*
Button
payBtn
=
(
Button
)
findViewById
(
R
.
id
.
payBtn
);
payBtn
.
setOnClickListener
(
new
View
.
OnClickListener
(){
@Override
public
void
onClick
(
View
v
){
String t1 = a1.getText().toString();
double change = 0.0;
double d1 = Double.parseDouble(a1.getText().toString());
if(t1.equals("")){
Toast.makeText(audiPay.this, "Enter amount", Toast.LENGTH_SHORT).show();
} else if(d1<finalTotal){
Toast.makeText(audiPay.this, "You must enter more than the amount!", Toast.LENGTH_SHORT).show();
}else if(d1>finalTotal){
change = d1 - finalTotal;
Intent intent = new Intent(audiPay.this, audiReceipt.class);
intent.putExtra("CHANGE", change);
intent.putExtra("TOTAL", finalTotal);
startActivity(intent);
String
value
=
a1
.
getText
().
toString
();
if
(
chk
==
true
){
if
(
value
.
equals
(
""
)){
Toast
.
makeText
(
audiPay
.
this
,
"Empty"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
Double
finalVal
=
Double
.
parseDouble
(
value
);
if
(
finalVal
==
0
)
{
Toast
.
makeText
(
audiPay
.
this
,
"Enter Correct Amount!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
if
(
finalVal
<
finalTotal
){
Toast
.
makeText
(
audiPay
.
this
,
"Enter Correct Amount!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
if
(
finalVal
==
finalTotal
){
Toast
.
makeText
(
audiPay
.
this
,
"You have paid: "
+
finalVal
,
Toast
.
LENGTH_SHORT
).
show
();
change
=
0.0
;
Intent
receiptEqual
=
new
Intent
(
audiPay
.
this
,
audiReceipt
.
class
);
receiptEqual
.
putExtra
(
"payed"
,
finalVal
);
receiptEqual
.
putExtra
(
"owed"
,
finalTotal
);
receiptEqual
.
putExtra
(
"change"
,
change
);
startActivity
(
receiptEqual
);
}
else
if
(
finalVal
>
finalTotal
){
Toast
.
makeText
(
audiPay
.
this
,
"You have paid: "
+
finalVal
,
Toast
.
LENGTH_SHORT
).
show
();
change
=
finalVal
-
finalTotal
;
Intent
receiptMore
=
new
Intent
(
audiPay
.
this
,
audiReceipt
.
class
);
receiptMore
.
putExtra
(
"payed"
,
finalVal
);
receiptMore
.
putExtra
(
"owed"
,
finalTotal
);
receiptMore
.
putExtra
(
"change"
,
change
);
startActivity
(
receiptMore
);
}
}
}
else
{
Toast
.
makeText
(
audiPay
.
this
,
"Click Discount Button!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
Toast.makeText(audiPay.this, "test", Toast.LENGTH_SHORT).show();
}
});
*/
}
...
...
app/src/main/java/com/example/carrentalsystem/audiReceipt.java
View file @
7708fb17
...
...
@@ -5,9 +5,15 @@ import androidx.appcompat.app.AppCompatActivity;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.math.RoundingMode
;
import
java.text.DecimalFormat
;
public
class
audiReceipt
extends
AppCompatActivity
{
double
change
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -16,9 +22,11 @@ public class audiReceipt extends AppCompatActivity {
TextView
changeTV
=
(
TextView
)
findViewById
(
R
.
id
.
changeView
);
Intent
i
=
getIntent
();
String
change
=
(
String
)
i
.
getSerializableExtra
(
"CHANGE"
);
change
=
(
Double
)
i
.
getSerializableExtra
(
"change"
);
String
changeString
=
String
.
valueOf
(
change
);
changeTV
.
setText
(
changeString
);
changeTV
.
setText
(
"Change: "
+
change
);
...
...
app/src/main/java/com/example/carrentalsystem/audiRefresh.java
View file @
7708fb17
...
...
@@ -26,12 +26,24 @@ public class audiRefresh extends AppCompatActivity {
private
TextView
totalItems
;
public
double
itemTotalTravel
=
0
;
int
hoursRefresh
;
TextView
tvhours
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_audi_refresh
);
Intent
fromPay
=
getIntent
();
hoursRefresh
=
fromPay
.
getIntExtra
(
"hours"
,
0
);
tvhours
=
findViewById
(
R
.
id
.
tvhours
);
tvhours
.
setText
(
"Hours: "
+
hoursRefresh
);
item1
=
(
EditText
)
findViewById
(
R
.
id
.
editText
);
item2
=
(
EditText
)
findViewById
(
R
.
id
.
editText2
);
...
...
@@ -100,9 +112,10 @@ public class audiRefresh extends AppCompatActivity {
Toast
.
makeText
(
getApplicationContext
(),
"Choice Cancelled"
,
Toast
.
LENGTH_SHORT
).
show
();
}
public
void
toPay
(
View
v
){
Intent
homeBtn
=
new
Intent
(
this
,
audiPay
.
class
);
homeBtn
.
putExtra
(
"ITEM_TOTAL"
,
itemTotalTravel
);
startActivity
(
homeBtn
);
Intent
toPaybtn
=
new
Intent
(
this
,
audiPay
.
class
);
toPaybtn
.
putExtra
(
"ITEM_TOTAL"
,
itemTotalTravel
);
toPaybtn
.
putExtra
(
"hoursRefresh"
,
hoursRefresh
);
startActivity
(
toPaybtn
);
}
...
...
app/src/main/java/com/example/carrentalsystem/hondaPage.java
View file @
7708fb17
package
com
.
example
.
carrentalsystem
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.Toast
;
public
class
hondaPage
extends
AppCompatActivity
{
Button
mBtn
,
pay
;
String
[]
listItems
;
TextView
mTextView
;
int
hours
=
0
;
Boolean
chkhours
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_honda_page
);
chkhours
=
false
;
mBtn
=
findViewById
(
R
.
id
.
hourBtn
);
mTextView
=
findViewById
(
R
.
id
.
tvDisplayChoice
);
pay
=
findViewById
(
R
.
id
.
pay
);
pay
.
setVisibility
(
View
.
GONE
);
mBtn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
listItems
=
new
String
[]{
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
};
AlertDialog
.
Builder
mBuilder
=
new
AlertDialog
.
Builder
(
hondaPage
.
this
);
mBuilder
.
setTitle
(
"How many hours?"
);
mBuilder
.
setSingleChoiceItems
(
listItems
,
-
1
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
i
)
{
mTextView
.
setText
(
listItems
[
i
]);
dialog
.
dismiss
();
chkhours
=
true
;
pay
.
setVisibility
(
View
.
VISIBLE
);
hours
=
Integer
.
valueOf
(
mTextView
.
getText
().
toString
());
Toast
.
makeText
(
hondaPage
.
this
,
""
+
hours
,
Toast
.
LENGTH_SHORT
).
show
();
}
});
mBuilder
.
setNeutralButton
(
"Cancel"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
i
)
{
}
});
AlertDialog
mDialog
=
mBuilder
.
create
();
mDialog
.
show
();
}
});
}
public
void
home
(
View
v
){
Intent
home
=
new
Intent
(
this
,
chooseCar
.
class
);
...
...
@@ -22,8 +70,31 @@ public class hondaPage extends AppCompatActivity {
public
void
toPay
(
View
v
){
Intent
toRefresh
=
new
Intent
(
this
,
hondaRefresh
.
class
);
startActivity
(
toRefresh
);
if
(
hours
==
1
){
Intent
toRefresh
=
new
Intent
(
this
,
hondaRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
2
){
Intent
toRefresh
=
new
Intent
(
this
,
hondaRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
3
){
Intent
toRefresh
=
new
Intent
(
this
,
hondaRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
4
){
Intent
toRefresh
=
new
Intent
(
this
,
hondaRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
5
){
Intent
toRefresh
=
new
Intent
(
this
,
hondaRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
6
){
Intent
toRefresh
=
new
Intent
(
this
,
hondaRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
}
}
app/src/main/java/com/example/carrentalsystem/hondaPay.java
View file @
7708fb17
...
...
@@ -16,6 +16,12 @@ public class hondaPay extends AppCompatActivity {
private
double
totalB4Discount
=
0
;
EditText
a1
;
TextView
p
;
boolean
chk
;
double
change
;
TextView
carTotal
;
int
carTotalSum
,
hoursPay
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -27,15 +33,26 @@ public class hondaPay extends AppCompatActivity {
TextView
itemTotalViewText
=
findViewById
(
R
.
id
.
itemTotal
);
itemTotalViewText
.
setText
(
Double
.
toString
(
itemTotal
));
double
totalB4Discount
=
itemTotal
+
9
;
hoursPay
=
intent
.
getIntExtra
(
"hoursRefresh"
,
0
);
carTotal
=
findViewById
(
R
.
id
.
carTotal
);
carTotalSum
=
9
*
hoursPay
;
carTotal
.
setText
(
carTotalSum
+
""
);
double
totalB4Discount
=
itemTotal
+
carTotalSum
;
TextView
sum
=
findViewById
(
R
.
id
.
totalTotal
);
sum
.
setText
(
Double
.
toString
(
totalB4Discount
));
p
=
(
TextView
)
findViewById
(
R
.
id
.
p
);
p
.
setVisibility
(
View
.
GONE
);
final
TextView
finalTV
=
(
TextView
)
findViewById
(
R
.
id
.
total
);
finalTV
.
setVisibility
(
View
.
GONE
);
chk
=
false
;
final
Random
myRandom
=
new
Random
();
final
Button
btnGenerate
=
(
Button
)
findViewById
(
R
.
id
.
generate
);
...
...
@@ -47,7 +64,9 @@ public class hondaPay extends AppCompatActivity {
Toast
.
makeText
(
hondaPay
.
this
,
"Your discount: "
+
dis
+
"%"
,
Toast
.
LENGTH_SHORT
).
show
();
btnGenerate
.
setVisibility
(
View
.
GONE
);
chk
=
true
;
finalTV
.
setVisibility
(
View
.
VISIBLE
);
p
.
setVisibility
(
View
.
VISIBLE
);
}
});
...
...
@@ -60,42 +79,48 @@ public class hondaPay extends AppCompatActivity {
a1
=
(
EditText
)
findViewById
(
R
.
id
.
userAmount
);
/*
Button
payBtn
=
(
Button
)
findViewById
(
R
.
id
.
payBtn
);
payBtn
.
setOnClickListener
(
new
View
.
OnClickListener
(){
@Override
public
void
onClick
(
View
v
){
String t1 = a1.getText().toString();
double change = 0.0;
double d1 = Double.parseDouble(a1.getText().toString());
if(t1.equals("")){
Toast.makeText(audiPay.this, "Enter amount", Toast.LENGTH_SHORT).show();
} else if(d1<finalTotal){
Toast.makeText(audiPay.this, "You must enter more than the amount!", Toast.LENGTH_SHORT).show();
}else if(d1>finalTotal){
change = d1 - finalTotal;
Intent intent = new Intent(audiPay.this, audiReceipt.class);
intent.putExtra("CHANGE", change);
intent.putExtra("TOTAL", finalTotal);
startActivity(intent);
String
value
=
a1
.
getText
().
toString
();
if
(
chk
==
true
){
if
(
value
.
equals
(
""
)){
Toast
.
makeText
(
hondaPay
.
this
,
"Empty"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
Double
finalVal
=
Double
.
parseDouble
(
value
);
if
(
finalVal
==
0
)
{
Toast
.
makeText
(
hondaPay
.
this
,
"Enter Correct Amount!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
if
(
finalVal
<
finalTotal
){
Toast
.
makeText
(
hondaPay
.
this
,
"Enter Correct Amount!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
if
(
finalVal
==
finalTotal
){
Toast
.
makeText
(
hondaPay
.
this
,
"You have paid: "
+
finalVal
,
Toast
.
LENGTH_SHORT
).
show
();
change
=
0.0
;
Intent
receiptEqual
=
new
Intent
(
hondaPay
.
this
,
hondaReceipt
.
class
);
receiptEqual
.
putExtra
(
"payed"
,
finalVal
);
receiptEqual
.
putExtra
(
"owed"
,
finalTotal
);
receiptEqual
.
putExtra
(
"change"
,
change
);
startActivity
(
receiptEqual
);
}
else
if
(
finalVal
>
finalTotal
){
Toast
.
makeText
(
hondaPay
.
this
,
"You have paid: "
+
finalVal
,
Toast
.
LENGTH_SHORT
).
show
();
change
=
finalVal
-
finalTotal
;
Intent
receiptMore
=
new
Intent
(
hondaPay
.
this
,
hondaReceipt
.
class
);
receiptMore
.
putExtra
(
"payed"
,
finalVal
);
receiptMore
.
putExtra
(
"owed"
,
finalTotal
);
receiptMore
.
putExtra
(
"change"
,
change
);
startActivity
(
receiptMore
);
}
}
}
else
{
Toast
.
makeText
(
hondaPay
.
this
,
"Click Discount Button!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
Toast.makeText(audiPay.this, "test", Toast.LENGTH_SHORT).show();
}
});
*/
}
...
...
app/src/main/java/com/example/carrentalsystem/hondaReceipt.java
0 → 100644
View file @
7708fb17
package
com
.
example
.
carrentalsystem
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.math.RoundingMode
;
import
java.text.DecimalFormat
;
public
class
hondaReceipt
extends
AppCompatActivity
{
double
change
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_audi_receipt
);
TextView
changeTV
=
(
TextView
)
findViewById
(
R
.
id
.
changeView
);
Intent
i
=
getIntent
();
change
=
(
Double
)
i
.
getSerializableExtra
(
"change"
);
String
changeString
=
String
.
valueOf
(
change
);
changeTV
.
setText
(
changeString
);
}
}
app/src/main/java/com/example/carrentalsystem/hondaRefresh.java
View file @
7708fb17
...
...
@@ -24,12 +24,20 @@ public class hondaRefresh extends AppCompatActivity {
private
TextView
totalItems
;
public
double
itemTotalTravel
=
0
;
int
hoursRefresh
;
TextView
tvhours
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_honda_refresh
);
Intent
fromPay
=
getIntent
();
hoursRefresh
=
fromPay
.
getIntExtra
(
"hours"
,
0
);
tvhours
=
findViewById
(
R
.
id
.
tvhours
);
tvhours
.
setText
(
"Hours: "
+
hoursRefresh
);
item1
=
(
EditText
)
findViewById
(
R
.
id
.
editText
);
item2
=
(
EditText
)
findViewById
(
R
.
id
.
editText2
);
...
...
@@ -100,6 +108,7 @@ public class hondaRefresh extends AppCompatActivity {
public
void
toPay
(
View
v
){
Intent
homeBtn
=
new
Intent
(
this
,
hondaPay
.
class
);
homeBtn
.
putExtra
(
"ITEM_TOTAL"
,
itemTotalTravel
);
homeBtn
.
putExtra
(
"hoursRefresh"
,
hoursRefresh
);
startActivity
(
homeBtn
);
}
...
...
app/src/main/java/com/example/carrentalsystem/jaguarPage.java
View file @
7708fb17
package
com
.
example
.
carrentalsystem
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.Toast
;
public
class
jaguarPage
extends
AppCompatActivity
{
Button
mBtn
,
pay
;
String
[]
listItems
;
TextView
mTextView
;
int
hours
=
0
;
Boolean
chkhours
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_jaguar_page
);
chkhours
=
false
;
mBtn
=
findViewById
(
R
.
id
.
hourBtn
);
mTextView
=
findViewById
(
R
.
id
.
tvDisplayChoice
);
pay
=
findViewById
(
R
.
id
.
pay
);
pay
.
setVisibility
(
View
.
GONE
);
mBtn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
listItems
=
new
String
[]{
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
};
AlertDialog
.
Builder
mBuilder
=
new
AlertDialog
.
Builder
(
jaguarPage
.
this
);
mBuilder
.
setTitle
(
"How many hours?"
);
mBuilder
.
setSingleChoiceItems
(
listItems
,
-
1
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
i
)
{
mTextView
.
setText
(
listItems
[
i
]);
dialog
.
dismiss
();
chkhours
=
true
;
pay
.
setVisibility
(
View
.
VISIBLE
);
hours
=
Integer
.
valueOf
(
mTextView
.
getText
().
toString
());
}
});
mBuilder
.
setNeutralButton
(
"Cancel"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
i
)
{
}
});
AlertDialog
mDialog
=
mBuilder
.
create
();
mDialog
.
show
();
}
});
}
public
void
home
(
View
v
){
Intent
home
=
new
Intent
(
this
,
chooseCar
.
class
);
...
...
@@ -21,8 +69,31 @@ public class jaguarPage extends AppCompatActivity {
}
public
void
toPay
(
View
v
){
Intent
toRefresh
=
new
Intent
(
this
,
jaguarRefresh
.
class
);
startActivity
(
toRefresh
);
if
(
hours
==
1
){
Intent
toRefresh
=
new
Intent
(
this
,
jaguarRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
2
){
Intent
toRefresh
=
new
Intent
(
this
,
jaguarRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
3
){
Intent
toRefresh
=
new
Intent
(
this
,
jaguarRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
4
){
Intent
toRefresh
=
new
Intent
(
this
,
jaguarRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
5
){
Intent
toRefresh
=
new
Intent
(
this
,
jaguarRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
6
){
Intent
toRefresh
=
new
Intent
(
this
,
jaguarRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
}
}
app/src/main/java/com/example/carrentalsystem/jaguarPay.java
View file @
7708fb17
...
...
@@ -16,6 +16,12 @@ public class jaguarPay extends AppCompatActivity {
private
double
totalB4Discount
=
0
;
EditText
a1
;
TextView
p
;
boolean
chk
;
double
change
;
TextView
carTotal
;
int
carTotalSum
,
hoursPay
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -27,12 +33,22 @@ public class jaguarPay extends AppCompatActivity {
TextView
itemTotalViewText
=
findViewById
(
R
.
id
.
itemTotal
);
itemTotalViewText
.
setText
(
Double
.
toString
(
itemTotal
));
double
totalB4Discount
=
itemTotal
+
10
;
hoursPay
=
intent
.
getIntExtra
(
"hoursRefresh"
,
0
);
carTotal
=
findViewById
(
R
.
id
.
carTotal
);
carTotalSum
=
10
*
hoursPay
;
carTotal
.
setText
(
carTotalSum
+
""
);
double
totalB4Discount
=
itemTotal
+
carTotalSum
;
chk
=
false
;
TextView
sum
=
findViewById
(
R
.
id
.
totalTotal
);
sum
.
setText
(
Double
.
toString
(
totalB4Discount
));
p
=
(
TextView
)
findViewById
(
R
.
id
.
p
);
p
.
setVisibility
(
View
.
GONE
);
final
TextView
finalTV
=
(
TextView
)
findViewById
(
R
.
id
.
total
);
finalTV
.
setVisibility
(
View
.
GONE
);
...
...
@@ -48,6 +64,8 @@ public class jaguarPay extends AppCompatActivity {
Toast
.
makeText
(
jaguarPay
.
this
,
"Your discount: "
+
dis
+
"%"
,
Toast
.
LENGTH_SHORT
).
show
();
btnGenerate
.
setVisibility
(
View
.
GONE
);
finalTV
.
setVisibility
(
View
.
VISIBLE
);
p
.
setVisibility
(
View
.
VISIBLE
);
chk
=
true
;
}
});
...
...
@@ -60,42 +78,48 @@ public class jaguarPay extends AppCompatActivity {
a1
=
(
EditText
)
findViewById
(
R
.
id
.
userAmount
);
/*
Button
payBtn
=
(
Button
)
findViewById
(
R
.
id
.
payBtn
);
payBtn
.
setOnClickListener
(
new
View
.
OnClickListener
(){
@Override
public
void
onClick
(
View
v
){
String t1 = a1.getText().toString();
double change = 0.0;
double d1 = Double.parseDouble(a1.getText().toString());
if(t1.equals("")){
Toast.makeText(audiPay.this, "Enter amount", Toast.LENGTH_SHORT).show();
} else if(d1<finalTotal){
Toast.makeText(audiPay.this, "You must enter more than the amount!", Toast.LENGTH_SHORT).show();
}else if(d1>finalTotal){
change = d1 - finalTotal;
Intent intent = new Intent(audiPay.this, audiReceipt.class);
intent.putExtra("CHANGE", change);
intent.putExtra("TOTAL", finalTotal);
startActivity(intent);
String
value
=
a1
.
getText
().
toString
();
if
(
chk
==
true
){
if
(
value
.
equals
(
""
)){
Toast
.
makeText
(
jaguarPay
.
this
,
"Empty"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
Double
finalVal
=
Double
.
parseDouble
(
value
);
if
(
finalVal
==
0
)
{
Toast
.
makeText
(
jaguarPay
.
this
,
"Enter Correct Amount!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
if
(
finalVal
<
finalTotal
){
Toast
.
makeText
(
jaguarPay
.
this
,
"Enter Correct Amount!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
if
(
finalVal
==
finalTotal
){
Toast
.
makeText
(
jaguarPay
.
this
,
"You have paid: "
+
finalVal
,
Toast
.
LENGTH_SHORT
).
show
();
change
=
0.0
;
Intent
receiptEqual
=
new
Intent
(
jaguarPay
.
this
,
jaguarReceipt
.
class
);
receiptEqual
.
putExtra
(
"payed"
,
finalVal
);
receiptEqual
.
putExtra
(
"owed"
,
finalTotal
);
receiptEqual
.
putExtra
(
"change"
,
change
);
startActivity
(
receiptEqual
);
}
else
if
(
finalVal
>
finalTotal
){
Toast
.
makeText
(
jaguarPay
.
this
,
"You have paid: "
+
finalVal
,
Toast
.
LENGTH_SHORT
).
show
();
change
=
finalVal
-
finalTotal
;
Intent
receiptMore
=
new
Intent
(
jaguarPay
.
this
,
jaguarReceipt
.
class
);
receiptMore
.
putExtra
(
"payed"
,
finalVal
);
receiptMore
.
putExtra
(
"owed"
,
finalTotal
);
receiptMore
.
putExtra
(
"change"
,
change
);
startActivity
(
receiptMore
);
}
}
}
else
{
Toast
.
makeText
(
jaguarPay
.
this
,
"Click Discount Button!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
Toast.makeText(audiPay.this, "test", Toast.LENGTH_SHORT).show();
}
});
*/
}
...
...
app/src/main/java/com/example/carrentalsystem/jaguarReceipt.java
0 → 100644
View file @
7708fb17
package
com
.
example
.
carrentalsystem
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.math.RoundingMode
;
import
java.text.DecimalFormat
;
public
class
jaguarReceipt
extends
AppCompatActivity
{
double
changeInfo
,
d
,
change
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_audi_receipt
);
TextView
changeTV
=
(
TextView
)
findViewById
(
R
.
id
.
changeView
);
Intent
i
=
getIntent
();
change
=
(
Double
)
i
.
getSerializableExtra
(
"change"
);
String
changeString
=
String
.
valueOf
(
change
);
changeTV
.
setText
(
changeString
);
}
}
\ No newline at end of file
app/src/main/java/com/example/carrentalsystem/jaguarRefresh.java
View file @
7708fb17
...
...
@@ -24,12 +24,21 @@ public class jaguarRefresh extends AppCompatActivity {
private
TextView
totalItems
;
public
double
itemTotalTravel
=
0
;
int
hoursRefresh
;
TextView
tvhours
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_jaguar_refresh
);
Intent
fromPay
=
getIntent
();
hoursRefresh
=
fromPay
.
getIntExtra
(
"hours"
,
0
);
tvhours
=
findViewById
(
R
.
id
.
tvhours
);
tvhours
.
setText
(
"Hours: "
+
hoursRefresh
);
item1
=
(
EditText
)
findViewById
(
R
.
id
.
editText
);
item2
=
(
EditText
)
findViewById
(
R
.
id
.
editText2
);
item3
=
(
EditText
)
findViewById
(
R
.
id
.
editText3
);
...
...
@@ -99,6 +108,7 @@ public class jaguarRefresh extends AppCompatActivity {
public
void
toPay
(
View
v
){
Intent
homeBtn
=
new
Intent
(
this
,
jaguarPay
.
class
);
homeBtn
.
putExtra
(
"ITEM_TOTAL"
,
itemTotalTravel
);
homeBtn
.
putExtra
(
"hoursRefresh"
,
hoursRefresh
);
startActivity
(
homeBtn
);
}
...
...
app/src/main/java/com/example/carrentalsystem/mercPage.java
View file @
7708fb17
package
com
.
example
.
carrentalsystem
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.Toast
;
public
class
mercPage
extends
AppCompatActivity
{
Button
mBtn
,
pay
;
String
[]
listItems
;
TextView
mTextView
;
int
hours
=
0
;
Boolean
chkhours
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_merc_page
);
chkhours
=
false
;
mBtn
=
findViewById
(
R
.
id
.
hourBtn
);
mTextView
=
findViewById
(
R
.
id
.
tvDisplayChoice
);
pay
=
findViewById
(
R
.
id
.
pay
);
pay
.
setVisibility
(
View
.
GONE
);
mBtn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
listItems
=
new
String
[]{
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
};
AlertDialog
.
Builder
mBuilder
=
new
AlertDialog
.
Builder
(
mercPage
.
this
);
mBuilder
.
setTitle
(
"How many hours?"
);
mBuilder
.
setSingleChoiceItems
(
listItems
,
-
1
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
i
)
{
mTextView
.
setText
(
listItems
[
i
]);
dialog
.
dismiss
();
chkhours
=
true
;
pay
.
setVisibility
(
View
.
VISIBLE
);
hours
=
Integer
.
valueOf
(
mTextView
.
getText
().
toString
());
}
});
mBuilder
.
setNeutralButton
(
"Cancel"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
i
)
{
}
});
AlertDialog
mDialog
=
mBuilder
.
create
();
mDialog
.
show
();
}
});
}
public
void
home
(
View
v
){
Intent
home
=
new
Intent
(
this
,
chooseCar
.
class
);
...
...
@@ -22,8 +69,31 @@ public class mercPage extends AppCompatActivity {
public
void
toPay
(
View
v
){
Intent
toRefresh
=
new
Intent
(
this
,
mercRefresh
.
class
);
startActivity
(
toRefresh
);
if
(
hours
==
1
){
Intent
toRefresh
=
new
Intent
(
this
,
mercRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
2
){
Intent
toRefresh
=
new
Intent
(
this
,
mercRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
3
){
Intent
toRefresh
=
new
Intent
(
this
,
mercRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
4
){
Intent
toRefresh
=
new
Intent
(
this
,
mercRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
5
){
Intent
toRefresh
=
new
Intent
(
this
,
mercRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
6
){
Intent
toRefresh
=
new
Intent
(
this
,
mercRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
}
...
...
app/src/main/java/com/example/carrentalsystem/mercPay.java
View file @
7708fb17
...
...
@@ -16,7 +16,12 @@ public class mercPay extends AppCompatActivity {
private
double
totalB4Discount
=
0
;
EditText
a1
;
TextView
p
;
boolean
chk
;
double
change
;
TextView
carTotal
;
int
carTotalSum
,
hoursPay
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
...
...
@@ -28,15 +33,24 @@ public class mercPay extends AppCompatActivity {
TextView
itemTotalViewText
=
findViewById
(
R
.
id
.
itemTotal
);
itemTotalViewText
.
setText
(
Double
.
toString
(
itemTotal
));
double
totalB4Discount
=
itemTotal
+
11
;
hoursPay
=
intent
.
getIntExtra
(
"hoursRefresh"
,
0
);
carTotal
=
findViewById
(
R
.
id
.
carTotal
);
carTotalSum
=
11
*
hoursPay
;
carTotal
.
setText
(
carTotalSum
+
""
);
double
totalB4Discount
=
itemTotal
+
carTotalSum
;
TextView
sum
=
findViewById
(
R
.
id
.
totalTotal
);
sum
.
setText
(
Double
.
toString
(
totalB4Discount
));
p
=
(
TextView
)
findViewById
(
R
.
id
.
p
);
p
.
setVisibility
(
View
.
GONE
);
final
TextView
finalTV
=
(
TextView
)
findViewById
(
R
.
id
.
total
);
finalTV
.
setVisibility
(
View
.
GONE
);
chk
=
false
;
final
Random
myRandom
=
new
Random
();
final
Button
btnGenerate
=
(
Button
)
findViewById
(
R
.
id
.
generate
);
...
...
@@ -49,6 +63,8 @@ public class mercPay extends AppCompatActivity {
Toast
.
makeText
(
mercPay
.
this
,
"Your discount: "
+
dis
+
"%"
,
Toast
.
LENGTH_SHORT
).
show
();
btnGenerate
.
setVisibility
(
View
.
GONE
);
finalTV
.
setVisibility
(
View
.
VISIBLE
);
p
.
setVisibility
(
View
.
VISIBLE
);
chk
=
true
;
}
});
...
...
@@ -61,42 +77,48 @@ public class mercPay extends AppCompatActivity {
a1
=
(
EditText
)
findViewById
(
R
.
id
.
userAmount
);
/*
Button
payBtn
=
(
Button
)
findViewById
(
R
.
id
.
payBtn
);
payBtn
.
setOnClickListener
(
new
View
.
OnClickListener
(){
@Override
public
void
onClick
(
View
v
){
String t1 = a1.getText().toString();
double change = 0.0;
double d1 = Double.parseDouble(a1.getText().toString());
if(t1.equals("")){
Toast.makeText(audiPay.this, "Enter amount", Toast.LENGTH_SHORT).show();
} else if(d1<finalTotal){
Toast.makeText(audiPay.this, "You must enter more than the amount!", Toast.LENGTH_SHORT).show();
}else if(d1>finalTotal){
change = d1 - finalTotal;
Intent intent = new Intent(audiPay.this, audiReceipt.class);
intent.putExtra("CHANGE", change);
intent.putExtra("TOTAL", finalTotal);
startActivity(intent);
String
value
=
a1
.
getText
().
toString
();
if
(
chk
==
true
){
if
(
value
.
equals
(
""
)){
Toast
.
makeText
(
mercPay
.
this
,
"Empty"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
Double
finalVal
=
Double
.
parseDouble
(
value
);
if
(
finalVal
==
0
)
{
Toast
.
makeText
(
mercPay
.
this
,
"Enter Correct Amount!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
if
(
finalVal
<
finalTotal
){
Toast
.
makeText
(
mercPay
.
this
,
"Enter Correct Amount!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
if
(
finalVal
==
finalTotal
){
Toast
.
makeText
(
mercPay
.
this
,
"You have paid: "
+
finalVal
,
Toast
.
LENGTH_SHORT
).
show
();
change
=
0.0
;
Intent
receiptEqual
=
new
Intent
(
mercPay
.
this
,
mercReceipt
.
class
);
receiptEqual
.
putExtra
(
"payed"
,
finalVal
);
receiptEqual
.
putExtra
(
"owed"
,
finalTotal
);
receiptEqual
.
putExtra
(
"change"
,
change
);
startActivity
(
receiptEqual
);
}
else
if
(
finalVal
>
finalTotal
){
Toast
.
makeText
(
mercPay
.
this
,
"You have paid: "
+
finalVal
,
Toast
.
LENGTH_SHORT
).
show
();
change
=
finalVal
-
finalTotal
;
Intent
receiptMore
=
new
Intent
(
mercPay
.
this
,
mercReceipt
.
class
);
receiptMore
.
putExtra
(
"payed"
,
finalVal
);
receiptMore
.
putExtra
(
"owed"
,
finalTotal
);
receiptMore
.
putExtra
(
"change"
,
change
);
startActivity
(
receiptMore
);
}
}
}
else
{
Toast
.
makeText
(
mercPay
.
this
,
"Click Discount Button!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
Toast.makeText(audiPay.this, "test", Toast.LENGTH_SHORT).show();
}
});
*/
}
...
...
app/src/main/java/com/example/carrentalsystem/mercReceipt.java
0 → 100644
View file @
7708fb17
package
com
.
example
.
carrentalsystem
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.math.RoundingMode
;
import
java.text.DecimalFormat
;
public
class
mercReceipt
extends
AppCompatActivity
{
double
change
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_audi_receipt
);
TextView
changeTV
=
(
TextView
)
findViewById
(
R
.
id
.
changeView
);
Intent
i
=
getIntent
();
change
=
(
Double
)
i
.
getSerializableExtra
(
"change"
);
String
changeString
=
String
.
valueOf
(
change
);
changeTV
.
setText
(
changeString
);
}
}
\ No newline at end of file
app/src/main/java/com/example/carrentalsystem/mercRefresh.java
View file @
7708fb17
...
...
@@ -25,12 +25,21 @@ public class mercRefresh extends AppCompatActivity {
private
TextView
totalItems
;
public
double
itemTotalTravel
=
0
;
int
hoursRefresh
;
TextView
tvhours
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_merc_refresh
);
Intent
fromPay
=
getIntent
();
hoursRefresh
=
fromPay
.
getIntExtra
(
"hours"
,
0
);
tvhours
=
findViewById
(
R
.
id
.
tvhours
);
tvhours
.
setText
(
"Hours: "
+
hoursRefresh
);
item1
=
(
EditText
)
findViewById
(
R
.
id
.
editText
);
item2
=
(
EditText
)
findViewById
(
R
.
id
.
editText2
);
item3
=
(
EditText
)
findViewById
(
R
.
id
.
editText3
);
...
...
@@ -100,6 +109,7 @@ public class mercRefresh extends AppCompatActivity {
public
void
toPay
(
View
v
){
Intent
homeBtn
=
new
Intent
(
this
,
mercPay
.
class
);
homeBtn
.
putExtra
(
"ITEM_TOTAL"
,
itemTotalTravel
);
homeBtn
.
putExtra
(
"hoursRefresh"
,
hoursRefresh
);
startActivity
(
homeBtn
);
}
...
...
app/src/main/java/com/example/carrentalsystem/registerPage.java
View file @
7708fb17
...
...
@@ -14,7 +14,7 @@ public class registerPage extends AppCompatActivity {
DatabaseHelper
db
;
EditText
e1
,
e2
,
e3
;
Button
b1
,
b2
;
Button
b1
;
...
...
@@ -28,7 +28,6 @@ public class registerPage extends AppCompatActivity {
e2
=(
EditText
)
findViewById
(
R
.
id
.
createPass
);
e3
=(
EditText
)
findViewById
(
R
.
id
.
confirmPass
);
b1
=(
Button
)
findViewById
(
R
.
id
.
finalLoginButton
);
// b2=(Button)findViewById(R.id.button2);
b1
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
...
...
@@ -49,11 +48,8 @@ public class registerPage extends AppCompatActivity {
Intent
goToLogin
=
new
Intent
(
registerPage
.
this
,
loginPage
.
class
);
startActivity
(
goToLogin
);
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
"
Nope
"
,
Toast
.
LENGTH_SHORT
).
show
();
Toast
.
makeText
(
getApplicationContext
(),
"
Error
"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
else
{
Toast
.
makeText
(
getApplicationContext
(),
"Username Already exists"
,
Toast
.
LENGTH_SHORT
).
show
();
...
...
app/src/main/java/com/example/carrentalsystem/toyotaPage.java
View file @
7708fb17
package
com
.
example
.
carrentalsystem
;
import
androidx.appcompat.app.AlertDialog
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.Toast
;
public
class
toyotaPage
extends
AppCompatActivity
{
Button
mBtn
,
pay
;
String
[]
listItems
;
TextView
mTextView
;
int
hours
=
0
;
Boolean
chkhours
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_toyota_page
);
chkhours
=
false
;
mBtn
=
findViewById
(
R
.
id
.
hourBtn
);
mTextView
=
findViewById
(
R
.
id
.
tvDisplayChoice
);
pay
=
findViewById
(
R
.
id
.
pay
);
pay
.
setVisibility
(
View
.
GONE
);
mBtn
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
listItems
=
new
String
[]{
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
};
AlertDialog
.
Builder
mBuilder
=
new
AlertDialog
.
Builder
(
toyotaPage
.
this
);
mBuilder
.
setTitle
(
"How many hours?"
);
mBuilder
.
setSingleChoiceItems
(
listItems
,
-
1
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
i
)
{
mTextView
.
setText
(
listItems
[
i
]);
dialog
.
dismiss
();
chkhours
=
true
;
pay
.
setVisibility
(
View
.
VISIBLE
);
hours
=
Integer
.
valueOf
(
mTextView
.
getText
().
toString
());
}
});
mBuilder
.
setNeutralButton
(
"Cancel"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
i
)
{
}
});
AlertDialog
mDialog
=
mBuilder
.
create
();
mDialog
.
show
();
}
});
}
public
void
home
(
View
v
){
Intent
home
=
new
Intent
(
this
,
chooseCar
.
class
);
...
...
@@ -22,8 +67,31 @@ public class toyotaPage extends AppCompatActivity {
public
void
toPay
(
View
v
){
Intent
toRefresh
=
new
Intent
(
this
,
toyotaRefresh
.
class
);
startActivity
(
toRefresh
);
if
(
hours
==
1
){
Intent
toRefresh
=
new
Intent
(
this
,
toyotaRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
2
){
Intent
toRefresh
=
new
Intent
(
this
,
toyotaRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
3
){
Intent
toRefresh
=
new
Intent
(
this
,
toyotaRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
4
){
Intent
toRefresh
=
new
Intent
(
this
,
toyotaRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
5
){
Intent
toRefresh
=
new
Intent
(
this
,
toyotaRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
else
if
(
hours
==
6
){
Intent
toRefresh
=
new
Intent
(
this
,
toyotaRefresh
.
class
);
toRefresh
.
putExtra
(
"hours"
,
hours
);
startActivity
(
toRefresh
);
}
}
}
app/src/main/java/com/example/carrentalsystem/toyotaPay.java
View file @
7708fb17
...
...
@@ -17,6 +17,12 @@ public class toyotaPay extends AppCompatActivity {
private
double
totalB4Discount
=
0
;
EditText
a1
;
TextView
p
;
boolean
chk
;
double
change
;
TextView
carTotal
;
int
carTotalSum
,
hoursPay
;
@Override
...
...
@@ -30,17 +36,25 @@ public class toyotaPay extends AppCompatActivity {
TextView
itemTotalViewText
=
findViewById
(
R
.
id
.
itemTotal
);
itemTotalViewText
.
setText
(
Double
.
toString
(
itemTotal
));
double
totalB4Discount
=
itemTotal
+
7
;
hoursPay
=
intent
.
getIntExtra
(
"hoursRefresh"
,
0
);
carTotal
=
findViewById
(
R
.
id
.
carTotal
);
carTotalSum
=
7
*
hoursPay
;
carTotal
.
setText
(
carTotalSum
+
""
);
double
totalB4Discount
=
itemTotal
+
carTotalSum
;
TextView
sum
=
findViewById
(
R
.
id
.
totalTotal
);
sum
.
setText
(
Double
.
toString
(
totalB4Discount
));
p
=
(
TextView
)
findViewById
(
R
.
id
.
p
);
p
.
setVisibility
(
View
.
GONE
);
final
TextView
finalTV
=
(
TextView
)
findViewById
(
R
.
id
.
total
);
finalTV
.
setVisibility
(
View
.
GONE
);
final
Random
myRandom
=
new
Random
();
chk
=
false
;
final
Button
btnGenerate
=
(
Button
)
findViewById
(
R
.
id
.
generate
);
final
int
dis
=
myRandom
.
nextInt
(
50
)+
1
;
...
...
@@ -51,6 +65,8 @@ public class toyotaPay extends AppCompatActivity {
Toast
.
makeText
(
toyotaPay
.
this
,
"Your discount: "
+
dis
+
"%"
,
Toast
.
LENGTH_SHORT
).
show
();
btnGenerate
.
setVisibility
(
View
.
GONE
);
finalTV
.
setVisibility
(
View
.
VISIBLE
);
p
.
setVisibility
(
View
.
VISIBLE
);
chk
=
true
;
}
});
...
...
@@ -63,42 +79,48 @@ public class toyotaPay extends AppCompatActivity {
a1
=
(
EditText
)
findViewById
(
R
.
id
.
userAmount
);
/*
Button
payBtn
=
(
Button
)
findViewById
(
R
.
id
.
payBtn
);
payBtn
.
setOnClickListener
(
new
View
.
OnClickListener
(){
@Override
public
void
onClick
(
View
v
){
String t1 = a1.getText().toString();
double change = 0.0;
double d1 = Double.parseDouble(a1.getText().toString());
if(t1.equals("")){
Toast.makeText(audiPay.this, "Enter amount", Toast.LENGTH_SHORT).show();
} else if(d1<finalTotal){
Toast.makeText(audiPay.this, "You must enter more than the amount!", Toast.LENGTH_SHORT).show();
}else if(d1>finalTotal){
change = d1 - finalTotal;
Intent intent = new Intent(audiPay.this, audiReceipt.class);
intent.putExtra("CHANGE", change);
intent.putExtra("TOTAL", finalTotal);
startActivity(intent);
String
value
=
a1
.
getText
().
toString
();
if
(
chk
==
true
){
if
(
value
.
equals
(
""
)){
Toast
.
makeText
(
toyotaPay
.
this
,
"Empty"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
{
Double
finalVal
=
Double
.
parseDouble
(
value
);
if
(
finalVal
==
0
)
{
Toast
.
makeText
(
toyotaPay
.
this
,
"Enter Correct Amount!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
if
(
finalVal
<
finalTotal
){
Toast
.
makeText
(
toyotaPay
.
this
,
"Enter Correct Amount!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
else
if
(
finalVal
==
finalTotal
){
Toast
.
makeText
(
toyotaPay
.
this
,
"You have paid: "
+
finalVal
,
Toast
.
LENGTH_SHORT
).
show
();
change
=
0.0
;
Intent
receiptEqual
=
new
Intent
(
toyotaPay
.
this
,
toyotaReceipt
.
class
);
receiptEqual
.
putExtra
(
"payed"
,
finalVal
);
receiptEqual
.
putExtra
(
"owed"
,
finalTotal
);
receiptEqual
.
putExtra
(
"change"
,
change
);
startActivity
(
receiptEqual
);
}
else
if
(
finalVal
>
finalTotal
){
Toast
.
makeText
(
toyotaPay
.
this
,
"You have paid: "
+
finalVal
,
Toast
.
LENGTH_SHORT
).
show
();
change
=
finalVal
-
finalTotal
;
Intent
receiptMore
=
new
Intent
(
toyotaPay
.
this
,
toyotaReceipt
.
class
);
receiptMore
.
putExtra
(
"payed"
,
finalVal
);
receiptMore
.
putExtra
(
"owed"
,
finalTotal
);
receiptMore
.
putExtra
(
"change"
,
change
);
startActivity
(
receiptMore
);
}
}
}
else
{
Toast
.
makeText
(
toyotaPay
.
this
,
"Click Discount Button!"
,
Toast
.
LENGTH_SHORT
).
show
();
}
Toast.makeText(audiPay.this, "test", Toast.LENGTH_SHORT).show();
}
});
*/
}
...
...
app/src/main/java/com/example/carrentalsystem/toyotaReceipt.java
0 → 100644
View file @
7708fb17
package
com
.
example
.
carrentalsystem
;
import
androidx.appcompat.app.AppCompatActivity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
java.math.RoundingMode
;
import
java.text.DecimalFormat
;
public
class
toyotaReceipt
extends
AppCompatActivity
{
double
change
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_audi_receipt
);
TextView
changeTV
=
(
TextView
)
findViewById
(
R
.
id
.
changeView
);
Intent
i
=
getIntent
();
change
=
(
Double
)
i
.
getSerializableExtra
(
"change"
);
String
changeString
=
String
.
valueOf
(
change
);
changeTV
.
setText
(
changeString
);
}
}
app/src/main/java/com/example/carrentalsystem/toyotaRefresh.java
View file @
7708fb17
...
...
@@ -24,12 +24,21 @@ public class toyotaRefresh extends AppCompatActivity {
private
TextView
totalItems
;
public
double
itemTotalTravel
=
0
;
int
hoursRefresh
;
TextView
tvhours
;
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_toyota_refresh
);
Intent
fromPay
=
getIntent
();
hoursRefresh
=
fromPay
.
getIntExtra
(
"hours"
,
0
);
tvhours
=
findViewById
(
R
.
id
.
tvhours
);
tvhours
.
setText
(
"Hours: "
+
hoursRefresh
);
item1
=
(
EditText
)
findViewById
(
R
.
id
.
editText
);
item2
=
(
EditText
)
findViewById
(
R
.
id
.
editText2
);
item3
=
(
EditText
)
findViewById
(
R
.
id
.
editText3
);
...
...
@@ -99,6 +108,7 @@ public class toyotaRefresh extends AppCompatActivity {
public
void
toPay
(
View
v
){
Intent
homeBtn
=
new
Intent
(
this
,
toyotaPay
.
class
);
homeBtn
.
putExtra
(
"ITEM_TOTAL"
,
itemTotalTravel
);
homeBtn
.
putExtra
(
"hoursRefresh"
,
hoursRefresh
);
startActivity
(
homeBtn
);
}
...
...
app/src/main/res/layout/activity_audi_page.xml
View file @
7708fb17
...
...
@@ -195,4 +195,41 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
<Button
android:id=
"@+id/hourBtn"
android:layout_width=
"94dp"
android:layout_height=
"48dp"
android:layout_marginTop=
"164dp"
android:layout_marginEnd=
"40dp"
android:background=
"@drawable/custom_button"
android:onClick=
"toPay"
android:textColor=
"#ffff"
android:textSize=
"20sp"
android:text=
"Hours"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
<TextView
android:id=
"@+id/tvDisplayChoice"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"88dp"
android:textColor=
"#302A2A"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/tvSelected"
/>
<TextView
android:id=
"@+id/tvSelected"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"128dp"
android:layout_marginEnd=
"24dp"
android:text=
"Selected Hours:"
android:textColor=
"#302A2A"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/imageView6"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_audi_pay.xml
View file @
7708fb17
...
...
@@ -86,11 +86,12 @@
android:layout_marginTop=
"12dp"
android:layout_marginEnd=
"132dp"
android:textSize=
"20dp"
android:maxLength=
"4"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/generate"
/>
<TextView
android:id=
"@+id/
textView4
"
android:id=
"@+id/
p
"
android:layout_width=
"12dp"
android:layout_height=
"29dp"
android:layout_marginTop=
"12dp"
...
...
@@ -115,7 +116,6 @@
android:layout_height=
"30sp"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"76dp"
android:text=
"8 /hr"
android:textSize=
"20dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/itemTotal"
/>
...
...
@@ -152,6 +152,7 @@
android:layout_marginEnd=
"84dp"
android:ems=
"10"
android:hint=
"Enter amount"
android:maxLength=
"6"
android:inputType=
"numberDecimal"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/total"
/>
...
...
app/src/main/res/layout/activity_audi_receipt.xml
View file @
7708fb17
...
...
@@ -12,6 +12,7 @@
android:layout_height=
"wrap_content"
android:layout_marginTop=
"153dp"
android:text=
"TextView"
android:maxLength=
"4"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
app/src/main/res/layout/activity_audi_refresh.xml
View file @
7708fb17
...
...
@@ -258,5 +258,15 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/juice"
/>
<TextView
android:id=
"@+id/tvhours"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"7dp"
android:textColor=
"#161414"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/total"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_honda_page.xml
View file @
7708fb17
...
...
@@ -140,8 +140,8 @@
android:id=
"@+id/pay"
android:layout_width=
"94dp"
android:layout_height=
"48dp"
android:layout_marginTop=
"
124
dp"
android:layout_marginEnd=
"4
8
dp"
android:layout_marginTop=
"
96
dp"
android:layout_marginEnd=
"4
0
dp"
android:background=
"@drawable/custom_button"
android:onClick=
"toPay"
android:text=
"PAY"
...
...
@@ -150,4 +150,41 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
<Button
android:id=
"@+id/hourBtn"
android:layout_width=
"94dp"
android:layout_height=
"48dp"
android:layout_marginTop=
"164dp"
android:layout_marginEnd=
"40dp"
android:background=
"@drawable/custom_button"
android:onClick=
"toPay"
android:textColor=
"#ffff"
android:textSize=
"20sp"
android:text=
"Hours"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
<TextView
android:id=
"@+id/tvDisplayChoice"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"88dp"
android:textColor=
"#302A2A"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/tvSelected"
/>
<TextView
android:id=
"@+id/tvSelected"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:text=
"Selected Hours:"
android:textColor=
"#302A2A"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_honda_pay.xml
View file @
7708fb17
...
...
@@ -84,13 +84,14 @@
android:layout_width=
"100dp"
android:layout_height=
"30dp"
android:layout_marginTop=
"12dp"
android:maxLength=
"4"
android:layout_marginEnd=
"132dp"
android:textSize=
"20dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/generate"
/>
<TextView
android:id=
"@+id/
textView4
"
android:id=
"@+id/
p
"
android:layout_width=
"12dp"
android:layout_height=
"29dp"
android:layout_marginTop=
"12dp"
...
...
@@ -115,7 +116,6 @@
android:layout_height=
"30sp"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"76dp"
android:text=
"9 /hr"
android:textSize=
"20dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/itemTotal"
/>
...
...
app/src/main/res/layout/activity_honda_receipt.xml
0 → 100644
View file @
7708fb17
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".hondaReceipt"
>
<TextView
android:id=
"@+id/changeTV"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"182dp"
android:layout_marginEnd=
"190dp"
android:text=
"TextView"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_honda_refresh.xml
View file @
7708fb17
...
...
@@ -260,4 +260,14 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/juice"
/>
<TextView
android:id=
"@+id/tvhours"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"7dp"
android:textColor=
"#161414"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/total"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_jaguar_page.xml
View file @
7708fb17
...
...
@@ -180,4 +180,41 @@
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
<Button
android:id=
"@+id/hourBtn"
android:layout_width=
"94dp"
android:layout_height=
"48dp"
android:layout_marginTop=
"128dp"
android:layout_marginEnd=
"36dp"
android:background=
"@drawable/custom_button"
android:onClick=
"toPay"
android:text=
"Hours"
android:textColor=
"#ffff"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
<TextView
android:id=
"@+id/tvDisplayChoice"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"88dp"
android:textColor=
"#302A2A"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/tvSelected"
/>
<TextView
android:id=
"@+id/tvSelected"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"48dp"
android:layout_marginEnd=
"36dp"
android:text=
"Selected Hours:"
android:textColor=
"#302A2A"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_jaguar_pay.xml
View file @
7708fb17
...
...
@@ -85,12 +85,13 @@
android:layout_height=
"30dp"
android:layout_marginTop=
"12dp"
android:layout_marginEnd=
"132dp"
android:maxLength=
"4"
android:textSize=
"20dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/generate"
/>
<TextView
android:id=
"@+id/
textView4
"
android:id=
"@+id/
p
"
android:layout_width=
"12dp"
android:layout_height=
"29dp"
android:layout_marginTop=
"12dp"
...
...
@@ -115,7 +116,6 @@
android:layout_height=
"30sp"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"76dp"
android:text=
"10 /hr"
android:textSize=
"20dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/itemTotal"
/>
...
...
app/src/main/res/layout/activity_jaguar_receipt.xml
0 → 100644
View file @
7708fb17
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".jaguarReceipt"
>
<TextView
android:id=
"@+id/textView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"186dp"
android:layout_marginEnd=
"195dp"
android:text=
"TextView"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_jaguar_refresh.xml
View file @
7708fb17
...
...
@@ -259,4 +259,14 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/juice"
/>
<TextView
android:id=
"@+id/tvhours"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"7dp"
android:textColor=
"#161414"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/total"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_merc_page.xml
View file @
7708fb17
...
...
@@ -138,4 +138,41 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
<Button
android:id=
"@+id/hourBtn"
android:layout_width=
"94dp"
android:layout_height=
"48dp"
android:layout_marginTop=
"164dp"
android:layout_marginEnd=
"40dp"
android:background=
"@drawable/custom_button"
android:onClick=
"toPay"
android:textColor=
"#ffff"
android:textSize=
"20sp"
android:text=
"Hours"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
<TextView
android:id=
"@+id/tvDisplayChoice"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"88dp"
android:textColor=
"#302A2A"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/tvSelected"
/>
<TextView
android:id=
"@+id/tvSelected"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"36dp"
android:layout_marginEnd=
"16dp"
android:text=
"Selected Hours:"
android:textColor=
"#302A2A"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_merc_pay.xml
View file @
7708fb17
...
...
@@ -84,13 +84,14 @@
android:layout_width=
"100dp"
android:layout_height=
"30dp"
android:layout_marginTop=
"12dp"
android:maxLength=
"4"
android:layout_marginEnd=
"132dp"
android:textSize=
"20dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/generate"
/>
<TextView
android:id=
"@+id/
textView4
"
android:id=
"@+id/
p
"
android:layout_width=
"12dp"
android:layout_height=
"29dp"
android:layout_marginTop=
"12dp"
...
...
@@ -115,7 +116,6 @@
android:layout_height=
"30sp"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"76dp"
android:text=
"11 /hr"
android:textSize=
"20dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/itemTotal"
/>
...
...
app/src/main/res/layout/activity_merc_receipt.xml
0 → 100644
View file @
7708fb17
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".mercReceipt"
>
<TextView
android:id=
"@+id/changeTV"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"157dp"
android:layout_marginEnd=
"186dp"
android:text=
"TextView"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_merc_refresh.xml
View file @
7708fb17
...
...
@@ -265,4 +265,14 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/juice"
/>
<TextView
android:id=
"@+id/tvhours"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"7dp"
android:textColor=
"#161414"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/total"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_toyota_page.xml
View file @
7708fb17
...
...
@@ -138,4 +138,41 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
<Button
android:id=
"@+id/hourBtn"
android:layout_width=
"94dp"
android:layout_height=
"48dp"
android:layout_marginTop=
"156dp"
android:layout_marginEnd=
"32dp"
android:background=
"@drawable/custom_button"
android:onClick=
"toPay"
android:text=
"Hours"
android:textColor=
"#ffff"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
<TextView
android:id=
"@+id/tvDisplayChoice"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"88dp"
android:textColor=
"#302A2A"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/tvSelected"
/>
<TextView
android:id=
"@+id/tvSelected"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:text=
"Selected Hours:"
android:textColor=
"#302A2A"
android:textSize=
"20sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/price"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_toyota_pay.xml
View file @
7708fb17
...
...
@@ -85,12 +85,13 @@
android:layout_height=
"30dp"
android:layout_marginTop=
"12dp"
android:layout_marginEnd=
"132dp"
android:maxLength=
"4"
android:textSize=
"20dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/generate"
/>
<TextView
android:id=
"@+id/
textView4
"
android:id=
"@+id/
p
"
android:layout_width=
"12dp"
android:layout_height=
"29dp"
android:layout_marginTop=
"12dp"
...
...
@@ -115,7 +116,6 @@
android:layout_height=
"30sp"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"76dp"
android:text=
"7 /hr"
android:textSize=
"20dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/itemTotal"
/>
...
...
app/src/main/res/layout/activity_toyota_receipt.xml
0 → 100644
View file @
7708fb17
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".toyotaReceipt"
>
<TextView
android:id=
"@+id/changeTV"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"162dp"
android:text=
"TextView"
android:maxLength=
"4"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/activity_toyota_refresh.xml
View file @
7708fb17
...
...
@@ -266,4 +266,14 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/juice"
/>
<TextView
android:id=
"@+id/tvhours"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"7dp"
android:textColor=
"#161414"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/total"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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