package io.zetaphase.chewsnap;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.RatingBar;
import android.widget.TextView;

/**
 * Created by Dave Ho on 3/10/2017.
 */

public class ViewDishPopup extends Activity{
    @Override
    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);

        setContentView(R.layout.view_dish_popup);

        DisplayMetrics dm = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(dm);

        int width = dm.widthPixels;
        int height = dm.heightPixels;

        getWindow().setLayout((int) (width*0.8), (int) (height*0.8));

        Intent intent = getIntent();
        int clickedPosition = Integer.valueOf(intent.getStringExtra("CLICKEDPOSITION"));

        Dish dish = MainActivity.dishList.get(clickedPosition);

        TextView title = (TextView) findViewById(R.id.viewDishTitle);
        TextView description = (TextView) findViewById(R.id.viewDishDescription);
        RatingBar ratingBar = (RatingBar) findViewById(R.id.viewDishRating);

        title.setText(dish.getTitle());
        description.setText(dish.getDescription());
        ratingBar.setRating(dish.getRating());

        
    }
}

@@ -841,10 +841,8 @@
 LICK
-ED
 POSI
@@ -1286,24 +1286,16 @@
 ng());%0A%0A
-        
 %0A    %7D%0A%7D

fix intent bug