package com.example.nuria.fesp_cyl;


import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.text.Html.ImageGetter;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import com.example.nuria.fesp_cyl.DataBase.StatusContract;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;


public class DetailsFragment extends Fragment{


    public static final String TAG = "DetailsFragments";

    private long idNoticia;

    private TextView titulo;
    private TextView fecha;
    private TextView descripcion;

    public DetailsFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        Log.d(TAG, "onCreateView");

        View view = inflater.inflate(R.layout. fragment_details, container, false);

        this.titulo = (TextView)view.findViewById(R.id.details_titulo);
        this.fecha = (TextView)view.findViewById(R.id.details_fecha);
        this.descripcion = (TextView)view.findViewById(R.id.details_descripcion);


        Bundle extras = getActivity().getIntent().getExtras();

        this.idNoticia = extras.getLong(StatusContract.Column.ID);

        this.titulo.setText(extras.getString(StatusContract.Column.TITULO));
        this.fecha.setText(extras.getString(StatusContract.Column.FECHA));
        this.descripcion.setText(Html.fromHtml(extras.getString(StatusContract.Column.DESCRIPCION),null,null));

        return view;
    }


}
