Commit a4b07d0c authored by Christophe Henry's avatar Christophe Henry

Solves #12: Implement CSS for article detail

parent f535e399
......@@ -10,6 +10,7 @@
* Add sections and section headers to subscriptions ([!10](https://git.feneas.org/christophehenry/freshrss-android/merge_requests/5))
* Implement [#45](https://git.feneas.org/christophehenry/freshrss-android/issues/45): add badge to unread articles section to indicate total count of unread articles ([!9](https://git.feneas.org/christophehenry/freshrss-android/merge_requests/9))
* Implement [#31](https://git.feneas.org/christophehenry/freshrss-android/issues/31): browse feeds by category ([!10](https://git.feneas.org/christophehenry/freshrss-android/merge_requests/10))
* Implement [#12](https://git.feneas.org/christophehenry/freshrss-android/merge_requests/12): CSS for article detail ([!12](https://git.feneas.org/christophehenry/freshrss-android/merge_requests/12))
## Bug fixes
......
body {
padding: 0 0.5rem;
font-size: 14pt;
}
body h1 {
line-height: 1.2em;
}
// TODO: Support other directions (arabic, for instance)
#article-authors {
direction: rtl;
}
#main-content, #main-content * {
max-width: 100%;
line-height: 1.4em;
overflow-x: auto;
}
#main-content img {
max-width: 80%;
height: auto;
display: block;
margin: 0 auto;
}
#main-content pre {
font-size: 12pt;
line-height: 1.2em;
}
#main-content ol, #main-content ul {
padding: 0 0 0 1.2em;
list-style-position: inside;
}
#main-content li:not(:first-child) {
padding-top: 0.5em;
}
#main-content > p:first-child {
margin-top: 0;
}
\ No newline at end of file
......@@ -54,17 +54,18 @@ class SubscriptionArticlesDetailFragment: Fragment() {
| <head>
| <title>${article.title}</title>
| <meta charset="UTF-8" />
| <link rel="stylesheet" type="text/css" href="base-style.css" />
| </head>
| <body>
| <h1 id="article-title">${article.title}</h1>
| ${if(article.author.isEmpty()) "<h2 id='article-authors'>${article.author}</h2>" else ""}
| ${if(article.author.isNotEmpty()) "<h3 id='article-authors'>${article.author}</h3>" else ""}
| <div id="main-content">${article.content}</div>
| </body>
|</html>
""".trimMargin("|").let {
wv.settings.javaScriptEnabled = false
wv.settings.defaultTextEncodingName = "UTF-8"
wv.loadData(it, "text/html; charset=utf-8", "UTF-8")
wv.loadDataWithBaseURL("file:///android_asset/", it, "text/html; charset=utf-8", "UTF-8", null)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment