// Path: app/src/main/java/com/vv/androidreview/entity/Content.java
// public class Content extends BmobObject {
// 
//     //标题
//     private String title;
// 
//     //内容正文
//     private String content;
// 
//     //作者
//     private String author;
// 
//     //内容来源
//     private String source;
// 
//     //创建者
//     private String creater;
// 
//     //所属知识点
//     private Point point;
// 
//     //简介
//     private String small;
// 
//     public String getSmall() {
//         return small;
//     }
// 
//     public void setSmall(String small) {
//         this.small = small;
//     }
// 
//     public Point getPoint() {
//         return point;
//     }
// 
//     public void setPoint(Point point) {
//         this.point = point;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public void setTitle(String title) {
//         this.title = title;
//     }
// 
//     public String getContent() {
//         return content;
//     }
// 
//     public void setContent(String content) {
//         this.content = content;
//     }
// 
//     public String getAuthor() {
//         return author;
//     }
// 
//     public void setAuthor(String author) {
//         this.author = author;
//     }
// 
//     public String getSource() {
//         return source;
//     }
// 
//     public void setSource(String source) {
//         this.source = source;
//     }
// 
//     public String getCreater() {
//         return creater;
//     }
// 
//     public void setCreater(String creater) {
//         this.creater = creater;
//     }
// }


import java.util.Map;
import android.os.Build;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ZoomButtonsController;
import com.orhanobut.logger.Logger;
import com.vv.androidreview.entity.Content;
import java.util.List;
/*
 * Copyright (c) 2016. Vv <envyfan@qq.com><http://www.v-sounds.com/>
 *
 * This file is part of AndroidReview (Android面试复习)
 *
 * AndroidReview is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *  AndroidReview is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 * along with AndroidReview.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.vv.androidreview.utils;




/**
 * Author：Vv on 2015/7/21 16:20
 * Mail：envyfan@qq.com
 * Description：UI帮助类
 */
public class WebViewHelper {

    public static final String LinkCss = "<link rel=\"stylesheet\" type=\"text/css\" href=\"file:///android_asset/css/common.css\">";
    public static final String LinkJS = "<script type=\"text/javascript\" src=\"file:///android_asset/js/common.js\"></script>";
    public static final String Function_RemoveImageAttribute="<script> javascript:removeImageAttribute()</script>";

    public static void initWebViewSettings(WebView webView) {
        WebSettings settings = webView.getSettings();
        //这个单位是SP
        settings.setDefaultFontSize(15);

        settings.setJavaScriptEnabled(true);  //支持js

        settings.setUseWideViewPort(false);  //将图片调整到适合webview的大小

        settings.setSupportZoom(true);  //支持缩放

        settings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);//无论是否有网络，只要本地有缓存，都使用缓存。本地没有缓存时才从网络上获取。 这里的WebView主要是用来加载图片和解析Html文本

        settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); //支持内容重新布局

        webView.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                //使超链接失效
                return true;
            }
        });

    }

    /**
     * 拼凑HTML的头部
     *
     * @return
     */
    public static String getWebViewHead() {
        StringBuffer htmlHead = new StringBuffer();
        htmlHead.append("<head>");
        htmlHead.append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />");
        htmlHead.append(WebViewHelper.setWebViewPadding(2, 2));
        htmlHead.append(WebViewHelper.LinkCss);
        htmlHead.append(WebViewHelper.LinkJS);
        htmlHead.append("</head>");
        return htmlHead.toString();
    }

// Path: app/src/main/java/com/vv/androidreview/entity/Content.java
// public class Content extends BmobObject {
// 
//     //标题
//     private String title;
// 
//     //内容正文
//     private String content;
// 
//     //作者
//     private String author;
// 
//     //内容来源
//     private String source;
// 
//     //创建者
//     private String creater;
// 
//     //所属知识点
//     private Point point;
// 
//     //简介
//     private String small;
// 
//     public String getSmall() {
//         return small;
//     }
// 
//     public void setSmall(String small) {
//         this.small = small;
//     }
// 
//     public Point getPoint() {
//         return point;
//     }
// 
//     public void setPoint(Point point) {
//         this.point = point;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public void setTitle(String title) {
//         this.title = title;
//     }
// 
//     public String getContent() {
//         return content;
//     }
// 
//     public void setContent(String content) {
//         this.content = content;
//     }
// 
//     public String getAuthor() {
//         return author;
//     }
// 
//     public void setAuthor(String author) {
//         this.author = author;
//     }
// 
//     public String getSource() {
//         return source;
//     }
// 
//     public void setSource(String source) {
//         this.source = source;
//     }
// 
//     public String getCreater() {
//         return creater;
//     }
// 
//     public void setCreater(String creater) {
//         this.creater = creater;
//     }
// }


// Path: app/src/main/java/com/vv/androidreview/utils/WebViewHelper.java
import java.util.Map;
import android.os.Build;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ZoomButtonsController;
import com.orhanobut.logger.Logger;
import com.vv.androidreview.entity.Content;
import java.util.List;

/*
 * Copyright (c) 2016. Vv <envyfan@qq.com><http://www.v-sounds.com/>
 *
 * This file is part of AndroidReview (Android面试复习)
 *
 * AndroidReview is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 *  AndroidReview is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 * along with AndroidReview.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.vv.androidreview.utils;




/**
 * Author：Vv on 2015/7/21 16:20
 * Mail：envyfan@qq.com
 * Description：UI帮助类
 */
public class WebViewHelper {

    public static final String LinkCss = "<link rel=\"stylesheet\" type=\"text/css\" href=\"file:///android_asset/css/common.css\">";
    public static final String LinkJS = "<script type=\"text/javascript\" src=\"file:///android_asset/js/common.js\"></script>";
    public static final String Function_RemoveImageAttribute="<script> javascript:removeImageAttribute()</script>";

    public static void initWebViewSettings(WebView webView) {
        WebSettings settings = webView.getSettings();
        //这个单位是SP
        settings.setDefaultFontSize(15);

        settings.setJavaScriptEnabled(true);  //支持js

        settings.setUseWideViewPort(false);  //将图片调整到适合webview的大小

        settings.setSupportZoom(true);  //支持缩放

        settings.setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);//无论是否有网络，只要本地有缓存，都使用缓存。本地没有缓存时才从网络上获取。 这里的WebView主要是用来加载图片和解析Html文本

        settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); //支持内容重新布局

        webView.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                //使超链接失效
                return true;
            }
        });

    }

    /**
     * 拼凑HTML的头部
     *
     * @return
     */
    public static String getWebViewHead() {
        StringBuffer htmlHead = new StringBuffer();
        htmlHead.append("<head>");
        htmlHead.append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />");
        htmlHead.append(WebViewHelper.setWebViewPadding(2, 2));
        htmlHead.append(WebViewHelper.LinkCss);
        htmlHead.append(WebViewHelper.LinkJS);
        htmlHead.append("</head>");
        return htmlHead.toString();
    }

    public static String getWebViewHtml(Content content) {