package org.commcare.dalvik.activities;

import android.annotation.TargetApi;
import android.os.Build;
import android.os.Bundle;
import android.view.Window;
import android.webkit.WebView;

import org.commcare.android.framework.CommCareActivity;
import org.commcare.android.util.InvalidStateException;
import org.commcare.android.view.GraphView;

/**
 * Full-screen view of a graph.
 *
 * Created by jschweers on 11/20/2015.
 */
public class GraphActivity extends CommCareActivity {

    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Bundle extras = getIntent().getExtras();
        String title = extras.getString(GraphView.TITLE);
        if (title == null) {
            requestWindowFeature(Window.FEATURE_NO_TITLE);
        } else if (title.length() > 0) {
            setTitle(title);
        }

        String html = extras.getString(GraphView.HTML);
        GraphView view = new GraphView(this, title, true);
        try {
            WebView view = (WebView) mView.getView(html);
            setContentView(view);
        } catch (InvalidStateException e) {
            e.printStackTrace();
            finish();
        }
    }
}
@@ -1017,25 +1017,30 @@
   GraphView 
-v
+graphV
 iew = new Gr
@@ -1103,17 +1103,20 @@
 WebView 
-v
+webV
 iew = (W
@@ -1123,17 +1123,21 @@
 ebView) 
-m
+graph
 View.get
@@ -1176,17 +1176,20 @@
 entView(
-v
+webV
 iew);%0D%0A 

fix error