package com.example.shridev1;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

public class RidersDetailsActivity extends AppCompatActivity {

    Button backtoridedetailsbutton;
    TextView ridersName;
    TextView ridersRating;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Ta bort titelbaren längst upp
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getSupportActionBar().hide();
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);


        setContentView(R.layout.activity_riders_details);
        ridersName = (TextView) findViewById(R.id.ridersName);
        ridersRating = (TextView) findViewById(R.id.ridersRating);

        String name = "Name: " + getIntent().getStringExtra("RidersName");
        ridersName.setText(name);

        String rating = "Rating: " + getIntent().getStringExtra("RidersRating");
        ridersRating.setText(rating);

        backtoridedetailsbutton = (Button)findViewById(R.id.backtoridedetailsbutton);
        backtoridedetailsbutton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent i = new Intent(getApplicationContext(), RideDetailsActivity.class);
                startActivity(i);
            }
        });
    }
}