{"comment":{"url":"https://api.github.com/repos/lambodart/android/comments/27608985","html_url":"https://github.com/lambodart/android/commit/93dcca2aa2c45b123ca59e6d8878a34a30d3fcf3#commitcomment-27608985","id":27608985,"user":{"login":"lambodart","id":36540492,"avatar_url":"https://avatars0.githubusercontent.com/u/36540492?v=4","gravatar_id":"","url":"https://api.github.com/users/lambodart","html_url":"https://github.com/lambodart","followers_url":"https://api.github.com/users/lambodart/followers","following_url":"https://api.github.com/users/lambodart/following{/other_user}","gists_url":"https://api.github.com/users/lambodart/gists{/gist_id}","starred_url":"https://api.github.com/users/lambodart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lambodart/subscriptions","organizations_url":"https://api.github.com/users/lambodart/orgs","repos_url":"https://api.github.com/users/lambodart/repos","events_url":"https://api.github.com/users/lambodart/events{/privacy}","received_events_url":"https://api.github.com/users/lambodart/received_events","type":"User","site_admin":false},"position":2,"line":2,"path":"README.md","commit_id":"93dcca2aa2c45b123ca59e6d8878a34a30d3fcf3","created_at":"2018-02-16T16:38:41Z","updated_at":"2018-02-16T16:38:41Z","author_association":"OWNER","body":"package com.example.acer.coffeeorder;\r\n\r\n\r\nimport android.os.Bundle;\r\nimport android.support.v7.app.AppCompatActivity;\r\nimport android.view.View;\r\nimport android.widget.TextView;\r\n\r\nimport java.text.NumberFormat;\r\n\r\n/**\r\n * This app displays an order form to order coffee.\r\n */\r\npublic class MainActivity extends AppCompatActivity {\r\n    int quantity=2;\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_main);\r\n    }\r\n\r\n    /**\r\n     * This method is called when the order button is clicked.calls\r\n     */\r\n    public void submitOrder(View view) {\r\n\r\n       String priceMessage=\"Total Price \" + quantity*5 ;\r\n       priceMessage=priceMessage+ \"\\nThank you!\";\r\n       displayMessage(priceMessage);\r\n    }\r\n    /**\r\n     * This method is called when the order button is clicked.calls\r\n     */\r\n    public void increment(View view) {\r\n\r\n        quantity=quantity+1;\r\n      //  quantity=quantity+1;\r\n        display(quantity);\r\n\r\n    }\r\n    /**\r\n     * This method is called when the order button is clicked.calls\r\n     */\r\n    public void decrement(View view) {\r\n\r\n        quantity=quantity-1;\r\n        display(quantity);\r\n    }\r\n\r\n    /**\r\n     * This method displays the given quantity value on the screen.declare\r\n     */\r\n    private void display(int number) {\r\n        TextView quantityTextView = (TextView) findViewById(R.id.quantity_text_view);\r\n        quantityTextView.setText(\"\" + number);\r\n    }\r\n    /**\r\n     * This method displays the given price on the screen.\r\n     */\r\n    private void displayPrice(int number) {\r\n        TextView priceTextView = (TextView) findViewById(R.id.price_text_view);\r\n        priceTextView.setText(NumberFormat.getCurrencyInstance().format(number));\r\n    }\r\n    /**\r\n     * This method displays the given text on the screen.\r\n     */\r\n    private void displayMessage(String message) {\r\n        TextView priceTextView = (TextView) findViewById(R.id.price_text_view);\r\n        priceTextView.setText(message);\r\n    }\r\n}\r\n"}}
{"actor":{"display_login":"lambodart"}}