Java Question Additional jar and Markdown .jar

bluedude

Well-Known Member
Licensed User
Longtime User
A very popular way to render HTML is from something called Markdown. I want to support markdown by using AdditionalJar, can that work?

Normally markdown is implemented like:

MarkdownView markdownView = new MarkdownView(this);setContentView(markdownView);

Can we di this by using Javaobject and AdditionalJar?

More info here: https://github.com/Gunio/MarkdownView
 

bluedude

Well-Known Member
Licensed User
Longtime User
I hav no clue how to do the oncreate stuff with a java object. It seems we need to bind the markdown library to an activity and that's it. Markdown is very very popular on Github etc.
 

thedesolatesoul

Expert
Licensed User
Longtime User
You wont be able to use setContentView (that happens before Activity_Create).

This view is essentialyl an extension of webview, I dont know if you just create a webview and assign an instance of the markdownview to it will it work.
Essentially that is assigning a subclass reference to a superclass variable. (Probably compile fail)

It is pretty easy to create a library out of this though. (However documentation will be lost as docs are not inherited).
 

bluedude

Well-Known Member
Licensed User
Longtime User
I would love to see somebody doing it with the Simple Library Compiler so I can also learn. Could you do that? I'm fine to pay a fee of course. Tell me what is reasonable, according to their documentation it seems to be extremely easy.

I will first look around for the best Markdown solution.

Cheers.
 

bluedude

Well-Known Member
Licensed User
Longtime User
Just discovered I can simply do it with a javascript and webview, seems to be working ok.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Thats good. Unfortunately I dont have a lot of time, but I would have liked to show and learn at the same time.

It would have been a simple wrapper as:

public MarkDownViewWrapper extends ViewWrapper<MarkDownView> {

}

Expose its two methods, and another method to return the underlying webview as a (WebViewWrapper).
The only thing I am not sure of is whether returning the webview wrapped into a WebViewWrapper is whether it will contain any LayoutParams.

I wonder what strategy Erel would have applied.
 
Top