package com.github.charmasaur.alpsinsects.ui.fragments;

import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.widget.CursorAdapter;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AlphabetIndexer;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.SectionIndexer;
import android.widget.TextView;
import android.widget.Toast;
import com.github.charmasaur.alpsinsects.R;
import com.github.charmasaur.alpsinsects.db.FieldGuideDatabase;

/**
 * Displays a block of HTML text.
 */
public class HtmlTextFragment extends Fragment {
  private static final String ARGUMENT_RESOURCE_ID = "resource_id";

  public static HtmlTextFragment newInstance(int resourceId) {
    Bundle arguments = new Bundle();
    arguments.putInt(ARGUMENT_RESOURCE_ID, resourceId);

    HtmlTextFragment fragment = new HtmlTextFragment();
    fragment.setArguments(arguments);
    return fragment;
  }

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {
    return inflater.inflate(R.layout.fragment_html_text, container, false);
  }

  @Override
  public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    TextView textView = (TextView) getView().findViewById(R.id.dummy);
    textView.setText(Html.fromHtml(
        getActivity().getString(getArguments().getInt(ARGUMENT_RESOURCE_ID))));
    textView.setMovementMethod(LinkMovementMethod.getInstance());
  }
}

@@ -54,101 +54,8 @@
 s;%0A%0A
-import android.app.Activity;%0Aimport android.content.Context;%0Aimport android.database.Cursor;%0A
 impo
@@ -120,56 +120,8 @@
 nt;%0A
-import android.support.v4.widget.CursorAdapter;%0A
 impo
@@ -193,33 +193,8 @@
 od;%0A
-import android.util.Log;%0A
 impo
@@ -308,330 +308,60 @@
 get.
-AdapterView;%0Aimport android.widget.AlphabetIndexer;%0Aimport android.widget.ImageView;%0Aimport android.widget.ListView;%0Aimport android.widget.SectionIndexer;%0Aimport android.widget.TextView;%0Aimport android.widget.Toast;%0Aimport com.github.charmasaur.alpsinsects.R;%0Aimport com.github.charmasaur.alpsinsects.db.FieldGuideDatabase
+TextView;%0Aimport com.github.charmasaur.alpsinsects.R
 ;%0A%0A/

Remove unused imports from HtmlTextFragment.