Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <string name="total_coffee_cost">You ordered %1$d cups of coffee. nPrepare to pay $%2$d. nThank you!</string>
- <string name="total_coffee_cost_zero">You have not ordered any cup of coffee. nTry to choose again. nThank you!</string>
- private TextView createOrderSummary(View view){
- CheckBox whippedCreamCheckBox = findViewById(R.id.whipped_cream_checkbox);
- hasWhippedCream = whippedCreamCheckBox.isChecked();
- CheckBox chocolateCheckBox = findViewById(R.id.chocolate_checkbox);
- hasChocolate = chocolateCheckBox.isChecked();
- TextView priceMessage = findViewById(R.id.price_text_view);
- if (numberOfCoffees == 0)
- priceMessage.setText(getString(R.string.total_coffee_cost_zero));
- ....
- else if ((numberOfCoffees > 1) && (!hasWhippedCream) && (!hasChocolate))
- priceMessage.setText(getString(R.string.total_coffee_cost, numberOfCoffees, numberOfCoffees * priceOfCup));
- ....
- return priceMessage;
- }
- <string name="total_coffee_cost">Hi, %1$s! You ordered %2$d cups of coffee. nPrepare to pay $%3$d. nThank you!</string>
Add Comment
Please, Sign In to add comment