Commit b6a5c8c9 authored by samuel.boulton's avatar samuel.boulton

finished, needs checking

parent 7708fb17
......@@ -102,14 +102,15 @@ public class audiPay extends AppCompatActivity {
} 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();
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("paid", finalVal);
receiptEqual.putExtra("owed", finalTotal);
receiptEqual.putExtra("change", change);
receiptEqual.putExtra("hours", hoursPay);
startActivity(receiptEqual);
} else if(finalVal > finalTotal){
......@@ -118,9 +119,10 @@ public class audiPay extends AppCompatActivity {
change = finalVal - finalTotal;
Intent receiptMore = new Intent(audiPay.this, audiReceipt.class);
receiptMore.putExtra("payed", finalVal);
receiptMore.putExtra("paid", finalVal);
receiptMore.putExtra("owed", finalTotal);
receiptMore.putExtra("change", change);
receiptMore.putExtra("hours", hoursPay);
startActivity(receiptMore);
}
}
......
......@@ -3,32 +3,159 @@ package com.example.carrentalsystem;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.service.autofill.VisibilitySetterAction;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Locale;
public class audiReceipt extends AppCompatActivity {
double change;
double change, paid;
int hours;
private Button homeBtn;
private TextView mTextViewCountDown;
private TextView timerLogo;
private Button mButtonStartPause;
private Button mButtonReset;
private CountDownTimer mCountDownTimer;
private boolean mTimerRunning;
private long mTimeLeftInMillis;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_audi_receipt);
TextView changeTV = (TextView) findViewById(R.id.changeView);
TextView hoursTV = (TextView) findViewById(R.id.hours);
TextView paidTV = (TextView) findViewById(R.id.pay);
mTextViewCountDown = findViewById(R.id.countdownText);
mButtonStartPause = findViewById(R.id.startBtn);
mButtonReset = findViewById(R.id.returnBtn);
timerLogo = findViewById(R.id.logoTime);
homeBtn = findViewById(R.id.homeBtn);
Intent i = getIntent();
change = (Double) i.getSerializableExtra("change");
hours = (Integer) i.getSerializableExtra("hours");
paid = (Double) i.getSerializableExtra("paid");
mTimeLeftInMillis = hours * 3600000;
String paidString = String.valueOf(paid);
paidTV.setText(paidString);
String hoursString = String.valueOf(hours);
hoursTV.setText(hoursString);
String changeString = String.valueOf(change);
changeTV.setText(changeString);
timerLogo.setVisibility(View.GONE);
mButtonReset.setVisibility(View.GONE);
homeBtn.setVisibility(View.GONE);
mTextViewCountDown.setVisibility(View.GONE);
mTextViewCountDown.setBackgroundColor(Color.BLACK);//set background color
mButtonStartPause.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mTextViewCountDown.setVisibility(View.VISIBLE);
startTimer();
mButtonStartPause.setVisibility(View.GONE);
mButtonReset.setVisibility(View.VISIBLE);
timerLogo.setVisibility(View.VISIBLE);
Toast.makeText(audiReceipt.this, "Rental started!", Toast.LENGTH_SHORT).show();
Handler handler = new Handler();
handler.postDelayed(new Runnable()
{
@Override
public void run()
{
Toast.makeText(audiReceipt.this, "Click RETURN to return vehicle", Toast.LENGTH_SHORT).show();
}
}, 2000);
}
});
mButtonReset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
resetTimer();
Toast.makeText(audiReceipt.this, "Vehicle Returned!", Toast.LENGTH_SHORT).show();
homeBtn.setVisibility(View.VISIBLE);
timerLogo.setVisibility(View.GONE);
mTextViewCountDown.setVisibility(View.GONE);
mButtonReset.setVisibility(View.GONE);
}
});
updateCountDownText();
homeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent homepage = new Intent(getApplicationContext(), chooseCar.class);
startActivity(homepage);
}
});
}
private void startTimer() {
mCountDownTimer = new CountDownTimer(mTimeLeftInMillis, 1000) {
@Override
public void onTick(long millisUntilFinished) {
mTimeLeftInMillis = millisUntilFinished;
updateCountDownText();
}
@Override
public void onFinish() {
mTimerRunning = false;
mButtonStartPause.setText("Start");
mButtonStartPause.setVisibility(View.INVISIBLE);
mButtonReset.setVisibility(View.VISIBLE);
}
}.start();
mTimerRunning = true;
mButtonReset.setVisibility(View.INVISIBLE);
}
private void resetTimer() {
mTimeLeftInMillis = hours;
updateCountDownText();
}
private void updateCountDownText() {
int hourTimer = (int) (mTimeLeftInMillis / 1000) / 3600;
int minutes = (int) ((mTimeLeftInMillis / 1000) % 3600) / 60;
int seconds = (int) (mTimeLeftInMillis / 1000) % 60;
String timeLeftFormatted;
if (hours > 0) {
timeLeftFormatted = String.format(Locale.getDefault(),
"%d:%02d:%02d", hourTimer, minutes, seconds);
} else {
timeLeftFormatted = String.format(Locale.getDefault(),
"%02d:%02d", minutes, seconds);
}
mTextViewCountDown.setText(timeLeftFormatted);
}
}
......@@ -4,8 +4,10 @@ import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class chooseCar extends AppCompatActivity {
......@@ -14,9 +16,12 @@ public class chooseCar extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_choose_car);
}
public void mercClick(View v){
Intent audiPicked = new Intent(chooseCar.this,mercPage.class);
startActivity(audiPicked);
......
......@@ -46,7 +46,6 @@ public class hondaPage extends AppCompatActivity {
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() {
......
......@@ -98,20 +98,22 @@ public class hondaPay extends AppCompatActivity {
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("paid", finalVal);
receiptEqual.putExtra("owed", finalTotal);
receiptEqual.putExtra("change", change);
receiptEqual.putExtra("hours", hoursPay);
startActivity(receiptEqual);
} else if(finalVal > finalTotal){
Toast.makeText(hondaPay.this, "You have paid: " + finalVal, Toast.LENGTH_SHORT).show();
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("paid", finalVal);
receiptMore.putExtra("owed", finalTotal);
receiptMore.putExtra("change", change);
receiptMore.putExtra("hours", hoursPay);
startActivity(receiptMore);
}
}
......
......@@ -3,16 +3,32 @@ package com.example.carrentalsystem;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Locale;
public class hondaReceipt extends AppCompatActivity {
double change;
double change, paid;
int hours;
private Button homeBtn;
private TextView mTextViewCountDown;
private TextView timerLogo;
private Button mButtonStartPause;
private Button mButtonReset;
private CountDownTimer mCountDownTimer;
private boolean mTimerRunning;
private long mTimeLeftInMillis;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -20,15 +36,122 @@ public class hondaReceipt extends AppCompatActivity {
setContentView(R.layout.activity_audi_receipt);
TextView changeTV = (TextView) findViewById(R.id.changeView);
TextView hoursTV = (TextView) findViewById(R.id.hours);
TextView paidTV = (TextView) findViewById(R.id.pay);
mTextViewCountDown = findViewById(R.id.countdownText);
mButtonStartPause = findViewById(R.id.startBtn);
mButtonReset = findViewById(R.id.returnBtn);
timerLogo = findViewById(R.id.logoTime);
homeBtn = findViewById(R.id.homeBtn);
Intent i = getIntent();
change = (Double) i.getSerializableExtra("change");
hours = (Integer) i.getSerializableExtra("hours");
paid = (Double) i.getSerializableExtra("paid");
mTimeLeftInMillis = hours * 3600000;
String paidString = String.valueOf(paid);
paidTV.setText(paidString);
String hoursString = String.valueOf(hours);
hoursTV.setText(hoursString);
String changeString = String.valueOf(change);
changeTV.setText(changeString);
timerLogo.setVisibility(View.GONE);
mButtonReset.setVisibility(View.GONE);
homeBtn.setVisibility(View.GONE);
mTextViewCountDown.setVisibility(View.GONE);
mTextViewCountDown.setBackgroundColor(Color.BLACK);//set background color
mButtonStartPause.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mTextViewCountDown.setVisibility(View.VISIBLE);
startTimer();
mButtonStartPause.setVisibility(View.GONE);
mButtonReset.setVisibility(View.VISIBLE);
timerLogo.setVisibility(View.VISIBLE);
Toast.makeText(hondaReceipt.this, "Rental started!", Toast.LENGTH_SHORT).show();
Handler handler = new Handler();
handler.postDelayed(new Runnable()
{
@Override
public void run()
{
Toast.makeText(hondaReceipt.this, "Click RETURN to return vehicle", Toast.LENGTH_SHORT).show();
}
}, 2000);
}
});
mButtonReset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
resetTimer();
Toast.makeText(hondaReceipt.this, "Vehicle Returned!", Toast.LENGTH_SHORT).show();
homeBtn.setVisibility(View.VISIBLE);
timerLogo.setVisibility(View.GONE);
mTextViewCountDown.setVisibility(View.GONE);
mButtonReset.setVisibility(View.GONE);
}
});
updateCountDownText();
homeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent homepage = new Intent(getApplicationContext(), chooseCar.class);
startActivity(homepage);
}
});
}
private void startTimer() {
mCountDownTimer = new CountDownTimer(mTimeLeftInMillis, 1000) {
@Override
public void onTick(long millisUntilFinished) {
mTimeLeftInMillis = millisUntilFinished;
updateCountDownText();
}
@Override
public void onFinish() {
mTimerRunning = false;
mButtonStartPause.setText("Start");
mButtonStartPause.setVisibility(View.INVISIBLE);
mButtonReset.setVisibility(View.VISIBLE);
}
}.start();
mTimerRunning = true;
mButtonReset.setVisibility(View.INVISIBLE);
}
private void resetTimer() {
mTimeLeftInMillis = hours;
updateCountDownText();
}
private void updateCountDownText() {
int hourTimer = (int) (mTimeLeftInMillis / 1000) / 3600;
int minutes = (int) ((mTimeLeftInMillis / 1000) % 3600) / 60;
int seconds = (int) (mTimeLeftInMillis / 1000) % 60;
String timeLeftFormatted;
if (hours > 0) {
timeLeftFormatted = String.format(Locale.getDefault(),
"%d:%02d:%02d", hourTimer, minutes, seconds);
} else {
timeLeftFormatted = String.format(Locale.getDefault(),
"%02d:%02d", minutes, seconds);
}
mTextViewCountDown.setText(timeLeftFormatted);
}
}
......@@ -97,20 +97,22 @@ public class jaguarPay extends AppCompatActivity {
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("paid", finalVal);
receiptEqual.putExtra("owed", finalTotal);
receiptEqual.putExtra("change", change);
receiptEqual.putExtra("hours", hoursPay);
startActivity(receiptEqual);
} else if(finalVal > finalTotal){
Toast.makeText(jaguarPay.this, "You have paid: " + finalVal, Toast.LENGTH_SHORT).show();
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("paid", finalVal);
receiptMore.putExtra("owed", finalTotal);
receiptMore.putExtra("change", change);
receiptMore.putExtra("hours", hoursPay);
startActivity(receiptMore);
}
}
......
......@@ -3,32 +3,156 @@ package com.example.carrentalsystem;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Locale;
public class jaguarReceipt extends AppCompatActivity {
double changeInfo, d, change;
double change, paid;
int hours;
private Button homeBtn;
private TextView mTextViewCountDown;
private TextView timerLogo;
private Button mButtonStartPause;
private Button mButtonReset;
private CountDownTimer mCountDownTimer;
private boolean mTimerRunning;
private long mTimeLeftInMillis;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_audi_receipt);
TextView changeTV = (TextView) findViewById(R.id.changeView);
TextView hoursTV = (TextView) findViewById(R.id.hours);
TextView paidTV = (TextView) findViewById(R.id.pay);
mTextViewCountDown = findViewById(R.id.countdownText);
mButtonStartPause = findViewById(R.id.startBtn);
mButtonReset = findViewById(R.id.returnBtn);
timerLogo = findViewById(R.id.logoTime);
homeBtn = findViewById(R.id.homeBtn);
Intent i = getIntent();
change = (Double) i.getSerializableExtra("change");
hours = (Integer) i.getSerializableExtra("hours");
paid = (Double) i.getSerializableExtra("paid");
mTimeLeftInMillis = hours * 3600000;
String paidString = String.valueOf(paid);
paidTV.setText(paidString);
String hoursString = String.valueOf(hours);
hoursTV.setText(hoursString);
String changeString = String.valueOf(change);
changeTV.setText(changeString);
timerLogo.setVisibility(View.GONE);
mButtonReset.setVisibility(View.GONE);
homeBtn.setVisibility(View.GONE);
mTextViewCountDown.setVisibility(View.GONE);
mTextViewCountDown.setBackgroundColor(Color.BLACK);//set background color
mButtonStartPause.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mTextViewCountDown.setVisibility(View.VISIBLE);
startTimer();
mButtonStartPause.setVisibility(View.GONE);
mButtonReset.setVisibility(View.VISIBLE);
timerLogo.setVisibility(View.VISIBLE);
Toast.makeText(jaguarReceipt.this, "Rental started!", Toast.LENGTH_SHORT).show();
Handler handler = new Handler();
handler.postDelayed(new Runnable()
{
@Override
public void run()
{
Toast.makeText(jaguarReceipt.this, "Click RETURN to return vehicle", Toast.LENGTH_SHORT).show();
}
}, 2000);
}
});
mButtonReset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
resetTimer();
Toast.makeText(jaguarReceipt.this, "Vehicle Returned!", Toast.LENGTH_SHORT).show();
homeBtn.setVisibility(View.VISIBLE);
timerLogo.setVisibility(View.GONE);
mTextViewCountDown.setVisibility(View.GONE);
mButtonReset.setVisibility(View.GONE);
}
});
updateCountDownText();
homeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent homepage = new Intent(getApplicationContext(), chooseCar.class);
startActivity(homepage);
}
});
}
private void startTimer() {
mCountDownTimer = new CountDownTimer(mTimeLeftInMillis, 1000) {
@Override
public void onTick(long millisUntilFinished) {
mTimeLeftInMillis = millisUntilFinished;
updateCountDownText();
}
@Override
public void onFinish() {
mTimerRunning = false;
mButtonStartPause.setText("Start");
mButtonStartPause.setVisibility(View.INVISIBLE);
mButtonReset.setVisibility(View.VISIBLE);
}
}.start();
mTimerRunning = true;
mButtonReset.setVisibility(View.INVISIBLE);
}
private void resetTimer() {
mTimeLeftInMillis = hours;
updateCountDownText();
}
private void updateCountDownText() {
int hourTimer = (int) (mTimeLeftInMillis / 1000) / 3600;
int minutes = (int) ((mTimeLeftInMillis / 1000) % 3600) / 60;
int seconds = (int) (mTimeLeftInMillis / 1000) % 60;
String timeLeftFormatted;
if (hours > 0) {
timeLeftFormatted = String.format(Locale.getDefault(),
"%d:%02d:%02d", hourTimer, minutes, seconds);
} else {
timeLeftFormatted = String.format(Locale.getDefault(),
"%02d:%02d", minutes, seconds);
}
mTextViewCountDown.setText(timeLeftFormatted);
}
}
\ No newline at end of file
......@@ -93,23 +93,25 @@ public class mercPay extends AppCompatActivity {
} 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();
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("paid", finalVal);
receiptEqual.putExtra("owed", finalTotal);
receiptEqual.putExtra("change", change);
receiptEqual.putExtra("hours", hoursPay);
startActivity(receiptEqual);
} else if(finalVal > finalTotal){
Toast.makeText(mercPay.this, "You have paid: " + finalVal, Toast.LENGTH_SHORT).show();
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("paid", finalVal);
receiptMore.putExtra("owed", finalTotal);
receiptMore.putExtra("change", change);
receiptMore.putExtra("hours", hoursPay);
startActivity(receiptMore);
}
}
......
......@@ -3,16 +3,32 @@ package com.example.carrentalsystem;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Locale;
public class mercReceipt extends AppCompatActivity {
double change;
double change, paid;
int hours;
private Button homeBtn;
private TextView mTextViewCountDown;
private TextView timerLogo;
private Button mButtonStartPause;
private Button mButtonReset;
private CountDownTimer mCountDownTimer;
private boolean mTimerRunning;
private long mTimeLeftInMillis;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -20,15 +36,122 @@ public class mercReceipt extends AppCompatActivity {
setContentView(R.layout.activity_audi_receipt);
TextView changeTV = (TextView) findViewById(R.id.changeView);
TextView hoursTV = (TextView) findViewById(R.id.hours);
TextView paidTV = (TextView) findViewById(R.id.pay);
mTextViewCountDown = findViewById(R.id.countdownText);
mButtonStartPause = findViewById(R.id.startBtn);
mButtonReset = findViewById(R.id.returnBtn);
timerLogo = findViewById(R.id.logoTime);
homeBtn = findViewById(R.id.homeBtn);
Intent i = getIntent();
change = (Double) i.getSerializableExtra("change");
hours = (Integer) i.getSerializableExtra("hours");
paid = (Double) i.getSerializableExtra("paid");
mTimeLeftInMillis = hours * 3600000;
String paidString = String.valueOf(paid);
paidTV.setText(paidString);
String hoursString = String.valueOf(hours);
hoursTV.setText(hoursString);
String changeString = String.valueOf(change);
changeTV.setText(changeString);
timerLogo.setVisibility(View.GONE);
mButtonReset.setVisibility(View.GONE);
homeBtn.setVisibility(View.GONE);
mTextViewCountDown.setVisibility(View.GONE);
mTextViewCountDown.setBackgroundColor(Color.BLACK);//set background color
mButtonStartPause.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mTextViewCountDown.setVisibility(View.VISIBLE);
startTimer();
mButtonStartPause.setVisibility(View.GONE);
mButtonReset.setVisibility(View.VISIBLE);
timerLogo.setVisibility(View.VISIBLE);
Toast.makeText(mercReceipt.this, "Rental started!", Toast.LENGTH_SHORT).show();
Handler handler = new Handler();
handler.postDelayed(new Runnable()
{
@Override
public void run()
{
Toast.makeText(mercReceipt.this, "Click RETURN to return vehicle", Toast.LENGTH_SHORT).show();
}
}, 2000);
}
});
mButtonReset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
resetTimer();
Toast.makeText(mercReceipt.this, "Vehicle Returned!", Toast.LENGTH_SHORT).show();
homeBtn.setVisibility(View.VISIBLE);
timerLogo.setVisibility(View.GONE);
mTextViewCountDown.setVisibility(View.GONE);
mButtonReset.setVisibility(View.GONE);
}
});
updateCountDownText();
homeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent homepage = new Intent(getApplicationContext(), chooseCar.class);
startActivity(homepage);
}
});
}
private void startTimer() {
mCountDownTimer = new CountDownTimer(mTimeLeftInMillis, 1000) {
@Override
public void onTick(long millisUntilFinished) {
mTimeLeftInMillis = millisUntilFinished;
updateCountDownText();
}
@Override
public void onFinish() {
mTimerRunning = false;
mButtonStartPause.setText("Start");
mButtonStartPause.setVisibility(View.INVISIBLE);
mButtonReset.setVisibility(View.VISIBLE);
}
}.start();
mTimerRunning = true;
mButtonReset.setVisibility(View.INVISIBLE);
}
private void resetTimer() {
mTimeLeftInMillis = hours;
updateCountDownText();
}
private void updateCountDownText() {
int hourTimer = (int) (mTimeLeftInMillis / 1000) / 3600;
int minutes = (int) ((mTimeLeftInMillis / 1000) % 3600) / 60;
int seconds = (int) (mTimeLeftInMillis / 1000) % 60;
String timeLeftFormatted;
if (hours > 0) {
timeLeftFormatted = String.format(Locale.getDefault(),
"%d:%02d:%02d", hourTimer, minutes, seconds);
} else {
timeLeftFormatted = String.format(Locale.getDefault(),
"%02d:%02d", minutes, seconds);
}
mTextViewCountDown.setText(timeLeftFormatted);
}
}
......@@ -95,23 +95,25 @@ public class toyotaPay extends AppCompatActivity {
} 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();
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("paid", finalVal);
receiptEqual.putExtra("owed", finalTotal);
receiptEqual.putExtra("change", change);
receiptEqual.putExtra("hours", hoursPay);
startActivity(receiptEqual);
} else if(finalVal > finalTotal){
Toast.makeText(toyotaPay.this, "You have paid: " + finalVal, Toast.LENGTH_SHORT).show();
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("paid", finalVal);
receiptMore.putExtra("owed", finalTotal);
receiptMore.putExtra("change", change);
receiptMore.putExtra("hours", hoursPay);
startActivity(receiptMore);
}
}
......
......@@ -3,16 +3,32 @@ package com.example.carrentalsystem;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.Locale;
public class toyotaReceipt extends AppCompatActivity {
double change;
double change, paid;
int hours;
private Button homeBtn;
private TextView mTextViewCountDown;
private TextView timerLogo;
private Button mButtonStartPause;
private Button mButtonReset;
private CountDownTimer mCountDownTimer;
private boolean mTimerRunning;
private long mTimeLeftInMillis;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -20,15 +36,123 @@ public class toyotaReceipt extends AppCompatActivity {
setContentView(R.layout.activity_audi_receipt);
TextView changeTV = (TextView) findViewById(R.id.changeView);
TextView hoursTV = (TextView) findViewById(R.id.hours);
TextView paidTV = (TextView) findViewById(R.id.pay);
mTextViewCountDown = findViewById(R.id.countdownText);
mButtonStartPause = findViewById(R.id.startBtn);
mButtonReset = findViewById(R.id.returnBtn);
timerLogo = findViewById(R.id.logoTime);
homeBtn = findViewById(R.id.homeBtn);
Intent i = getIntent();
change = (Double) i.getSerializableExtra("change");
hours = (Integer) i.getSerializableExtra("hours");
paid = (Double) i.getSerializableExtra("paid");
mTimeLeftInMillis = hours * 3600000;
String paidString = String.valueOf(paid);
paidTV.setText(paidString);
String hoursString = String.valueOf(hours);
hoursTV.setText(hoursString);
String changeString = String.valueOf(change);
changeTV.setText(changeString);
timerLogo.setVisibility(View.GONE);
mButtonReset.setVisibility(View.GONE);
homeBtn.setVisibility(View.GONE);
mTextViewCountDown.setVisibility(View.GONE);
mTextViewCountDown.setBackgroundColor(Color.BLACK);//set background color
mButtonStartPause.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mTextViewCountDown.setVisibility(View.VISIBLE);
startTimer();
mButtonStartPause.setVisibility(View.GONE);
mButtonReset.setVisibility(View.VISIBLE);
timerLogo.setVisibility(View.VISIBLE);
Toast.makeText(toyotaReceipt.this, "Rental started!", Toast.LENGTH_SHORT).show();
Handler handler = new Handler();
handler.postDelayed(new Runnable()
{
@Override
public void run()
{
Toast.makeText(toyotaReceipt.this, "Click RETURN to return vehicle", Toast.LENGTH_SHORT).show();
}
}, 2000);
}
});
mButtonReset.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
resetTimer();
Toast.makeText(toyotaReceipt.this, "Vehicle Returned!", Toast.LENGTH_SHORT).show();
homeBtn.setVisibility(View.VISIBLE);
timerLogo.setVisibility(View.GONE);
mTextViewCountDown.setVisibility(View.GONE);
mButtonReset.setVisibility(View.GONE);
}
});
updateCountDownText();
homeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent homepage = new Intent(getApplicationContext(), chooseCar.class);
startActivity(homepage);
}
});
}
private void startTimer() {
mCountDownTimer = new CountDownTimer(mTimeLeftInMillis, 1000) {
@Override
public void onTick(long millisUntilFinished) {
mTimeLeftInMillis = millisUntilFinished;
updateCountDownText();
}
@Override
public void onFinish() {
mTimerRunning = false;
mButtonStartPause.setText("Start");
mButtonStartPause.setVisibility(View.INVISIBLE);
mButtonReset.setVisibility(View.VISIBLE);
}
}.start();
mTimerRunning = true;
mButtonReset.setVisibility(View.INVISIBLE);
}
private void resetTimer() {
mTimeLeftInMillis = hours;
updateCountDownText();
}
private void updateCountDownText() {
int hourTimer = (int) (mTimeLeftInMillis / 1000) / 3600;
int minutes = (int) ((mTimeLeftInMillis / 1000) % 3600) / 60;
int seconds = (int) (mTimeLeftInMillis / 1000) % 60;
String timeLeftFormatted;
if (hours > 0) {
timeLeftFormatted = String.format(Locale.getDefault(),
"%d:%02d:%02d", hourTimer, minutes, seconds);
} else {
timeLeftFormatted = String.format(Locale.getDefault(),
"%02d:%02d", minutes, seconds);
}
mTextViewCountDown.setText(timeLeftFormatted);
}
}
......@@ -86,7 +86,6 @@
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" />
......
......@@ -4,16 +4,171 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
tools:context=".audiReceipt">
<TextView
android:id="@+id/changeView"
android:id="@+id/logoTime"
android:layout_width="312dp"
android:layout_height="63dp"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="Timer:"
android:textColor="#CC3E3E"
android:textSize="30sp"
android:textStyle="bold|italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.515"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/homeBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="153dp"
android:text="TextView"
android:maxLength="4"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="HOME"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<TextView
android:id="@+id/logo"
android:layout_width="312dp"
android:layout_height="63dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="108dp"
android:gravity="center"
android:text="Receipt"
android:textColor="#CC3E3E"
android:textSize="50sp"
android:textStyle="bold|italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.494"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvChange"
android:layout_width="98dp"
android:layout_height="31dp"
android:layout_marginStart="112dp"
android:layout_marginTop="12dp"
android:text="Change: £"
android:textSize="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logo" />
<TextView
android:id="@+id/changeView"
android:layout_width="100sp"
android:layout_height="30sp"
android:layout_marginTop="12dp"
android:layout_marginEnd="96dp"
android:maxLength="4"
android:textSize="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logo" />
<TextView
android:id="@+id/tvPaid"
android:layout_width="128dp"
android:layout_height="18dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="Paid:"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/infoTwo" />
<TextView
android:id="@+id/tvHours"
android:layout_width="128dp"
android:layout_height="21dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="Hours:"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pay" />
<TextView
android:id="@+id/infoTwo"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="*VAT WAS TAKEN OFF CHANGE*"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvChange" />
<TextView
android:id="@+id/pay"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvPaid" />
<TextView
android:id="@+id/hours"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvHours" />
<Button
android:id="@+id/startBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="Start"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<ImageView
android:id="@+id/imageView11"
android:layout_width="222dp"
android:layout_height="56dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="92dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/hours"
app:srcCompat="@drawable/audibadge" />
<Button
android:id="@+id/returnBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="RETURN"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<TextView
android:id="@+id/countdownText"
android:textColor="#ffff"
android:layout_width="98dp"
android:layout_height="31dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="148dp"
android:textSize="20dp"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logoTime" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -215,63 +215,4 @@
app:layout_constraintTop_toBottomOf="@+id/audiText"
android:background="@drawable/hyperlink_underline" />
<TextView
android:id="@+id/countdownMerc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginEnd="28dp"
tools:visibility="visible"
android:visibility="invisible"
android:text="00:00"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/chooseLogo" />
<TextView
android:id="@+id/countdownToyota"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="52dp"
android:visibility="invisible"
tools:visibility="visible"
android:layout_marginEnd="28dp"
android:text="00:00"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/countdownMerc" />
<TextView
android:id="@+id/countdownHonda"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="52dp"
android:visibility="invisible"
tools:visibility="visible"
android:layout_marginEnd="28dp"
android:text="00:00"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/countdownToyota" />
<TextView
android:id="@+id/countdownJaguar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="48dp"
android:layout_marginEnd="28dp"
tools:visibility="visible"
android:visibility="invisible"
android:text="00:00"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/countdownHonda" />
<TextView
android:id="@+id/countdownAudi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="52dp"
android:layout_marginEnd="28dp"
android:text="00:00"
tools:visibility="visible"
android:visibility="invisible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/countdownJaguar" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -84,7 +84,6 @@
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"
......
......@@ -7,12 +7,164 @@
tools:context=".hondaReceipt">
<TextView
android:id="@+id/changeTV"
android:id="@+id/logoTime"
android:layout_width="312dp"
android:layout_height="63dp"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="Timer:"
android:textColor="#CC3E3E"
android:textSize="30sp"
android:textStyle="bold|italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.515"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/homeBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="182dp"
android:layout_marginEnd="190dp"
android:text="TextView"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="HOME"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<TextView
android:id="@+id/logo"
android:layout_width="312dp"
android:layout_height="63dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="108dp"
android:gravity="center"
android:text="Receipt"
android:textColor="#CC3E3E"
android:textSize="50sp"
android:textStyle="bold|italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.494"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvChange"
android:layout_width="98dp"
android:layout_height="31dp"
android:layout_marginStart="112dp"
android:layout_marginTop="12dp"
android:text="Change: £"
android:textSize="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logo" />
<TextView
android:id="@+id/changeView"
android:layout_width="100sp"
android:layout_height="30sp"
android:layout_marginTop="12dp"
android:layout_marginEnd="96dp"
android:maxLength="4"
android:textSize="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logo" />
<TextView
android:id="@+id/tvPaid"
android:layout_width="128dp"
android:layout_height="18dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="Paid:"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/infoTwo" />
<TextView
android:id="@+id/tvHours"
android:layout_width="128dp"
android:layout_height="21dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="Hours:"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pay" />
<TextView
android:id="@+id/infoTwo"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="*VAT WAS TAKEN OFF CHANGE*"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvChange" />
<TextView
android:id="@+id/pay"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvPaid" />
<TextView
android:id="@+id/hours"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvHours" />
<Button
android:id="@+id/startBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="Start"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<ImageView
android:id="@+id/imageView11"
android:layout_width="222dp"
android:layout_height="56dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="92dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/hours"
app:srcCompat="@drawable/audibadge" />
<Button
android:id="@+id/returnBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="RETURN"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<TextView
android:id="@+id/countdownText"
android:textColor="#ffff"
android:layout_width="98dp"
android:layout_height="31dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="148dp"
android:textSize="20dp"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logoTime" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -85,7 +85,6 @@
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" />
......
......@@ -7,12 +7,164 @@
tools:context=".jaguarReceipt">
<TextView
android:id="@+id/textView"
android:id="@+id/logoTime"
android:layout_width="312dp"
android:layout_height="63dp"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="Timer:"
android:textColor="#CC3E3E"
android:textSize="30sp"
android:textStyle="bold|italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.515"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/homeBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="186dp"
android:layout_marginEnd="195dp"
android:text="TextView"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="HOME"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<TextView
android:id="@+id/logo"
android:layout_width="312dp"
android:layout_height="63dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="108dp"
android:gravity="center"
android:text="Receipt"
android:textColor="#CC3E3E"
android:textSize="50sp"
android:textStyle="bold|italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.494"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvChange"
android:layout_width="98dp"
android:layout_height="31dp"
android:layout_marginStart="112dp"
android:layout_marginTop="12dp"
android:text="Change: £"
android:textSize="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logo" />
<TextView
android:id="@+id/changeView"
android:layout_width="100sp"
android:layout_height="30sp"
android:layout_marginTop="12dp"
android:layout_marginEnd="96dp"
android:maxLength="4"
android:textSize="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logo" />
<TextView
android:id="@+id/tvPaid"
android:layout_width="128dp"
android:layout_height="18dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="Paid:"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/infoTwo" />
<TextView
android:id="@+id/tvHours"
android:layout_width="128dp"
android:layout_height="21dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="Hours:"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pay" />
<TextView
android:id="@+id/infoTwo"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="*VAT WAS TAKEN OFF CHANGE*"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvChange" />
<TextView
android:id="@+id/pay"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvPaid" />
<TextView
android:id="@+id/hours"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvHours" />
<Button
android:id="@+id/startBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="Start"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<ImageView
android:id="@+id/imageView11"
android:layout_width="222dp"
android:layout_height="56dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="92dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/hours"
app:srcCompat="@drawable/audibadge" />
<Button
android:id="@+id/returnBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="RETURN"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<TextView
android:id="@+id/countdownText"
android:textColor="#ffff"
android:layout_width="98dp"
android:layout_height="31dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="148dp"
android:textSize="20dp"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logoTime" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -84,7 +84,6 @@
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"
......
......@@ -7,12 +7,164 @@
tools:context=".mercReceipt">
<TextView
android:id="@+id/changeTV"
android:id="@+id/logoTime"
android:layout_width="312dp"
android:layout_height="63dp"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="Timer:"
android:textColor="#CC3E3E"
android:textSize="30sp"
android:textStyle="bold|italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.515"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/homeBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="157dp"
android:layout_marginEnd="186dp"
android:text="TextView"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="HOME"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<TextView
android:id="@+id/logo"
android:layout_width="312dp"
android:layout_height="63dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="108dp"
android:gravity="center"
android:text="Receipt"
android:textColor="#CC3E3E"
android:textSize="50sp"
android:textStyle="bold|italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.494"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvChange"
android:layout_width="98dp"
android:layout_height="31dp"
android:layout_marginStart="112dp"
android:layout_marginTop="12dp"
android:text="Change: £"
android:textSize="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logo" />
<TextView
android:id="@+id/changeView"
android:layout_width="100sp"
android:layout_height="30sp"
android:layout_marginTop="12dp"
android:layout_marginEnd="96dp"
android:maxLength="4"
android:textSize="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logo" />
<TextView
android:id="@+id/tvPaid"
android:layout_width="128dp"
android:layout_height="18dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="Paid:"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/infoTwo" />
<TextView
android:id="@+id/tvHours"
android:layout_width="128dp"
android:layout_height="21dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="Hours:"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pay" />
<TextView
android:id="@+id/infoTwo"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="*VAT WAS TAKEN OFF CHANGE*"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvChange" />
<TextView
android:id="@+id/pay"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvPaid" />
<TextView
android:id="@+id/hours"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvHours" />
<Button
android:id="@+id/startBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="Start"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<ImageView
android:id="@+id/imageView11"
android:layout_width="222dp"
android:layout_height="56dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="92dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/hours"
app:srcCompat="@drawable/audibadge" />
<Button
android:id="@+id/returnBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="RETURN"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<TextView
android:id="@+id/countdownText"
android:textColor="#ffff"
android:layout_width="98dp"
android:layout_height="31dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="148dp"
android:textSize="20dp"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logoTime" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -85,7 +85,6 @@
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" />
......
......@@ -7,13 +7,164 @@
tools:context=".toyotaReceipt">
<TextView
android:id="@+id/changeTV"
android:id="@+id/logoTime"
android:layout_width="312dp"
android:layout_height="63dp"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="Timer:"
android:textColor="#CC3E3E"
android:textSize="30sp"
android:textStyle="bold|italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.515"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/homeBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="162dp"
android:text="TextView"
android:maxLength="4"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="HOME"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<TextView
android:id="@+id/logo"
android:layout_width="312dp"
android:layout_height="63dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="108dp"
android:gravity="center"
android:text="Receipt"
android:textColor="#CC3E3E"
android:textSize="50sp"
android:textStyle="bold|italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.494"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvChange"
android:layout_width="98dp"
android:layout_height="31dp"
android:layout_marginStart="112dp"
android:layout_marginTop="12dp"
android:text="Change: £"
android:textSize="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logo" />
<TextView
android:id="@+id/changeView"
android:layout_width="100sp"
android:layout_height="30sp"
android:layout_marginTop="12dp"
android:layout_marginEnd="96dp"
android:maxLength="4"
android:textSize="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logo" />
<TextView
android:id="@+id/tvPaid"
android:layout_width="128dp"
android:layout_height="18dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="Paid:"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/infoTwo" />
<TextView
android:id="@+id/tvHours"
android:layout_width="128dp"
android:layout_height="21dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="Hours:"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/pay" />
<TextView
android:id="@+id/infoTwo"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
android:text="*VAT WAS TAKEN OFF CHANGE*"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvChange" />
<TextView
android:id="@+id/pay"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvPaid" />
<TextView
android:id="@+id/hours"
android:layout_width="128dp"
android:layout_height="20dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="140dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvHours" />
<Button
android:id="@+id/startBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="Start"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<ImageView
android:id="@+id/imageView11"
android:layout_width="222dp"
android:layout_height="56dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="92dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/hours"
app:srcCompat="@drawable/audibadge" />
<Button
android:id="@+id/returnBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="160dp"
android:background="@drawable/custom_button"
android:text="RETURN"
android:textColor="#ffff"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView11" />
<TextView
android:id="@+id/countdownText"
android:textColor="#ffff"
android:layout_width="98dp"
android:layout_height="31dp"
android:layout_marginTop="2dp"
android:layout_marginEnd="148dp"
android:textSize="20dp"
android:gravity="center"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logoTime" />
</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