Commit 7708fb17 authored by samuel.boulton's avatar samuel.boulton

receipt left to do

parent 512476bc
<?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" />
......
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){
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);
}
}
}
......@@ -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();
}
});
*/
}
......
......@@ -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);
......
......@@ -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);
}
......
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){
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);
}
}
}
......@@ -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();
}
});
*/
}
......
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);
}
}
......@@ -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);
}
......
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){
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);
}
}
}
......@@ -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();
}
});
*/
}
......
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
......@@ -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);
}
......
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){
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);
}
}
......
......@@ -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();
}
});
*/
}
......
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
......@@ -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);
}
......
......@@ -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();
......
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){
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);
}
}
}
......@@ -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();
}
});
*/
}
......
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);
}
}
......@@ -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);
}
......
......@@ -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
......@@ -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" />
......
......@@ -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" />
......
......@@ -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
......@@ -140,8 +140,8 @@
android:id="@+id/pay"
android:layout_width="94dp"
android:layout_height="48dp"
android:layout_marginTop="124dp"
android:layout_marginEnd="48dp"
android:layout_marginTop="96dp"
android:layout_marginEnd="40dp"
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
......@@ -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" />
......
<?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
......@@ -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
......@@ -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
......@@ -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" />
......
<?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
......@@ -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
......@@ -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
......@@ -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" />
......
<?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
......@@ -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
......@@ -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
......@@ -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" />
......
<?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
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment