Android Open Source - MarkdownView Markdown Themes Activity






From Project

Back to project page MarkdownView.

License

The source code is released under:

Apache License

If you think the Android project MarkdownView listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package us.feras.mdv.demo;
/*  ww w  . ja va  2 s . co  m*/
import us.feras.mdv.MarkdownView;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

public class MarkdownThemesActivity extends Activity implements
    OnItemSelectedListener {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.markdown_themes);
    Spinner themesSpinner = (Spinner) findViewById(R.id.themes_spinner);
    ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
        this, R.array.md_themes, android.R.layout.simple_spinner_item);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    themesSpinner.setAdapter(adapter);
    themesSpinner.setSelection(0);
    themesSpinner.setOnItemSelectedListener(this);
  }

  @Override
  public void onItemSelected(AdapterView<?> parent, View view, int pos,
      long id) {
    MarkdownView mdv = (MarkdownView) findViewById(R.id.markdownView);
    mdv.loadMarkdownFile("file:///android_asset/hello.md",
        "file:///android_asset/markdown_css_themes/"
            + parent.getItemAtPosition(pos).toString() + ".css");
  }

  @Override
  public void onNothingSelected(AdapterView<?> parent) {
    // no-op
  }
}




Java Source Code List

com.petebevin.markdown.CharacterProtector.java
com.petebevin.markdown.HTMLDecoder.java
com.petebevin.markdown.HTMLToken.java
com.petebevin.markdown.LinkDefinition.java
com.petebevin.markdown.MarkdownProcessor.java
com.petebevin.markdown.Replacement.java
com.petebevin.markdown.TextEditor.java
us.feras.mdv.MarkdownView.java
us.feras.mdv.demo.LocalMarkdownActivity.java
us.feras.mdv.demo.MainActivity.java
us.feras.mdv.demo.MarkdownDataActivity.java
us.feras.mdv.demo.MarkdownThemesActivity.java
us.feras.mdv.demo.OnlineMarkdownActivity.java
us.feras.mdv.util.HttpHelper.java