public void subOne(View view) { if (coffeeNumber != 0) { Log.d(TAG, "Subtracting one"); coffeeNumber--; } else { Log.d(TAG, "Can't subtract, already a at 0"); } findMyPrice.displayAll(coffeeNumber, cost); }
/** This method is called when the order button is clicked. */ public void submitOrder(View view) { Log.d(TAG, "Your order has been submitted!"); // Toast.makeText(getApplicationContext(), "Your order has been successfully submitted!", // Toast.LENGTH_SHORT).show(); int finalPrice = findMyPrice.calcPrice(coffeeNumber, cost); Intent intent = new Intent(this, OrderActivity.class); intent.putExtra("milkBool", milk); intent.putExtra("creamBool", cream); intent.putExtra("sugarBool", sugar); intent.putExtra("displayValue", finalPrice); intent.putExtra("coffeeCount", coffeeNumber); startActivity(intent); }
public void reset(View view) { coffeeNumber = 0; findMyPrice.displayAll(coffeeNumber, cost); TextView priceView = (TextView) findViewById(R.id.price_text_view); CheckBox milkBox = (CheckBox) findViewById(R.id.milkBox); CheckBox creamBox = (CheckBox) findViewById(R.id.creamBox); CheckBox sugarBox = (CheckBox) findViewById(R.id.sugarBox); if (milkBox.isChecked()) { milkBox.toggle(); } if (creamBox.isChecked()) { creamBox.toggle(); } if (sugarBox.isChecked()) { sugarBox.toggle(); } priceView.setText(""); }
public void addOne(View view) { Log.d(TAG, "Adding one"); coffeeNumber++; findMyPrice.displayAll(coffeeNumber, cost); }