package com.example.instilostandfound;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

public class ItemDetails extends AppCompatActivity {
String category, name, key;
int type;
Bundle details_bundle;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_item_details);

        CreateFoundObject objectfound = (CreateFoundObject)getIntent().getSerializableExtra("FoundObject");
        Log.v("desc",objectfound.getmDescription());

        ((TextView)findViewById(R.id.categorycontent)).setText(objectfound.getmCategory());
        ((TextView)findViewById(R.id.namecontent)).setText(objectfound.getmTitle());
        ((TextView) findViewById(R.id.placecontent)).setText(objectfound.getmLocation());
        ((TextView) findViewById(R.id.descriptioncontent)).setText(objectfound.getmDescription());
        ((TextView) findViewById(R.id.datecontent)).setText(objectfound.getDate());
        ImageView camera = findViewById(R.id.imagecam);
        Picasso.with(ItemDetails.this).load(objectfound.getImageUrl())
                .fit()
                .centerCrop()
                .into(camera);


       // findViewById(R.id.edit_post).setOnClickListener(this);
       // findViewById(R.id.resolve_post).setOnClickListener(this);
    }

 /*   @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.edit_post:
                if(details_bundle.getString("type").equals("lost")){
                    Intent intent = new Intent(ItemDetails.this, LostItem.class);
                    intent.putExtras(details_bundle);
                    startActivity(intent);
                }
                else if(details_bundle.getString("type").equals("found")){
                    Intent intent = new Intent(ItemDetails.this, FoundItem.class);
                    intent.putExtras(details_bundle);
                    startActivity(intent);
                }
                break;
            case R.id.resolve_post:
                break;
        }
    }*/
}
