Browse Source

commit1

master
陈文博 6 years ago
commit
fcb142bc7b
100 changed files with 10204 additions and 0 deletions
  1. 10
    0
      .gitignore
  2. BIN
      .idea/caches/build_file_checksums.ser
  3. 29
    0
      .idea/codeStyles/Project.xml
  4. 18
    0
      .idea/gradle.xml
  5. 9
    0
      .idea/misc.xml
  6. 12
    0
      .idea/runConfigurations.xml
  7. 1
    0
      app/.gitignore
  8. 24
    0
      app/build.gradle
  9. 17
    0
      app/proguard-rules.pro
  10. 22
    0
      app/src/main/AndroidManifest.xml
  11. 72
    0
      app/src/main/assets/TestHtml.html
  12. 95
    0
      app/src/main/assets/TestHtml2.html
  13. 50
    0
      app/src/main/assets/TestHtml3.html
  14. 52
    0
      app/src/main/assets/TestHtml4.html
  15. 45
    0
      app/src/main/assets/TestHtml5.html
  16. 172
    0
      app/src/main/assets/TestHtml6.html
  17. BIN
      app/src/main/assets/smiley/tieba/01.png
  18. BIN
      app/src/main/assets/smiley/tieba/02.png
  19. BIN
      app/src/main/assets/smiley/tieba/03.png
  20. BIN
      app/src/main/assets/smiley/tieba/04.png
  21. BIN
      app/src/main/assets/smiley/tieba/05.png
  22. BIN
      app/src/main/assets/smiley/tieba/06.png
  23. BIN
      app/src/main/assets/smiley/tieba/07.png
  24. BIN
      app/src/main/assets/smiley/tieba/08.png
  25. BIN
      app/src/main/assets/smiley/tieba/09.png
  26. BIN
      app/src/main/assets/smiley/tieba/10.png
  27. BIN
      app/src/main/assets/smiley/tieba/11.png
  28. BIN
      app/src/main/assets/smiley/tieba/12.png
  29. BIN
      app/src/main/assets/smiley/tieba/13.png
  30. BIN
      app/src/main/assets/smiley/tieba/14.png
  31. BIN
      app/src/main/assets/smiley/tieba/15.png
  32. BIN
      app/src/main/assets/smiley/tieba/16.png
  33. BIN
      app/src/main/assets/smiley/tieba/17.png
  34. BIN
      app/src/main/assets/smiley/tieba/18.png
  35. BIN
      app/src/main/assets/smiley/tieba/19.png
  36. BIN
      app/src/main/assets/smiley/tieba/20.png
  37. BIN
      app/src/main/assets/smiley/tieba/21.png
  38. BIN
      app/src/main/assets/smiley/tieba/22.png
  39. BIN
      app/src/main/assets/smiley/tieba/23.png
  40. BIN
      app/src/main/assets/smiley/tieba/24.png
  41. BIN
      app/src/main/assets/smiley/tieba/25.png
  42. BIN
      app/src/main/assets/smiley/tieba/26.png
  43. BIN
      app/src/main/assets/smiley/tieba/27.png
  44. BIN
      app/src/main/assets/smiley/tieba/28.png
  45. BIN
      app/src/main/assets/smiley/tieba/29.png
  46. BIN
      app/src/main/assets/smiley/tieba/30.png
  47. BIN
      app/src/main/assets/smiley/tieba/31.png
  48. BIN
      app/src/main/assets/smiley/tieba/32.png
  49. BIN
      app/src/main/assets/smiley/tieba/33.png
  50. BIN
      app/src/main/assets/smiley/tieba/34.png
  51. BIN
      app/src/main/assets/smiley/tieba/35.png
  52. BIN
      app/src/main/assets/smiley/tieba/36.png
  53. BIN
      app/src/main/assets/smiley/tieba/37.png
  54. BIN
      app/src/main/assets/smiley/tieba/38.png
  55. BIN
      app/src/main/assets/smiley/tieba/39.png
  56. BIN
      app/src/main/assets/smiley/tieba/40.png
  57. BIN
      app/src/main/assets/smiley/tieba/41.png
  58. BIN
      app/src/main/assets/smiley/tieba/42.png
  59. BIN
      app/src/main/assets/smiley/tieba/43.png
  60. BIN
      app/src/main/assets/smiley/tieba/44.png
  61. BIN
      app/src/main/assets/smiley/tieba/45.png
  62. BIN
      app/src/main/assets/smiley/tieba/46.png
  63. BIN
      app/src/main/assets/smiley/tieba/47.png
  64. BIN
      app/src/main/assets/smiley/tieba/48.png
  65. BIN
      app/src/main/assets/smiley/tieba/49.png
  66. BIN
      app/src/main/assets/smiley/tieba/50.png
  67. BIN
      app/src/main/assets/smiley/tieba/51.png
  68. BIN
      app/src/main/assets/smiley/tieba/52.png
  69. BIN
      app/src/main/assets/smiley/tieba/53.png
  70. BIN
      app/src/main/assets/smiley/tieba/54.png
  71. BIN
      app/src/main/assets/smiley/tieba/55.png
  72. BIN
      app/src/main/assets/smiley/tieba/56.png
  73. BIN
      app/src/main/assets/smiley/tieba/57.png
  74. BIN
      app/src/main/assets/smiley/tieba/58.png
  75. BIN
      app/src/main/assets/smiley/tieba/59.png
  76. BIN
      app/src/main/assets/smiley/tieba/60.png
  77. BIN
      app/src/main/assets/smiley/tieba/61.png
  78. BIN
      app/src/main/assets/smiley/tieba/62.png
  79. BIN
      app/src/main/assets/smiley/tieba/63.png
  80. BIN
      app/src/main/assets/smiley/tieba/64.png
  81. BIN
      app/src/main/assets/smiley/tieba/65.png
  82. BIN
      app/src/main/assets/smiley/tieba/66.png
  83. BIN
      app/src/main/assets/smiley/tieba/67.png
  84. BIN
      app/src/main/assets/smiley/tieba/68.png
  85. BIN
      app/src/main/assets/smiley/tieba/69.png
  86. BIN
      app/src/main/assets/smiley/tieba/70.png
  87. BIN
      app/src/main/assets/smiley/tieba/71.png
  88. BIN
      app/src/main/assets/smiley/tieba/72.png
  89. BIN
      app/src/main/assets/smiley/tieba/73.png
  90. 182
    0
      app/src/main/assets/test.html
  91. BIN
      app/src/main/assets/test1.jpg
  92. 184
    0
      app/src/main/assets/test2.html
  93. 7625
    0
      app/src/main/assets/test3.html
  94. 330
    0
      app/src/main/java/me/yluo/htmlview/AttrParser.java
  95. 44
    0
      app/src/main/java/me/yluo/htmlview/DefaultClickHandler.java
  96. 293
    0
      app/src/main/java/me/yluo/htmlview/DefaultImageGetter.java
  97. 48
    0
      app/src/main/java/me/yluo/htmlview/HtmlNode.java
  98. 794
    0
      app/src/main/java/me/yluo/htmlview/HtmlParser.java
  99. 76
    0
      app/src/main/java/me/yluo/htmlview/HtmlTag.java
  100. 0
    0
      app/src/main/java/me/yluo/htmlview/HtmlView.java

+ 10
- 0
.gitignore View File

@@ -0,0 +1,10 @@
1
+*.iml
2
+.gradle
3
+/local.properties
4
+/.idea/libraries
5
+/.idea/modules.xml
6
+/.idea/workspace.xml
7
+.DS_Store
8
+/build
9
+/captures
10
+.externalNativeBuild

BIN
.idea/caches/build_file_checksums.ser View File


+ 29
- 0
.idea/codeStyles/Project.xml View File

@@ -0,0 +1,29 @@
1
+<component name="ProjectCodeStyleConfiguration">
2
+  <code_scheme name="Project" version="173">
3
+    <Objective-C-extensions>
4
+      <file>
5
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
6
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
7
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
8
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
9
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
10
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
11
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
12
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
13
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
14
+      </file>
15
+      <class>
16
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
17
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
18
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
19
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
20
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
21
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
22
+      </class>
23
+      <extensions>
24
+        <pair source="cpp" header="h" fileNamingConvention="NONE" />
25
+        <pair source="c" header="h" fileNamingConvention="NONE" />
26
+      </extensions>
27
+    </Objective-C-extensions>
28
+  </code_scheme>
29
+</component>

+ 18
- 0
.idea/gradle.xml View File

@@ -0,0 +1,18 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="GradleSettings">
4
+    <option name="linkedExternalProjectsSettings">
5
+      <GradleProjectSettings>
6
+        <option name="distributionType" value="DEFAULT_WRAPPED" />
7
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
8
+        <option name="modules">
9
+          <set>
10
+            <option value="$PROJECT_DIR$" />
11
+            <option value="$PROJECT_DIR$/app" />
12
+          </set>
13
+        </option>
14
+        <option name="resolveModulePerSourceSet" value="false" />
15
+      </GradleProjectSettings>
16
+    </option>
17
+  </component>
18
+</project>

+ 9
- 0
.idea/misc.xml View File

@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
4
+    <output url="file://$PROJECT_DIR$/build/classes" />
5
+  </component>
6
+  <component name="ProjectType">
7
+    <option name="id" value="Android" />
8
+  </component>
9
+</project>

+ 12
- 0
.idea/runConfigurations.xml View File

@@ -0,0 +1,12 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="RunConfigurationProducerService">
4
+    <option name="ignoredProducers">
5
+      <set>
6
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
7
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
8
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
9
+      </set>
10
+    </option>
11
+  </component>
12
+</project>

+ 1
- 0
app/.gitignore View File

@@ -0,0 +1 @@
1
+/build

+ 24
- 0
app/build.gradle View File

@@ -0,0 +1,24 @@
1
+apply plugin: 'com.android.application'
2
+
3
+android {
4
+    compileSdkVersion 25
5
+    buildToolsVersion '27.0.3'
6
+    defaultConfig {
7
+        applicationId "me.yluo.htmlview"
8
+        minSdkVersion 21
9
+        targetSdkVersion 25
10
+        versionCode 1
11
+        versionName "1.0"
12
+        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13
+    }
14
+    buildTypes {
15
+        release {
16
+            minifyEnabled false
17
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18
+        }
19
+    }
20
+}
21
+
22
+dependencies {
23
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
24
+}

+ 17
- 0
app/proguard-rules.pro View File

@@ -0,0 +1,17 @@
1
+# Add project specific ProGuard rules here.
2
+# By default, the flags in this file are appended to flags specified
3
+# in C:\app\AndroidSdk/tools/proguard/proguard-android.txt
4
+# You can edit the include path and order by changing the proguardFiles
5
+# directive in build.gradle.
6
+#
7
+# For more details, see
8
+#   http://developer.android.com/guide/developing/tools/proguard.html
9
+
10
+# Add any project specific keep options here:
11
+
12
+# If your project uses WebView with JS, uncomment the following
13
+# and specify the fully qualified class name to the JavaScript interface
14
+# class:
15
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16
+#   public *;
17
+#}

+ 22
- 0
app/src/main/AndroidManifest.xml View File

@@ -0,0 +1,22 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+    package="me.yluo.htmlview">
4
+
5
+    <uses-permission android:name="android.permission.INTERNET" />
6
+
7
+    <application
8
+        android:allowBackup="true"
9
+        android:icon="@mipmap/ic_launcher"
10
+        android:label="@string/app_name"
11
+        android:supportsRtl="true"
12
+        android:theme="@style/AppTheme">
13
+        <activity android:name=".MainActivity">
14
+            <intent-filter>
15
+                <action android:name="android.intent.action.MAIN" />
16
+
17
+                <category android:name="android.intent.category.LAUNCHER" />
18
+            </intent-filter>
19
+        </activity>
20
+    </application>
21
+
22
+</manifest>

+ 72
- 0
app/src/main/assets/TestHtml.html View File

@@ -0,0 +1,72 @@
1
+<h1>这是h1无法自定义这是h1</h1>
2
+<p>西安电子科技大学校园睿思论坛客户端。本客户端在校园网和校外网环境下均可使用</p>
3
+<h2>这是h2</h2>
4
+<p>西安电子科技大学校园睿思论坛客户端。本客户端在校园网和校外网环境下均可使用</p>
5
+<h3>这是h3</h3>
6
+<p>西安电子科技大学校园睿思论坛客户端。本客户端在校园网和校外网环境下均可使用</p>
7
+<h4>这是h4</h4>
8
+<h5>这是h5</h5>
9
+<h6>这是h6</h6>
10
+
11
+<hr/>
12
+
13
+<!--adasfdafdfsd这是注释  -->
14
+
15
+<p style="text-align:right;color: #00FF00;">This is <a href="http://jsoup.org/">jsoup</a>.</p>
16
+
17
+<ul>
18
+    <li>这是ul里面的li1</li>
19
+    <li>这是ul里面的li2</li>
20
+    <li>这是ul里面的li3</li>
21
+    <li>这是ul里面的li4</li>
22
+    <li>这是ul里面的li5</li>
23
+</ul>
24
+
25
+<a href="http://www.baidu.com/">连接标签连接标签</a>
26
+
27
+<img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1494414177844&di=6a1e3005437619001044ca61dd996fd5&imgtype=0&src=http%3A%2F%2Fwww.bz55.com%2Fuploads%2Fallimg%2F120913%2F1-120913151Z6.jpg">
28
+<img src="https://ss0.baidu.com/-Po3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/2cf5e0fe9925bc311723793e5cdf8db1cb13701d.jpg">
29
+<img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1494414215043&di=50964a8f9bc49c56e77c7c20cac56f49&imgtype=0&src=http%3A%2F%2Fc.hiphotos.baidu.com%2Fzhidao%2Fpic%2Fitem%2F0eb30f2442a7d9337afbe24aa94bd11373f001b3.jpg">
30
+
31
+
32
+<blockquote>
33
+    这是blockquote标签这是blockquote标签这是blockquote标签这是blockquote标签
34
+</blockquote>
35
+
36
+
37
+<i>i标签</i><u>u标签</u><b>b标签</b><strike>strike标签</strike><strong>加粗标签</strong>
38
+
39
+<pre>
40
+private SpanConverter(String source, HtmlView.ImageGetter imageGetter) {
41
+    mSource = source;
42
+    this.imageGetter = imageGetter;
43
+    parser = new HtmlParser();
44
+    nodes = new Stack<>();
45
+    parser.setHandler(this);
46
+    position = 0;
47
+}
48
+</pre>
49
+
50
+<code>code标签</code>
51
+
52
+<div class="message">
53
+    我们在高中相识,高二的一个上自习的晚上决定在一起的<img src="smiley/tieba/25.png">,大学异地三年多,她西电本科毕业就工作了,我在西电读研,至今她工作一年半,我对她的朋友什么的都不认识,她也拒绝介绍我,我跟我的朋友都介绍过她,<br/>从她开始工作提过好多次分手,但我很舍不得,后来她说要想和她在一起,让我给她xxxx钱<img
54
+        src="smiley/tieba/28.png">,我就给了,现在她没有提分手,但我一给她打电话或者聊天她一般就回两个字,说多了就说我很烦,我感觉她是在逼我分手,心里很不是滋味,能做的我都做了,不知道她心里到底是怎么想的,感觉工作的和学习的谈恋爱好难,不知道大家都是怎么处理这种事情的,给点建议。<br>
55
+</div>
56
+
57
+<font size="5">555555555</font>
58
+<font size="5">222222222222</font>
59
+<font size="3">高二的一个上自习的晚上决定在一起的333</font>
60
+<font size="1">高二的一个上自习的晚上决定在一起的111</font>
61
+
62
+<br/>
63
+
64
+<font face="仿宋">
65
+    <font size="5">
66
+        <font color="blue">
67
+            <font color="red">
68
+                火热征集中!请小伙伴们继续留下真知灼见!......
69
+            </font>
70
+        </font>
71
+    </font>
72
+</font>

+ 95
- 0
app/src/main/assets/TestHtml2.html View File

@@ -0,0 +1,95 @@
1
+<div class="message">
2
+
3
+
4
+    <i class="pstatus"> 本帖最后由 风信子2012 于 2017-4-28 13:17 编辑 </i><br>
5
+    <br>
6
+    <img src="static/image/smiley/jgz/jgz060.png" smilieid="756" border="0" alt=""
7
+         zsrc="static/image/smiley/jgz/jgz060.png"
8
+         style="display: inline; visibility: visible;"><font size="4">那是一个神奇的一天,自那以后打开了新世界的大门,我在学习的轨道上偏离的越来越远了</font><img
9
+        src="static/image/smiley/jgz/jgz082.png" smilieid="755" border="0" alt=""
10
+        zsrc="static/image/smiley/jgz/jgz082.png" style="display: inline; visibility: visible;">因为,我来到了——<font
11
+        size="4"><font color="#ff0000">睿思</font></font><br>
12
+    <font size="4">其实,我只是觉得在睿思花的时间有点多了,但是也没有觉得很可怕啊。可是,在我分析了我的下载历史之后,我发现学习成绩越来越差是有原因的啊</font><img
13
+        src="static/image/smiley/jgz/jgz072.png" smilieid="743" border="0" alt=""
14
+        zsrc="static/image/smiley/jgz/jgz072.png"
15
+        style="display: inline; visibility: visible;"><font size="4"><br>
16
+</font><br>
17
+    <font size="4">废话少说,放图了</font><img src="static/image/smiley/qiubilong/101.gif" smilieid="623"
18
+                                       border="0" alt=""
19
+                                       zsrc="static/image/smiley/qiubilong/101.gif"
20
+                                       style="display: inline; visibility: visible;"><br>
21
+    <font color="#0000ff">2013年5月31日-2017年4月25日在睿思每月下载种子数量</font><br>
22
+
23
+
24
+    <a href="forum.php?mod=viewthread&amp;tid=862167&amp;aid=871569&amp;from=album&amp;page=1&amp;mobile=2"
25
+       class="orange"><img id="aimg_871569"
26
+                           src="forum.php?mod=image&aid=871569&size=140x140&key=e209321841424cc9&type=fixnone"
27
+                           alt="rs1.jpg" title="rs1.jpg"
28
+                           zsrc="forum.php?mod=image&amp;aid=871569&amp;size=140x140&amp;key=e209321841424cc9&amp;type=fixnone"
29
+                           style="display: inline; visibility: visible;"></a>
30
+
31
+    <br>
32
+    <br>
33
+    <br>
34
+    <img src="static/image/smiley/jgz/jgz082.png" smilieid="755" border="0" alt=""
35
+         zsrc="static/image/smiley/jgz/jgz082.png"
36
+         style="display: inline; visibility: visible;"><font size="4">谁能告诉我2014年9月-12月发生了什么嘛,下载种子数量飙升啊,那时候我应该还是个热爱学习的好少年啊</font><img
37
+        src="static/image/smiley/jgz/jgz035.png" smilieid="809" border="0" alt=""
38
+        zsrc="static/image/smiley/jgz/jgz035.png" style="display: inline; visibility: visible;"><br>
39
+    <br>
40
+    <font size="4">15年11月到16年8月没有下载数据,虽然我很爱学习,可是不下载貌似不可能啊,是不是当时睿思服务器挂了数据丢失了啊</font><img
41
+        src="static/image/smiley/jgz/jgz086.png" smilieid="779" border="0" alt=""
42
+        zsrc="static/image/smiley/jgz/jgz086.png" style="display: inline; visibility: visible;"><br>
43
+    <font color="#0000ff"><br>
44
+    </font><br>
45
+    <font color="#0000ff">各类种子下载占比</font><br>
46
+
47
+
48
+    <a href="forum.php?mod=viewthread&amp;tid=862167&amp;aid=871570&amp;from=album&amp;page=1&amp;mobile=2"
49
+       class="orange"><img id="aimg_871570"
50
+                           src="forum.php?mod=image&amp;aid=871570&amp;size=140x140&amp;key=d03eb149666403e2&amp;type=fixnone"
51
+                           alt="rs2.jpg" title="rs2.jpg"
52
+                           zsrc="forum.php?mod=image&amp;aid=871570&amp;size=140x140&amp;key=d03eb149666403e2&amp;type=fixnone"
53
+                           style="display: inline; visibility: visible;"></a>
54
+
55
+    <br>
56
+    <img src="static/image/smiley/jgz/jgz038.png" smilieid="792" border="0" alt=""
57
+         zsrc="static/image/smiley/jgz/jgz038.png"
58
+         style="display: inline; visibility: visible;"><font size="4">值得欣慰的是,学习相关的还能占到第三,嗯,加上软件和文档的,也许学习相关的就第一了呢,我真的是个热爱学习的好少年啊</font><br>
59
+    <font color="#0000ff"><br>
60
+    </font><br>
61
+    <font color="#0000ff">各类种子下载量</font><br>
62
+
63
+
64
+    <a href="forum.php?mod=viewthread&amp;tid=862167&amp;aid=871571&amp;from=album&amp;page=1&amp;mobile=2"
65
+       class="orange"><img id="aimg_871571"
66
+                           src="forum.php?mod=image&amp;aid=871571&amp;size=140x140&amp;key=e8ae9b21f5517bf4&amp;type=fixnone"
67
+                           alt="rs3.jpg" title="rs3.jpg"
68
+                           zsrc="forum.php?mod=image&amp;aid=871571&amp;size=140x140&amp;key=e8ae9b21f5517bf4&amp;type=fixnone"
69
+                           style="display: inline; visibility: visible;"></a>
70
+
71
+    <br>
72
+    <img src="static/image/smiley/jgz/jgz062.png" smilieid="766" border="0" alt=""
73
+         zsrc="static/image/smiley/jgz/jgz062.png"
74
+         style="display: inline; visibility: visible;"><font size="4">我看出来了我是一个有一定的影视鉴赏能力和热爱学习的当代优秀大学生啊,不信你看我种子下载数量啊,影视和学习那么多呢,啊哈哈</font><br>
75
+    <font size="4"><br>
76
+    </font><br>
77
+    <font size="4"><br>
78
+    </font><br>
79
+    <font size="4">分析了数据,写了这么多,千言万语汇成一句话,爱我中华,</font><font size="4">爱我中华,</font><font size="4">爱我中华!哦,画风不对啊,是</font><font
80
+        size="6"><font color="#ff0000">爱我睿思,爱我睿思,爱我睿思</font></font><br>
81
+    <font size="4"><font
82
+            color="#000000">看了我的下载记录,才知道睿思给了我多大的帮助,感谢睿思,感谢版主的付出,感谢一切为了睿思更好的人啊</font></font><img
83
+        src="static/image/smiley/jgz/jgz008.png" smilieid="718" border="0" alt=""
84
+        zsrc="static/image/smiley/jgz/jgz008.png" style="display: inline; visibility: visible;"><br>
85
+    <br>
86
+    <br>
87
+    <br>
88
+    <font size="4">最后,睿思走到今天真的很不容易,珍惜拥有睿思的每一天吧,我是快要离开睿思了</font><img
89
+        src="static/image/smiley/jgz/jgz082.png" smilieid="755" border="0" alt=""
90
+        zsrc="static/image/smiley/jgz/jgz082.png" style="display: inline; visibility: visible;"><br>
91
+    <font size="4">多些理解,多些包容,多些支持,睿思给了我很大帮助。</font><br>
92
+    <img src="static/image/smiley/jgz/jgz018.png" smilieid="731" border="0" alt=""
93
+         zsrc="static/image/smiley/jgz/jgz018.png"
94
+         style="display: inline; visibility: visible;"><font size="5"><font color="#ff0000">人品和金币在哪里啊,求捧场啊</font></font><br>
95
+</div>

+ 50
- 0
app/src/main/assets/TestHtml3.html View File

@@ -0,0 +1,50 @@
1
+<div class="message">
2
+    <div id="postmessage_21922861" class="postmessage">不知道大家对微商怎么看待,
3
+        我现在已经无法理解那些不停地在朋友圈买东西的人了。。。如果不是吃的或者化妆品什么的,我还是勉强可以接受一点,如果是化妆品,就算是送给我的,我都不会用的。虽然在外面店里买的东西也不一定那么安全,但是感觉比微商靠谱。<br>
4
+        至于为啥不买化妆品,楼主亲身体验。 去年在闺蜜哪里买了一个韩束的套盒,背后的防伪验证码直接被扣掉了。扣掉了。。。<br>
5
+    </div>
6
+    <div class="bt pd2">
7
+        <form id="poll" name="poll" method="post" autocomplete="off"
8
+              action="forum.php?mod=misc&amp;action=votepoll&amp;fid=72&amp;tid=864908&amp;pollsubmit=yes&amp;quickforward=yes&amp;mobile=2">
9
+            <input type="hidden" name="formhash" value="0eb5b050">
10
+            <div>
11
+                <strong>多选投票</strong>: ( 最多可选 2 项 ) , 投票后结果可见, 共有 106 人参与投票
12
+            </div>
13
+
14
+            <p>
15
+                距结束还有:
16
+                <span class="xg1">
17
+4 天23 小时28 分钟
18
+</span>
19
+            </p>
20
+
21
+            <div>
22
+                <p>
23
+                    <input type="checkbox" id="option_1" name="pollanswers[]" value="22790">
24
+                    <label for="option_1">1.微商可以信赖</label>
25
+                </p>
26
+                <p>
27
+                    <input type="checkbox" id="option_2" name="pollanswers[]" value="22791">
28
+                    <label for="option_2">2.微商都是骗人的</label>
29
+                </p>
30
+                <p>
31
+                    <input type="checkbox" id="option_3" name="pollanswers[]" value="22792">
32
+                    <label for="option_3">3.买过微商的东西</label>
33
+                </p>
34
+                <p>
35
+                    <input type="checkbox" id="option_4" name="pollanswers[]" value="22793">
36
+                    <label for="option_4">4.没有买过微商的东西</label>
37
+                </p>
38
+                <p>
39
+                    <input type="checkbox" id="option_5" name="pollanswers[]" value="22794">
40
+                    <label for="option_5">5.微商部分可信</label>
41
+                </p>
42
+                <p>
43
+                    <input type="checkbox" id="option_6" name="pollanswers[]" value="22795">
44
+                    <label for="option_6">6.无感</label>
45
+                </p>
46
+                <input type="submit" name="pollsubmit" id="pollsubmit" value="提交">
47
+            </div>
48
+        </form>
49
+    </div>
50
+</div>

+ 52
- 0
app/src/main/assets/TestHtml4.html View File

@@ -0,0 +1,52 @@
1
+<div class="message">
2
+
3
+
4
+    <font color="red">请登录睿思电脑版查看完整种子信息</font>                                <i class="pstatus"> 本帖最后由 凡王之血 于 2017-5-9 15:41 编辑 </i><br>
5
+    <br>
6
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">游戏名称:尼尔:机械纪元</font></font></font><br>
7
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">英文名称:NieR:Automata</font></font></font><br>
8
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">游戏类型:动作冒险类(ACT)游戏</font></font></font><br>
9
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">游戏制作:Platinum Games Inc.</font></font></font><br>
10
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">游戏发行:Square Enix</font></font></font><br>
11
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">游戏平台:PC</font></font></font><br>
12
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">发售时间:2017年3月17日</font></font></font><br>
13
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">官方网站:<a href="http://www.niergame.com/" target="_blank">http://www.niergame.com/</a></font></font></font><br>
14
+    <br>
15
+    <br>
16
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">游戏介绍</font></font></font><br>
17
+    <br>
18
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">  《尼尔:机械纪元》是由SE和白金工作室联合开发的一款动作角色扮演游戏。故事发生在和《尼尔》相同的世界,并将有一个全新的故事剧情,但和前作几乎没有关联。</font></font></font><br>
19
+    <br>
20
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">  游戏讲述在被摧毁的地球上由人类的敌人外星人派来的机械生命体与人类方派出的人造人“尤尔哈(YoRHa)”部队进行战斗的故事。主角叫做“尤尔哈2号B型”人造人,擅长使用刀和长剑,在战斗过程中可以随时切换。而游戏中还有被称为“POD”的机器人进行远距离支援攻击。游戏里面充斥着各种暴力元素,这非常符合日系游戏的特点。女主角孤身一人,蒙着眼睛,与各种各样的机器人搏斗。</font></font></font><br>
21
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">&nbsp; &nbsp;&nbsp; &nbsp;</font></font></font><br>
22
+    <br>
23
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">配置要求</font></font></font><br>
24
+    <br>
25
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">最低配置:</font></font></font><br>
26
+    <br>
27
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">操作系统: Windows 7 /8.1 /10 64bit</font></font></font><br>
28
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">处理器: Intel Core i3 2100 or AMD A8-6500</font></font></font><br>
29
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">内存: 4 GB RAM</font></font></font><br>
30
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">图形: NVIDIA GeForce GTX 770 VRAM 2GB or AMD Radeon R9 270X VRAM 2GB</font></font></font><br>
31
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">DirectX 版本: 11</font></font></font><br>
32
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">存储空间: 需要 50 GB 可用空间</font></font></font><br>
33
+    <br>
34
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">推荐配置:</font></font></font><br>
35
+    <br>
36
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">操作系统: Windows 8.1 /10 64bit</font></font></font><br>
37
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">处理器: Intel Core i5 4670 or AMD A10-7850K</font></font></font><br>
38
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">内存: 8 GB RAM</font></font></font><br>
39
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">图形: NVIDIA GeForce GTX 980 VRAM 4GB or AMD Radeon R9 380X VRAM 4GB</font></font></font><br>
40
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">DirectX 版本: 11</font></font></font><br>
41
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">存储空间: 需要 50 GB 可用空间</font></font></font><br>
42
+    <br>
43
+    <br>
44
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">安装信息</font></font></font><br>
45
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">1. 解压缩</font></font></font><br>
46
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px">2. 运行游戏NieRAutomata.exe</font></font></font><br>
47
+    <font color="#000"><font face="tahoma, arial, helvetica, sans-serif"><font style="font-size:12px"><font style="font-size:14px">已集成1号升级档+DLC+BALDMAN未加密补丁+轩辕汉化v6.5<br>
48
+        注意:经测试 这版破解会出现随机跳出的问题 请务必经常存档!</font></font></font></font><br>
49
+    <br>
50
+    <br>
51
+    <br>
52
+</div>

+ 45
- 0
app/src/main/assets/TestHtml5.html View File

@@ -0,0 +1,45 @@
1
+<div class="message">
2
+
3
+
4
+    <i class="pstatus"> 本帖最后由 西电研会 于 2017-5-5 12:25 编辑 </i><br>
5
+    <br>
6
+    <div align="left"><font style="color:rgb(0,0,0)">​</font></div><div align="center"><font style="color:rgb(0,0,0)">
7
+
8
+    <a href="forum.php?mod=viewthread&amp;tid=863377&amp;aid=873054&amp;from=album&amp;page=1&amp;mobile=2" class="orange"><img id="aimg_873054" src="forum.php?mod=image&amp;aid=873054&amp;size=140x140&amp;key=0013618be5a121ea&amp;type=fixnone" alt="1.jpg" title="1.jpg" zsrc="forum.php?mod=image&amp;aid=873054&amp;size=140x140&amp;key=0013618be5a121ea&amp;type=fixnone" style="display: inline; visibility: visible;"></a>
9
+
10
+</font></div><font style="color:rgb(0,0,0)"><br>
11
+    <div align="center"><font size="4">大赛详情文案:</font><a href="https://mp.weixin.qq.com/s?__biz=MjM5NDkwMTI3MQ==&amp;mid=2652569577&amp;idx=1&amp;sn=8870fdfdabffcbe0d79947972da96494&amp;chksm=bd6ee3918a196a87a2950ea32096210c6023793e17364944f446437e389aa024ef81b905b002#rd" target="_blank"><font size="4"><strong>模拟招聘大赛</strong></font></a></div></font><div align="center"><font style="color:rgb(0,0,0)">
12
+
13
+    <a href="forum.php?mod=viewthread&amp;tid=863377&amp;aid=873055&amp;from=album&amp;page=1&amp;mobile=2" class="orange"><img id="aimg_873055" src="forum.php?mod=image&amp;aid=873055&amp;size=140x140&amp;key=3f73f8a6a0bc553b&amp;type=fixnone" alt="2.jpg" title="2.jpg" zsrc="forum.php?mod=image&amp;aid=873055&amp;size=140x140&amp;key=3f73f8a6a0bc553b&amp;type=fixnone" style="display: inline; visibility: visible;"></a>
14
+
15
+</font></div><div align="center"><font style="color:rgb(0,0,0)">
16
+
17
+    <a href="forum.php?mod=viewthread&amp;tid=863377&amp;aid=873056&amp;from=album&amp;page=1&amp;mobile=2" class="orange"><img id="aimg_873056" src="forum.php?mod=image&amp;aid=873056&amp;size=140x140&amp;key=cab18b1f0b94007a&amp;type=fixnone" alt="3.jpg" title="3.jpg" zsrc="forum.php?mod=image&amp;aid=873056&amp;size=140x140&amp;key=cab18b1f0b94007a&amp;type=fixnone" style="display: inline; visibility: visible;"></a>
18
+
19
+</font></div><div align="center"><font style="color:rgb(0,0,0)">
20
+
21
+    <a href="forum.php?mod=viewthread&amp;tid=863377&amp;aid=873057&amp;from=album&amp;page=1&amp;mobile=2" class="orange"><img id="aimg_873057" src="forum.php?mod=image&amp;aid=873057&amp;size=140x140&amp;key=8bbc1a5fa077de98&amp;type=fixnone" alt="4.jpg" title="4.jpg" zsrc="forum.php?mod=image&amp;aid=873057&amp;size=140x140&amp;key=8bbc1a5fa077de98&amp;type=fixnone" style="display: inline; visibility: visible;"></a>
22
+
23
+</font></div><div align="center"><font style="color:rgb(0,0,0)">
24
+
25
+    <a href="forum.php?mod=viewthread&amp;tid=863377&amp;aid=873058&amp;from=album&amp;page=1&amp;mobile=2" class="orange"><img id="aimg_873058" src="forum.php?mod=image&amp;aid=873058&amp;size=140x140&amp;key=6d69ac37722e0580&amp;type=fixnone" alt="5.jpg" title="5.jpg" zsrc="forum.php?mod=image&amp;aid=873058&amp;size=140x140&amp;key=6d69ac37722e0580&amp;type=fixnone" style="display: inline; visibility: visible;"></a>
26
+
27
+</font></div><div align="center"><font style="color:rgb(0,0,0)">
28
+
29
+    <a href="forum.php?mod=viewthread&amp;tid=863377&amp;aid=873059&amp;from=album&amp;page=1&amp;mobile=2" class="orange"><img id="aimg_873059" src="forum.php?mod=image&amp;aid=873059&amp;size=140x140&amp;key=e4fd7b32e7c8c22c&amp;type=fixnone" alt="6.jpg" title="6.jpg" zsrc="forum.php?mod=image&amp;aid=873059&amp;size=140x140&amp;key=e4fd7b32e7c8c22c&amp;type=fixnone" style="display: inline; visibility: visible;"></a>
30
+
31
+</font><font style="color:rgb(0,0,0)"><br>
32
+</font></div><br>
33
+    <div align="center"><font size="3"><font style="color:rgb(0,0,0)"><strong>参赛报名方式</strong></font></font></div><div align="center"><font style="color:rgb(0,0,0)"><font size="3"><strong>登录官网(</strong><font color="#0000ff"> </font><u><font color="#336699">job.zte.com.cn</font></u><font color="#0000ff"> </font><strong>)→注册账号→填写简历信息→提交简历→获得简历编号→发送邮件(将“简历编号+岗位+姓名+电话”发送至邮箱</strong></font><a href="mailto:ZTE_mnzpds@163.com" target="_blank"><font size="3"><strong>ZTE_mnzpds@163.com</strong></font></a><font size="3"><strong>)</strong></font></font></div><br>
34
+    <div align="center"> </div><div align="center"><font size="4"><font color="red"><strong>大赛开幕式地点更改</strong></font></font></div><div align="center"><font style="color:rgb(0,0,0)"><strong><strong><font size="3">5月11日<strong>19:00</strong></font></strong></strong></font></div><div align="center"><font style="color:rgb(0,0,0)"><strong><strong><strong><font size="3"><strong>西电图书馆西裙楼报告厅</strong></font></strong></strong></strong></font></div><div align="center"><font style="color:rgb(0,0,0)"><font size="3"><div align="center"><font size="4"><font color="red"><strong>大赛开幕式地点更改</strong></font></font></div></font></font></div><br>
35
+    <br>
36
+    <div align="center"><a href="http://job.zte.com.cn/" target="_blank"><font size="4">大赛简历注册请点击该文字</font></a></div><br>
37
+    <div align="center"><font size="3"><font color="magenta"><strong>大赛邮箱:</strong></font><font color="blue"><a href="mailto:ZTE_mnzpds@163.com" target="_blank">ZTE_mnzpds@163.com</a> </font></font></div><br>
38
+    <p style="line-height:nullpx;text-indent:2em;text-align:center"><font size="1"><font style="font-size:16px"><font size="2">主办:共青团西安电子科技大学委员会</font></font></font></p><p style="line-height:nullpx;text-indent:2em;text-align:center"><font size="2"><font style="font-size:16px"><font size="2">中兴通讯股份有限公司</font></font></font></p><p style="line-height:nullpx;text-indent:2em;text-align:center"><font size="2"><font style="font-size:16px"><font size="2">承办:西安电子科技大学研究生会</font></font></font></p><p style="line-height:nullpx;text-indent:2em;text-align:center"><font size="2"><font style="font-size:16px"><font size="2">协办:ZTE西电兴人类俱乐部</font></font></font></p><p style="line-height:nullpx;text-indent:2em;text-align:center"><font size="2">
39
+
40
+    <a href="forum.php?mod=viewthread&amp;tid=863377&amp;aid=873068&amp;from=album&amp;page=1&amp;mobile=2" class="orange">
41
+        <img id="aimg_873068" src="forum.php?mod=image&amp;aid=873068&amp;size=140x140&amp;key=272e455bd6aa917b&amp;type=fixnone" alt="无标题.png" title="无标题.png" zsrc="forum.php?mod=image&amp;aid=873068&amp;size=140x140&amp;key=272e455bd6aa917b&amp;type=fixnone" style="display: inline; visibility: visible;">
42
+    </a>
43
+
44
+</font></p>
45
+</div>

+ 172
- 0
app/src/main/assets/TestHtml6.html View File

@@ -0,0 +1,172 @@
1
+<div class="message">
2
+
3
+
4
+    <i class="pstatus"> 本帖最后由 xaxuehua 于 2017-5-8 23:39 编辑 </i><br>
5
+    <br>
6
+    <div align="center"><font face="楷体,楷体_GB2312"><font size="5"><font color="blue"><strong>@美文星空
7
+        研究生要毕业了,作为学长学姐的你,想对学弟学妹说些什么?<img src="static/image/smiley/default/tongue.gif" smilieid="7"
8
+                                         border="0" alt=""
9
+                                         zsrc="static/image/smiley/default/tongue.gif"
10
+                                         style="display: inline; visibility: visible;"></strong></font></font></font>
11
+    </div>
12
+    <br>
13
+    <div align="center"><font face="楷体,楷体_GB2312"><font size="5"><font color="blue"><strong>希望满满的正能量!</strong></font></font></font>
14
+    </div>
15
+    <br>
16
+    <div align="center"><font face="楷体,楷体_GB2312"><font size="5"><font color="blue"><strong>学习+生活+未来都可以哈!<img
17
+            src="static/image/smiley/default/loveliness.gif" smilieid="13" border="0" alt=""
18
+            zsrc="static/image/smiley/default/loveliness.gif"
19
+            style="display: inline; visibility: visible;"></strong></font></font></font></div>
20
+    <br>
21
+    <br>
22
+    <font face="楷体,楷体_GB2312"><font size="5"><font color="red"><strong>【发帖理由】</strong></font></font></font><font
23
+        face="楷体,楷体_GB2312"><font size="5"><font color="black"><strong>我觉得思想和经验的传承相当重要,虽然我们各奔四方,但我们留下的应是璀璨的精神食粮。</strong></font></font></font><br>
24
+    <br>
25
+    <br>
26
+    <font face="仿宋,仿宋_GB2312"><font size="5"><font color="black"><strong>我来抛砖引玉…………<img
27
+            src="static/image/smiley/default/tongue.gif" smilieid="7" border="0" alt=""
28
+            zsrc="static/image/smiley/default/tongue.gif"
29
+            style="display: inline; visibility: visible;"></strong></font></font></font><br>
30
+    <font face="仿宋,仿宋_GB2312"><font size="5"><font color="black"><strong>我想说:做科研、做人要踏实,要想有成果,必须脚踏实地,从基础做起,要想浮起来,必须要沉下去!</strong></font></font></font><font
31
+        face="仿宋,仿宋_GB2312"><font size="5"><font color="black"><strong>一心急于求成,急功近利,往往适得其反!</strong></font></font></font><br>
32
+    <br>
33
+    <font color="red"><strong><font size="5"><font face="楷体,楷体_GB2312"><font color="red">【小伙伴们在说------陆续更新,排名不分先后!,为传递正能量,相关内容有做删改!】</font></font></font></strong><br>
34
+    </font><strong><font face="仿宋"><font size="5"><font color="#000000"><a
35
+        href="mailto:1.@13010199052"
36
+        target="_blank">1.@13010199052</a></font></font></font></strong><br>
37
+    <strong><font face="仿宋"><font size="5"><font color="#000000">真的静下心来不太可能,重在参与吧,无论什么竞赛都去参加一次,体验因为学习而通宵的充实</font></font></font></strong><br>
38
+    <strong><font face="仿宋"><font size="5"><font color="#000000"><a href="mailto:2.@leihaora"
39
+                                                                    target="_blank">2.@leihaora</a></font></font></font></strong><br>
40
+    <strong><font face="仿宋"><font size="5"><font
41
+            color="#000000">在学习之余打游戏,莫要在打游戏之余学习</font></font></font></strong><br>
42
+    <strong><font face="仿宋"><font size="5"><font color="#000000"><a href="mailto:3.@shangyuzhe"
43
+                                                                    target="_blank">3.@shangyuzhe</a><br>
44
+        重要的是三年前要选择一个对的老师</font></font></font></strong><br>
45
+    <strong><font face="仿宋"><font size="5"><font color="#000000">4.@木头鬼<br>
46
+        往往抵抗不了急功近利的诱惑!!</font></font></font></strong><br>
47
+    <strong><font face="仿宋"><font size="5"><font color="#000000"><a href="mailto:5.@kfly"
48
+                                                                    target="_blank">5.@kfly</a></font></font></font></strong><br>
49
+    <strong><font face="仿宋"><font size="5"><font color="#000000"><font color="#336699"><font
50
+            color="black">知人者智,自知者明。不求做一个智者,但至少要做一个明者,这样才算是找到了自己,未来人生再怎么变化,都是自己的人生。</font></font></font></font></font></strong><br>
51
+    <font color="#000000"><strong><font face="仿宋"><font
52
+            size="5">6.@美文星空</font></font></strong></font><br>
53
+    <font color="#000000"><strong><font face="仿宋"><font
54
+            size="5">脚踏实地,专心致志!</font></font></strong></font><br>
55
+    <font face="仿宋"><font size="5"><font color="#000000"><strong><a href="mailto:7.@shangwu_10"
56
+                                                                    target="_blank">7.@shangwu_10</a></strong></font></font></font><br>
57
+    <font face="仿宋"><font size="5"><font color="#000000"><strong>奋发图强、珍惜时间。。。</strong></font></font></font><br>
58
+    <font face="仿宋"><font size="5"><font
59
+            color="#000000"><strong>8.</strong><strong>@雨落忧伤</strong></font></font></font><br>
60
+    <strong><font face="仿宋"><font size="5"><font color="#000000">作为一个没有在实验室坐过的学长告诉你们:笔者是多么羡慕一个有电脑和座位可以安静看论文或做仿真或实验的同学,然而现实告诉我同一个专业资源分配真不合理,望各位学弟学妹们能够珍惜现有的资源!然而即使贫瘠的土壤也能孕育倔强的花朵,正验证了曾经不绝耳边的嘱咐和寄托“条件确实很艰苦,大家克服一下吧!”</font></font></font></strong><br>
61
+    <font face="仿宋"><font size="5"><font color="#000000"><strong><a href="mailto:9.@fan2527265"
62
+                                                                    target="_blank">9.@fan2527265</a></strong></font></font></font><br>
63
+    <font face="仿宋"><font size="5"><font
64
+            color="#000000"><strong>选一个好的导师非常重要,最好咨询下之前学长学姐的意见。</strong></font></font></font><br>
65
+    <font face="仿宋"><font size="5"><font color="#000000"><strong>10.@一路前进<br>
66
+        加油,希望自己可以脚踏实地,仰望星空,加油!<br>
67
+    </strong><a href="mailto:11.@04101075041011" target="_blank"><strong>11.@04101075041011</strong></a><br>
68
+        <strong>好好珍惜同学之间的友情!</strong></font></font></font><br>
69
+    <font face="仿宋"><font size="5"><font color="#000000"><strong><a href="mailto:12.@xdshui"
70
+                                                                    target="_blank">12.@xdshui</a><br>
71
+        莫等闲,白了骚年头,空悲切!<br>
72
+        13.@土卫六<br>
73
+        执行和方向都很重要<br>
74
+        14.@注册比***还难<br>
75
+        作为研究生应该好好的准备老师的科研问题,要不毕业真是个问题</strong></font></font></font><br>
76
+    <font face="仿宋"><font size="5"><font color="#000000"><strong><a href="mailto:15.@kianty"
77
+                                                                    target="_blank">15.@kianty</a><br>
78
+        脚踏实地,锻炼学习能力,掌握基本理论和基本工具</strong></font></font></font><br>
79
+    <font face="仿宋"><font size="5"><font color="#000000"><strong><a href="mailto:16.@liufangjie"
80
+                                                                    target="_blank">16.@liufangjie</a><br>
81
+        不要抱怨老师不好,不要抱怨工作难找,不要整天玩玩闹闹。有时间多看书,技术的,文学的都看看。最后, 基础很重要!<br>
82
+        <a href="mailto:17.@jinknow_000" target="_blank">17.@jinknow_000</a><br>
83
+        仰望星空,脚踏实地,希望你们都能早点理解,这句话没有多美有的是厚重<br>
84
+        <a href="mailto:18.@Arm_arm" target="_blank">18.@Arm_arm</a><br>
85
+        重要的是三年前要选择一个对的老师,最重要的是:选择你想要过的生活!!!而不是让生活选择你!<br>
86
+        <a href="mailto:19.@hanwenhui" target="_blank">19.@hanwenhui</a><br>
87
+        珍惜时光,莫攀比,不管是科研、做项目,还是玩、追女朋友,重要的是做自己,把三年过成自己想要的样子!<br>
88
+        20.@灰色星空<br>
89
+        导师人nice &amp;科研能力强 &gt; 导师人nice &amp;科研能力差 &gt; 导师人bad &amp; 科研能力强 &gt; 导师人bad &amp;
90
+        科研能力差<br>
91
+        选导师如同选专业,不,有过之而无不及,慎重!<br>
92
+        <a href="mailto:21.@spirit66882" target="_blank">21.@spirit66882</a><br>
93
+        你不是在学习如何写代码,而是学习如何解决问题。因此你的核心竞争力是思考的力量,而不是代码写得多么好!<br>
94
+        <a href="mailto:22.@03101130" target="_blank">22.@03101130</a><br>
95
+        早找对象。。。。。。。。。。。。。<br>
96
+        <a href="mailto:23.@pengweijian" target="_blank">23.@pengweijian</a><br>
97
+        除了学习,锻炼身体很重要,交朋友也很重要!<br>
98
+        24.@阿肯色人<br>
99
+        还没毕业,但是我想和各位研一的小伙伴共勉一句“Java(C++)和Matlab起飞,科研和饭碗共举<a href="mailto:”@Sunny0070"
100
+                                                            target="_blank">”</a></strong></font></font></font><br>
101
+    <font face="仿宋"><font size="5"><font color="#000000"><strong><a href="mailto:25.@Sunny0070"
102
+                                                                    target="_blank">25.@Sunny0070</a><br>
103
+        第一,大脑和手的距离决定了梦想和现实的距离,勤于动手,善于思考,再简单的问题一定要亲手过一遍。如果还不放心,写技术博客吧,给别人能讲明白,那是真的懂了。<br>
104
+        第二,要想飞的高,基础很重要,基础一定要扎实。<br>
105
+        第三,生活远不止科研,社交、运动、旅游、对象、游戏...都很丰富多彩。如果你不是致力于成为一名科学家,那么情商真的很重要。 </strong></font></font></font><br>
106
+    <font face="仿宋"><font size="5"><font color="#000000"><strong>26.@仗剑走西电<br>
107
+        莫道人,要律己。敬导师,莫盲信。<br>
108
+        好工作,需实习。科研路,要耐力。<br>
109
+        读博士,勿贪念。追女友,别放弃。<br>
110
+        朝起早,夜眠迟。别熬夜,爱身体。<br>
111
+        不关己,莫闲管。研年短,惜此时。<br>
112
+        见人善,要结交。见人恶,要远离。<br>
113
+        校人杂,类不齐。同学多,仁者希。<br>
114
+        要风骚,唯实力。啥都不懂别逼逼。</strong></font></font></font><br>
115
+    <font face="仿宋"><font size="5"><font color="#000000"><strong>27.@傻小兴<br>
116
+        从现在看见,从现在懂得,去做,去动</strong></font></font></font><br>
117
+    <font face="仿宋"><font size="5"><font color="#000000"><strong>28.@流年里的榴莲<br>
118
+        好好学习,多读书。能谈恋爱就谈恋爱,遇见有感觉的不要怂。多参加活动,多出去走走。锻炼身体,少窝在宿舍。</strong></font></font></font><br>
119
+    <font face="仿宋"><font size="5"><font color="#000000"><strong>29.@银灵子<br>
120
+        找不到志同道合的小伙伴,一定要学会孤独,享受孤独。不要在无聊的人和无聊的事情上浪费时间<br>
121
+        <a href="mailto:30.@wk" target="_blank">30.@wk</a>小飞龙<br>
122
+        关键是要付诸实践,强大的执行力</strong></font></font></font><br>
123
+    <font face="仿宋"><font size="5"><font color="#000000"><strong>31.@飞-NARUTO<br>
124
+        应该是远离享乐,无论是大学期间,还是研究生期间,一定要努力学习啊,早晚会有回报不学习的话迟早会哭着填当年挖的坑,就像现在的我,血的教训!!!<br>
125
+        <a href="mailto:32.@nn" target="_blank">32.@nn</a>老虎油 <br>
126
+        珍惜珍惜再珍惜,因为三年过的真的很快很快~无法想象的快,相信很多人都有同感。</strong></font></font></font><br>
127
+    <font face="仿宋"><font size="5"><font color="#000000"><strong><a href="mailto:33.@sailinmood"
128
+                                                                    target="_blank">33.@sailinmood</a><br>
129
+        晚上睡觉的时候把手机放在你伸手够不到的地方</strong></font></font></font><br>
130
+    <font face="仿宋"><font size="5"><font color="#000000"><strong>34.@大陈<br>
131
+        住在四号楼,宿舍朝向东南,窗户外面是西斜六路,夏天炎热,没有空调,晚上有飙车的声音,冬天,对面宿舍,朝向西北,阴暗干冷,但是三年没有暑假没有回过家,寒假也是在过年前几天才回去,在学校的生活还算开心,认识了一些小伙伴,即将结束,今年最大的变化是宿舍将要装空调了,下一届的小伙伴有福了,不用再忍受宿舍的炎热和寒冷了,可以安心的搞科研了,只想对你们说,加油加油加油,日子只能向前走,一个方向顺时钟。</strong></font></font></font><br>
132
+    <strong><font face="仿宋"><font size="5"><font color="#000000"><a href="mailto:35.@CQQ"
133
+                                                                    target="_blank">35.@CQQ</a><br>
134
+        一定要坚持每天早睡,熬夜毁一天</font></font></font></strong><br>
135
+    <strong><font face="仿宋"><font size="5"><font color="#000000"><a
136
+            href="mailto:36.@zhaoqi911379608" target="_blank">36.@zhaoqi911379608</a><br>
137
+        无论任何事情和任何决定,都要本着对自己的未来负责的态度,不要太受其他人的影响(包括你敬爱的导师),不要太在意别人的看法</font></font></font></strong><br>
138
+    <br>
139
+    <br>
140
+    <br>
141
+    <br>
142
+    <br>
143
+    <br>
144
+    <font size="5"><font color="red"><font face="楷体,楷体_GB2312"><strong>【</strong><strong>看了亲的回复,楼主非常感动,也想再说几句:</strong><strong>::】</strong></font></font></font><br>
145
+    <font face="仿宋"><font size="5"><font color="#000000"><strong>&nbsp; &nbsp;首先,非常感谢亲们慷慨解囊,把自己的经验与我们分享;<br>
146
+        &nbsp; &nbsp;其次,楼主认为,读研只是一个人生的阶段,并非全部,也并非说考上研究生就是人生的赢家,读研只是人生积攒资本的一个过程,那么,什么样的资本需要我们积攒,楼主认为,<br>
147
+        &nbsp; &nbsp;一是知识资本,在当今社会,使蛮力往往收效甚微,知识说白了就是做事的一种高效手段。<br>
148
+        &nbsp; &nbsp;二是做事方法,很多小朋友往往忽略这一问题,楼主一直认为,做事方法是一个人智商和情商的双重体现,好的做事方法是通向成功的高速公路。<br>
149
+        &nbsp; &nbsp;三是抵御挫折的能力,人生逆境十有九之,怎么对待,怎么渡过,这是一个众说纷纭的问题,但楼主发现,大家都殊途同归提到了心态这一关键要素,就楼主看来,心态的好坏并不取决于是否自己已经过的很幸福了,而是在于是不是比别人过的更幸福,说到底就是,恶性的攀比造成了个人心态的失衡,对于西电的小伙伴来说,你们已经比下有余了,但这并不意味着自我麻痹,楼主已经发现不少养尊处优的西电小伙伴,我想提醒你们,成功的天平并不会总是偏向于你,不断加大自己的筹码才是当务之急!<br>
150
+        &nbsp; &nbsp;四是人脉资源,楼主发现,或许是因为研究生工作性质和分班的缘故,小伙伴们可能仅仅认识数十位好友,和偌大的班级基数相比,无疑是沧海一粟,客观原因我们不谈,是不是我们应该把自己的心窗打开一点呢?不要总带着防备和有色眼镜看人,主动是交朋友的开始,试着从明天起给陌生人一个微笑,或许在西电,每个小伙伴心中都会春色满园。至于说为什么要积攒人脉资源,想必不用多说。<br>
151
+        &nbsp; &nbsp;再次,从回复的帖子和与周围小伙伴们的攀谈中,总会有一个永恒的话题,那就是导师,楼主认为,导师没有好坏,只有是否合得来,坦率地讲,楼主也会时常抱怨一下导师。能跟上一个学术大牛是你的荣幸,请你不要骄傲,对你来说,论文和专利可能唾手可得,希望你向更高的山峰攀登,切勿炫耀,因为你理应你别人站得更高、走的更远,你要扪心自问,这么好的老师和环境给你,你浪费了吗?如果跟上了不满意的导师,你就要告诉自己,既定的事实已经无法改变,未来的画笔扔在自己手中,如果你觉得比其他小伙伴差,那你更需好好努力,否则你会比别人差得更远,目前,你要做到现有条件下的最好,想想在这片土地开荒的老一辈西军电人,你现在的条件比那时还不知道好到哪里了。<br>
152
+        &nbsp; &nbsp;最后,楼主想说一下找工作的问题。找工作是为了生存,不要眼睛只盯着钱,如果小伙伴们不是急等钱用,就找一个相对清闲的工作,虽说钱少,但总体生活质量高。楼主想力劝大家有空多回家陪陪父母,这个比什么都重要,想想作为父母的他们,现在更需要什么!!</strong></font></font></font><br>
153
+    <font face="仿宋"><font size="5"><font color="#000000"><strong>&nbsp; &nbsp;总结一下,不要抱怨现在的苦,因为有人比我们更苦,不要抱怨现实的残酷,因为我们无法改变,不要忽略身边的亲人,因为他们更需要我们呵护,不要一味消沉条件的苛刻,因为未来还在我们手中!</strong></font></font></font><br>
154
+    <br>
155
+    <br>
156
+    <br>
157
+    <font face="仿宋">
158
+        <font size="5">
159
+            <font color="#000000">
160
+                <font face="楷体,楷体_GB2312">
161
+                    <font color="red">火热征集中!请小伙伴们继续留下真知灼见!......</font>
162
+                </font>
163
+            </font>
164
+        </font>
165
+    </font>
166
+    <br>
167
+    <br>
168
+    <br>
169
+    <br>
170
+    <br>
171
+    <br>
172
+</div>

BIN
app/src/main/assets/smiley/tieba/01.png View File


BIN
app/src/main/assets/smiley/tieba/02.png View File


BIN
app/src/main/assets/smiley/tieba/03.png View File


BIN
app/src/main/assets/smiley/tieba/04.png View File


BIN
app/src/main/assets/smiley/tieba/05.png View File


BIN
app/src/main/assets/smiley/tieba/06.png View File


BIN
app/src/main/assets/smiley/tieba/07.png View File


BIN
app/src/main/assets/smiley/tieba/08.png View File


BIN
app/src/main/assets/smiley/tieba/09.png View File


BIN
app/src/main/assets/smiley/tieba/10.png View File


BIN
app/src/main/assets/smiley/tieba/11.png View File


BIN
app/src/main/assets/smiley/tieba/12.png View File


BIN
app/src/main/assets/smiley/tieba/13.png View File


BIN
app/src/main/assets/smiley/tieba/14.png View File


BIN
app/src/main/assets/smiley/tieba/15.png View File


BIN
app/src/main/assets/smiley/tieba/16.png View File


BIN
app/src/main/assets/smiley/tieba/17.png View File


BIN
app/src/main/assets/smiley/tieba/18.png View File


BIN
app/src/main/assets/smiley/tieba/19.png View File


BIN
app/src/main/assets/smiley/tieba/20.png View File


BIN
app/src/main/assets/smiley/tieba/21.png View File


BIN
app/src/main/assets/smiley/tieba/22.png View File


BIN
app/src/main/assets/smiley/tieba/23.png View File


BIN
app/src/main/assets/smiley/tieba/24.png View File


BIN
app/src/main/assets/smiley/tieba/25.png View File


BIN
app/src/main/assets/smiley/tieba/26.png View File


BIN
app/src/main/assets/smiley/tieba/27.png View File


BIN
app/src/main/assets/smiley/tieba/28.png View File


BIN
app/src/main/assets/smiley/tieba/29.png View File


BIN
app/src/main/assets/smiley/tieba/30.png View File


BIN
app/src/main/assets/smiley/tieba/31.png View File


BIN
app/src/main/assets/smiley/tieba/32.png View File


BIN
app/src/main/assets/smiley/tieba/33.png View File


BIN
app/src/main/assets/smiley/tieba/34.png View File


BIN
app/src/main/assets/smiley/tieba/35.png View File


BIN
app/src/main/assets/smiley/tieba/36.png View File


BIN
app/src/main/assets/smiley/tieba/37.png View File


BIN
app/src/main/assets/smiley/tieba/38.png View File


BIN
app/src/main/assets/smiley/tieba/39.png View File


BIN
app/src/main/assets/smiley/tieba/40.png View File


BIN
app/src/main/assets/smiley/tieba/41.png View File


BIN
app/src/main/assets/smiley/tieba/42.png View File


BIN
app/src/main/assets/smiley/tieba/43.png View File


BIN
app/src/main/assets/smiley/tieba/44.png View File


BIN
app/src/main/assets/smiley/tieba/45.png View File


BIN
app/src/main/assets/smiley/tieba/46.png View File


BIN
app/src/main/assets/smiley/tieba/47.png View File


BIN
app/src/main/assets/smiley/tieba/48.png View File


BIN
app/src/main/assets/smiley/tieba/49.png View File


BIN
app/src/main/assets/smiley/tieba/50.png View File


BIN
app/src/main/assets/smiley/tieba/51.png View File


BIN
app/src/main/assets/smiley/tieba/52.png View File


BIN
app/src/main/assets/smiley/tieba/53.png View File


BIN
app/src/main/assets/smiley/tieba/54.png View File


BIN
app/src/main/assets/smiley/tieba/55.png View File


BIN
app/src/main/assets/smiley/tieba/56.png View File


BIN
app/src/main/assets/smiley/tieba/57.png View File


BIN
app/src/main/assets/smiley/tieba/58.png View File


BIN
app/src/main/assets/smiley/tieba/59.png View File


BIN
app/src/main/assets/smiley/tieba/60.png View File


BIN
app/src/main/assets/smiley/tieba/61.png View File


BIN
app/src/main/assets/smiley/tieba/62.png View File


BIN
app/src/main/assets/smiley/tieba/63.png View File


BIN
app/src/main/assets/smiley/tieba/64.png View File


BIN
app/src/main/assets/smiley/tieba/65.png View File


BIN
app/src/main/assets/smiley/tieba/66.png View File


BIN
app/src/main/assets/smiley/tieba/67.png View File


BIN
app/src/main/assets/smiley/tieba/68.png View File


BIN
app/src/main/assets/smiley/tieba/69.png View File


BIN
app/src/main/assets/smiley/tieba/70.png View File


BIN
app/src/main/assets/smiley/tieba/71.png View File


BIN
app/src/main/assets/smiley/tieba/72.png View File


BIN
app/src/main/assets/smiley/tieba/73.png View File


+ 182
- 0
app/src/main/assets/test.html View File

@@ -0,0 +1,182 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+	<title></title>
5
+	<meta charset="utf-8">
6
+</head>
7
+<body>
8
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
9
+<span
10
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;"><TopicNumber>C</span></p>
11
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
12
+<span
13
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">&nbsp;&nbsp;&nbsp;&nbsp;Lily&nbsp;has&nbsp;a&nbsp;clothes&nbsp;store.&nbsp;Its&nbsp;name&nbsp;is&nbsp;Love&nbsp;House.&nbsp;She&nbsp;will&nbsp;decorate</span><span
14
+ style="color:#000000; font-family:宋体; font-size:16px; vertical-align: middle;">(装修)</span><span
15
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">the&nbsp;store,&nbsp;so&nbsp;all&nbsp;the&nbsp;clothes&nbsp;in&nbsp;her&nbsp;store&nbsp;are&nbsp;on&nbsp;sale.</span></p>
16
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
17
+<table style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000;  border-collapse: collapse;">
18
+	<tr>
19
+		<td colspan=4 width="426px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="top">
20
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
21
+<span
22
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">Welcome&nbsp;to&nbsp;Love&nbsp;House!
23
+  <br>
24
+</span></p>
25
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
26
+<span
27
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">All&nbsp;the&nbsp;clothes&nbsp;are&nbsp;on&nbsp;sale&nbsp;from&nbsp;April&nbsp;27th&nbsp;to&nbsp;May&nbsp;15th.&nbsp;
28
+  <br>
29
+</span></p>
30
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
31
+<span
32
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">Please&nbsp;visit&nbsp;www.lovehouse.com.
33
+  <br>
34
+</span></p>
35
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
36
+<span
37
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">Our&nbsp;phone&nbsp;number&nbsp;is&nbsp;387-1789.
38
+</span></p>
39
+		</td>
40
+	</tr>
41
+	<tr>
42
+		<td width="77px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
43
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
44
+<span
45
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">Clothes
46
+</span></p>
47
+		</td>
48
+		<td width="163px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
49
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
50
+<span
51
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">Colors
52
+</span></p>
53
+		</td>
54
+		<td width="100px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
55
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
56
+<span
57
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">Price&nbsp;Before
58
+</span></p>
59
+		</td>
60
+		<td width="87px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
61
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
62
+<span
63
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">Price&nbsp;Now
64
+</span></p>
65
+		</td>
66
+	</tr>
67
+	<tr>
68
+		<td width="77px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
69
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
70
+<span
71
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">Dresses
72
+</span></p>
73
+		</td>
74
+		<td width="163px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
75
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
76
+<span
77
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">red,&nbsp;white&nbsp;,&nbsp;black,&nbsp;blue
78
+</span></p>
79
+		</td>
80
+		<td width="100px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
81
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
82
+<span
83
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">$36
84
+</span></p>
85
+		</td>
86
+		<td width="87px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
87
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
88
+<span
89
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">$18
90
+</span></p>
91
+		</td>
92
+	</tr>
93
+	<tr>
94
+		<td width="77px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
95
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
96
+<span
97
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">Coats
98
+</span></p>
99
+		</td>
100
+		<td width="163px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
101
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
102
+<span
103
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">black,&nbsp;blue
104
+</span></p>
105
+		</td>
106
+		<td width="100px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
107
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
108
+<span
109
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">$78
110
+</span></p>
111
+		</td>
112
+		<td width="87px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
113
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
114
+<span
115
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">$40
116
+</span></p>
117
+		</td>
118
+	</tr>
119
+	<tr>
120
+		<td width="77px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
121
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
122
+<span
123
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">Shirts
124
+</span></p>
125
+		</td>
126
+		<td width="163px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
127
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
128
+<span
129
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">white&nbsp;,&nbsp;purple&nbsp;,&nbsp;yellow
130
+</span></p>
131
+		</td>
132
+		<td width="100px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
133
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
134
+<span
135
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">$24
136
+</span></p>
137
+		</td>
138
+		<td width="87px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
139
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
140
+<span
141
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">$12
142
+</span></p>
143
+		</td>
144
+	</tr>
145
+	<tr>
146
+		<td width="77px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
147
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
148
+<span
149
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">Sweaters
150
+</span></p>
151
+		</td>
152
+		<td width="163px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
153
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
154
+<span
155
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">brown,&nbsp;black,&nbsp;white
156
+</span></p>
157
+		</td>
158
+		<td width="100px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
159
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
160
+<span
161
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">$40
162
+</span></p>
163
+		</td>
164
+		<td width="87px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="middle">
165
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
166
+<span
167
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">$30
168
+</span></p>
169
+		</td>
170
+	</tr>
171
+</table>
172
+</p>
173
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
174
+<span
175
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span
176
+ style="color:#000000; font-family:宋体; font-size:16px; vertical-align: middle;">根据材料内容,选择最佳答案。</span></p>
177
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
178
+</p>
179
+
180
+
181
+</body>
182
+</html>

BIN
app/src/main/assets/test1.jpg View File


+ 184
- 0
app/src/main/assets/test2.html View File

@@ -0,0 +1,184 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+	<title></title>
5
+
6
+	<meta charset="utf-8">
7
+
8
+</head>
9
+<body>
10
+
11
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
12
+<span
13
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;"><TopicNumber></span><b><span
14
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">A</span></b></p>
15
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
16
+<span
17
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Maria:&nbsp;&nbsp;I&nbsp;lost&nbsp;a&nbsp;gold</span><span
18
+ style="color:#000000; font-family:宋体; font-size:19px; vertical-align: middle;">(金的)</span><span
19
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">ring.&nbsp;If&nbsp;you&nbsp;find&nbsp;it,&nbsp;call&nbsp;me&nbsp;at&nbsp;468-9861.</span></p>
20
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
21
+<span
22
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Jim:&nbsp;&nbsp;I&nbsp;found</span><span
23
+ style="color:#000000; font-family:宋体; font-size:19px; vertical-align: middle;">(找到)</span><span
24
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">a&nbsp;watch.&nbsp;My&nbsp;phone&nbsp;number&nbsp;is&nbsp;536-6475.</span></p>
25
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
26
+<span
27
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Frank:&nbsp;&nbsp;I&nbsp;lost&nbsp;a&nbsp;set&nbsp;of&nbsp;keys.&nbsp;If&nbsp;you&nbsp;find&nbsp;it,&nbsp;please&nbsp;call&nbsp;213-4569.</span></p>
28
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
29
+<span
30
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Eddie:&nbsp;I&nbsp;found&nbsp;a&nbsp;notebook&nbsp;with</span><span
31
+ style="color:#000000; font-family:宋体; font-size:19px; vertical-align: middle;">(带着)</span><span
32
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">the&nbsp;name&nbsp;&quot;David&quot;.&nbsp;My&nbsp;phone&nbsp;number&nbsp;is&nbsp;555-0287.</span></p>
33
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
34
+<span
35
+ style="color:#000000; font-family:宋体; font-size:19px; vertical-align: middle;">根据所给信息,完成下列表格。</span></p>
36
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
37
+<b><span
38
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Lost&amp;Found</span></b></p>
39
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
40
+<table style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000;  border-collapse: collapse;">
41
+	<tr>
42
+		<td width="573px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="top">
43
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
44
+<span
45
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Found
46
+  <br>
47
+</span></p>
48
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
49
+<span
50
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Is&nbsp;this&nbsp;your&nbsp;watch?
51
+  <br>
52
+</span></p>
53
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
54
+<span
55
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Please&nbsp;call&nbsp;1.&nbsp;</span><u><span
56
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></u><span
57
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">at
58
+  <br>
59
+</span></p>
60
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
61
+<span
62
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">2.</span><u><span
63
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></u><span
64
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">.</span><span
65
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">
66
+</span></p>
67
+		</td>
68
+	</tr>
69
+</table>
70
+</p>
71
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
72
+<span
73
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">  <br>
74
+</span></p>
75
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
76
+<table style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000;  border-collapse: collapse;">
77
+	<tr>
78
+		<td width="573px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="top">
79
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
80
+<span
81
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Lost:&nbsp;3.</span><u><span
82
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></u><span
83
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">
84
+  <br>
85
+</span></p>
86
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
87
+<span
88
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">My&nbsp;name&nbsp;is&nbsp;Frank&nbsp;Cooper.
89
+  <br>
90
+</span></p>
91
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
92
+<span
93
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Please&nbsp;call&nbsp;4.</span><u><span
94
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></u><span
95
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">at
96
+  <br>
97
+</span></p>
98
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
99
+<span
100
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">5.</span><u><span
101
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></u><span
102
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">.</span><span
103
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">
104
+</span></p>
105
+		</td>
106
+	</tr>
107
+</table>
108
+</p>
109
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
110
+<span
111
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">  <br>
112
+</span></p>
113
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
114
+<table style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000;  border-collapse: collapse;">
115
+	<tr>
116
+		<td width="573px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="top">
117
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
118
+<span
119
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Lost:&nbsp;A&nbsp;gold&nbsp;ring
120
+  <br>
121
+</span></p>
122
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
123
+<span
124
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">My&nbsp;name&nbsp;is&nbsp;6.</span><u><span
125
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></u><span
126
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">.
127
+  <br>
128
+</span></p>
129
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
130
+<span
131
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">My&nbsp;phone&nbsp;number&nbsp;is&nbsp;7.</span><u><span
132
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></u><span
133
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">.</span><span
134
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">
135
+</span></p>
136
+		</td>
137
+	</tr>
138
+</table>
139
+</p>
140
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
141
+<span
142
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">  <br>
143
+</span></p>
144
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
145
+<table style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000;  border-collapse: collapse;">
146
+	<tr>
147
+		<td width="573px" style="border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000; padding-left: 9px;padding-right: 9px;padding-top: 0px;padding-bottom: 0px;"valign="top">
148
+<p style="text-align:center; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
149
+<span
150
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Found
151
+  <br>
152
+</span></p>
153
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
154
+<span
155
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Is&nbsp;this&nbsp;your&nbsp;8.</span><u><span
156
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></u><span
157
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">?
158
+  <br>
159
+</span></p>
160
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
161
+<span
162
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">Please&nbsp;call&nbsp;9.</span><u><span
163
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></u><span
164
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">at
165
+  <br>
166
+</span></p>
167
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
168
+<span
169
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">10.</span><u><span
170
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></u><span
171
+ style="color:#000000; font-family:Times New Roman; font-size:19px; vertical-align: middle;">.</span><span
172
+ style="color:#000000; font-family:Times New Roman; font-size:16px; vertical-align: middle;">
173
+</span></p>
174
+		</td>
175
+	</tr>
176
+</table>
177
+</p>
178
+<p style="text-align:justify; margin-top: 0px; margin-bottom: 0px; text-indent: 0px; margin-left: 0px; margin-right: 0px; ">
179
+</p>
180
+
181
+
182
+
183
+</body>
184
+</html>

+ 7625
- 0
app/src/main/assets/test3.html
File diff suppressed because it is too large
View File


+ 330
- 0
app/src/main/java/me/yluo/htmlview/AttrParser.java View File

@@ -0,0 +1,330 @@
1
+package me.yluo.htmlview;
2
+
3
+import android.text.Spannable;
4
+import android.text.TextUtils;
5
+import android.util.Log;
6
+
7
+import java.util.Hashtable;
8
+import java.util.Locale;
9
+
10
+/**
11
+ * html属性解析器
12
+ * 对症下药
13
+ * a - > href
14
+ * img -> src
15
+ * font -> color...
16
+ */
17
+public class AttrParser {
18
+
19
+    private static final Hashtable<String, Integer> sColorMap;
20
+    // TODO: 2017/5/10  有点不严谨
21
+    public static final int COLOR_NONE = 0x00000001;
22
+
23
+    static {
24
+        sColorMap = new Hashtable<>();
25
+        sColorMap.put("aqua", 0xFF00FFFF);
26
+        sColorMap.put("black", 0xFF000000);
27
+        sColorMap.put("blue", 0xFF0000FF);
28
+        sColorMap.put("darkgrey", 0xFFA9A9A9);
29
+        sColorMap.put("fuchsia", 0xFFFF00FF);
30
+        sColorMap.put("gray", 0xFF808080);
31
+        sColorMap.put("grey", 0xFF808080);
32
+        sColorMap.put("green", 0xFF008000);
33
+        sColorMap.put("lightblue", 0xFFADD8E6);
34
+        sColorMap.put("lightgrey", 0xFFD3D3D3);
35
+        sColorMap.put("lime", 0xFF00FF00);
36
+        sColorMap.put("maroon", 0xFF800000);
37
+        sColorMap.put("navy", 0xFF000080);
38
+        sColorMap.put("olive", 0xFF808000);
39
+        sColorMap.put("orange", 0xFFFFA500);
40
+        sColorMap.put("purple", 0xFF800080);
41
+        sColorMap.put("red", 0xFFFF0000);
42
+        sColorMap.put("silver", 0xFFC0C0C0);
43
+        sColorMap.put("teal", 0xFF008080);
44
+        sColorMap.put("white", 0xFFFFFFFF);
45
+        sColorMap.put("yellow", 0xFFFFFF00);
46
+
47
+        //discuz
48
+        sColorMap.put("sienna", 0xFFA0522D);
49
+        sColorMap.put("darkolivegreen", 0xFF556B2F);
50
+        sColorMap.put("darkgreen", 0xFF006400);
51
+        sColorMap.put("darkslateblue", 0xFF483D8B);
52
+        sColorMap.put("indigo", 0xFF4B0082);
53
+        sColorMap.put("darkslategray", 0xFF2F4F4F);
54
+        sColorMap.put("darkred", 0xFF8B0000);
55
+        sColorMap.put("darkorange", 0xFFFF8C00);
56
+        sColorMap.put("slategray", 0xFF708090);
57
+        sColorMap.put("dimgray", 0xFF696969);
58
+        sColorMap.put("sandybrown", 0xFFF4A460);
59
+        sColorMap.put("yellowgreen", 0xFFADFF2F);
60
+        sColorMap.put("seagreen", 0xFF2E8B57);
61
+        sColorMap.put("mediumturquoise", 0xFF48D1CC);
62
+        sColorMap.put("royalblue", 0xFF4169E1);
63
+        sColorMap.put("magenta", 0xFFFF00FF);
64
+        sColorMap.put("cyan", 0xFF00FFFF);
65
+        sColorMap.put("deepskyblue", 0xFF00BFFF);
66
+        sColorMap.put("darkorchid", 0xFF9932CC);
67
+        sColorMap.put("pink", 0xFFFFC0CB);
68
+        sColorMap.put("wheat", 0xFFF5DEB3);
69
+        sColorMap.put("lemonchiffon", 0xFFFFFACD);
70
+        sColorMap.put("palegreen", 0xFF98FB98);
71
+        sColorMap.put("paleturquoise", 0xFFAFEEEE);
72
+        sColorMap.put("plum", 0xFFDDA0DD);
73
+    }
74
+
75
+    public static HtmlNode.HtmlAttr parserAttr(int type, char[] buf, int len) {
76
+        HtmlNode.HtmlAttr attr = new HtmlNode.HtmlAttr();
77
+        String attrStr = new String(buf, 0, len);
78
+        switch (type) {
79
+            case HtmlTag.A:
80
+                attr.href = getAttrs(attrStr, 0, "href");
81
+                if (attr.href != null && attr.href.contains("&")) {
82
+                    attr.href = attr.href.replace("&amp;", "&");
83
+                }
84
+                break;
85
+            case HtmlTag.IMG:
86
+                attr.src = getImgAttrs(attrStr, 0, "src");
87
+                if (attr.src != null && attr.src.contains("&")) {
88
+                    attr.src = attr.src.replace("&amp;", "&");
89
+                }
90
+                break;
91
+            case HtmlTag.FONT:
92
+                attr.color = getTextColor(attrStr, 0);
93
+                attr.fontSize = getFontSize(attrStr, 0);
94
+            case HtmlTag.P://p 标签比较特殊 text-align 也可以是align
95
+                attr.color = getTextColor(attrStr, 0);
96
+                attr.textAlign = getAlign(true, attrStr, 0);
97
+                break;
98
+            case HtmlTag.DIV:
99
+            case HtmlTag.UL:
100
+                attr.align = getAlign(false, attrStr, 0);
101
+                break;
102
+        }
103
+        return attr;
104
+    }
105
+
106
+
107
+    //只有块状标签才有意义
108
+    //left right center
109
+    //内部布局  align="center"
110
+    //或者文字布局 text-align="center"
111
+    private static int getAlign(boolean isTextAlign, String s, int start) {
112
+        if (isTextAlign) {
113
+            start = getValidStrPos(s, start, "text-align", 15);
114
+        } else {
115
+            start = getValidStrPos(s, start, "align", 10);
116
+        }
117
+
118
+        if (start > 0) {
119
+            while (start < s.length() && (s.charAt(start) < 'a' || s.charAt(start) > 'z')) {
120
+                start++;
121
+            }
122
+            if (s.startsWith("right", start)) {
123
+                return HtmlNode.ALIGN_RIGHT;
124
+            } else if (s.startsWith("center", start)) {
125
+                return HtmlNode.ALIGN_CENTER;
126
+            } else if (s.startsWith("left", start)) {
127
+                return HtmlNode.ALIGN_LEFT;
128
+            }
129
+        }
130
+        return HtmlNode.ALIGN_UNDEFINE;
131
+    }
132
+
133
+    //color="red" " color:red "
134
+    //attr css
135
+    private static int getTextColor(String s, int start) {
136
+        int j = getValidStrPos(s, start, "color", 10);
137
+        if (j < 0) return COLOR_NONE;
138
+        //color 排除background-color bgcolor
139
+        if (j > start + 5 && ((s.charAt(j - 6) == '-') || (s.charAt(j - 6) == 'g'))) {
140
+            return COLOR_NONE;
141
+        }
142
+
143
+        while (j < s.length() - 3) {
144
+            if (s.charAt(j) == '=') {
145
+                while (j < (s.length() - 3) && s.charAt(j) != '\"') {
146
+                    j++;
147
+                }
148
+
149
+                if (s.charAt(j) == '\"') {
150
+                    start = j + 1;
151
+                    while (start < s.length()
152
+                            && s.charAt(start) != '\"'
153
+                            && s.charAt(start) != ' '
154
+                            && s.charAt(start) != '\n') {
155
+                        start++;
156
+                    }
157
+
158
+                    return getHtmlColor(j + 1, start, s);
159
+                }
160
+
161
+                return -1;
162
+            } else if (s.charAt(j) == ':') {
163
+                j++;
164
+                while (j < s.length() - 3 && (s.charAt(j) == ' ' || s.charAt(j) == '\n')) {
165
+                    j++;
166
+                }
167
+
168
+                start = j + 1;
169
+                while (start < s.length()
170
+                        && s.charAt(start) != ';'
171
+                        && s.charAt(start) != ' '
172
+                        && s.charAt(start) != '\n'
173
+                        && s.charAt(start) != '\"') {
174
+                    start++;
175
+                }
176
+
177
+                return getHtmlColor(j, start, s);
178
+            } else {
179
+                if (s.charAt(j) == '\"') {
180
+                    return COLOR_NONE;
181
+                }
182
+                j++;
183
+            }
184
+        }
185
+
186
+        return COLOR_NONE;
187
+    }
188
+
189
+    //text-decoration:none underline overline line-through
190
+    //css
191
+    //TextPaint tp = new TextPaint();
192
+    //tp.setUnderlineText(true);  //1
193
+    //tp.setStrikeThruText(true); //2
194
+    //none //0
195
+    public static int getTextDecoration(int start, String s) {
196
+        int j = getValidStrPos(s, start, "text-decoration", 20);
197
+        if (j < 0) return -1;
198
+
199
+        while (j < s.length() && (s.charAt(j) < 'a' || s.charAt(j) > 'z')) {
200
+            j++;
201
+        }
202
+
203
+        if (s.startsWith("underline", j)) {
204
+            return HtmlNode.DEC_UNDERLINE;
205
+        } else if (s.startsWith("line-through", j)) {
206
+            return HtmlNode.DEC_LINE_THROUGH;
207
+        } else if (s.startsWith("none", j)) {
208
+            return HtmlNode.DEC_NONE;
209
+        }
210
+        return HtmlNode.DEC_UNDEFINE;
211
+    }
212
+
213
+    //size="5"
214
+    private static int getFontSize(String source, int start) {
215
+        String s = getAttrs(source, start, "size");
216
+        if (s == null) return -1;
217
+        if (TextUtils.isDigitsOnly(s)) {
218
+            return Integer.parseInt(s);
219
+        }
220
+
221
+        return -1;
222
+    }
223
+
224
+
225
+    //a="b" src="" href=""
226
+    private static String getAttrs(String source, int start, String to) {
227
+        if (source.length() - start - 4 < to.length()) return null;
228
+        int j = getValidStrPos(source, start, to, to.length() + 4);
229
+        if (j < 0) return null;
230
+        //="aaaa"
231
+        j = source.indexOf("=", j);
232
+        if (j < 0) return null;
233
+
234
+        j = source.indexOf("\"", j);
235
+        if (j < 0) return null;
236
+        j++;
237
+        if (j > source.length() - 2) return null;
238
+
239
+        while (j < (source.length() - 2)
240
+                && (source.charAt(j) == ' '
241
+                || source.charAt(j) == '\n')) {
242
+            j++;
243
+        }
244
+
245
+        int pos2 = j + 1;
246
+        while (pos2 < source.length() - 1
247
+                && source.charAt(pos2) != '\"'
248
+                && source.charAt(pos2) != ' '
249
+                && source.charAt(pos2) != '\n') {
250
+            pos2++;
251
+        }
252
+
253
+        if (pos2 <= source.length() - 1) {
254
+            return source.substring(j, pos2);
255
+        }
256
+        return null;
257
+    }
258
+    private static String getImgAttrs(String source, int start, String to) {
259
+        if (source.length() - start - 4 < to.length()) return null;
260
+        int j = getValidStrPos(source, start, to, to.length() + 4);
261
+        if (j < 0) return null;
262
+        //="aaaa"
263
+        j = source.indexOf("=", j);
264
+        if (j < 0) return null;
265
+
266
+        j = source.indexOf("\"", j);
267
+        if (j < 0) return null;
268
+        j++;
269
+        if (j > source.length() - 2) return null;
270
+
271
+        while (j < (source.length() - 2)
272
+                && (source.charAt(j) == ' '
273
+                || source.charAt(j) == '\"')) {
274
+            j++;
275
+        }
276
+
277
+        int pos2 = j + 1;
278
+        while (pos2 < source.length() - 1
279
+                && source.charAt(pos2) != '\"') {
280
+            pos2++;
281
+        }
282
+
283
+        if (pos2 <= source.length() - 1) {
284
+            return source.substring(j, pos2);
285
+        }
286
+        return null;
287
+    }
288
+
289
+    //html color-> android color
290
+    private static int getHtmlColor(int start, int end, String color) {
291
+        if (end - start < 3) return COLOR_NONE;
292
+        if (color.charAt(start) == '#') {
293
+            if (end - start == 9) start += 2;
294
+            if (end - start == 7) {
295
+                int colorInt = Integer.parseInt(color.substring(start + 1, end), 16);
296
+                return (colorInt | 0xff000000);
297
+            }
298
+            return COLOR_NONE;
299
+        } else {
300
+            Integer i = sColorMap.get(color.substring(start, end).toLowerCase(Locale.US));
301
+            if (i != null) {
302
+                return i;
303
+            }
304
+            return COLOR_NONE;
305
+        }
306
+    }
307
+
308
+    //从source中找到to并且指定最小有效长度,如寻找style那么最小有效长度为17
309
+    //style="color:red" 17
310
+    //text-align:left 15
311
+    private static int getValidStrPos(String source, int start, String to, int minlen) {
312
+        int len = source.length() - start;
313
+        if (len < minlen) return -1;
314
+
315
+        int pos1 = 0;
316
+        int pos2 = 0;
317
+        while (pos1 <= len - minlen) {
318
+            pos2 = 0;
319
+            while (source.charAt(pos1) == to.charAt(pos2)) {
320
+                pos2++;
321
+                pos1++;
322
+                if (pos2 == to.length()) {
323
+                    return pos1;
324
+                }
325
+            }
326
+            pos1++;
327
+        }
328
+        return -1;
329
+    }
330
+}

+ 44
- 0
app/src/main/java/me/yluo/htmlview/DefaultClickHandler.java View File

@@ -0,0 +1,44 @@
1
+package me.yluo.htmlview;
2
+
3
+import android.content.ActivityNotFoundException;
4
+import android.content.Context;
5
+import android.content.Intent;
6
+import android.net.Uri;
7
+import android.provider.Browser;
8
+import android.util.Log;
9
+
10
+import me.yluo.htmlview.callback.SpanClickListener;
11
+
12
+/**
13
+ * 链接点击事件处理内
14
+ */
15
+public class DefaultClickHandler implements SpanClickListener {
16
+    private static final String TAG = DefaultClickHandler.class.getSimpleName();
17
+
18
+    private Context context;
19
+
20
+    public DefaultClickHandler(Context context) {
21
+        this.context = context;
22
+    }
23
+
24
+    @Override
25
+    public void onSpanClick(int type, String source) {
26
+        Log.d(TAG, "span click type is " + type + " source is:" + source);
27
+        switch (type) {
28
+            case HtmlTag.A:
29
+                Uri uri = Uri.parse(source);
30
+                Intent intent = new Intent(Intent.ACTION_VIEW, uri);
31
+                intent.putExtra(Browser.EXTRA_APPLICATION_ID, context.getPackageName());
32
+                try {
33
+                    context.startActivity(intent);
34
+                } catch (ActivityNotFoundException e) {
35
+                    Log.w("URLSpan", "Actvity was not found for intent, " + intent.toString());
36
+                }
37
+                break;
38
+            case HtmlTag.IMG:
39
+                break;
40
+            default:
41
+                break;
42
+        }
43
+    }
44
+}

+ 293
- 0
app/src/main/java/me/yluo/htmlview/DefaultImageGetter.java View File

@@ -0,0 +1,293 @@
1
+package me.yluo.htmlview;
2
+
3
+import android.content.Context;
4
+import android.content.res.Resources;
5
+import android.graphics.Bitmap;
6
+import android.graphics.BitmapFactory;
7
+import android.graphics.drawable.BitmapDrawable;
8
+import android.graphics.drawable.ColorDrawable;
9
+import android.graphics.drawable.Drawable;
10
+import android.util.Base64;
11
+import android.util.Log;
12
+
13
+import java.io.BufferedInputStream;
14
+import java.io.BufferedOutputStream;
15
+import java.io.IOException;
16
+import java.io.InputStream;
17
+import java.net.HttpURLConnection;
18
+import java.net.URL;
19
+import java.util.HashSet;
20
+import java.util.Set;
21
+import java.util.concurrent.ExecutorService;
22
+import java.util.concurrent.Executors;
23
+
24
+import me.yluo.htmlview.callback.ImageGetter;
25
+import me.yluo.htmlview.callback.ImageGetterCallBack;
26
+
27
+
28
+public class DefaultImageGetter implements ImageGetter {
29
+
30
+    private static final String TAG = DefaultImageGetter.class.getSimpleName();
31
+    private Context context;
32
+    private ImageCacher imageCacher;
33
+    private int maxWidth;//最大宽度 图片不要大于这个值
34
+    private static Set<BitmapWorkerTask> taskCollection;
35
+    private static ExecutorService mPool;
36
+    private final int smileySize;//限制表情最大值
37
+    private String baseUrl;
38
+
39
+    static {
40
+        taskCollection = new HashSet<>();
41
+        if (mPool == null) {
42
+            int thread = Runtime.getRuntime().availableProcessors();
43
+            mPool = Executors.newFixedThreadPool(thread);
44
+        }
45
+    }
46
+
47
+
48
+    public DefaultImageGetter(String baseUrl, int maxWidth, Context context) {
49
+        this.context = context;
50
+        this.maxWidth = maxWidth;
51
+        imageCacher = ImageCacher.instance(context.getCacheDir() + "/imageCache/");
52
+        smileySize = (int) (HtmlView.FONT_SIZE * 2.5f);
53
+        this.baseUrl = baseUrl == null ? "" : baseUrl.endsWith("/") ? baseUrl : baseUrl + "/";
54
+    }
55
+
56
+
57
+    @Override
58
+    public void getDrawable(String source, int start, int end, ImageGetterCallBack callBack) {
59
+        if (callBack == null) return;
60
+        Log.d(TAG, "get getDrawable " + source);
61
+        Bitmap b = imageCacher.getMemCache(source);
62
+        if (b == null) {
63
+            if (source.startsWith("data")) {
64
+              b= stringtoBitmap(source);
65
+            } else {
66
+                //网络图片再检查硬盘缓存
67
+                b = BitmapFactory.decodeStream(imageCacher.getDiskCacheStream(source));
68
+                b = scaleBitmap(b, maxWidth);
69
+                if (b != null) {
70
+                    Log.d(TAG, "get image from diskcache " + source);
71
+                }
72
+
73
+                //没有缓存去下载
74
+                if (b == null && !mPool.isShutdown()) {
75
+                    mPool.execute(new BitmapWorkerTask(source, start, end, callBack));
76
+                }
77
+            }
78
+
79
+            //放到内存缓存
80
+            if (b != null) {
81
+                imageCacher.putMemCache(source, b);
82
+            }
83
+        }
84
+
85
+        callBack.onImageReady(source, start, end, bmpToDrawable(source, b));
86
+    }
87
+
88
+    public Bitmap stringtoBitmap(String string) {
89
+        //将字符串转换成Bitmap类型
90
+        Bitmap bitmap = null;
91
+        try {
92
+            if (string.contains("base64,")) {
93
+                string = string.split(",")[1];
94
+            }
95
+            //Log.i(TAG, "stringtoBitmap: " + string);
96
+            byte[] decode = Base64.decode(string, Base64.DEFAULT);
97
+            bitmap = BitmapFactory.decodeByteArray(decode, 0, decode.length);
98
+        } catch (Exception e) {
99
+            e.printStackTrace();
100
+        }
101
+
102
+        return bitmap;
103
+    }
104
+
105
+    public void cancelAllTasks() {
106
+        if (taskCollection != null) {
107
+            for (BitmapWorkerTask t : taskCollection) {
108
+                t.cancel();
109
+            }
110
+        }
111
+
112
+        if (mPool != null && !mPool.isShutdown()) {
113
+            synchronized (mPool) {
114
+                mPool.shutdownNow();
115
+            }
116
+        }
117
+    }
118
+
119
+    //图片下载及存储
120
+    private class BitmapWorkerTask implements Runnable {
121
+        private String imageUrl;
122
+        private boolean isCancel;
123
+        private int start, end;
124
+        private ImageGetterCallBack callBack;
125
+
126
+        public BitmapWorkerTask(String imageUrl, int start, int end, ImageGetterCallBack callBack) {
127
+            this.imageUrl = imageUrl;
128
+            this.start = start;
129
+            this.end = end;
130
+            this.callBack = callBack;
131
+        }
132
+
133
+        public void cancel() {
134
+            isCancel = true;
135
+        }
136
+
137
+        @Override
138
+        public void run() {
139
+            taskCollection.add(this);
140
+            Log.d(TAG, "start download image " + imageUrl);
141
+            HttpURLConnection urlConnection = null;
142
+            BufferedOutputStream out = null;
143
+            BufferedInputStream in = null;
144
+            Bitmap bitmap = null;
145
+            try {
146
+                //todo url不合法就别下了
147
+                final URL url = new URL(imageUrl.startsWith("http") ? imageUrl : baseUrl + imageUrl);
148
+                urlConnection = (HttpURLConnection) url.openConnection();
149
+                in = new BufferedInputStream(urlConnection.getInputStream(), 4 * 1024);
150
+                //bitmap = decodeBitmapFromStream(in, maxWidth);
151
+                bitmap = BitmapFactory.decodeStream(in);
152
+                if (bitmap != null && !isCancel) {
153
+                    Log.d(TAG, "download image compete " + imageUrl);
154
+                    //存到硬盘
155
+                    Bitmap.CompressFormat f = Bitmap.CompressFormat.PNG;
156
+                    if (imageUrl.endsWith(".jpg") || imageUrl.endsWith(".jpeg") ||
157
+                            imageUrl.endsWith(".JPG") || imageUrl.endsWith(".JPEG")) {
158
+                        f = Bitmap.CompressFormat.JPEG;
159
+                    } else if (imageUrl.endsWith(".webp")) {
160
+                        f = Bitmap.CompressFormat.WEBP;
161
+                    }
162
+
163
+                    out = new BufferedOutputStream(imageCacher.newDiskCacheStream(imageUrl), 4 * 1024);
164
+                    bitmap.compress(f, 90, out);
165
+
166
+                    Log.d(TAG, "image init width is " + bitmap.getWidth());
167
+                    //存到内存之前需要压缩
168
+                    bitmap = scaleBitmap(bitmap, maxWidth);
169
+                    Log.d(TAG, "after scale image width is " + bitmap.getWidth());
170
+                    imageCacher.putMemCache(imageUrl, bitmap);
171
+                } else {
172
+                    Log.d(TAG, "download image error " + imageUrl);
173
+                }
174
+            } catch (final IOException e) {
175
+                e.printStackTrace();
176
+            } finally {
177
+                if (urlConnection != null) {
178
+                    urlConnection.disconnect();
179
+                }
180
+                try {
181
+                    if (out != null) {
182
+                        out.close();
183
+                    }
184
+                    if (in != null) {
185
+                        in.close();
186
+                    }
187
+                } catch (IOException e) {
188
+                    e.printStackTrace();
189
+                }
190
+            }
191
+            taskCollection.remove(this);
192
+            if (!isCancel && bitmap != null) {
193
+                //如果下载失败就不用返回了 因为之前以前有holder了
194
+                callBack.onImageReady(imageUrl, start, end, bmpToDrawable(imageUrl, bitmap));
195
+            }
196
+        }
197
+    }
198
+
199
+    //永远不要返回null
200
+    public Drawable bmpToDrawable(String source, Bitmap b) {
201
+        if (b == null) {
202
+            return getPlaceHolder(source);
203
+        } else {
204
+            Drawable d = new BitmapDrawable(context.getResources(), b);
205
+            d.setBounds(0, 0, b.getWidth(), b.getHeight());
206
+            return d;
207
+        }
208
+    }
209
+
210
+    //// TODO: 2017/2/22
211
+    private Drawable getPlaceHolder(String souce) {
212
+        ColorDrawable colorDrawable = new ColorDrawable(0xffcccccc);
213
+        if (souce == null || souce.isEmpty()) {
214
+            colorDrawable.setBounds(0, 0, 120, 120);
215
+        } else if (souce.startsWith("/smiley")) {
216
+            colorDrawable.setBounds(0, 0, smileySize, smileySize);
217
+        } else {
218
+            colorDrawable.setBounds(0, 0, maxWidth, maxWidth / 2);
219
+        }
220
+
221
+        return colorDrawable;
222
+    }
223
+
224
+
225
+    public static Bitmap decodeBitmapFromStream(InputStream is, boolean needScale, int reqWidth) {
226
+        if (is == null) return null;
227
+        if (needScale) {
228
+            final BitmapFactory.Options options = new BitmapFactory.Options();
229
+            options.inJustDecodeBounds = true;
230
+            BitmapFactory.decodeStream(is, null, options);
231
+            options.inSampleSize = calculateInSampleSize(options, reqWidth);
232
+            options.inJustDecodeBounds = false;
233
+            Bitmap src = BitmapFactory.decodeStream(is, null, options);
234
+            return scaleBitmap(src, reqWidth);
235
+        } else {
236
+            Bitmap src = BitmapFactory.decodeStream(is);
237
+            return scaleBitmap(src, reqWidth);
238
+        }
239
+    }
240
+
241
+    public static Bitmap decodeBitmapFromRes(Resources res, int resId, boolean needScale, int reqWidth) {
242
+        if (needScale) {
243
+            final BitmapFactory.Options options = new BitmapFactory.Options();
244
+            options.inJustDecodeBounds = true;
245
+            BitmapFactory.decodeResource(res, resId, options);
246
+            options.inSampleSize = calculateInSampleSize(options, reqWidth);
247
+            options.inJustDecodeBounds = false;
248
+            Bitmap src = BitmapFactory.decodeResource(res, resId, options);
249
+            return scaleBitmap(src, reqWidth);
250
+        } else {
251
+            Bitmap src = BitmapFactory.decodeResource(res, resId);
252
+            return scaleBitmap(src, reqWidth);
253
+        }
254
+    }
255
+
256
+    private static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth) {
257
+        // 源图片的高度和宽度
258
+        final int width = options.outWidth;
259
+        int inSampleSize = 1;
260
+        if (width > reqWidth) {
261
+            final int halfWidth = width / 2;
262
+            while ((halfWidth / inSampleSize) >= reqWidth) {
263
+                inSampleSize *= 2;
264
+            }
265
+        }
266
+        return inSampleSize;
267
+    }
268
+
269
+    private static Bitmap scaleBitmap(Bitmap src, int dstWidth) {
270
+        if (src == null) return null;
271
+        int srcWidth = src.getWidth();
272
+        if (srcWidth <= dstWidth) return src;
273
+
274
+        float scale = dstWidth * 1.0f / srcWidth;
275
+        int dstHeight = (int) (scale * src.getHeight());
276
+
277
+        Bitmap dst = Bitmap.createScaledBitmap(src, dstWidth, dstHeight, false);
278
+        if (src != dst) { // 如果没有缩放,那么不回收
279
+            src.recycle(); // 释放Bitmap的native像素数组
280
+        }
281
+        return dst;
282
+    }
283
+}
284
+
285
+/**
286
+ * 笔记 android 分辨率和dpi关系
287
+ * ldpi	    120dpi	0.75
288
+ * mdpi	    160dpi	1
289
+ * hdpi	    240dpi	1.5
290
+ * xhdpi    320dpi	2     1280*720   1dp=2px
291
+ * xxhdpi: 480dpi  3     1920*1080 1dp=3px
292
+ * xxxhdpi  640dpi  4
293
+ */

+ 48
- 0
app/src/main/java/me/yluo/htmlview/HtmlNode.java View File

@@ -0,0 +1,48 @@
1
+package me.yluo.htmlview;
2
+
3
+
4
+public class HtmlNode {
5
+    public int type = HtmlTag.UNKNOWN;
6
+    public String name;
7
+    public int start = -1;
8
+    public HtmlAttr attr;
9
+
10
+    public static final int ALIGN_RIGHT = 2;
11
+    public static final int ALIGN_CENTER = 1;
12
+    public static final int ALIGN_LEFT = 0;
13
+    public static final int ALIGN_UNDEFINE = -1;
14
+
15
+    public static final int DEC_UNDERLINE = 1;
16
+    public static final int DEC_LINE_THROUGH = 2;
17
+    public static final int DEC_NONE = 0;
18
+    public static final int DEC_UNDEFINE = -1;
19
+
20
+    public HtmlNode(int type, String name, HtmlAttr attr) {
21
+        this.type = type;
22
+        this.name = name;
23
+        this.attr = attr;
24
+    }
25
+
26
+    public static class HtmlAttr {
27
+        public String src;//attr
28
+        public String href;//attr
29
+        public int color = AttrParser.COLOR_NONE;//css,attr color
30
+        public int fontSize = -1;// TODO: 2017/5/10  
31
+        public int textAlign = ALIGN_UNDEFINE;
32
+        public int textDecoration = DEC_UNDEFINE;
33
+        public int align = ALIGN_UNDEFINE;//布局方向 block元素起作用
34
+        
35
+
36
+        @Override
37
+        public String toString() {
38
+            return "{color:" + color
39
+                    + (src == null ? "" : ", src:" + src)
40
+                    + (href == null ? "" : ", href:" + href) + "}";
41
+        }
42
+    }
43
+
44
+    @Override
45
+    public String toString() {
46
+        return "name:" + name + ", type:" + type + ", attr:{" + attr;
47
+    }
48
+}

+ 794
- 0
app/src/main/java/me/yluo/htmlview/HtmlParser.java View File

@@ -0,0 +1,794 @@
1
+package me.yluo.htmlview;
2
+
3
+import android.util.Log;
4
+
5
+import java.io.IOException;
6
+import java.io.InputStream;
7
+import java.io.InputStreamReader;
8
+import java.io.Reader;
9
+import java.util.Objects;
10
+import java.util.Stack;
11
+
12
+
13
+/**
14
+ * html解析器
15
+ * html文本-> html node
16
+ * startDocument->
17
+ * startElement->characters->endElement->
18
+ * endDocument
19
+ */
20
+public class HtmlParser {
21
+    private static final char EOF = (char) -1;
22
+    private static final int MAX_TAG_LEN = 16;
23
+    private static final int MAX_ATTR_LEN = Integer.MAX_VALUE;
24
+
25
+
26
+    //pre 标签的层数0-no >0 有
27
+    private int preLevel = 0;
28
+
29
+    private Reader reader;
30
+    private int srcPos, srcCount;
31
+    private char[] srcBuf;
32
+
33
+    private int bufPos;
34
+    private char[] buf;
35
+    private char readItem = EOF, lastRead = EOF;
36
+    private ParserCallback handler;
37
+    private Stack<HtmlNode> stack;
38
+
39
+    public HtmlParser() {
40
+        stack = new Stack<>();
41
+    }
42
+
43
+    public void setHandler(ParserCallback handler) {
44
+        this.handler = handler;
45
+    }
46
+
47
+    public void parase(InputStream is) throws IOException {
48
+        if (handler == null) {
49
+            throw new NullPointerException("you must set ParserCallback");
50
+        }
51
+
52
+        int len = is.available();
53
+        len = len < 1024 ? 1024 : (len < 4096 ? 4096 : 6114);
54
+        srcBuf = new char[len];
55
+        buf = new char[(len >= 4096) ? 2048 : 1024];
56
+        this.reader = new InputStreamReader(is, "UTF-8");
57
+        srcPos = 0;
58
+        srcCount = 0;
59
+        stack.clear();
60
+        parse();
61
+    }
62
+
63
+    public void parase(String s) throws IOException {
64
+        if (s == null) {
65
+            throw new NullPointerException("input cant be null");
66
+        }
67
+        srcBuf = s.toCharArray();
68
+        srcPos = 0;
69
+        srcCount = srcBuf.length;
70
+        int len = srcBuf.length;
71
+        stack.clear();
72
+     //   len = len < 2048 ? len : 2048;
73
+        buf = new char[len];
74
+        parse();
75
+    }
76
+
77
+    //<!doctype html>
78
+    //<!--注释-->
79
+    private void parse() {
80
+        if (handler == null) {
81
+            return;
82
+        } else {
83
+            handler.startDocument(srcBuf.length);
84
+        }
85
+        read();
86
+        while (readItem != EOF) {
87
+            switch (readItem) {
88
+                case EOF://end
89
+                    handleStop();
90
+                    break;
91
+                case '<'://tags
92
+                    read();
93
+                    switch (readItem) {
94
+                        case '/':
95
+                            parseEndTag();
96
+                            break;
97
+                        case '!':
98
+                            read();
99
+                            if (readItem == '-') {
100
+                                if (read() == '-') {
101
+                                    parseComment();
102
+                                } else if (readItem != '>') {
103
+                                    skip();
104
+                                }
105
+                            } else {
106
+                                skip();
107
+                            }
108
+                            break;
109
+                        case '?':
110
+                            skip();
111
+                            break;
112
+                        default:
113
+                            parseStartTag();
114
+                            break;
115
+                    }
116
+                    break;
117
+                case '>':
118
+                    //end tag
119
+                    read();
120
+                    parseText();
121
+                    break;
122
+                default:
123
+                    if (lastRead == EOF || lastRead == '>') {
124
+                        parseText();
125
+                    } else {
126
+                        read();
127
+                    }
128
+                    break;
129
+            }
130
+        }
131
+    }
132
+
133
+    //解析开始标签<a> <img /> <x a="b" c="d" e>
134
+    //单标签只有开始
135
+    private void parseStartTag() {
136
+        if ((readItem < 'a' || readItem > 'z')
137
+                && (readItem < 'A' || readItem > 'Z')) {
138
+            //不合法的开始标签
139
+            return;
140
+        }
141
+
142
+        //read name
143
+        bufPos = 0;
144
+        do {
145
+            if (readItem >= 'A' && readItem <= 'Z') {
146
+                readItem = (char) (readItem + 'a' - 'A');
147
+            }
148
+            buf[bufPos++] = readItem;
149
+            read();
150
+        } while (readItem != EOF && bufPos < MAX_TAG_LEN
151
+                && ((readItem >= 'a' && readItem <= 'z')
152
+                || (readItem >= 'A' && readItem <= 'Z')
153
+                || (readItem >= '0' && readItem <= '9')));
154
+
155
+        String name = new String(buf, 0, bufPos);
156
+        int type = getTagType();
157
+        bufPos = 0;
158
+
159
+        if (readItem == '/') {
160
+            read();
161
+        }
162
+
163
+        if (readItem != '>') {
164
+            if (readItem == ' ' || readItem == '\n') {
165
+                readNoSpcBr();
166
+            }
167
+
168
+            if (readItem == '/') {
169
+                read();
170
+            }
171
+
172
+            if (readItem != '>') {
173
+                parseAttr();
174
+            }
175
+        }
176
+
177
+        if (handler != null) {
178
+            if (type == HtmlTag.PRE) {
179
+                preLevel++;
180
+            }
181
+
182
+            //说明attr长度大于等于5为有效attr
183
+            HtmlNode.HtmlAttr attr = null;
184
+            if (bufPos >= 5) {
185
+                attr = AttrParser.parserAttr(type, buf, bufPos);
186
+
187
+            }
188
+            HtmlNode n = new HtmlNode(type, name, attr);
189
+            pushNode(n);
190
+            handler.startElement(n);
191
+        }
192
+    }
193
+
194
+    //解析属性值
195
+    private void parseAttr() {
196
+        bufPos = 0;
197
+        do {
198
+            buf[bufPos++] = readItem;
199
+            read();
200
+        } while (readItem != EOF
201
+                && readItem != '>'
202
+                && bufPos < MAX_ATTR_LEN);
203
+
204
+        if (buf[(bufPos - 1)] == '/') {
205
+            bufPos--;
206
+        }
207
+
208
+        if (readItem != '>') {
209
+            skip();
210
+        }
211
+    }
212
+
213
+    //解析结束标签</xxx  > </xxx> </xxx\n  >
214
+    private void parseEndTag() {
215
+        bufPos = 0;
216
+        while (readItem != EOF && (readItem = readNoSpcBr()) != '>') {
217
+            if (bufPos >= MAX_TAG_LEN) {
218
+                //不可能出现太长的tag
219
+                break;
220
+            } else {
221
+                buf[bufPos++] = readItem;
222
+            }
223
+        }
224
+
225
+        String s = new String(buf, 0, bufPos);
226
+        int type = getTagType();
227
+        bufPos = 0;
228
+
229
+        if (type == HtmlTag.PRE && preLevel > 0) {
230
+            preLevel--;
231
+        }
232
+
233
+        popNode(type, s);
234
+        handler.endElement(type, s);
235
+    }
236
+
237
+    //解析注释
238
+    private void parseComment() {
239
+        while (readItem != EOF) {
240
+            read();
241
+            read();
242
+            if (readItem == '-' && lastRead == '-') {
243
+                read();
244
+                if (readItem == '>') {
245
+                    break;
246
+                }
247
+            }
248
+        }
249
+    }
250
+
251
+    //解析文字
252
+    //处理转义
253
+    //&amp; "&"
254
+    //&apos;  "'"
255
+    //&gt; ">"
256
+    //&lt; "<"
257
+    //&quot; "\"
258
+    //&nbsp; ' '
259
+    private void parseText() {
260
+        bufPos = 0;
261
+        while (readItem != EOF && readItem != '<' && readItem != '>') {
262
+            if (preLevel > 0 && bufPos > 0) {//pre 标签 原封不动push
263
+                pushText(readItem);
264
+            } else {
265
+                //转义
266
+                if (readItem == '&') {//&nbsp;
267
+                    read();
268
+                    if (readItem != EOF && readItem == 'n') {
269
+                        read();
270
+                        if (readItem != EOF && readItem == 'b') {
271
+                            read();
272
+                            if (readItem != EOF && readItem == 's') {
273
+                                read();
274
+                                if (readItem != EOF && readItem == 'p') {
275
+                                    read();
276
+                                    if (readItem != EOF && readItem == ';') {
277
+                                        pushText(' '); //&nbsp;
278
+                                        read();
279
+                                        continue;//强制空格
280
+                                    } else {
281
+                                        pushText('&');
282
+                                        pushText('n');
283
+                                        pushText('b');
284
+                                        pushText('s');
285
+                                        pushText('p');
286
+                                    }
287
+                                } else {
288
+                                    pushText('&');
289
+                                    pushText('n');
290
+                                    pushText('b');
291
+                                    pushText('s');
292
+                                }
293
+                            } else {
294
+                                pushText('&');
295
+                                pushText('n');
296
+                                pushText('b');
297
+                            }
298
+                        } else {
299
+                            pushText('&');
300
+                            pushText('n');
301
+                        }
302
+                    } else if (readItem != EOF && readItem == 'a') { //&amp; &apos;
303
+                        read();
304
+                        if (readItem != EOF && readItem == 'm') {//&amp;
305
+                            read();
306
+                            if (readItem != EOF && readItem == 'p') {//&amp;
307
+                                read();
308
+                                if (readItem != EOF && readItem == ';') {//&amp;
309
+                                    pushText('&'); //&nbsp;
310
+                                    read();
311
+                                    continue;
312
+                                } else {
313
+                                    pushText('&');
314
+                                    pushText('a');
315
+                                    pushText('m');
316
+                                    pushText('p');
317
+                                }
318
+                            } else {
319
+                                pushText('&');
320
+                                pushText('a');
321
+                                pushText('m');
322
+                            }
323
+                        } else if (readItem != EOF && readItem == 'p') {//&apos;
324
+                            read();
325
+                            if (readItem != EOF && readItem == 'o') {//&apos;
326
+                                read();
327
+                                if (readItem != EOF && readItem == 's') {//&apos;
328
+                                    read();
329
+                                    if (readItem != EOF && readItem == ';') {
330
+                                        pushText('\''); //&apos;
331
+                                        read();
332
+                                        continue;
333
+                                    } else {
334
+                                        pushText('&');
335
+                                        pushText('a');
336
+                                        pushText('p');
337
+                                        pushText('o');
338
+                                        pushText('s');
339
+                                    }
340
+                                } else {
341
+                                    pushText('&');
342
+                                    pushText('a');
343
+                                    pushText('p');
344
+                                    pushText('o');
345
+                                }
346
+                            } else {
347
+                                pushText('&');
348
+                                pushText('a');
349
+                                pushText('p');
350
+                            }
351
+                        } else {
352
+                            pushText('&');
353
+                            pushText('a');
354
+                        }
355
+                    } else if (readItem != EOF && readItem == 'g') {//&gt;
356
+                        read();
357
+                        if (readItem != EOF && readItem == 't') {
358
+                            read();
359
+                            if (readItem != EOF && readItem == ';') {
360
+                                pushText('>'); //&gt;
361
+                                read();
362
+                                continue;
363
+                            } else {
364
+                                pushText('&');
365
+                                pushText('g');
366
+                                pushText('t');
367
+                            }
368
+                        } else {
369
+                            pushText('&');
370
+                            pushText('g');
371
+                        }
372
+                    } else if (readItem != EOF && readItem == 'l') {//&lt;
373
+                        read();
374
+                        if (readItem != EOF && readItem == 't') {
375
+                            read();
376
+                            if (readItem != EOF && readItem == ';') {
377
+                                pushText('<'); //&lt;
378
+                                read();
379
+                                continue;
380
+                            } else {
381
+                                pushText('&');
382
+                                pushText('l');
383
+                                pushText('t');
384
+                            }
385
+                        } else {
386
+                            pushText('&');
387
+                            pushText('l');
388
+                        }
389
+                    } else if (readItem != EOF && readItem == 'q') {//&quot;
390
+                        read();
391
+                        if (readItem != EOF && readItem == 'u') {
392
+                            read();
393
+                            if (readItem != EOF && readItem == 'o') {
394
+                                read();
395
+                                if (readItem != EOF && readItem == 't') {
396
+                                    read();
397
+                                    if (readItem != EOF && readItem == ';') {
398
+                                        pushText('\\'); //&nbsp;
399
+                                        read();
400
+                                        continue;
401
+                                    } else {
402
+                                        pushText('&');
403
+                                        pushText('q');
404
+                                        pushText('u');
405
+                                        pushText('o');
406
+                                        pushText('t');
407
+                                    }
408
+                                } else {
409
+                                    pushText('&');
410
+                                    pushText('q');
411
+                                    pushText('u');
412
+                                    pushText('o');
413
+                                }
414
+                            } else {
415
+                                pushText('&');
416
+                                pushText('q');
417
+                                pushText('u');
418
+                            }
419
+                        } else {
420
+                            pushText('&');
421
+                            pushText('q');
422
+                        }
423
+                    } else {
424
+                        pushText('&');
425
+                    }
426
+                }
427
+
428
+                if (readItem == ' ' || readItem == '\n') {
429
+                    if (bufPos != 0 && buf[(bufPos - 1)] != ' ') {
430
+                        readItem = ' ';
431
+                        pushText(readItem);
432
+                    }
433
+                } else {
434
+                    pushText(readItem);
435
+                }
436
+            }
437
+            read();
438
+        }
439
+
440
+        //不是空
441
+        if (bufPos > 0 && handler != null) {
442
+            handler.characters(buf, 0, bufPos);
443
+        }
444
+    }
445
+
446
+    //处理解析完成
447
+    private void handleStop() {
448
+        while (!stack.isEmpty()) {
449
+            HtmlNode n = stack.pop();
450
+            handler.endElement(n.type, n.name);
451
+        }
452
+        readItem = EOF;
453
+        handler.endDocument();
454
+    }
455
+
456
+    //读取一个字符
457
+    private char read() {
458
+        lastRead = readItem;
459
+        if (srcPos < srcCount)
460
+            readItem = srcBuf[srcPos++];
461
+        else {
462
+            if (reader == null) {
463
+                readItem = EOF;
464
+            } else {
465
+                try {
466
+                    srcCount = reader.read(srcBuf, 0, srcBuf.length);
467
+                } catch (IOException e) {
468
+                    e.printStackTrace();
469
+                    readItem = EOF;
470
+                }
471
+                if (srcCount <= 0)
472
+                    readItem = EOF;
473
+                else
474
+                    readItem = srcBuf[0];
475
+                srcPos = 1;
476
+            }
477
+        }
478
+
479
+        switch (readItem) {
480
+            case EOF:
481
+                handleStop();
482
+                break;
483
+            case '\r':
484
+                read();
485
+                break;
486
+        }
487
+        return readItem;
488
+    }
489
+
490
+    //忽略读入的空格和回车
491
+    private char readNoSpcBr() {
492
+        while (readItem != EOF) {
493
+            read();
494
+            if (readItem != '\n' && readItem != ' ') {
495
+                return readItem;
496
+            }
497
+        }
498
+        return EOF;
499
+    }
500
+
501
+    //skip to next > or EOF
502
+    private void skip() {
503
+        while (readItem != EOF && readItem != '>') {
504
+            read();
505
+        }
506
+    }
507
+
508
+    //加入一个新的文字
509
+    private void pushText(int c) {
510
+        if (bufPos == buf.length) {
511
+            char[] bigger = new char[bufPos * 4 / 3 + 4];
512
+            System.arraycopy(buf, 0, bigger, 0, bufPos);
513
+            buf = bigger;
514
+        }
515
+
516
+        buf[bufPos++] = (char) c;
517
+    }
518
+
519
+    private boolean equalTag(int start, String b) {
520
+        int len = b.length();
521
+        while (len-- != 0) {
522
+            if (buf[start] != b.charAt(start))
523
+                return false;
524
+            start++;
525
+        }
526
+
527
+        return true;
528
+    }
529
+
530
+    private int getTagType() {
531
+        switch (bufPos) {
532
+            case 1:
533
+                switch (buf[0]) {
534
+                    case 'a':
535
+                        return HtmlTag.A;
536
+                    case 'b':
537
+                        return HtmlTag.B;
538
+                    case 'i':
539
+                        return HtmlTag.I;
540
+                    case 'p':
541
+                        return HtmlTag.P;
542
+                    case 'q':
543
+                        return HtmlTag.Q;
544
+                    case 's':
545
+                        return HtmlTag.S;
546
+                    case 'u':
547
+                        return HtmlTag.U;
548
+                }
549
+                break;
550
+            case 2:
551
+                switch (buf[0]) {
552
+                    case 'b':
553
+                        if (buf[1] == 'r')
554
+                            return HtmlTag.BR;
555
+                        break;
556
+                    case 'e':
557
+                        if (buf[1] == 'r')
558
+                            return HtmlTag.EM;
559
+                        break;
560
+                    case 'h':
561
+                        if ('1' <= buf[1] && buf[1] <= '6') {
562
+                            return (buf[1] - '1') + HtmlTag.H1;
563
+                        } else if (buf[1] == 'r') {
564
+                            return HtmlTag.HR;
565
+                        }
566
+                        break;
567
+                    case 'l':
568
+                        if (buf[1] == 'i')
569
+                            return HtmlTag.LI;
570
+                        break;
571
+                    case 'o':
572
+                        if (buf[1] == 'l')
573
+                            return HtmlTag.OL;
574
+                        break;
575
+                    case 't':
576
+                        if (buf[1] == 'd') {
577
+                            return HtmlTag.TD;
578
+                        } else if (buf[1] == 'h') {
579
+                            return HtmlTag.TH;
580
+                        } else if (buf[1] == 'r') {
581
+                            return HtmlTag.TR;
582
+                        } else if (buf[1] == 't') {
583
+                            return HtmlTag.TT;
584
+                        }
585
+                        break;
586
+                    case 'u':
587
+                        if (buf[1] == 'l')
588
+                            return HtmlTag.UL;
589
+                        break;
590
+                    default:
591
+                        return HtmlTag.UNKNOWN;
592
+                }
593
+                break;
594
+            case 3:
595
+                switch (buf[0]) {
596
+                    case 'b':
597
+                        if (buf[1] == 'i' && buf[2] == 'g') {
598
+                            return HtmlTag.BIG;
599
+                        }
600
+                        break;
601
+                    case 'd':
602
+                        if (buf[1] == 'e' && buf[2] == 'l') {
603
+                            return HtmlTag.DEL;
604
+                        } else if (buf[1] == 'f' && buf[2] == 'n') {
605
+                            return HtmlTag.DFN;
606
+                        } else if (buf[1] == 'i' && buf[2] == 'v') {
607
+                            return HtmlTag.DIV;
608
+                        }
609
+                        break;
610
+                    case 'i':
611
+                        if (buf[1] == 'm' && buf[2] == 'g') {
612
+                            return HtmlTag.IMG;
613
+                        } else if (buf[1] == 'n' && buf[2] == 's') {
614
+                            return HtmlTag.INS;
615
+                        }
616
+                        break;
617
+                    case 'k':
618
+                        if (buf[1] == 'b' && buf[2] == 'd') {
619
+                            return HtmlTag.KBD;
620
+                        }
621
+                        break;
622
+                    case 'p':
623
+                        if (buf[1] == 'r') {
624
+                            if (buf[2] == 'e') {
625
+                                return HtmlTag.PRE;
626
+                            }
627
+                        }
628
+                        break;
629
+                    case 's':
630
+                        if (buf[1] == 'u') {
631
+                            if (buf[2] == 'b') {
632
+                                return HtmlTag.SUB;
633
+                            } else if (buf[2] == 'p') {
634
+                                return HtmlTag.SUP;
635
+                            }
636
+                        }
637
+                        break;
638
+                    default:
639
+                        return HtmlTag.UNKNOWN;
640
+                }
641
+                break;
642
+            case 4:
643
+                switch (buf[0]) {
644
+                    case 'c':
645
+                        if (buf[1] == 'i' && buf[2] == 't' && buf[3] == 'e') {
646
+                            return HtmlTag.CITE;
647
+                        } else if (buf[1] == 'o' && buf[2] == 'd' && buf[3] == 'e') {
648
+                            return HtmlTag.CODE;
649
+                        }
650
+                        break;
651
+                    case 'f':
652
+                        if (buf[1] == 'o' && buf[2] == 'n' && buf[3] == 't') {
653
+                            return HtmlTag.FONT;
654
+                        }
655
+                        break;
656
+                    case 's':
657
+                        if (buf[1] == 'p' && buf[2] == 'a' && buf[3] == 'n') {
658
+                            return HtmlTag.SPAN;
659
+                        }
660
+                        break;
661
+                    case 'm':
662
+                        if (buf[1] == 'a' && buf[2] == 'r' && buf[3] == 'k') {
663
+                            return HtmlTag.MARK;
664
+                        }
665
+                        break;
666
+                    default:
667
+                        return HtmlTag.UNKNOWN;
668
+                }
669
+                break;
670
+            case 5:
671
+                if (equalTag(2, "dio")) {
672
+                    if (buf[0] == 'a' && buf[1] == 'u') {
673
+                        return HtmlTag.AUDIO;
674
+                    } else if (buf[0] == 'v' && buf[1] == 'e') {
675
+                        return HtmlTag.VEDIO;
676
+                    }
677
+                } else {
678
+                    switch (buf[0]) {
679
+                        case 's':
680
+                            if (equalTag(1, "mall")) {
681
+                                return HtmlTag.SMALL;
682
+                            }
683
+                            break;
684
+                        case 't':
685
+                            if (equalTag(1, "able")) {
686
+                                return HtmlTag.TABLE;
687
+                            } else if (equalTag(1, "body")) {
688
+                                return HtmlTag.TBODY;
689
+                            } else if (equalTag(1, "head")) {
690
+                                return HtmlTag.THEAD;
691
+                            } else if (equalTag(1, "foot")) {
692
+                                return HtmlTag.TFOOT;
693
+                            }
694
+                            break;
695
+                        default:
696
+                            return HtmlTag.UNKNOWN;
697
+                    }
698
+                }
699
+                break;
700
+            case 6:
701
+                if (equalTag(0, "str")) {
702
+                    if (buf[3] == 'o' && buf[4] == 'n' && buf[5] == 'g') {
703
+                        return HtmlTag.STRONG;
704
+                    } else if (buf[3] == 'i' && buf[4] == 'k' && buf[5] == 'e') {
705
+                        return HtmlTag.STRIKE;
706
+                    }
707
+                } else if (buf[4] == 'e' && buf[5] == 'f') {
708
+                    if (buf[0] == 'h' && buf[1] == 'e' && buf[2] == 'a' && buf[3] == 'd') {
709
+                        return HtmlTag.HEADER;
710
+                    } else if (buf[0] == 'f' && buf[1] == 'o' && buf[2] == 'o' && buf[3] == 't') {
711
+                        return HtmlTag.FOOTER;
712
+                    }
713
+                }
714
+                break;
715
+            case 7:
716
+                if (equalTag(0, "caption")) {
717
+                    return HtmlTag.CAPTION;
718
+                }
719
+                break;
720
+            case 10:
721
+                if (equalTag(0, "blockquote")) {
722
+                    return HtmlTag.BLOCKQUOTE;
723
+                }
724
+                break;
725
+            default:
726
+                return HtmlTag.UNKNOWN;
727
+        }
728
+
729
+        return HtmlTag.UNKNOWN;
730
+    }
731
+
732
+    //压栈node到stack 更新节点属性
733
+    private void pushNode(HtmlNode node) {
734
+        //单标签不压栈,且属性也不继承
735
+        if (node.type == HtmlTag.IMG
736
+                || node.type == HtmlTag.BR
737
+                || node.type == HtmlTag.HR) {
738
+            return;
739
+        }
740
+
741
+        HtmlNode.HtmlAttr parentAttr;
742
+        if (!stack.isEmpty() && (parentAttr = stack.peek().attr) != null) {
743
+            if (node.attr == null) {
744
+                node.attr = parentAttr;
745
+            } else {
746
+                //字体颜色继承
747
+                if (node.attr.color == AttrParser.COLOR_NONE) {
748
+                    node.attr.color = parentAttr.color;
749
+                }
750
+
751
+                // textDecoration 是否需要集成?
752
+                if (node.attr.textDecoration == HtmlNode.DEC_NONE) {
753
+                    node.attr.textDecoration = parentAttr.textDecoration;
754
+                }
755
+            }
756
+        }
757
+
758
+        //压栈
759
+        stack.push(node);
760
+    }
761
+
762
+    private void popNode(int type, String name) {
763
+        //这些节点不在栈
764
+        if (type == HtmlTag.IMG
765
+                || type == HtmlTag.BR
766
+                || type == HtmlTag.HR) {
767
+            return;
768
+        }
769
+
770
+        HtmlNode n;
771
+        if (!stack.isEmpty() && (n = stack.peek()) != null) {
772
+            //栈顶元素相同出栈
773
+            if (n.type == type && Objects.equals(n.name, name)) {
774
+                stack.pop();
775
+            } else {//不相同 是出还是不出???
776
+                int i = stack.size() - 1;
777
+                for (; i > 0; i--) {
778
+                    if (stack.get(i).type == type && Objects.equals(stack.get(i).name, name)) {
779
+                        break;
780
+                    }
781
+                }
782
+
783
+                //栈里有 一直出栈
784
+                if (i > 0) {
785
+                    int j = stack.size() - 1;
786
+                    while (j != i - 1) {
787
+                        stack.pop();
788
+                        j--;
789
+                    }
790
+                }
791
+            }
792
+        }
793
+    }
794
+}

+ 76
- 0
app/src/main/java/me/yluo/htmlview/HtmlTag.java View File

@@ -0,0 +1,76 @@
1
+package me.yluo.htmlview;
2
+
3
+
4
+public class HtmlTag {
5
+
6
+    public static final int UNKNOWN = -1;
7
+
8
+    /**
9
+     * 内联标签
10
+     */
11
+    public static final int FONT = 1;//不赞同字体color face size
12
+    public static final int TT = 2;//等宽的文本效果
13
+    public static final int I = 3;//斜体
14
+    public static final int CITE = 4;//引用斜体
15
+    public static final int DFN = 5;//定义斜体
16
+    public static final int U = 6;//下划线
17
+    public static final int BIG = 7;
18
+    public static final int SMALL = 8;
19
+    public static final int EM = 9;//强调的内容斜体
20
+    public static final int STRONG = 10;//语气更强的强调
21
+    public static final int B = 11;//加粗
22
+    public static final int KBD = 12;//定义键盘文本
23
+    public static final int MARK = 13;//突出显示部分文本
24
+    public static final int A = 14; //href
25
+    //img 标签比较特殊 当为
26
+    public static final int IMG = 15; //src
27
+    public static final int BR = 16;
28
+    public static final int SUB = 17;
29
+    public static final int SUP = 18;
30
+    public static final int INS = 19;//下划线
31
+    public static final int DEL = 20;//删除线
32
+    public static final int S = 21;//不赞同删除线
33
+    public static final int STRIKE = 22;//不赞同删除线DEL替代
34
+    public static final int SPAN = 23;
35
+    public static final int Q = 24;//引用
36
+    public static final int CODE = 25;//代码
37
+
38
+    /**
39
+     * 块标签
40
+     */
41
+    public static final int HEADER = 50;
42
+    public static final int FOOTER = 51;
43
+    public static final int DIV = 53;
44
+
45
+    public static final int P = 54;
46
+    public static final int UL = 55;
47
+    public static final int OL = 56;
48
+    public static final int LI = 57;
49
+
50
+    public static final int H1 = 61;
51
+    public static final int H2 = 62;
52
+    public static final int H3 = 63;
53
+    public static final int H4 = 64;
54
+    public static final int H5 = 65;
55
+    public static final int H6 = 66;
56
+
57
+    public static final int PRE = 70;
58
+    public static final int BLOCKQUOTE = 71;
59
+    public static final int HR = 72;
60
+
61
+    public static final int TABLE = 81;
62
+    public static final int CAPTION = 82;
63
+    public static final int THEAD = 83;
64
+    public static final int TFOOT = 84;
65
+    public static final int TBODY = 85;
66
+    public static final int TR = 86;
67
+    public static final int TH = 87;
68
+    public static final int TD = 88;
69
+
70
+    public static final int VEDIO = 91; //src
71
+    public static final int AUDIO = 92; //src
72
+
73
+    public static boolean isBolckTag(int i) {
74
+        return i >= 50;
75
+    }
76
+}

+ 0
- 0
app/src/main/java/me/yluo/htmlview/HtmlView.java View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save