Closed aryanagarwal15 closed 6 years ago
@Rushi98 Please allot this to me. I'll revamp the Article Activity all together.
How can this be solved? Showing images separately from text might not be a good idea as it would lose context. As can be demonstrated by the post in question itself.
I am planning to apply advanced string manipulation techniques. Will just add a width attribute to image.
please explain (advanced string manipulation techniques)
Basically here I have two methods to try out 1) Adding custom style attribute to each tag. with correct width and padding. 2) Adding a custom style sheet to the html. With specific width for all the images.
how to do it on raw html?
htmlData = "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />" + htmlData; // lets assume we have /assets/style.css file webView.loadDataWithBaseURL("file:///android_asset/", htmlData, "text/html", "UTF-8", null);
The example post (http://bitsherald.org/api/get_post/?id=3412) has width and height as inline style. This will override the stylesheet attached. Source: https://www.w3schools.com/css/css_howto.asp
https://stackoverflow.com/questions/16813220/how-can-i-override-inline-styles-with-external-css
We can put !important in external css file for it to override inline style/width attributes.
fixed by #128
Issue: In article images must be handled separately in ArticleViewerActivity. Currently the images shown are of actual length and are flowing out of bounds.
Mimic the issue: Search for "Runtastic Routes" article and scroll down to see in article images.
Screenshot: