package org.keyscience.fragments;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import org.keyscience.R;

public class ReefRestoChildFragment extends Fragment {
    Context context;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable final Bundle savedInstanceState) {
        context = getContext();

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

        // Paragraphs that require HTML
        String rrSection2 = getResources().getString(R.string.reef_child_restoTxt2);
        TextView rr_textView2 = view.findViewById(R.id.rr_child_textView2);
        rr_textView2.setText(Html.fromHtml(rrSection2));

        TextView rrEmail = view.findViewById(R.id.rr_child_email);
        rrEmail.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("mailto:rescueareef@gmail.com"));
                startActivity(browserIntent);
            }
        });

        return view;
    }
}
