package us.feras.mdv.demo;

import us.feras.mdv.MarkdownView;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class MarkdownDataActivity extends Activity {

	EditText markdownEditText;
	MarkdownView markdownView;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.markdown_view);
		markdownEditText = (EditText) findViewById(R.id.markdownText);
		markdownView = (MarkdownView) findViewById(R.id.markdownView);
		String text = "## This is a demo of MarkdownView" + "\n" + "* * *" + "\n" + "### Edit the text and hit update to see the changes on the view.";
		markdownEditText.setText(text);
		updateMarkdownView();

		Button updateView = (Button) findViewById(R.id.updateButton);
		updateView.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				updateMarkdownView();
			}
		});

	}

	void updateMarkdownView() {
		markdownView.loadMarkDownData(markdownEditText.getText().toString());
	}
}
@@ -84,16 +84,47 @@
 tivity;%0A
+import android.graphics.Color;%0A
 import a
@@ -835,16 +835,80 @@
 (text);%0A
+%09%09markdownView.setBackgroundColor(Color.parseColor(%22#EED8AE%22));%0A
 %09%09update

Change the background color for an example.