Android Library to View an Article Offline
Follow one of these steps to import Article-Viewer into your project:
compile 'com.jeffg.articleviewer:article-viewer:1.3.2'
<dependency>
<groupId>com.jeffg.articleviewer</groupId>
<artifactId>article-viewer</artifactId>
<version>1.3.2</version>
<type>pom</type>
</dependency>
<dependency org='com.jeffg.articleviewer' name='article-viewer' rev='1.3.2'>
<artifact name='article-viewer' ext='pom' ></artifact>
</dependency>
ArticleHtml articleHtml = new ArticleHtml(this);
articleHtml.setBuilder(new ArticleContent.Builder()
.setImageBitmap(bitmap, 100)
.setTitle("Title")
.setSource("Source")
.setContent("Content")
.build());
String html = articleHtml.getHtml();
webview.loadDataWithBaseURL("", html, "text/html", "UTF-8", "");
.setImageBitmap(Bitmap bitmap, int quality)
.setImageDrawable(Drawable drawable, int quality)
.setBackgroundColor(int color)
.setFont(String font)
.setTitle(String title)
.setTitleTextSize(int px)
.setTitleTextAlign(String textAlign)
.setTitleTextColor(int color)
.setSource(String source)
.setSourceTextSize(int px)
.setSourceTextAlign(String textAlign)
.setSourceTextColor(int color)
.setContent(String content)
.setContentTextSize(int px)
.setContentTextAlign(String textAlign)
.setContentTextColor(int color)
.build()
Copyright 2018 Jeff Gugelmann
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.