Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.biedin.loginpageactivity;
- import androidx.appcompat.app.AppCompatActivity;
- import android.content.Intent;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.RatingBar;
- import android.widget.TextView;
- public class OrderDetailActivity extends AppCompatActivity {
- private TextView textViewDetails;
- private TextView textViewRating;
- private RatingBar ratingBar;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_order_detail);
- Intent intent = getIntent();
- String login = intent.getStringExtra("login");
- String password = intent.getStringExtra("password");
- String details = intent.getStringExtra("details");
- textViewDetails = findViewById(R.id.textViewComplete);
- textViewRating = findViewById(R.id.textViewRating);
- ratingBar = (RatingBar) findViewById(R.id.ratingBar);
- textViewDetails.setText(String.format(getString(R.string.finish), login, password, details));
- }
- public void onClickRating(View view) {
- switch ((int) ratingBar.getRating()){
- case 1: textViewRating.setText("Так все плохо?"); break;
- case 2: textViewRating.setText("Разве плохо?"); break;
- case 3: textViewRating.setText("Твердая тройка!"); break;
- case 4: textViewRating.setText("А почему не 5?"); break;
- case 5: textViewRating.setText("Ой, ну спасибо :)"); break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement