csx 2 gadus atpakaļ
vecāks
revīzija
6b19d64119
100 mainītis faili ar 2744 papildinājumiem un 0 dzēšanām
  1. 10 0
      .gitignore
  2. 29 0
      .idea/codeStyles/Project.xml
  3. 1 0
      app/.gitignore
  4. 37 0
      app/build.gradle
  5. Binārs
      app/kuyiyun.jks
  6. Binārs
      app/libs/tbs_sdk_thirdapp_v4.3.0.326_44226_sharewithdownloadwithfile_withoutGame_obfs_20220825_155943.jar
  7. Binārs
      app/lindialy
  8. Binārs
      app/mobile_kuyiyun.jks
  9. 25 0
      app/proguard-rules.pro
  10. Binārs
      app/release/app-release.apk
  11. 1 0
      app/release/output.json
  12. 26 0
      app/src/androidTest/java/com/jkhd/testmobile/kuyicloud/ExampleInstrumentedTest.java
  13. 59 0
      app/src/main/AndroidManifest.xml
  14. 129 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/App.java
  15. 286 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/BaseWebViewActivity.java
  16. 50 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/SplashActivity.java
  17. 25 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/SystemWebViewActivity.java
  18. 52 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/sp/AppSharePreference.java
  19. 157 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/ContentUriUtil.java
  20. 40 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/FileUtil.java
  21. 17 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/LogUtil.java
  22. 185 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/PackageUtils.java
  23. 48 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/PermissionUtil.java
  24. 148 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/SizeUtils.java
  25. 20 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/ToastUtil.java
  26. 277 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/WeakHandler.java
  27. 6 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/WebViewJavaScriptFunction.java
  28. 35 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/X5ProcessInitService.java
  29. 55 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/widget/CustomView.java
  30. 139 0
      app/src/main/java/com/linkdialy/mobile/kuyicloud/widget/MaterialProgressBar.java
  31. Binārs
      app/src/main/jniLibs/armeabi/liblbs.so
  32. 13 0
      app/src/main/res/anim/error_frame_in.xml
  33. 9 0
      app/src/main/res/anim/push_bottom_in.xml
  34. 10 0
      app/src/main/res/anim/push_bottom_out.xml
  35. 9 0
      app/src/main/res/anim/push_top_in.xml
  36. 10 0
      app/src/main/res/anim/push_top_out.xml
  37. Binārs
      app/src/main/res/drawable-hdpi/ic_info_circle.png
  38. Binārs
      app/src/main/res/drawable-hdpi/ic_left.png
  39. Binārs
      app/src/main/res/drawable-hdpi/ic_line_x.png
  40. Binārs
      app/src/main/res/drawable-hdpi/ic_refresh_line.png
  41. Binārs
      app/src/main/res/drawable-hdpi/ic_right.png
  42. Binārs
      app/src/main/res/drawable-hdpi/ic_service_list_fill.png
  43. Binārs
      app/src/main/res/drawable-hdpi/ic_turn_off.png
  44. 34 0
      app/src/main/res/drawable-v24/ic_launcher_foreground.xml
  45. Binārs
      app/src/main/res/drawable-xxhdpi/card_bg.9.png
  46. Binārs
      app/src/main/res/drawable-xxhdpi/common_icon_site.png
  47. Binārs
      app/src/main/res/drawable-xxhdpi/empty_pic.jpg
  48. Binārs
      app/src/main/res/drawable-xxhdpi/icon_36kr.png
  49. Binārs
      app/src/main/res/drawable-xxhdpi/icon_github.png
  50. Binārs
      app/src/main/res/drawable-xxhdpi/icon_qq.png
  51. Binārs
      app/src/main/res/drawable-xxhdpi/icon_qqlive.png
  52. Binārs
      app/src/main/res/drawable-xxhdpi/icon_taimeiti.png
  53. Binārs
      app/src/main/res/drawable-xxhdpi/logo.png
  54. 12 0
      app/src/main/res/drawable/btn_background_rectangle_gery.xml
  55. 9 0
      app/src/main/res/drawable/btn_background_shape_while.xml
  56. 10 0
      app/src/main/res/drawable/btn_blue_shape.xml
  57. 6 0
      app/src/main/res/drawable/btn_go.xml
  58. 10 0
      app/src/main/res/drawable/btn_theme_shape.xml
  59. 5 0
      app/src/main/res/drawable/enter.xml
  60. 170 0
      app/src/main/res/drawable/ic_launcher_background.xml
  61. 8 0
      app/src/main/res/drawable/login_click.xml
  62. 5 0
      app/src/main/res/drawable/login_click_foucs.xml
  63. 5 0
      app/src/main/res/drawable/login_click_nomal.xml
  64. 24 0
      app/src/main/res/drawable/progress_bar_webview.xml
  65. 12 0
      app/src/main/res/drawable/round_btn.xml
  66. 16 0
      app/src/main/res/drawable/url_input_frame.xml
  67. 35 0
      app/src/main/res/layout/activity_checkcore.xml
  68. 59 0
      app/src/main/res/layout/activity_file_reader.xml
  69. 9 0
      app/src/main/res/layout/activity_main2.xml
  70. 14 0
      app/src/main/res/layout/activity_navigation.xml
  71. 10 0
      app/src/main/res/layout/activity_preview.xml
  72. 19 0
      app/src/main/res/layout/activity_splash.xml
  73. 59 0
      app/src/main/res/layout/activity_tbs_reader_view.xml
  74. 30 0
      app/src/main/res/layout/activity_webview.xml
  75. 29 0
      app/src/main/res/layout/center_progress_dialog_layout.xml
  76. 24 0
      app/src/main/res/layout/item_shortcut.xml
  77. 8 0
      app/src/main/res/layout/nav_list_item.xml
  78. 10 0
      app/src/main/res/layout/nav_section_header.xml
  79. 26 0
      app/src/main/res/layout/progress_dialog_layout.xml
  80. 105 0
      app/src/main/res/layout/update_dialog.xml
  81. 39 0
      app/src/main/res/layout/web_activity.xml
  82. 24 0
      app/src/main/res/menu/website_menu.xml
  83. 5 0
      app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  84. 5 0
      app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  85. Binārs
      app/src/main/res/mipmap-hdpi/ic_launcher.png
  86. Binārs
      app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  87. Binārs
      app/src/main/res/mipmap-hdpi/icon.png
  88. Binārs
      app/src/main/res/mipmap-hdpi/x5_logo.png
  89. Binārs
      app/src/main/res/mipmap-mdpi/ic_launcher.png
  90. Binārs
      app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  91. Binārs
      app/src/main/res/mipmap-mdpi/icon.png
  92. Binārs
      app/src/main/res/mipmap-xhdpi/ic_launcher.png
  93. Binārs
      app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  94. Binārs
      app/src/main/res/mipmap-xhdpi/icon.png
  95. Binārs
      app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  96. Binārs
      app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  97. Binārs
      app/src/main/res/mipmap-xxhdpi/icon.png
  98. Binārs
      app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  99. Binārs
      app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  100. 0 0
      app/src/main/res/mipmap-xxxhdpi/icon.png

+ 10 - 0
.gitignore Parādīt failu

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

+ 29 - 0
.idea/codeStyles/Project.xml Parādīt failu

@@ -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>

+ 1 - 0
app/.gitignore Parādīt failu

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

+ 37 - 0
app/build.gradle Parādīt failu

@@ -0,0 +1,37 @@
1
+apply plugin: 'com.android.application'
2
+
3
+android {
4
+    compileSdkVersion 26
5
+    buildToolsVersion '26.0.2'
6
+    defaultConfig {
7
+        applicationId "com.linkdialy.mobile.kuyicloud"
8
+        minSdkVersion 15
9
+        targetSdkVersion 26
10
+        versionCode 50
11
+        versionName "1.1.0"
12
+        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13
+        ndk{abiFilters "armeabi"}
14
+    }
15
+    buildTypes {
16
+        release {
17
+            minifyEnabled false
18
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19
+        }
20
+    }
21
+    compileOptions {
22
+        sourceCompatibility = '1.8'
23
+        targetCompatibility = '1.8'
24
+    }
25
+}
26
+
27
+dependencies {
28
+    compile fileTree(include: ['*.jar'], dir: 'libs')
29
+    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
30
+        exclude group: 'com.android.support', module: 'support-annotations'
31
+    })
32
+    compile files('libs/tbs_sdk_thirdapp_v4.3.0.326_44226_sharewithdownloadwithfile_withoutGame_obfs_20220825_155943')
33
+    compile 'com.azhon:appupdate:1.5.6'
34
+    compile 'com.squareup.okhttp3:okhttp:3.11.0'
35
+    testCompile 'junit:junit:4.12'
36
+    compile 'com.android.support:appcompat-v7:26.0.0'
37
+}

Binārs
app/kuyiyun.jks Parādīt failu


Binārs
app/libs/tbs_sdk_thirdapp_v4.3.0.326_44226_sharewithdownloadwithfile_withoutGame_obfs_20220825_155943.jar Parādīt failu


Binārs
app/lindialy Parādīt failu


Binārs
app/mobile_kuyiyun.jks Parādīt failu


+ 25 - 0
app/proguard-rules.pro Parādīt failu

@@ -0,0 +1,25 @@
1
+# Add project specific ProGuard rules here.
2
+# By default, the flags in this file are appended to flags specified
3
+# in /Users/csx/Library/Android/sdk/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
+#}
18
+
19
+# Uncomment this to preserve the line number information for
20
+# debugging stack traces.
21
+#-keepattributes SourceFile,LineNumberTable
22
+
23
+# If you keep the line number information, uncomment this to
24
+# hide the original source file name.
25
+#-renamesourcefileattribute SourceFile

Binārs
app/release/app-release.apk Parādīt failu


+ 1 - 0
app/release/output.json Parādīt failu

@@ -0,0 +1 @@
1
+[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":50},"path":"app-release.apk","properties":{"packageId":"com.linkdialy.mobile.kuyicloud","split":"","minSdkVersion":"15"}}]

+ 26 - 0
app/src/androidTest/java/com/jkhd/testmobile/kuyicloud/ExampleInstrumentedTest.java Parādīt failu

@@ -0,0 +1,26 @@
1
+package com.jkhd.testmobile.kuyicloud;
2
+
3
+import android.content.Context;
4
+import android.support.test.InstrumentationRegistry;
5
+import android.support.test.runner.AndroidJUnit4;
6
+
7
+import org.junit.Test;
8
+import org.junit.runner.RunWith;
9
+
10
+import static org.junit.Assert.*;
11
+
12
+/**
13
+ * Instrumentation test, which will execute on an Android device.
14
+ *
15
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16
+ */
17
+@RunWith(AndroidJUnit4.class)
18
+public class ExampleInstrumentedTest {
19
+    @Test
20
+    public void useAppContext() throws Exception {
21
+        // Context of the app under test.
22
+        Context appContext = InstrumentationRegistry.getTargetContext();
23
+
24
+        assertEquals("com.jkhd.kuyiyun.kuyicloud", appContext.getPackageName());
25
+    }
26
+}

+ 59 - 0
app/src/main/AndroidManifest.xml Parādīt failu

@@ -0,0 +1,59 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+    package="com.linkdialy.mobile.kuyicloud">
4
+
5
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
6
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
7
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
8
+    <uses-permission android:name="android.permission.INTERNET" />
9
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
10
+
11
+    <uses-feature android:name="android.hardware.camera" />
12
+    <!--相机权限-->
13
+    <uses-permission android:name="android.permission.CAMERA" />
14
+    <!--写入SD卡的权限:如果你希望保存相机拍照后的照片-->
15
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
16
+    <!--读取SD卡的权限:打开相册选取图片所必须的权限-->
17
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
18
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 精确定位权限,允许一个程序访问精确位置(GPS定位) -->
19
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
20
+
21
+
22
+    <application
23
+        android:name="com.linkdialy.mobile.kuyicloud.App"
24
+        android:allowBackup="true"
25
+        android:icon="@mipmap/icon"
26
+        android:persistent="true"
27
+        android:usesCleartextTraffic="true"
28
+        android:label="@string/app_name"
29
+        android:supportsRtl="true"
30
+        android:theme="@style/AppTheme"
31
+        >
32
+        <activity android:name="com.linkdialy.mobile.kuyicloud.SplashActivity"
33
+            android:configChanges="keyboardHidden|orientation|screenSize"
34
+            >
35
+            <intent-filter>
36
+                <action android:name="android.intent.action.MAIN" />
37
+
38
+                <category android:name="android.intent.category.LAUNCHER" />
39
+            </intent-filter>
40
+        </activity>
41
+        <activity android:name="com.linkdialy.mobile.kuyicloud.SystemWebViewActivity"
42
+            android:configChanges="keyboardHidden|orientation|screenSize"
43
+            ></activity>
44
+
45
+        <uses-library
46
+            android:name="org.apache.http.legacy"
47
+            android:required="false" /> <!-- 文件预览需要设置FileProvider,以及xml资源文件 -->
48
+        <provider
49
+            android:name="com.tencent.smtt.utils.FileProvider"
50
+            android:authorities="com.tencent.tbs.demo.provider"
51
+            android:exported="false"
52
+            android:grantUriPermissions="true">
53
+            <meta-data
54
+                android:name="android.support.FILE_PROVIDER_PATHS"
55
+                android:resource="@xml/x5webview_file_paths" />
56
+        </provider>
57
+    </application>
58
+
59
+</manifest>

+ 129 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/App.java Parādīt failu

@@ -0,0 +1,129 @@
1
+package com.linkdialy.mobile.kuyicloud;
2
+
3
+import android.app.Application;
4
+import android.content.Intent;
5
+import android.net.Uri;
6
+import android.util.Log;
7
+
8
+import com.linkdialy.mobile.kuyicloud.utils.X5ProcessInitService;
9
+import com.tencent.smtt.sdk.QbSdk;
10
+import com.tencent.smtt.sdk.TbsListener;
11
+import com.tencent.smtt.sdk.WebView;
12
+
13
+import java.io.File;
14
+
15
+/**
16
+ * Created by csx on 2018/10/29.
17
+ */
18
+
19
+public class App extends Application {
20
+
21
+    private static App instance;
22
+    private String TAG = "BaseApplication";
23
+
24
+    @Override
25
+    public void onCreate() {
26
+        super.onCreate();
27
+
28
+        instance = this;
29
+        initTbs();
30
+    }
31
+
32
+    private void initTbs() {
33
+        //搜集本地tbs内核信息并上报服务器,服务器返回结果决定使用哪个内核。
34
+        /* [new] 独立Web进程演示 */
35
+        if (!startX5WebProcessPreinitService()) {
36
+            return;
37
+        }
38
+
39
+        /* 设置允许移动网络下进行内核下载。默认不下载,会导致部分一直用移动网络的用户无法使用x5内核 */
40
+        QbSdk.setDownloadWithoutWifi(true);
41
+
42
+        QbSdk.setCoreMinVersion(QbSdk.CORE_VER_ENABLE_202112);
43
+        /* SDK内核初始化周期回调,包括 下载、安装、加载 */
44
+
45
+        QbSdk.setTbsListener(new TbsListener() {
46
+
47
+            /**
48
+             * @param stateCode 用户可处理错误码请参考{@link com.tencent.smtt.sdk.TbsCommonCode}
49
+             */
50
+            @Override
51
+            public void onDownloadFinish(int stateCode) {
52
+                Log.i(TAG, "onDownloadFinished: " + stateCode);
53
+            }
54
+
55
+            /**
56
+             * @param stateCode 用户可处理错误码请参考{@link com.tencent.smtt.sdk.TbsCommonCode}
57
+             */
58
+            @Override
59
+            public void onInstallFinish(int stateCode) {
60
+                Log.i(TAG, "onInstallFinished: " + stateCode);
61
+            }
62
+
63
+            /**
64
+             * 首次安装应用,会触发内核下载,此时会有内核下载的进度回调。
65
+             * @param progress 0 - 100
66
+             */
67
+            @Override
68
+            public void onDownloadProgress(int progress) {
69
+                Log.i(TAG, "Core Downloading: " + progress);
70
+            }
71
+        });
72
+
73
+        /* 此过程包括X5内核的下载、预初始化,接入方不需要接管处理x5的初始化流程,希望无感接入 */
74
+        QbSdk.initX5Environment(this, new QbSdk.PreInitCallback() {
75
+            @Override
76
+            public void onCoreInitFinished() {
77
+                // 内核初始化完成,可能为系统内核,也可能为系统内核
78
+            }
79
+
80
+            /**
81
+             * 预初始化结束
82
+             * 由于X5内核体积较大,需要依赖wifi网络下发,所以当内核不存在的时候,默认会回调false,此时将会使用系统内核代替
83
+             * 内核下发请求发起有24小时间隔,卸载重装、调整系统时间24小时后都可重置
84
+             * 调试阶段建议通过 WebView 访问 debugtbs.qq.com -> 安装线上内核 解决
85
+             * @param isX5 是否使用X5内核
86
+             */
87
+            @Override
88
+            public void onViewInitFinished(boolean isX5) {
89
+                Log.i(TAG, "onViewInitFinished: " + isX5);
90
+                // hint: you can use QbSdk.getX5CoreLoadHelp(context) anytime to get help.
91
+            }
92
+        });
93
+    }
94
+
95
+    public static App getInstance() {
96
+        return instance;
97
+    }
98
+
99
+
100
+    public void installApp(String pathString) {
101
+        Intent install = new Intent(Intent.ACTION_VIEW);
102
+        install.setDataAndType(Uri.fromFile(new File(pathString)), "application/vnd.android.package-archive");
103
+        install.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
104
+        startActivity(install);
105
+    }
106
+
107
+    /**
108
+     * 启动X5 独立Web进程的预加载服务。优点:
109
+     * 1、后台启动,用户无感进程切换
110
+     * 2、启动进程服务后,有X5内核时,X5预加载内核
111
+     * 3、Web进程Crash时,不会使得整个应用进程crash掉
112
+     * 4、隔离主进程的内存,降低网页导致的App OOM概率。
113
+     *
114
+     * 缺点:
115
+     * 进程的创建占用手机整体的内存,demo 约为 150 MB
116
+     */
117
+    private boolean startX5WebProcessPreinitService() {
118
+        String currentProcessName = QbSdk.getCurrentProcessName(this);
119
+        // 设置多进程数据目录隔离,不设置的话系统内核多个进程使用WebView会crash,X5下可能ANR
120
+        WebView.setDataDirectorySuffix(QbSdk.getCurrentProcessName(this));
121
+        Log.i(TAG, currentProcessName);
122
+        if (currentProcessName.equals(this.getPackageName())) {
123
+            this.startService(new Intent(this, X5ProcessInitService.class));
124
+            return true;
125
+        }
126
+        return false;
127
+    }
128
+
129
+}

+ 286 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/BaseWebViewActivity.java Parādīt failu

@@ -0,0 +1,286 @@
1
+package com.linkdialy.mobile.kuyicloud;
2
+
3
+
4
+import android.app.Activity;
5
+import android.content.Context;
6
+import android.content.Intent;
7
+import android.content.pm.PackageManager;
8
+import android.graphics.Bitmap;
9
+import android.net.Uri;
10
+import android.os.Build;
11
+import android.os.Bundle;
12
+import android.support.annotation.Nullable;
13
+import android.support.annotation.RequiresApi;
14
+import android.support.v7.app.AppCompatActivity;
15
+import android.util.Log;
16
+import android.view.KeyEvent;
17
+import android.view.ViewGroup;
18
+import android.webkit.JavascriptInterface;
19
+import android.widget.Toast;
20
+
21
+import com.linkdialy.mobile.kuyicloud.utils.WebViewJavaScriptFunction;
22
+import com.tencent.smtt.export.external.interfaces.GeolocationPermissionsCallback;
23
+import com.tencent.smtt.export.external.interfaces.JsPromptResult;
24
+import com.tencent.smtt.export.external.interfaces.JsResult;
25
+import com.tencent.smtt.sdk.ValueCallback;
26
+import com.tencent.smtt.sdk.WebChromeClient;
27
+import com.tencent.smtt.sdk.WebSettings;
28
+import com.tencent.smtt.sdk.WebView;
29
+import com.tencent.smtt.sdk.WebViewClient;
30
+
31
+import static com.linkdialy.mobile.kuyicloud.utils.PermissionUtil.REQUEST_EXTERNAL_STORAGE;
32
+import static com.linkdialy.mobile.kuyicloud.utils.PermissionUtil.REQUEST_GEOLOCATION;
33
+import static com.linkdialy.mobile.kuyicloud.utils.PermissionUtil.verifyLocationPermissions;
34
+
35
+/**
36
+ * Demo 基础 WebViewActivity,所有WebView能力Demo继承该 Activity 开发
37
+ */
38
+public class BaseWebViewActivity extends AppCompatActivity {
39
+    private String TAG = "BaseWebViewActivity";
40
+
41
+    protected WebView mWebView;
42
+    private static final int DISABLE_ALPHA = 120;
43
+    private static final int ENABLE_ALPHA = 255;
44
+    private static final int FILE_CHOOSER_REQUEST = 100;
45
+
46
+    private long mClickBackTime = 0;
47
+
48
+
49
+    private ValueCallback<Uri[]> mFilePathCallback;
50
+
51
+    private GeolocationPermissionsCallback mGeolocationCallback;
52
+    private String locationPermissionUrl;
53
+
54
+
55
+    @Override
56
+    protected void onCreate(Bundle savedInstanceState) {
57
+        super.onCreate(savedInstanceState);
58
+
59
+        setContentView(R.layout.activity_webview);
60
+        initWebView();
61
+    }
62
+
63
+    /**
64
+     * 自定义初始化WebView设置,此处为默认 BaseWebViewActivity 初始化
65
+     * 可通过继承该 Activity Override 该方法做自己的实现
66
+     */
67
+    protected void initWebView() {
68
+
69
+        Context context = this;
70
+        mWebView = new WebView(context);
71
+        ViewGroup mContainer = findViewById(R.id.webViewContainer);
72
+        mContainer.addView(mWebView);
73
+        WebSettings webSetting = mWebView.getSettings();
74
+        webSetting.setJavaScriptEnabled(true);
75
+        webSetting.setAllowFileAccess(true);
76
+        webSetting.setSupportZoom(true);
77
+        webSetting.setDatabaseEnabled(true);
78
+        webSetting.setAllowFileAccess(true);
79
+        webSetting.setDomStorageEnabled(true);
80
+        initWebViewClient();
81
+        initWebChromeClient();
82
+        initJavaScriptInterface();
83
+
84
+        mWebView.loadUrl("http://mobile.kuyicloud.com/");
85
+    }
86
+
87
+
88
+    private void initWebViewClient() {
89
+        mWebView.setWebViewClient(new WebViewClient() {
90
+
91
+            /**
92
+             * 具体接口使用细节请参考文档:
93
+             * https://x5.tencent.com/docs/webview.html
94
+             * 或 Android WebKit 官方:
95
+             * https://developer.android.com/reference/android/webkit/WebChromeClient
96
+             */
97
+
98
+            @Override
99
+            public void onPageStarted(WebView view, String url, Bitmap favicon) {
100
+                Log.i(TAG, "onPageStarted, view:" + view + ", url:" + url);
101
+            }
102
+
103
+            @Override
104
+            public void onPageFinished(WebView view, String url) {
105
+                Log.i(TAG, "onPageFinished, view:" + view + ", url:" + url);
106
+            }
107
+
108
+            @Override
109
+            public void onReceivedError(WebView webView, int errorCode, String description, String failingUrl) {
110
+
111
+            }
112
+
113
+
114
+        });
115
+    }
116
+
117
+    private void initWebChromeClient() {
118
+        final Context context = this;
119
+        final Activity activity = this;
120
+        mWebView.setWebChromeClient(new WebChromeClient() {
121
+            /**
122
+             * 具体接口使用细节请参考文档:
123
+             * https://x5.tencent.com/docs/webview.html
124
+             * 或 Android WebKit 官方:
125
+             * https://developer.android.com/reference/android/webkit/WebChromeClient
126
+             */
127
+
128
+            @Override
129
+            public void onProgressChanged(WebView view, int newProgress) {
130
+                Log.i(TAG, "onProgressChanged, newProgress:" + newProgress + ", view:" + view);
131
+            }
132
+
133
+            @Override
134
+            public boolean onJsAlert(WebView webView, String url, String message, JsResult result) {
135
+
136
+                return true;
137
+            }
138
+
139
+            @Override
140
+            public boolean onJsConfirm(WebView webView, String url, String message, JsResult result) {
141
+
142
+                return true;
143
+            }
144
+
145
+            @Override
146
+            public boolean onJsBeforeUnload(WebView webView, String url, String message, JsResult result) {
147
+
148
+                return true;
149
+            }
150
+
151
+            @Override
152
+            public boolean onJsPrompt(WebView webView, String url, String message, String defaultValue, JsPromptResult result) {
153
+
154
+                return true;
155
+            }
156
+
157
+            /**
158
+             * Return value usage see FILE_CHOOSE_REQUEST in
159
+             * {@link BaseWebViewActivity#onActivityResult(int, int, Intent)}
160
+             */
161
+            @Override
162
+            public boolean onShowFileChooser(WebView webView,
163
+                    ValueCallback<Uri[]> filePathCallback,
164
+                    FileChooserParams fileChooserParams) {
165
+                Log.i(TAG, "openFileChooser: " + fileChooserParams.getMode());
166
+                mFilePathCallback = filePathCallback;
167
+                openFileChooseProcess(fileChooserParams.getMode() == FileChooserParams.MODE_OPEN_MULTIPLE);
168
+                return true;
169
+            }
170
+
171
+            @Override
172
+            public void onGeolocationPermissionsShowPrompt(String origin,
173
+                    GeolocationPermissionsCallback geolocationPermissionsCallback) {
174
+                if (verifyLocationPermissions(activity)) {
175
+                    geolocationPermissionsCallback.invoke(origin, true, false);
176
+                } else {
177
+                    locationPermissionUrl = origin;
178
+                    mGeolocationCallback = geolocationPermissionsCallback;
179
+                }
180
+            }
181
+        });
182
+    }
183
+
184
+    private void initJavaScriptInterface() {
185
+        final Activity context = this;
186
+        mWebView.addJavascriptInterface(new WebViewJavaScriptFunction() {
187
+            @Override
188
+            public void onJsFunctionCalled(String tag) {
189
+
190
+            }
191
+            @JavascriptInterface
192
+            public void openDebugX5() {
193
+                mWebView.loadUrl("http://mobile.kuyicloud.com/");
194
+            }
195
+
196
+
197
+        }, "Android");
198
+    }
199
+
200
+    /* Don't care about the Base UI Logic below ^_^ */
201
+    @Override
202
+    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
203
+        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
204
+        if (requestCode == REQUEST_EXTERNAL_STORAGE) {
205
+            initWebView();
206
+        }
207
+
208
+        if (mGeolocationCallback != null && requestCode == REQUEST_GEOLOCATION) {
209
+            boolean allow = grantResults[0] == PackageManager.PERMISSION_GRANTED;
210
+            mGeolocationCallback.invoke(locationPermissionUrl, allow,false);
211
+            mGeolocationCallback = null;
212
+            locationPermissionUrl = "";
213
+        }
214
+    }
215
+
216
+    @Override
217
+    protected void onDestroy() {
218
+        if (mWebView != null) {
219
+            mWebView.destroy();
220
+        }
221
+        super.onDestroy();
222
+    }
223
+
224
+    @Override
225
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
226
+        if (keyCode == KeyEvent.KEYCODE_BACK) {
227
+            if (mWebView != null && mWebView.canGoBack()) {
228
+                mWebView.goBack();
229
+                return true;
230
+            }
231
+            long currentTime = System.currentTimeMillis();
232
+            // 3秒内连按两次后退按钮,退出应用
233
+            if (currentTime - mClickBackTime < 3000) {
234
+//                android.os.Process.killProcess(android.os.Process.myPid());
235
+                finish();
236
+            } else {
237
+                Toast.makeText(getApplicationContext(), "再按一次返回键退出", Toast.LENGTH_SHORT).show();
238
+                mClickBackTime = currentTime;
239
+            }
240
+
241
+            return true;
242
+        }
243
+
244
+        return super.onKeyDown(keyCode, event);
245
+    }
246
+
247
+    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
248
+    @Override
249
+    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
250
+        super.onActivityResult(requestCode, resultCode, data);
251
+            if (resultCode == RESULT_OK) {
252
+                if (mFilePathCallback != null) {
253
+                    if(data != null && data.getClipData() != null) {
254
+                        //有选择多个文件
255
+                        int count = data.getClipData().getItemCount();
256
+                        Log.i(TAG, "url count :  " + count);
257
+                        Uri[] uris = new Uri[count];
258
+                        int currentItem = 0;
259
+                        while(currentItem < count) {
260
+                            Uri fileUri = data.getClipData().getItemAt(currentItem).getUri();
261
+                            uris[currentItem] = fileUri;
262
+                            currentItem = currentItem + 1;
263
+                        }
264
+                        mFilePathCallback.onReceiveValue(uris);
265
+                    } else {
266
+                        Uri result = data == null ? null : data.getData();
267
+                        Log.e(TAG, "" + result);
268
+                        mFilePathCallback.onReceiveValue(new Uri[]{result});
269
+                    }
270
+                    mFilePathCallback = null;
271
+                }
272
+            }
273
+    }
274
+
275
+    private void openFileChooseProcess(boolean isMulti) {
276
+        Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
277
+        intent.addCategory(Intent.CATEGORY_DEFAULT);
278
+        intent.setType("*/*");
279
+        if (isMulti) {
280
+            Log.e(TAG, "putExtra");
281
+            intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
282
+        }
283
+        startActivityForResult(Intent.createChooser(intent, "FileChooser"), FILE_CHOOSER_REQUEST);
284
+    }
285
+
286
+}

+ 50 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/SplashActivity.java Parādīt failu

@@ -0,0 +1,50 @@
1
+package com.linkdialy.mobile.kuyicloud;
2
+
3
+import android.content.Intent;
4
+import android.content.pm.ActivityInfo;
5
+import android.os.CountDownTimer;
6
+import android.support.v7.app.AppCompatActivity;
7
+import android.os.Bundle;
8
+import android.view.WindowManager;
9
+
10
+
11
+public class SplashActivity extends AppCompatActivity {
12
+    private DownTimer downTimer;
13
+
14
+    @Override
15
+    protected void onCreate(Bundle savedInstanceState) {
16
+        super.onCreate(savedInstanceState);
17
+        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
18
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
19
+        if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
20
+            finish();
21
+            return;
22
+        }
23
+        setContentView(R.layout.activity_splash);
24
+        downTimer = new DownTimer(3 * 1000, 1000);//设置广告时间
25
+        downTimer.start();
26
+    }
27
+
28
+    /**
29
+     * 倒计时
30
+     */
31
+    private class DownTimer extends CountDownTimer {
32
+
33
+        public DownTimer(long millisInFuture, long countDownInterval) {
34
+            super(millisInFuture, countDownInterval);
35
+        }
36
+
37
+        @Override
38
+        public void onTick(long millisUntilFinished) {
39
+        }
40
+
41
+        @Override
42
+        public void onFinish() {
43
+            Intent intent = new Intent(SplashActivity.this, SystemWebViewActivity.class);
44
+            startActivity(intent);
45
+            finish();
46
+            downTimer.cancel();
47
+
48
+        }
49
+    }
50
+}

+ 25 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/SystemWebViewActivity.java Parādīt failu

@@ -0,0 +1,25 @@
1
+package com.linkdialy.mobile.kuyicloud;
2
+
3
+import android.os.Bundle;
4
+import android.widget.Toast;
5
+import com.tencent.smtt.sdk.QbSdk;
6
+
7
+/**
8
+ * <p>SDK中封装的系统WebView</p>
9
+ * 进程强制系统内核接口(进程不可恢复X5) QbSdk.forceSysWebView()
10
+ */
11
+public class SystemWebViewActivity extends BaseWebViewActivity {
12
+
13
+    protected static final String M_TAG = "SystemWebViewActivity";
14
+
15
+    @Override
16
+    protected void onCreate(Bundle savedInstanceState) {
17
+        super.onCreate(savedInstanceState);
18
+    }
19
+
20
+    @Override
21
+    protected void initWebView() {
22
+        QbSdk.forceSysWebView();
23
+        super.initWebView();
24
+    }
25
+}

+ 52 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/sp/AppSharePreference.java Parādīt failu

@@ -0,0 +1,52 @@
1
+package com.linkdialy.mobile.kuyicloud.sp;
2
+
3
+import android.content.Context;
4
+import android.content.SharedPreferences;
5
+
6
+
7
+/**
8
+ * 保存用户信息
9
+ * Created by Administrator on 2015-07-09.
10
+ */
11
+public class AppSharePreference {
12
+
13
+    private SharedPreferences sp;
14
+    private SharedPreferences.Editor editor;
15
+    public String spName = "AppSharePreference";
16
+
17
+
18
+    public AppSharePreference(Context context) {
19
+        sp = context.getSharedPreferences(spName, Context.MODE_PRIVATE);
20
+        editor = sp.edit();
21
+    }
22
+
23
+    /**
24
+     * 保存cookie
25
+     *
26
+     */
27
+    public AppSharePreference putCookie(String cookie) {
28
+        editor.putString("cookie", cookie);
29
+        return this;
30
+    }
31
+
32
+    /**
33
+     * 获取保存的cookie
34
+     *
35
+     */
36
+    public String getCookie() {
37
+        return sp.getString("cookie", "");
38
+    }
39
+
40
+
41
+
42
+    /**
43
+     * 最终提交修改的方法,对保存操作,必须在最后调用此方法
44
+     */
45
+    public void apply() {
46
+        editor.apply();
47
+    }
48
+
49
+
50
+
51
+
52
+}

+ 157 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/ContentUriUtil.java Parādīt failu

@@ -0,0 +1,157 @@
1
+package com.linkdialy.mobile.kuyicloud.utils;
2
+
3
+import android.content.ContentUris;
4
+import android.content.Context;
5
+import android.database.Cursor;
6
+import android.net.Uri;
7
+import android.os.Build;
8
+import android.os.Environment;
9
+import android.provider.DocumentsContract;
10
+import android.provider.MediaStore;
11
+import android.support.annotation.RequiresApi;
12
+
13
+public class ContentUriUtil {
14
+
15
+    /**
16
+     * Get a file path from a Uri. This will get the the path for Storage Access
17
+     * Framework Documents, as well as the _data field for the MediaStore and
18
+     * other file-based ContentProviders.
19
+     *
20
+     * @param context The context.
21
+     * @param uri The Uri to query.
22
+     * @author paulburke
23
+     */
24
+    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
25
+    public static String getPath(final Context context, final Uri uri) {
26
+
27
+        // DocumentProvider
28
+        if (DocumentsContract.isDocumentUri(context, uri)) {
29
+            // ExternalStorageProvider
30
+            if (isExternalStorageDocument(uri)) {
31
+                final String docId = DocumentsContract.getDocumentId(uri);
32
+                final String[] split = docId.split(":");
33
+                final String type = split[0];
34
+
35
+                if ("primary".equalsIgnoreCase(type)) {
36
+                    return Environment.getExternalStorageDirectory() + "/" + split[1];
37
+                }
38
+
39
+                // TODO handle non-primary volumes
40
+            }
41
+            // DownloadsProvider
42
+            else if (isDownloadsDocument(uri)) {
43
+
44
+                final String id = DocumentsContract.getDocumentId(uri);
45
+                final Uri contentUri = ContentUris.withAppendedId(
46
+                        Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
47
+
48
+                return getDataColumn(context, contentUri, null, null);
49
+            }
50
+            // MediaProvider
51
+            else if (isMediaDocument(uri)) {
52
+                final String docId = DocumentsContract.getDocumentId(uri);
53
+                final String[] split = docId.split(":");
54
+                final String type = split[0];
55
+
56
+                Uri contentUri = null;
57
+                if ("image".equals(type)) {
58
+                    contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
59
+                } else if ("video".equals(type)) {
60
+                    contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
61
+                } else if ("audio".equals(type)) {
62
+                    contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
63
+                }
64
+
65
+                final String selection = "_id=?";
66
+                final String[] selectionArgs = new String[] {
67
+                        split[1]
68
+                };
69
+
70
+                return getDataColumn(context, contentUri, selection, selectionArgs);
71
+            }
72
+        }
73
+        // MediaStore (and general)
74
+        else if ("content".equalsIgnoreCase(uri.getScheme())) {
75
+
76
+            // Return the remote address
77
+            if (isGooglePhotosUri(uri))
78
+                return uri.getLastPathSegment();
79
+
80
+            return getDataColumn(context, uri, null, null);
81
+        }
82
+        // File
83
+        else if ("file".equalsIgnoreCase(uri.getScheme())) {
84
+            return uri.getPath();
85
+        }
86
+
87
+        return null;
88
+    }
89
+
90
+    /**
91
+     **
92
+     * Get the value of the data column for this Uri. This is useful for
93
+     * MediaStore Uris, and other file-based ContentProviders.
94
+     *
95
+     * @param context The context.
96
+     * @param uri The Uri to query.
97
+     * @param selection (Optional) Filter used in the query.
98
+     * @param selectionArgs (Optional) Selection arguments used in the query.
99
+     * @return The value of the _data column, which is typically a file path.
100
+     */
101
+    public static String getDataColumn(Context context, Uri uri, String selection,
102
+            String[] selectionArgs) {
103
+
104
+        Cursor cursor = null;
105
+        final String column = "_data";
106
+        final String[] projection = {
107
+                column
108
+        };
109
+
110
+        try {
111
+            cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
112
+                    null);
113
+            if (cursor != null && cursor.moveToFirst()) {
114
+                final int index = cursor.getColumnIndexOrThrow(column);
115
+                return cursor.getString(index);
116
+            }
117
+        } finally {
118
+            if (cursor != null)
119
+                cursor.close();
120
+        }
121
+        return null;
122
+    }
123
+
124
+
125
+    /**
126
+     * @param uri The Uri to check.
127
+     * @return Whether the Uri authority is ExternalStorageProvider.
128
+     */
129
+    public static boolean isExternalStorageDocument(Uri uri) {
130
+        return "com.android.externalstorage.documents".equals(uri.getAuthority());
131
+    }
132
+
133
+    /**
134
+     * @param uri The Uri to check.
135
+     * @return Whether the Uri authority is DownloadsProvider.
136
+     */
137
+    public static boolean isDownloadsDocument(Uri uri) {
138
+        return "com.android.providers.downloads.documents".equals(uri.getAuthority());
139
+    }
140
+
141
+    /**
142
+     * @param uri The Uri to check.
143
+     * @return Whether the Uri authority is MediaProvider.
144
+     */
145
+    public static boolean isMediaDocument(Uri uri) {
146
+        return "com.android.providers.media.documents".equals(uri.getAuthority());
147
+    }
148
+
149
+    /**
150
+     * @param uri The Uri to check.
151
+     * @return Whether the Uri authority is Google Photos.
152
+     */
153
+    public static boolean isGooglePhotosUri(Uri uri) {
154
+        return "com.google.android.apps.photos.content".equals(uri.getAuthority());
155
+    }
156
+
157
+}

+ 40 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/FileUtil.java Parādīt failu

@@ -0,0 +1,40 @@
1
+package com.linkdialy.mobile.kuyicloud.utils;
2
+
3
+import java.io.File;
4
+import java.io.FileOutputStream;
5
+import java.io.IOException;
6
+import java.io.InputStream;
7
+
8
+public class FileUtil {
9
+
10
+    public static void writeBytesToFile(InputStream is, File file) throws IOException {
11
+        if (file.exists()) {
12
+            return;
13
+        }
14
+        FileOutputStream fos = null;
15
+        try {
16
+            byte[] data = new byte[2048];
17
+            int nbread = 0;
18
+            fos = new FileOutputStream(file);
19
+            while ((nbread = is.read(data)) > -1) {
20
+                fos.write(data,0, nbread);
21
+            }
22
+        } catch (Exception ex) {
23
+            ex.printStackTrace();
24
+        } finally{
25
+            if (fos != null) {
26
+                fos.close();
27
+            }
28
+        }
29
+    }
30
+
31
+    public static String getFileType(String filename) {
32
+        if ((filename != null) && (filename.length() > 0)) {
33
+            int dot = filename.lastIndexOf('.');
34
+            if ((dot > -1) && (dot < (filename.length() - 1))) {
35
+                return filename.substring(dot + 1);
36
+            }
37
+        }
38
+        return null;
39
+    }
40
+}

+ 17 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/LogUtil.java Parādīt failu

@@ -0,0 +1,17 @@
1
+package com.linkdialy.mobile.kuyicloud.utils;
2
+
3
+import android.util.Log;
4
+
5
+/**
6
+ * Created by xiongwenwei@aliyun.com
7
+ * CreateTime: 2017/1/12
8
+ * Note:
9
+ */
10
+public class LogUtil {
11
+
12
+    private static String TAG = "打印日志";
13
+
14
+    public static void i(Object object) {
15
+        Log.i(TAG, object + "");
16
+    }
17
+}

+ 185 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/PackageUtils.java Parādīt failu

@@ -0,0 +1,185 @@
1
+package com.linkdialy.mobile.kuyicloud.utils;
2
+
3
+import android.app.ActivityManager;
4
+import android.content.ComponentName;
5
+import android.content.Context;
6
+import android.content.pm.ApplicationInfo;
7
+import android.content.pm.PackageInfo;
8
+import android.content.pm.PackageManager;
9
+import android.graphics.drawable.Drawable;
10
+import android.os.Bundle;
11
+
12
+import java.util.ArrayList;
13
+import java.util.Iterator;
14
+import java.util.List;
15
+
16
+/**
17
+ * <p>need to be tested
18
+ *
19
+ * @author Jason
20
+ */
21
+public class PackageUtils {
22
+
23
+    /**
24
+     * Check if the service is running
25
+     *
26
+     * @param context Context
27
+     * @param cls     The service class
28
+     * @return Will return true if the service is running, false otherwise
29
+     */
30
+    public static boolean isServiceRunning(Context context, Class<?> cls) {
31
+        ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
32
+        List<ActivityManager.RunningServiceInfo> services = activityManager.getRunningServices(Integer.MAX_VALUE);
33
+        for (ActivityManager.RunningServiceInfo serviceInfo : services) {
34
+            ComponentName componentName = serviceInfo.service;
35
+            String serviceName = componentName.getClassName();
36
+            if (serviceName.equals(cls.getName())) {
37
+                return true;
38
+            }
39
+        }
40
+        return false;
41
+    }
42
+
43
+    /**
44
+     * Get the current running activity, deprecated in api 21
45
+     * Should specify GET_TASKS permission
46
+     *
47
+     * @param context Context
48
+     * @return Will return null if getting the current activity failed
49
+     */
50
+    public static String getCurrentActivity(Context context) {
51
+        try {
52
+            ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
53
+            return activityManager.getRunningTasks(1).get(0).topActivity.getClassName();
54
+        } catch (SecurityException e) {
55
+            e.printStackTrace();
56
+        }
57
+        return null;
58
+    }
59
+
60
+    /**
61
+     * Get the app icon drawable with the specify package name
62
+     *
63
+     * @param context     Context
64
+     * @param packageName The package name fo the application
65
+     * @return The drawable of the application
66
+     */
67
+    public static Drawable getAppIcon(Context context, String packageName) {
68
+        final PackageManager packageManager = context.getPackageManager();
69
+        List<PackageInfo> packageInfo = packageManager.getInstalledPackages(0);
70
+        List<String> packageNames = new ArrayList<>();
71
+        if (packageInfo != null) {
72
+            for (int i = 0; i < packageInfo.size(); i++) {
73
+                String packName = packageInfo.get(i).packageName;
74
+                packageNames.add(packName);
75
+                if (packageNames.contains(packageName)) {
76
+                    return packageInfo.get(i).applicationInfo.loadIcon(packageManager);
77
+                }
78
+            }
79
+        }
80
+        return null;
81
+    }
82
+
83
+    /**
84
+     * Check if the specify application was installed or not
85
+     *
86
+     * @param context     Context
87
+     * @param packageName The package name you want to check
88
+     * @return Will return true if the application is installed, false otherwise
89
+     */
90
+    public static boolean isAppInstalled(Context context, String packageName) {
91
+        final PackageManager packageManager = context.getPackageManager();
92
+        List<PackageInfo> packageInfo = packageManager.getInstalledPackages(0);
93
+        List<String> packageNames = new ArrayList<>();
94
+        if (packageInfo != null) {
95
+            for (int i = 0; i < packageInfo.size(); i++) {
96
+                String packName = packageInfo.get(i).packageName;
97
+                packageNames.add(packName);
98
+            }
99
+        }
100
+        return packageNames.contains(packageName);
101
+    }
102
+
103
+    /**
104
+     * Get the version code of the application
105
+     *
106
+     * @param context Context
107
+     * @return Will return the version code if the package name exists
108
+     * will return -1 if the name not found
109
+     */
110
+    public static int getVersionCode(Context context) {
111
+        try {
112
+            PackageManager manager = context.getPackageManager();
113
+            PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0);
114
+            return info.versionCode;
115
+        } catch (PackageManager.NameNotFoundException e) {
116
+            return -1;
117
+        }
118
+    }
119
+
120
+    /**
121
+     * Get the version name of the application
122
+     *
123
+     * @param context Context
124
+     * @return The version name if the package name exists
125
+     * will return null if the name not found
126
+     */
127
+    public static String getVersionName(Context context) {
128
+        try {
129
+            PackageManager manager = context.getPackageManager();
130
+            PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0);
131
+            return info.versionName;
132
+        } catch (PackageManager.NameNotFoundException e) {
133
+            return null;
134
+        }
135
+    }
136
+
137
+    /**
138
+     * Get the package name of the application
139
+     *
140
+     * @param context Context
141
+     * @return The package name if the package name exists
142
+     * will return null if the name not found
143
+     */
144
+    public static String getPackageName(Context context) {
145
+        try {
146
+            PackageManager manager = context.getPackageManager();
147
+            PackageInfo info = manager.getPackageInfo(context.getPackageName(), 0);
148
+            return info.packageName;
149
+        } catch (PackageManager.NameNotFoundException e) {
150
+            return null;
151
+        }
152
+    }
153
+
154
+    public static Bundle getMetaData(Context context) {
155
+        PackageManager manager = context.getPackageManager();
156
+        try {
157
+            ApplicationInfo info = manager.getApplicationInfo(context.getPackageName(), PackageManager.GET_META_DATA);
158
+            return info.metaData;
159
+        } catch (PackageManager.NameNotFoundException e) {
160
+            e.printStackTrace();
161
+        }
162
+        return null;
163
+    }
164
+
165
+    public static String getAppName(Context context, int pID) {
166
+        String processName = null;
167
+        ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
168
+        List l = am.getRunningAppProcesses();
169
+        Iterator i = l.iterator();
170
+        PackageManager pm = context.getPackageManager();
171
+        while (i.hasNext()) {
172
+            ActivityManager.RunningAppProcessInfo info = (ActivityManager.RunningAppProcessInfo) (i.next());
173
+            try {
174
+                if (info.pid == pID) {
175
+                    CharSequence c = pm.getApplicationLabel(pm.getApplicationInfo(info.processName, PackageManager.GET_META_DATA));
176
+                    processName = info.processName;
177
+                    return processName;
178
+                }
179
+            } catch (Exception e) {
180
+                e.printStackTrace();
181
+            }
182
+        }
183
+        return processName;
184
+    }
185
+}

+ 48 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/PermissionUtil.java Parādīt failu

@@ -0,0 +1,48 @@
1
+package com.linkdialy.mobile.kuyicloud.utils;
2
+
3
+import android.Manifest;
4
+import android.Manifest.permission;
5
+import android.app.Activity;
6
+import android.content.pm.PackageManager;
7
+import android.support.v4.app.ActivityCompat;
8
+
9
+public class PermissionUtil {
10
+
11
+    public static final String[] PERMISSIONS_STORAGE = {
12
+            permission.READ_EXTERNAL_STORAGE,
13
+            permission.WRITE_EXTERNAL_STORAGE
14
+    };
15
+
16
+    public static final String[] PERMISSIONS_LOCATION = {
17
+            permission.ACCESS_FINE_LOCATION,
18
+            permission.ACCESS_COARSE_LOCATION
19
+    };
20
+
21
+    public static final int REQUEST_EXTERNAL_STORAGE = 1;
22
+
23
+    public static final int REQUEST_GEOLOCATION = 2;
24
+
25
+    public static boolean verifyStoragePermissions(Activity activity) {
26
+        // Check if we have write permission
27
+        int permission = ActivityCompat.checkSelfPermission(activity,
28
+                Manifest.permission.WRITE_EXTERNAL_STORAGE);
29
+        if (permission != PackageManager.PERMISSION_GRANTED) {
30
+            // We don't have permission so prompt the user
31
+            ActivityCompat.requestPermissions(activity, PERMISSIONS_STORAGE, REQUEST_EXTERNAL_STORAGE);
32
+            return false;
33
+        }
34
+        return true;
35
+    }
36
+
37
+    public static boolean verifyLocationPermissions(Activity activity) {
38
+        // Check if we have write permission
39
+        int permission = ActivityCompat.checkSelfPermission(activity,
40
+                Manifest.permission.ACCESS_FINE_LOCATION);
41
+        if (permission != PackageManager.PERMISSION_GRANTED) {
42
+            // We don't have permission so prompt the user
43
+            ActivityCompat.requestPermissions(activity, PERMISSIONS_LOCATION, REQUEST_GEOLOCATION);
44
+            return false;
45
+        }
46
+        return true;
47
+    }
48
+}

+ 148 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/SizeUtils.java Parādīt failu

@@ -0,0 +1,148 @@
1
+package com.linkdialy.mobile.kuyicloud.utils;
2
+
3
+import android.content.Context;
4
+import android.view.View;
5
+import android.view.ViewTreeObserver;
6
+
7
+public class SizeUtils {
8
+
9
+    /**
10
+     * The absolute height of the display in pixels
11
+     *
12
+     * @param context Context
13
+     * @return px(int)
14
+     */
15
+    public static int getScreenHeight(Context context) {
16
+        return context.getResources().getDisplayMetrics().heightPixels;
17
+    }
18
+
19
+    /**
20
+     * The absolute width of the display in pixels
21
+     *
22
+     * @param context Context
23
+     * @return px(int)
24
+     */
25
+    public static int getScreenWidth(Context context) {
26
+        return context.getResources().getDisplayMetrics().widthPixels;
27
+    }
28
+
29
+    /**
30
+     * Size tool to convert dp to px
31
+     *
32
+     * @param context Context
33
+     * @param dpValue dp unit
34
+     * @return The converted size in pixel
35
+     */
36
+    public static int convertDp2Px(Context context, int dpValue) {
37
+        final float scale = context.getResources().getDisplayMetrics().density;
38
+        return (int) (dpValue * scale + 0.5f);
39
+    }
40
+
41
+    /**
42
+     * Size tool to convert px to dp
43
+     *
44
+     * @param context Context
45
+     * @param pxValue px unit
46
+     * @return The converted size in pixel
47
+     */
48
+    public static int convertPx2Dp(Context context, float pxValue) {
49
+        final float scale = context.getResources().getDisplayMetrics().density;
50
+        return (int) (pxValue / scale + 0.5f);
51
+    }
52
+
53
+    /**
54
+     * Size tool to convert px to dp
55
+     *
56
+     * @param context Context
57
+     * @param spValue px unit
58
+     * @return The converted size in pixel
59
+     */
60
+    public static int convertSp2Px(Context context, float spValue) {
61
+        final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
62
+        return (int) (spValue * fontScale + 0.5f);
63
+    }
64
+
65
+    /**
66
+     * Size tool to convert px to dp
67
+     *
68
+     * @param context Context
69
+     * @param pxValue px unit
70
+     * @return The converted size in pixel
71
+     */
72
+    public static int convertPx2Sp(Context context, float pxValue) {
73
+        final float scale = context.getResources().getDisplayMetrics().scaledDensity;
74
+        return (int) (pxValue / scale + 0.5f);
75
+    }
76
+
77
+    /**
78
+     * Gain the width of the widget
79
+     *
80
+     * @param view The view to be measured
81
+     * @return Get the width of the widget
82
+     */
83
+    public static int getWidgetWidth(View view) {
84
+        int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
85
+        int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
86
+        view.measure(w, h);
87
+        return view.getMeasuredWidth();
88
+    }
89
+
90
+    /**
91
+     * Gain the height of the widget
92
+     *
93
+     * @param view The view to be measured
94
+     * @return Get the Height of the widget
95
+     */
96
+    public static int getWidgetHeight(View view) {
97
+        int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
98
+        int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
99
+        view.measure(w, h);
100
+        return view.getMeasuredHeight();
101
+    }
102
+
103
+    public static int getWidgetHeightWithObv(final View view) {
104
+        int height = 0;
105
+        final ViewTreeObserver viewTreeObserver = view.getViewTreeObserver();
106
+        viewTreeObserver.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
107
+            @Override
108
+            public boolean onPreDraw() {
109
+                viewTreeObserver.removeOnPreDrawListener(this);
110
+//                h = view.getMeasuredHeight();
111
+                return true;
112
+            }
113
+        });
114
+        return height;
115
+    }
116
+
117
+//
118
+//    No2:
119
+//
120
+//    ViewTreeObserver vto = imageView.getViewTreeObserver();
121
+//    vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
122
+//        public boolean onPreDraw() {
123
+//            vto.removeOnPreDrawListener(this);
124
+//            int height = imageView.getMeasuredHeight();
125
+//            int width = imageView.getMeasuredWidth();
126
+//            return true;
127
+//        }
128
+//    });
129
+//
130
+//    这个方法,我们需要注册一个ViewTreeObserver的监听回调,这个监听回调,就是专门监听绘图的,既然是监听绘图,那么我们自然可以获取测量值了,同时,我们在每次监听前remove前一次的监听,避免重复监听。
131
+//
132
+//
133
+//
134
+//    No3:
135
+//
136
+//    ViewTreeObserver vto = imageView.getViewTreeObserver();
137
+//    vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
138
+//        @Override
139
+//        public void onGlobalLayout() {
140
+//            imageView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
141
+//            imageView.getHeight();
142
+//            imageView.getWidth();
143
+//        }
144
+//    });
145
+//
146
+//    这个方法于第2个方法基本相同,但他是全局的布局改变监听器,所以是最推荐使用的。
147
+
148
+}

+ 20 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/ToastUtil.java Parādīt failu

@@ -0,0 +1,20 @@
1
+package com.linkdialy.mobile.kuyicloud.utils;
2
+
3
+import android.view.Gravity;
4
+import android.widget.Toast;
5
+
6
+import com.linkdialy.mobile.kuyicloud.App;
7
+
8
+
9
+/**
10
+ * Created by llbt on 2016/4/25.
11
+ */
12
+public class ToastUtil {
13
+
14
+    public static void show(Object object) {
15
+        Toast toast = Toast.makeText(App.getInstance(), object + "", Toast.LENGTH_SHORT);
16
+        toast.setGravity(Gravity.CENTER, 0, 0);
17
+        toast.show();
18
+    }
19
+
20
+}

+ 277 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/WeakHandler.java Parādīt failu

@@ -0,0 +1,277 @@
1
+package com.linkdialy.mobile.kuyicloud.utils;
2
+
3
+import android.os.Handler;
4
+import android.os.Looper;
5
+import android.os.Message;
6
+import android.support.annotation.NonNull;
7
+import android.support.annotation.Nullable;
8
+
9
+import java.lang.ref.WeakReference;
10
+
11
+/**
12
+ * time: 15/7/1
13
+ * description: 对原生handler进行封装
14
+ *
15
+ * @author sunjianfei
16
+ */
17
+public class WeakHandler {
18
+    private final Handler.Callback mCallback;
19
+    private final ExecHandler mExec;
20
+    private final ChainedRef mRunnables = new ChainedRef((Runnable) null);
21
+
22
+    public WeakHandler() {
23
+        this.mCallback = null;
24
+        this.mExec = new ExecHandler();
25
+    }
26
+
27
+    public WeakHandler(@Nullable Handler.Callback callback) {
28
+        this.mCallback = callback;
29
+        this.mExec = new ExecHandler(new WeakReference(callback));
30
+    }
31
+
32
+    public WeakHandler(@NonNull Looper looper) {
33
+        this.mCallback = null;
34
+        this.mExec = new ExecHandler(looper);
35
+    }
36
+
37
+    public WeakHandler(@NonNull Looper looper, @NonNull Handler.Callback callback) {
38
+        this.mCallback = callback;
39
+        this.mExec = new ExecHandler(looper, new WeakReference(callback));
40
+    }
41
+
42
+    public final boolean post(@NonNull Runnable r) {
43
+        return this.mExec.post(this.wrapRunnable(r));
44
+    }
45
+
46
+    public final boolean postAtTime(@NonNull Runnable r, long uptimeMillis) {
47
+        return this.mExec.postAtTime(this.wrapRunnable(r), uptimeMillis);
48
+    }
49
+
50
+    public final boolean postAtTime(Runnable r, Object token, long uptimeMillis) {
51
+        return this.mExec.postAtTime(this.wrapRunnable(r), token, uptimeMillis);
52
+    }
53
+
54
+    public final boolean postDelayed(Runnable r, long delayMillis) {
55
+        return this.mExec.postDelayed(this.wrapRunnable(r), delayMillis);
56
+    }
57
+
58
+    public final boolean postAtFrontOfQueue(Runnable r) {
59
+        return this.mExec.postAtFrontOfQueue(this.wrapRunnable(r));
60
+    }
61
+
62
+    public final void removeCallbacks(Runnable r) {
63
+        ChainedRef runnableRef = this.mRunnables.findForward(r);
64
+        if (runnableRef != null) {
65
+            this.mExec.removeCallbacks(runnableRef.wrapper);
66
+        }
67
+
68
+    }
69
+
70
+    public final void removeCallbacks(Runnable r, Object token) {
71
+        ChainedRef runnableRef = this.mRunnables.findForward(r);
72
+        if (runnableRef != null) {
73
+            this.mExec.removeCallbacks(runnableRef.wrapper, token);
74
+        }
75
+
76
+    }
77
+
78
+    public final boolean sendMessage(Message msg) {
79
+        return this.mExec.sendMessage(msg);
80
+    }
81
+
82
+    public final boolean sendEmptyMessage(int what) {
83
+        return this.mExec.sendEmptyMessage(what);
84
+    }
85
+
86
+    public final boolean sendEmptyMessageDelayed(int what, long delayMillis) {
87
+        return this.mExec.sendEmptyMessageDelayed(what, delayMillis);
88
+    }
89
+
90
+    public final boolean sendEmptyMessageAtTime(int what, long uptimeMillis) {
91
+        return this.mExec.sendEmptyMessageAtTime(what, uptimeMillis);
92
+    }
93
+
94
+    public final boolean sendMessageDelayed(Message msg, long delayMillis) {
95
+        return this.mExec.sendMessageDelayed(msg, delayMillis);
96
+    }
97
+
98
+    public boolean sendMessageAtTime(Message msg, long uptimeMillis) {
99
+        return this.mExec.sendMessageAtTime(msg, uptimeMillis);
100
+    }
101
+
102
+    public final boolean sendMessageAtFrontOfQueue(Message msg) {
103
+        return this.mExec.sendMessageAtFrontOfQueue(msg);
104
+    }
105
+
106
+    public final void removeMessages(int what) {
107
+        this.mExec.removeMessages(what);
108
+    }
109
+
110
+    public final void removeMessages(int what, Object object) {
111
+        this.mExec.removeMessages(what, object);
112
+    }
113
+
114
+    public final void removeCallbacksAndMessages(Object token) {
115
+        this.mExec.removeCallbacksAndMessages(token);
116
+    }
117
+
118
+    public final boolean hasMessages(int what) {
119
+        return this.mExec.hasMessages(what);
120
+    }
121
+
122
+    public final boolean hasMessages(int what, Object object) {
123
+        return this.mExec.hasMessages(what, object);
124
+    }
125
+
126
+    public final Looper getLooper() {
127
+        return this.mExec.getLooper();
128
+    }
129
+
130
+    private WeakRunnable wrapRunnable(Runnable r) {
131
+        ChainedRef hardRef = ChainedRef.obtain(r);
132
+        this.mRunnables.insertAbove(hardRef);
133
+        return hardRef.wrapper = new WeakRunnable(new WeakReference(r), new WeakReference(hardRef));
134
+    }
135
+
136
+    static class ChainedRef {
137
+        @Nullable
138
+        ChainedRef next;
139
+        @Nullable
140
+        ChainedRef prev;
141
+        @Nullable
142
+        Runnable runnable;
143
+        @Nullable
144
+        WeakRunnable wrapper;
145
+        @Nullable
146
+        static ChainedRef sPool;
147
+        static int sPoolSize;
148
+        static final int MAX_POOL_SIZE = 15;
149
+
150
+        public ChainedRef(Runnable r) {
151
+            this.runnable = r;
152
+        }
153
+
154
+        public void remove() {
155
+            if (this.prev != null) {
156
+                this.prev.next = this.next;
157
+            }
158
+
159
+            if (this.next != null) {
160
+                this.next.prev = this.prev;
161
+            }
162
+
163
+            this.prev = null;
164
+            this.runnable = null;
165
+            this.wrapper = null;
166
+            Class var1 = ChainedRef.class;
167
+            synchronized (ChainedRef.class) {
168
+                if (sPoolSize <= 15) {
169
+                    this.next = sPool;
170
+                    sPool = this;
171
+                    ++sPoolSize;
172
+                }
173
+            }
174
+        }
175
+
176
+        public void insertAbove(@NonNull ChainedRef candidate) {
177
+            if (this.next != null) {
178
+                this.next.prev = candidate;
179
+            }
180
+
181
+            candidate.next = this.next;
182
+            this.next = candidate;
183
+            candidate.prev = this;
184
+        }
185
+
186
+        @Nullable
187
+        public ChainedRef findForward(Runnable obj) {
188
+            for (ChainedRef curr = this; curr != null; curr = curr.next) {
189
+                if (curr.runnable != null) {
190
+                    if (curr.runnable.equals(obj)) {
191
+                        return curr;
192
+                    }
193
+                } else if (obj == null) {
194
+                    return curr;
195
+                }
196
+            }
197
+
198
+            return null;
199
+        }
200
+
201
+        public static ChainedRef obtain(Runnable r) {
202
+            ChainedRef result = null;
203
+            Class var2 = ChainedRef.class;
204
+            synchronized (ChainedRef.class) {
205
+                if (sPool != null) {
206
+                    result = sPool;
207
+                    sPool = sPool.next;
208
+                    --sPoolSize;
209
+                }
210
+            }
211
+
212
+            if (result != null) {
213
+                result.runnable = r;
214
+                return result;
215
+            } else {
216
+                return new ChainedRef(r);
217
+            }
218
+        }
219
+    }
220
+
221
+    static class WeakRunnable implements Runnable {
222
+        private final WeakReference<Runnable> mDelegate;
223
+        private final WeakReference<ChainedRef> mReference;
224
+
225
+        WeakRunnable(WeakReference<Runnable> delegate, WeakReference<ChainedRef> reference) {
226
+            this.mDelegate = delegate;
227
+            this.mReference = reference;
228
+        }
229
+
230
+        public void run() {
231
+            Runnable delegate = (Runnable) this.mDelegate.get();
232
+            ChainedRef reference = (ChainedRef) this.mReference.get();
233
+            if (reference != null) {
234
+                reference.remove();
235
+            }
236
+
237
+            if (delegate != null) {
238
+                delegate.run();
239
+            }
240
+
241
+        }
242
+    }
243
+
244
+
245
+
246
+    private static class ExecHandler extends Handler {
247
+        private final WeakReference<Callback> mCallback;
248
+
249
+        ExecHandler() {
250
+            this.mCallback = null;
251
+        }
252
+
253
+        ExecHandler(WeakReference<Callback> callback) {
254
+            this.mCallback = callback;
255
+        }
256
+
257
+        ExecHandler(Looper looper) {
258
+            super(looper);
259
+            this.mCallback = null;
260
+        }
261
+
262
+        ExecHandler(Looper looper, WeakReference<Callback> callback) {
263
+            super(looper);
264
+            this.mCallback = callback;
265
+        }
266
+
267
+        public void handleMessage(Message msg) {
268
+            if (this.mCallback != null) {
269
+                Callback callback = (Callback) this.mCallback.get();
270
+                if (callback != null) {
271
+                    callback.handleMessage(msg);
272
+                }
273
+            }
274
+        }
275
+    }
276
+}
277
+

+ 6 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/WebViewJavaScriptFunction.java Parādīt failu

@@ -0,0 +1,6 @@
1
+package com.linkdialy.mobile.kuyicloud.utils;
2
+
3
+public interface WebViewJavaScriptFunction {
4
+
5
+	void onJsFunctionCalled(String tag);
6
+}

+ 35 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/utils/X5ProcessInitService.java Parādīt failu

@@ -0,0 +1,35 @@
1
+package com.linkdialy.mobile.kuyicloud.utils;
2
+
3
+import android.app.Service;
4
+import android.content.Intent;
5
+import android.os.IBinder;
6
+import android.util.Log;
7
+import com.tencent.smtt.sdk.QbSdk;
8
+import com.tencent.smtt.sdk.QbSdk.PreInitCallback;
9
+
10
+public class X5ProcessInitService extends Service {
11
+
12
+    private static final String TAG = "X5ProcessInitService";
13
+
14
+    @Override
15
+    public void onCreate() {
16
+        /* 只进行本地内核的预加载、不做版本检测及内核下载 */
17
+        QbSdk.preInit(this.getApplicationContext(), new PreInitCallback() {
18
+            @Override
19
+            public void onCoreInitFinished() {
20
+
21
+            }
22
+
23
+            @Override
24
+            public void onViewInitFinished(boolean b) {
25
+                Log.i(TAG, "init web process x5: " + b);
26
+            }
27
+        });
28
+    }
29
+
30
+    @Override
31
+    public IBinder onBind(Intent intent) {
32
+        Log.i(TAG, "Service OnBind");
33
+        return null;
34
+    }
35
+}

+ 55 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/widget/CustomView.java Parādīt failu

@@ -0,0 +1,55 @@
1
+package com.linkdialy.mobile.kuyicloud.widget;
2
+
3
+import android.content.Context;
4
+import android.graphics.Canvas;
5
+import android.graphics.Color;
6
+import android.util.AttributeSet;
7
+import android.widget.RelativeLayout;
8
+
9
+public class CustomView extends RelativeLayout {
10
+
11
+
12
+    final static String MATERIALDESIGNXML = "http://schemas.android.com/apk/res-auto";
13
+    final static String ANDROIDXML = "http://schemas.android.com/apk/res/android";
14
+
15
+    final int disabledBackgroundColor = Color.parseColor("#E2E2E2");
16
+    int beforeBackground;
17
+
18
+    // Indicate if user touched this view the last time
19
+    public boolean isLastTouch = false;
20
+
21
+    public CustomView(Context context, AttributeSet attrs) {
22
+        super(context, attrs);
23
+    }
24
+
25
+    @Override
26
+    public void setEnabled(boolean enabled) {
27
+        super.setEnabled(enabled);
28
+        if (enabled)
29
+            setBackgroundColor(beforeBackground);
30
+        else
31
+            setBackgroundColor(disabledBackgroundColor);
32
+        invalidate();
33
+    }
34
+
35
+    boolean animation = false;
36
+
37
+    @Override
38
+    protected void onAnimationStart() {
39
+        super.onAnimationStart();
40
+        animation = true;
41
+    }
42
+
43
+    @Override
44
+    protected void onAnimationEnd() {
45
+        super.onAnimationEnd();
46
+        animation = false;
47
+    }
48
+
49
+    @Override
50
+    protected void onDraw(Canvas canvas) {
51
+        super.onDraw(canvas);
52
+        if (animation)
53
+            invalidate();
54
+    }
55
+}

+ 139 - 0
app/src/main/java/com/linkdialy/mobile/kuyicloud/widget/MaterialProgressBar.java Parādīt failu

@@ -0,0 +1,139 @@
1
+package com.linkdialy.mobile.kuyicloud.widget;
2
+
3
+import android.content.Context;
4
+import android.graphics.Bitmap;
5
+import android.graphics.Canvas;
6
+import android.graphics.Color;
7
+import android.graphics.Paint;
8
+import android.graphics.PorterDuff;
9
+import android.graphics.PorterDuffXfermode;
10
+import android.graphics.RectF;
11
+import android.util.AttributeSet;
12
+
13
+import com.linkdialy.mobile.kuyicloud.utils.SizeUtils;
14
+
15
+
16
+public class MaterialProgressBar extends CustomView {
17
+
18
+    final static String ANDROIDXML = "http://schemas.android.com/apk/res/android";
19
+    int backgroundColor = Color.parseColor("#1E88E5");
20
+    private Context mContext;
21
+
22
+    public MaterialProgressBar(Context context, AttributeSet attrs) {
23
+        super(context, attrs);
24
+        mContext = context;
25
+        setAttributes(attrs);
26
+    }
27
+
28
+    protected void setAttributes(AttributeSet attrs) {
29
+        setMinimumHeight(SizeUtils.convertDp2Px(mContext, 32));
30
+        setMinimumWidth(SizeUtils.convertDp2Px(mContext, 32));
31
+        int bacgroundColor = attrs.getAttributeResourceValue(ANDROIDXML, "background", -1);
32
+        if (bacgroundColor != -1) {
33
+            setBackgroundColor(getResources().getColor(bacgroundColor));
34
+        } else {
35
+            int background = attrs.getAttributeIntValue(ANDROIDXML, "background", -1);
36
+            if (background != -1)
37
+                setBackgroundColor(background);
38
+            else
39
+                setBackgroundColor(Color.parseColor("#1E88E5"));
40
+        }
41
+        setMinimumHeight(SizeUtils.convertDp2Px(mContext, 3));
42
+    }
43
+
44
+    protected int makePressColor() {
45
+        int r = (this.backgroundColor >> 16) & 0xFF;
46
+        int g = (this.backgroundColor >> 8) & 0xFF;
47
+        int b = (this.backgroundColor >> 0) & 0xFF;
48
+        return Color.argb(128, r, g, b);
49
+    }
50
+
51
+
52
+    @Override
53
+    protected void onDraw(Canvas canvas) {
54
+        super.onDraw(canvas);
55
+        if (firstAnimationOver == false)
56
+            drawFirstAnimation(canvas);
57
+        if (cont > 0)
58
+            drawSecondAnimation(canvas);
59
+        invalidate();
60
+
61
+    }
62
+
63
+    float radius1 = 0;
64
+    float radius2 = 0;
65
+    int cont = 0;
66
+    boolean firstAnimationOver = false;
67
+
68
+    private void drawFirstAnimation(Canvas canvas) {
69
+        if (radius1 < getWidth() / 2) {
70
+            Paint paint = new Paint();
71
+            paint.setAntiAlias(true);
72
+            paint.setColor(makePressColor());
73
+            radius1 = (radius1 >= getWidth() / 2) ? (float) getWidth() / 2 : radius1 + 1;
74
+            canvas.drawCircle(getWidth() / 2, getHeight() / 2, radius1, paint);
75
+        } else {
76
+            Bitmap bitmap = Bitmap.createBitmap(canvas.getWidth(), canvas.getHeight(), Bitmap.Config.ARGB_8888);
77
+            Canvas temp = new Canvas(bitmap);
78
+            Paint paint = new Paint();
79
+            paint.setAntiAlias(true);
80
+            paint.setColor(makePressColor());
81
+            temp.drawCircle(getWidth() / 2, getHeight() / 2, getHeight() / 2, paint);
82
+            Paint transparentPaint = new Paint();
83
+            transparentPaint.setAntiAlias(true);
84
+            transparentPaint.setColor(getResources().getColor(android.R.color.transparent));
85
+            transparentPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
86
+            if (cont >= 50) {
87
+                radius2 = (radius2 >= getWidth() / 2) ? (float) getWidth() / 2 : radius2 + 1;
88
+            } else {
89
+                radius2 = (radius2 >= getWidth() / 2 - SizeUtils.convertDp2Px(mContext, 4)) ? (float) getWidth() / 2 - SizeUtils.convertDp2Px(mContext, 4) : radius2 + 1;
90
+            }
91
+            temp.drawCircle(getWidth() / 2, getHeight() / 2, radius2, transparentPaint);
92
+            canvas.drawBitmap(bitmap, 0, 0, new Paint());
93
+            if (radius2 >= getWidth() / 2 - SizeUtils.convertDp2Px(mContext, 4))
94
+                cont++;
95
+            if (radius2 >= getWidth() / 2)
96
+                firstAnimationOver = true;
97
+        }
98
+    }
99
+
100
+    int arcD = 1;
101
+    int arcO = 0;
102
+    float rotateAngle = 0;
103
+    int limit = 0;
104
+
105
+    private void drawSecondAnimation(Canvas canvas) {
106
+        if (arcO == limit)
107
+            arcD += 6;
108
+        if (arcD >= 290 || arcO > limit) {
109
+            arcO += 6;
110
+            arcD -= 6;
111
+        }
112
+        if (arcO > limit + 290) {
113
+            limit = arcO;
114
+            arcO = limit;
115
+            arcD = 1;
116
+        }
117
+        rotateAngle += 4;
118
+        canvas.rotate(rotateAngle, getWidth() / 2, getHeight() / 2);
119
+        Bitmap bitmap = Bitmap.createBitmap(canvas.getWidth(), canvas.getHeight(), Bitmap.Config.ARGB_8888);
120
+        Canvas temp = new Canvas(bitmap);
121
+        Paint paint = new Paint();
122
+        paint.setAntiAlias(true);
123
+        paint.setColor(backgroundColor);
124
+        temp.drawArc(new RectF(0, 0, getWidth(), getHeight()), arcO, arcD, true, paint);
125
+        Paint transparentPaint = new Paint();
126
+        transparentPaint.setAntiAlias(true);
127
+        transparentPaint.setColor(getResources().getColor(android.R.color.transparent));
128
+        transparentPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
129
+        temp.drawCircle(getWidth() / 2, getHeight() / 2, (getWidth() / 2) - SizeUtils.convertDp2Px(mContext, 4), transparentPaint);
130
+        canvas.drawBitmap(bitmap, 0, 0, new Paint());
131
+    }
132
+
133
+    public void setBackgroundColor(int color) {
134
+        super.setBackgroundColor(getResources().getColor(android.R.color.transparent));
135
+        if (isEnabled())
136
+            beforeBackground = backgroundColor;
137
+        this.backgroundColor = color;
138
+    }
139
+}

Binārs
app/src/main/jniLibs/armeabi/liblbs.so Parādīt failu


+ 13 - 0
app/src/main/res/anim/error_frame_in.xml Parādīt failu

@@ -0,0 +1,13 @@
1
+<alpha android:fromAlpha="0"
2
+        android:toAlpha="1"
3
+        android:duration="400"
4
+        xmlns:android="http://schemas.android.com/apk/res/android" />
5
+
6
+
7
+<!--<sweet:cn.pedant.SweetAlert.Rotate3dAnimation
8
+    sweet:rollType="x"
9
+    sweet:fromDeg="100"
10
+    sweet:toDeg="0"
11
+    sweet:pivotX="50%"
12
+    sweet:pivotY="50%"
13
+    android:duration="400"/>-->

+ 9 - 0
app/src/main/res/anim/push_bottom_in.xml Parādīt failu

@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<set xmlns:android="http://schemas.android.com/apk/res/android">
3
+
4
+    <translate
5
+        android:duration="200"
6
+        android:fromYDelta="100%p"
7
+        android:toYDelta="0" />
8
+
9
+</set>

+ 10 - 0
app/src/main/res/anim/push_bottom_out.xml Parādīt failu

@@ -0,0 +1,10 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<set xmlns:android="http://schemas.android.com/apk/res/android">
3
+
4
+
5
+    <translate
6
+        android:duration="200"
7
+        android:fromYDelta="0"
8
+        android:toYDelta="100%p" />
9
+
10
+</set>

+ 9 - 0
app/src/main/res/anim/push_top_in.xml Parādīt failu

@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<set xmlns:android="http://schemas.android.com/apk/res/android">
3
+
4
+    <translate
5
+        android:duration="200"
6
+        android:fromYDelta="-100%p"
7
+        android:toYDelta="0" />
8
+
9
+</set>

+ 10 - 0
app/src/main/res/anim/push_top_out.xml Parādīt failu

@@ -0,0 +1,10 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<set xmlns:android="http://schemas.android.com/apk/res/android">
3
+
4
+
5
+    <translate
6
+        android:duration="200"
7
+        android:fromYDelta="0"
8
+        android:toYDelta="-100%p" />
9
+
10
+</set>

Binārs
app/src/main/res/drawable-hdpi/ic_info_circle.png Parādīt failu


Binārs
app/src/main/res/drawable-hdpi/ic_left.png Parādīt failu


Binārs
app/src/main/res/drawable-hdpi/ic_line_x.png Parādīt failu


Binārs
app/src/main/res/drawable-hdpi/ic_refresh_line.png Parādīt failu


Binārs
app/src/main/res/drawable-hdpi/ic_right.png Parādīt failu


Binārs
app/src/main/res/drawable-hdpi/ic_service_list_fill.png Parādīt failu


Binārs
app/src/main/res/drawable-hdpi/ic_turn_off.png Parādīt failu


+ 34 - 0
app/src/main/res/drawable-v24/ic_launcher_foreground.xml Parādīt failu

@@ -0,0 +1,34 @@
1
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
2
+    xmlns:aapt="http://schemas.android.com/aapt"
3
+    android:width="108dp"
4
+    android:height="108dp"
5
+    android:viewportHeight="108"
6
+    android:viewportWidth="108">
7
+    <path
8
+        android:fillType="evenOdd"
9
+        android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
10
+        android:strokeColor="#00000000"
11
+        android:strokeWidth="1">
12
+        <aapt:attr name="android:fillColor">
13
+            <gradient
14
+                android:endX="78.5885"
15
+                android:endY="90.9159"
16
+                android:startX="48.7653"
17
+                android:startY="61.0927"
18
+                android:type="linear">
19
+                <item
20
+                    android:color="#44000000"
21
+                    android:offset="0.0" />
22
+                <item
23
+                    android:color="#00000000"
24
+                    android:offset="1.0" />
25
+            </gradient>
26
+        </aapt:attr>
27
+    </path>
28
+    <path
29
+        android:fillColor="#FFFFFF"
30
+        android:fillType="nonZero"
31
+        android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
32
+        android:strokeColor="#00000000"
33
+        android:strokeWidth="1" />
34
+</vector>

Binārs
app/src/main/res/drawable-xxhdpi/card_bg.9.png Parādīt failu


Binārs
app/src/main/res/drawable-xxhdpi/common_icon_site.png Parādīt failu


Binārs
app/src/main/res/drawable-xxhdpi/empty_pic.jpg Parādīt failu


Binārs
app/src/main/res/drawable-xxhdpi/icon_36kr.png Parādīt failu


Binārs
app/src/main/res/drawable-xxhdpi/icon_github.png Parādīt failu


Binārs
app/src/main/res/drawable-xxhdpi/icon_qq.png Parādīt failu


Binārs
app/src/main/res/drawable-xxhdpi/icon_qqlive.png Parādīt failu


Binārs
app/src/main/res/drawable-xxhdpi/icon_taimeiti.png Parādīt failu


Binārs
app/src/main/res/drawable-xxhdpi/logo.png Parādīt failu


+ 12 - 0
app/src/main/res/drawable/btn_background_rectangle_gery.xml Parādīt failu

@@ -0,0 +1,12 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<shape xmlns:android="http://schemas.android.com/apk/res/android" >
3
+    <solid />
4
+    <corners android:bottomLeftRadius="5dp"
5
+        android:bottomRightRadius="5dp"
6
+        android:topLeftRadius="5dp"
7
+        android:topRightRadius="5dp"
8
+        >
9
+
10
+    </corners>
11
+    <stroke android:width="1px" />
12
+</shape>

+ 9 - 0
app/src/main/res/drawable/btn_background_shape_while.xml Parādīt failu

@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<shape xmlns:android="http://schemas.android.com/apk/res/android" >
3
+    <solid android:color="#fff"/>
4
+    <corners  android:bottomLeftRadius="12dp"
5
+        android:bottomRightRadius="12dp"
6
+        android:topLeftRadius="12dp"
7
+        android:topRightRadius="12dp"/>
8
+    <stroke android:width="1px" />
9
+</shape>

+ 10 - 0
app/src/main/res/drawable/btn_blue_shape.xml Parādīt failu

@@ -0,0 +1,10 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:shape="rectangle">
4
+    <!-- 填充颜色 -->
5
+    <solid></solid>
6
+    <!-- 线的宽度,颜色灰色 -->
7
+    <stroke android:width="1px" ></stroke>
8
+    <!-- 矩形的圆角半径 -->
9
+    <corners android:radius="5dp" />
10
+</shape>

+ 6 - 0
app/src/main/res/drawable/btn_go.xml Parādīt failu

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
3
+
4
+    <item android:state_pressed="true" android:drawable="@color/colorPrimary" />
5
+    <item android:drawable="@color/pureBlack" />
6
+</selector>

+ 10 - 0
app/src/main/res/drawable/btn_theme_shape.xml Parādīt failu

@@ -0,0 +1,10 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:shape="rectangle">
4
+    <!-- 填充颜色 -->
5
+    <solid ></solid>
6
+    <!-- 线的宽度,颜色灰色 -->
7
+    <stroke android:width="1px" ></stroke>
8
+    <!-- 矩形的圆角半径 -->
9
+    <corners android:radius="5dp" />
10
+</shape>

+ 5 - 0
app/src/main/res/drawable/enter.xml Parādīt failu

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
3
+
4
+
5
+</selector>

+ 170 - 0
app/src/main/res/drawable/ic_launcher_background.xml Parādīt failu

@@ -0,0 +1,170 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:width="108dp"
4
+    android:height="108dp"
5
+    android:viewportHeight="108"
6
+    android:viewportWidth="108">
7
+    <path
8
+        android:fillColor="#008577"
9
+        android:pathData="M0,0h108v108h-108z" />
10
+    <path
11
+        android:fillColor="#00000000"
12
+        android:pathData="M9,0L9,108"
13
+        android:strokeColor="#33FFFFFF"
14
+        android:strokeWidth="0.8" />
15
+    <path
16
+        android:fillColor="#00000000"
17
+        android:pathData="M19,0L19,108"
18
+        android:strokeColor="#33FFFFFF"
19
+        android:strokeWidth="0.8" />
20
+    <path
21
+        android:fillColor="#00000000"
22
+        android:pathData="M29,0L29,108"
23
+        android:strokeColor="#33FFFFFF"
24
+        android:strokeWidth="0.8" />
25
+    <path
26
+        android:fillColor="#00000000"
27
+        android:pathData="M39,0L39,108"
28
+        android:strokeColor="#33FFFFFF"
29
+        android:strokeWidth="0.8" />
30
+    <path
31
+        android:fillColor="#00000000"
32
+        android:pathData="M49,0L49,108"
33
+        android:strokeColor="#33FFFFFF"
34
+        android:strokeWidth="0.8" />
35
+    <path
36
+        android:fillColor="#00000000"
37
+        android:pathData="M59,0L59,108"
38
+        android:strokeColor="#33FFFFFF"
39
+        android:strokeWidth="0.8" />
40
+    <path
41
+        android:fillColor="#00000000"
42
+        android:pathData="M69,0L69,108"
43
+        android:strokeColor="#33FFFFFF"
44
+        android:strokeWidth="0.8" />
45
+    <path
46
+        android:fillColor="#00000000"
47
+        android:pathData="M79,0L79,108"
48
+        android:strokeColor="#33FFFFFF"
49
+        android:strokeWidth="0.8" />
50
+    <path
51
+        android:fillColor="#00000000"
52
+        android:pathData="M89,0L89,108"
53
+        android:strokeColor="#33FFFFFF"
54
+        android:strokeWidth="0.8" />
55
+    <path
56
+        android:fillColor="#00000000"
57
+        android:pathData="M99,0L99,108"
58
+        android:strokeColor="#33FFFFFF"
59
+        android:strokeWidth="0.8" />
60
+    <path
61
+        android:fillColor="#00000000"
62
+        android:pathData="M0,9L108,9"
63
+        android:strokeColor="#33FFFFFF"
64
+        android:strokeWidth="0.8" />
65
+    <path
66
+        android:fillColor="#00000000"
67
+        android:pathData="M0,19L108,19"
68
+        android:strokeColor="#33FFFFFF"
69
+        android:strokeWidth="0.8" />
70
+    <path
71
+        android:fillColor="#00000000"
72
+        android:pathData="M0,29L108,29"
73
+        android:strokeColor="#33FFFFFF"
74
+        android:strokeWidth="0.8" />
75
+    <path
76
+        android:fillColor="#00000000"
77
+        android:pathData="M0,39L108,39"
78
+        android:strokeColor="#33FFFFFF"
79
+        android:strokeWidth="0.8" />
80
+    <path
81
+        android:fillColor="#00000000"
82
+        android:pathData="M0,49L108,49"
83
+        android:strokeColor="#33FFFFFF"
84
+        android:strokeWidth="0.8" />
85
+    <path
86
+        android:fillColor="#00000000"
87
+        android:pathData="M0,59L108,59"
88
+        android:strokeColor="#33FFFFFF"
89
+        android:strokeWidth="0.8" />
90
+    <path
91
+        android:fillColor="#00000000"
92
+        android:pathData="M0,69L108,69"
93
+        android:strokeColor="#33FFFFFF"
94
+        android:strokeWidth="0.8" />
95
+    <path
96
+        android:fillColor="#00000000"
97
+        android:pathData="M0,79L108,79"
98
+        android:strokeColor="#33FFFFFF"
99
+        android:strokeWidth="0.8" />
100
+    <path
101
+        android:fillColor="#00000000"
102
+        android:pathData="M0,89L108,89"
103
+        android:strokeColor="#33FFFFFF"
104
+        android:strokeWidth="0.8" />
105
+    <path
106
+        android:fillColor="#00000000"
107
+        android:pathData="M0,99L108,99"
108
+        android:strokeColor="#33FFFFFF"
109
+        android:strokeWidth="0.8" />
110
+    <path
111
+        android:fillColor="#00000000"
112
+        android:pathData="M19,29L89,29"
113
+        android:strokeColor="#33FFFFFF"
114
+        android:strokeWidth="0.8" />
115
+    <path
116
+        android:fillColor="#00000000"
117
+        android:pathData="M19,39L89,39"
118
+        android:strokeColor="#33FFFFFF"
119
+        android:strokeWidth="0.8" />
120
+    <path
121
+        android:fillColor="#00000000"
122
+        android:pathData="M19,49L89,49"
123
+        android:strokeColor="#33FFFFFF"
124
+        android:strokeWidth="0.8" />
125
+    <path
126
+        android:fillColor="#00000000"
127
+        android:pathData="M19,59L89,59"
128
+        android:strokeColor="#33FFFFFF"
129
+        android:strokeWidth="0.8" />
130
+    <path
131
+        android:fillColor="#00000000"
132
+        android:pathData="M19,69L89,69"
133
+        android:strokeColor="#33FFFFFF"
134
+        android:strokeWidth="0.8" />
135
+    <path
136
+        android:fillColor="#00000000"
137
+        android:pathData="M19,79L89,79"
138
+        android:strokeColor="#33FFFFFF"
139
+        android:strokeWidth="0.8" />
140
+    <path
141
+        android:fillColor="#00000000"
142
+        android:pathData="M29,19L29,89"
143
+        android:strokeColor="#33FFFFFF"
144
+        android:strokeWidth="0.8" />
145
+    <path
146
+        android:fillColor="#00000000"
147
+        android:pathData="M39,19L39,89"
148
+        android:strokeColor="#33FFFFFF"
149
+        android:strokeWidth="0.8" />
150
+    <path
151
+        android:fillColor="#00000000"
152
+        android:pathData="M49,19L49,89"
153
+        android:strokeColor="#33FFFFFF"
154
+        android:strokeWidth="0.8" />
155
+    <path
156
+        android:fillColor="#00000000"
157
+        android:pathData="M59,19L59,89"
158
+        android:strokeColor="#33FFFFFF"
159
+        android:strokeWidth="0.8" />
160
+    <path
161
+        android:fillColor="#00000000"
162
+        android:pathData="M69,19L69,89"
163
+        android:strokeColor="#33FFFFFF"
164
+        android:strokeWidth="0.8" />
165
+    <path
166
+        android:fillColor="#00000000"
167
+        android:pathData="M79,19L79,89"
168
+        android:strokeColor="#33FFFFFF"
169
+        android:strokeWidth="0.8" />
170
+</vector>

+ 8 - 0
app/src/main/res/drawable/login_click.xml Parādīt failu

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
3
+
4
+    <item android:drawable="@drawable/login_click_nomal" android:state_pressed="false"></item>
5
+    <item android:drawable="@drawable/login_click_foucs" android:state_pressed="true"></item>
6
+    <item android:drawable="@drawable/login_click_nomal" android:state_window_focused="false"></item>
7
+
8
+</selector>

+ 5 - 0
app/src/main/res/drawable/login_click_foucs.xml Parādīt failu

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
3
+    <solid android:color="@color/colorPrimaryDark" />
4
+    <corners android:radius="3dp" />
5
+</shape>

+ 5 - 0
app/src/main/res/drawable/login_click_nomal.xml Parādīt failu

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
3
+    <solid android:color="@color/colorPrimary" />
4
+    <corners android:radius="3dp" />
5
+</shape>

+ 24 - 0
app/src/main/res/drawable/progress_bar_webview.xml Parādīt failu

@@ -0,0 +1,24 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3
+    <item android:id="@android:id/background">
4
+        <shape>
5
+            <solid android:color="#6fff"/>
6
+        </shape>
7
+    </item>
8
+
9
+    <item android:id="@android:id/secondaryProgress">
10
+        <clip>
11
+        <shape>
12
+        </shape>
13
+        </clip>
14
+    </item>
15
+
16
+    <item android:id="@android:id/progress">
17
+        <clip>
18
+            <shape>
19
+            </shape>
20
+        </clip>
21
+    </item>
22
+
23
+
24
+</layer-list>

+ 12 - 0
app/src/main/res/drawable/round_btn.xml Parādīt failu

@@ -0,0 +1,12 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+
3
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
4
+        android:shape="rectangle">
5
+    <!-- rectangle表示为矩形 -->
6
+
7
+    <!-- 填充的颜色 -->
8
+    <solid android:color="@color/colorPrimary" />
9
+
10
+    <corners android:radius="6dp" />
11
+
12
+</shape>

+ 16 - 0
app/src/main/res/drawable/url_input_frame.xml Parādīt failu

@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+
3
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
4
+        android:shape="rectangle">
5
+    <!-- rectangle表示为矩形 -->
6
+
7
+    <!-- 填充的颜色 -->
8
+    <solid android:color="@color/pureWhite" />
9
+    <stroke
10
+            android:width="2dp"
11
+            android:color="@color/pureBlack"
12
+            />
13
+
14
+    <corners android:radius="6dp" />
15
+
16
+</shape>

+ 35 - 0
app/src/main/res/layout/activity_checkcore.xml Parādīt failu

@@ -0,0 +1,35 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+        xmlns:tools="http://schemas.android.com/tools"
4
+        android:layout_width="fill_parent"
5
+        android:layout_height="fill_parent"
6
+        android:orientation="vertical">
7
+
8
+    <LinearLayout
9
+            android:layout_width="match_parent"
10
+            android:layout_height="wrap_content"
11
+            android:orientation="vertical">
12
+
13
+        <Button
14
+                android:id="@+id/btn_download_x5_backend"
15
+                android:layout_width="match_parent"
16
+                android:layout_height="wrap_content"
17
+                android:text="后台下载X5内核" />
18
+
19
+        <Button
20
+                android:id="@+id/btn_download_x5_frontend"
21
+                android:layout_width="match_parent"
22
+                android:layout_height="wrap_content"
23
+                android:text="前台下载X5内核" />
24
+
25
+        <Button
26
+                android:id="@+id/btn_use_sys_core"
27
+                android:layout_width="match_parent"
28
+                android:layout_height="wrap_content"
29
+                android:text="直接使用系统内核" />
30
+
31
+    </LinearLayout>
32
+
33
+
34
+
35
+</LinearLayout>

+ 59 - 0
app/src/main/res/layout/activity_file_reader.xml Parādīt failu

@@ -0,0 +1,59 @@
1
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
+    xmlns:tools="http://schemas.android.com/tools"
3
+    android:layout_width="fill_parent"
4
+    android:layout_height="fill_parent"
5
+    android:orientation="vertical">
6
+
7
+    <Button
8
+            android:id="@+id/btn_open_pdf_reader"
9
+            android:layout_width="match_parent"
10
+            android:layout_height="wrap_content"
11
+            android:text="打开.pdf"/>
12
+    <Button
13
+            android:id="@+id/btn_open_doc_reader"
14
+            android:layout_width="match_parent"
15
+            android:layout_height="wrap_content"
16
+            android:text="打开.doc"/>
17
+    <Button
18
+            android:id="@+id/btn_open_docx_reader"
19
+            android:layout_width="match_parent"
20
+            android:layout_height="wrap_content"
21
+            android:text="打开.docx"/>
22
+    <Button
23
+            android:id="@+id/btn_open_ppt_reader"
24
+            android:layout_width="match_parent"
25
+            android:layout_height="wrap_content"
26
+            android:text="打开.ppt"/>
27
+    <Button
28
+            android:id="@+id/btn_open_pptx_reader"
29
+            android:layout_width="match_parent"
30
+            android:layout_height="wrap_content"
31
+            android:text="打开.pptx"/>
32
+    <Button
33
+            android:id="@+id/btn_open_xls_reader"
34
+            android:layout_width="match_parent"
35
+            android:layout_height="wrap_content"
36
+            android:text="打开.xls"/>
37
+    <Button
38
+            android:id="@+id/btn_open_xlsx_reader"
39
+            android:layout_width="match_parent"
40
+            android:layout_height="wrap_content"
41
+            android:text="打开.xlsx"/>
42
+    <Button
43
+            android:id="@+id/btn_open_txt_reader"
44
+            android:layout_width="match_parent"
45
+            android:layout_height="wrap_content"
46
+            android:text="打开.txt"/>
47
+    <Button
48
+            android:id="@+id/btn_open_epub_reader"
49
+            android:layout_width="match_parent"
50
+            android:layout_height="wrap_content"
51
+            android:text="打开.epub"/>
52
+
53
+    <Button
54
+            android:id="@+id/exit"
55
+            android:layout_width="match_parent"
56
+            android:layout_height="wrap_content"
57
+            android:text="返回"/>
58
+
59
+</LinearLayout>

+ 9 - 0
app/src/main/res/layout/activity_main2.xml Parādīt failu

@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:app="http://schemas.android.com/apk/res-auto"
4
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+   >
8
+
9
+</android.support.constraint.ConstraintLayout>

+ 14 - 0
app/src/main/res/layout/activity_navigation.xml Parādīt failu

@@ -0,0 +1,14 @@
1
+<LinearLayout
2
+        xmlns:android="http://schemas.android.com/apk/res/android"
3
+        xmlns:app="http://schemas.android.com/apk/res-auto"
4
+        xmlns:tools="http://schemas.android.com/tools"
5
+        android:layout_width="fill_parent"
6
+        android:layout_height="fill_parent"
7
+        android:orientation="horizontal">
8
+
9
+    <ListView
10
+            android:id="@+id/list_base_func"
11
+            android:layout_width="match_parent"
12
+            android:layout_height="match_parent" />
13
+
14
+</LinearLayout>

+ 10 - 0
app/src/main/res/layout/activity_preview.xml Parādīt failu

@@ -0,0 +1,10 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<RelativeLayout
3
+    xmlns:android="http://schemas.android.com/apk/res/android"
4
+    android:id="@+id/fl_container"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    android:background="@android:color/white"
8
+    >
9
+
10
+</RelativeLayout>

+ 19 - 0
app/src/main/res/layout/activity_splash.xml Parādīt failu

@@ -0,0 +1,19 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<RelativeLayout
3
+    xmlns:android="http://schemas.android.com/apk/res/android"
4
+    xmlns:tools="http://schemas.android.com/tools"
5
+    android:layout_width="match_parent"
6
+    android:layout_height="match_parent"
7
+    tools:context=".SplashActivity"
8
+    >
9
+
10
+
11
+    <ImageView
12
+        android:layout_width="wrap_content"
13
+        android:layout_height="wrap_content"
14
+        android:layout_centerInParent="true"
15
+        android:src="@drawable/logo"
16
+        />
17
+
18
+
19
+</RelativeLayout>

+ 59 - 0
app/src/main/res/layout/activity_tbs_reader_view.xml Parādīt failu

@@ -0,0 +1,59 @@
1
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
+    xmlns:tools="http://schemas.android.com/tools"
3
+    android:layout_width="fill_parent"
4
+    android:layout_height="fill_parent"
5
+    android:orientation="vertical">
6
+
7
+    <Button
8
+        android:id="@+id/btn_open_pdf_reader"
9
+        android:layout_width="match_parent"
10
+        android:layout_height="wrap_content"
11
+        android:text="打开.pdf"/>
12
+    <Button
13
+        android:id="@+id/btn_open_doc_reader"
14
+        android:layout_width="match_parent"
15
+        android:layout_height="wrap_content"
16
+        android:text="打开.doc"/>
17
+    <Button
18
+        android:id="@+id/btn_open_docx_reader"
19
+        android:layout_width="match_parent"
20
+        android:layout_height="wrap_content"
21
+        android:text="打开.docx"/>
22
+    <Button
23
+        android:id="@+id/btn_open_ppt_reader"
24
+        android:layout_width="match_parent"
25
+        android:layout_height="wrap_content"
26
+        android:text="打开.ppt"/>
27
+    <Button
28
+        android:id="@+id/btn_open_pptx_reader"
29
+        android:layout_width="match_parent"
30
+        android:layout_height="wrap_content"
31
+        android:text="打开.pptx"/>
32
+    <Button
33
+        android:id="@+id/btn_open_xls_reader"
34
+        android:layout_width="match_parent"
35
+        android:layout_height="wrap_content"
36
+        android:text="打开.xls"/>
37
+    <Button
38
+        android:id="@+id/btn_open_xlsx_reader"
39
+        android:layout_width="match_parent"
40
+        android:layout_height="wrap_content"
41
+        android:text="打开.xlsx"/>
42
+    <Button
43
+        android:id="@+id/btn_open_txt_reader"
44
+        android:layout_width="match_parent"
45
+        android:layout_height="wrap_content"
46
+        android:text="打开.txt"/>
47
+    <Button
48
+        android:id="@+id/btn_open_epub_reader"
49
+        android:layout_width="match_parent"
50
+        android:layout_height="wrap_content"
51
+        android:text="打开.epub"/>
52
+
53
+    <Button
54
+        android:id="@+id/exit"
55
+        android:layout_width="match_parent"
56
+        android:layout_height="wrap_content"
57
+        android:text="返回"/>
58
+
59
+</LinearLayout>

+ 30 - 0
app/src/main/res/layout/activity_webview.xml Parādīt failu

@@ -0,0 +1,30 @@
1
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
+        xmlns:tools="http://schemas.android.com/tools"
3
+        android:layout_width="fill_parent"
4
+        android:layout_height="fill_parent"
5
+        android:orientation="vertical">
6
+
7
+    <LinearLayout
8
+            android:layout_width="match_parent"
9
+            android:layout_height="0dp"
10
+            android:layout_weight="1"
11
+            android:orientation="vertical">
12
+
13
+
14
+        <FrameLayout
15
+                android:id="@+id/webViewContainer"
16
+                android:layout_width="match_parent"
17
+                android:layout_height="match_parent"
18
+                android:background="@android:color/darker_gray">
19
+            <View
20
+                    android:id="@+id/select_popup_view"
21
+                    android:layout_width="0dp"
22
+                    android:layout_height="0dp" />
23
+        </FrameLayout>
24
+
25
+
26
+    </LinearLayout>
27
+
28
+
29
+
30
+</LinearLayout>

+ 29 - 0
app/src/main/res/layout/center_progress_dialog_layout.xml Parādīt failu

@@ -0,0 +1,29 @@
1
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
+    android:layout_width="match_parent"
3
+    android:layout_height="wrap_content">
4
+
5
+    <LinearLayout android:id="@+id/body"
6
+        android:orientation="horizontal"
7
+        android:layout_width="match_parent"
8
+        android:layout_height="match_parent"
9
+        android:background="@drawable/card_bg"
10
+        android:paddingLeft="10dp"
11
+        android:paddingRight="10dp"
12
+        android:paddingTop="15dp"
13
+        android:paddingBottom="15dp"
14
+        android:baselineAligned="false">
15
+
16
+        <com.studio.jframework.widget.progressbar.MaterialProgressBar
17
+            android:id="@+id/progress"
18
+            android:layout_width="36dp"
19
+            android:layout_height="36dp"
20
+            android:layout_margin="16dp"/>
21
+
22
+        <TextView android:id="@+id/message"
23
+            android:layout_width="match_parent"
24
+            android:layout_height="wrap_content"
25
+            android:layout_gravity="center_vertical"
26
+            android:layout_marginRight="16dp"
27
+            android:layout_marginEnd="16dp"/>
28
+    </LinearLayout>
29
+</FrameLayout>

+ 24 - 0
app/src/main/res/layout/item_shortcut.xml Parādīt failu

@@ -0,0 +1,24 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:id="@+id/llShortcut"
4
+    android:layout_width="match_parent"
5
+    android:layout_height="match_parent"
6
+    android:orientation="vertical">
7
+
8
+    <ImageView
9
+        android:id="@+id/ivIcon"
10
+        android:layout_width="match_parent"
11
+        android:layout_height="wrap_content"
12
+        android:layout_marginTop="5dp"
13
+        android:src="@drawable/icon_github" />
14
+
15
+    <TextView
16
+        android:id="@+id/tvName"
17
+        android:layout_width="match_parent"
18
+        android:layout_height="wrap_content"
19
+        android:layout_marginTop="5dp"
20
+        android:gravity="center"
21
+        android:text="微博"
22
+        android:textSize="10sp" />
23
+
24
+</LinearLayout>

+ 8 - 0
app/src/main/res/layout/nav_list_item.xml Parādīt failu

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+
3
+<TextView
4
+        xmlns:android="http://schemas.android.com/apk/res/android"
5
+        android:layout_width="match_parent"
6
+        android:layout_height="wrap_content"
7
+        android:padding="7dp" />
8
+

+ 10 - 0
app/src/main/res/layout/nav_section_header.xml Parādīt failu

@@ -0,0 +1,10 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
3
+        android:layout_width="match_parent"
4
+        android:layout_height="match_parent"
5
+        android:background="@color/tBlue"
6
+        android:textColor="@color/pureWhite"
7
+        android:padding="7dp"
8
+        android:textSize="18dp">
9
+
10
+</TextView>

+ 26 - 0
app/src/main/res/layout/progress_dialog_layout.xml Parādīt failu

@@ -0,0 +1,26 @@
1
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
2
+    android:layout_width="match_parent"
3
+    android:layout_height="wrap_content">
4
+
5
+    <LinearLayout android:id="@+id/body"
6
+        android:orientation="horizontal"
7
+        android:layout_width="match_parent"
8
+        android:layout_height="match_parent"
9
+        android:paddingTop="5dp"
10
+        android:paddingBottom="5dp"
11
+        android:baselineAligned="false">
12
+
13
+        <com..widget.progressbar.MaterialProgressBar
14
+            android:id="@+id/progress"
15
+            android:layout_width="36dp"
16
+            android:layout_height="36dp"
17
+            android:layout_margin="16dp"/>
18
+
19
+        <TextView android:id="@+id/message"
20
+            android:layout_width="match_parent"
21
+            android:layout_height="wrap_content"
22
+            android:layout_gravity="center_vertical"
23
+            android:layout_marginRight="16dp"
24
+            android:layout_marginEnd="16dp"/>
25
+    </LinearLayout>
26
+</FrameLayout>

+ 105 - 0
app/src/main/res/layout/update_dialog.xml Parādīt failu

@@ -0,0 +1,105 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    android:layout_width="match_parent"
4
+    android:layout_height="wrap_content"
5
+    >
6
+
7
+    <RelativeLayout
8
+        android:layout_width="match_parent"
9
+        android:layout_height="wrap_content"
10
+        android:layout_margin="16dp"
11
+        android:paddingTop="30dp"
12
+        android:background="@drawable/btn_background_shape_while">
13
+
14
+        <TextView
15
+            android:layout_centerHorizontal="true"
16
+            android:text="发现新版本"
17
+            android:textSize="16sp"
18
+            android:gravity="center"
19
+            android:layout_marginBottom="10dp"
20
+            android:layout_width="wrap_content"
21
+            android:layout_height="wrap_content"
22
+            android:id="@+id/title_text" />
23
+        <View
24
+            android:id="@+id/view_line"
25
+            android:layout_below="@id/title_text"
26
+            android:layout_width="match_parent"
27
+            android:layout_height="2dp"
28
+            android:layout_marginTop="5dp"
29
+            android:layout_marginRight="15dp"
30
+            android:layout_marginLeft="15dp"
31
+            />
32
+
33
+
34
+        <LinearLayout
35
+            android:layout_width="match_parent"
36
+            android:id="@+id/web_desc"
37
+            android:layout_margin="15dp"
38
+            android:layout_below="@id/title_text"
39
+            android:layout_height="150dp">
40
+            <WebView
41
+                android:id="@+id/tv_desc"
42
+                android:layout_below="@id/title_text"
43
+                android:layout_width="match_parent"
44
+                android:layout_height="match_parent"
45
+                android:text=""
46
+                />
47
+        </LinearLayout>
48
+
49
+
50
+
51
+        <LinearLayout
52
+            android:layout_width="match_parent"
53
+            android:layout_height="80dp"
54
+            android:orientation="horizontal"
55
+            android:layout_below="@+id/web_desc"
56
+            android:layout_marginBottom="10dp"
57
+            >
58
+
59
+            <Button
60
+                style="@style/Widget.AppCompat.Button.Borderless"
61
+                android:layout_width="0dp"
62
+                android:layout_marginLeft="15dp"
63
+                android:layout_marginRight="20dp"
64
+                android:layout_alignParentLeft="true"
65
+                android:gravity="center"
66
+                android:layout_weight="1"
67
+                android:visibility="visible"
68
+                android:layout_marginBottom="15dp"
69
+                android:background="@drawable/btn_theme_shape"
70
+                android:layout_height="wrap_content"
71
+                android:text="立即更新"
72
+                android:id="@+id/confirm" />
73
+
74
+            <Button
75
+                style="@style/Widget.AppCompat.Button.Borderless"
76
+                android:layout_width="0dp"
77
+                android:layout_alignParentRight="true"
78
+                android:layout_marginRight="15dp"
79
+                android:layout_marginLeft="20dp"
80
+                android:layout_weight="1"
81
+                android:gravity="center"
82
+                android:visibility="visible"
83
+                android:layout_height="wrap_content"
84
+                android:background="@drawable/btn_background_rectangle_gery"
85
+                android:text="以后再说"
86
+                android:id="@+id/cancel" />
87
+
88
+            <Button
89
+                style="@style/Widget.AppCompat.Button.Borderless"
90
+                android:layout_width="0dp"
91
+                android:layout_alignParentRight="true"
92
+                android:layout_marginRight="15dp"
93
+                android:layout_marginLeft="15dp"
94
+                android:layout_weight="1"
95
+                android:gravity="center"
96
+                android:visibility="gone"
97
+                android:layout_height="wrap_content"
98
+                android:background="@drawable/btn_theme_shape"
99
+                android:text="立即更新"
100
+                android:id="@+id/must_confirm" />
101
+        </LinearLayout>
102
+
103
+    </RelativeLayout>
104
+
105
+</LinearLayout>

+ 39 - 0
app/src/main/res/layout/web_activity.xml Parādīt failu

@@ -0,0 +1,39 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
+    xmlns:tools="http://schemas.android.com/tools"
4
+    android:layout_width="match_parent"
5
+    android:layout_height="match_parent"
6
+    android:orientation="vertical"
7
+    >
8
+
9
+
10
+    <RelativeLayout
11
+        android:layout_width="match_parent"
12
+        android:layout_height="match_parent">
13
+
14
+        <com.tencent.smtt.sdk.WebView
15
+            android:id="@+id/webView"
16
+            android:layout_width="match_parent"
17
+            android:layout_height="match_parent"
18
+            />
19
+
20
+        <ProgressBar
21
+            android:id="@+id/progressBar"
22
+            style="?android:attr/progressBarStyleHorizontal"
23
+            android:layout_width="match_parent"
24
+            android:layout_height="2dp"
25
+            android:max="100"
26
+            android:progress="0" />
27
+
28
+        <TextView
29
+            android:id="@+id/tvStatus"
30
+            android:layout_width="wrap_content"
31
+            android:layout_height="wrap_content"
32
+            android:background="#903B9FF8"
33
+            android:padding="5dp"
34
+            android:text="当前内核:--\n内核版本:---"
35
+            android:textColor="#FFF"
36
+            android:textSize="12sp" />
37
+    </RelativeLayout>
38
+
39
+</LinearLayout>

+ 24 - 0
app/src/main/res/menu/website_menu.xml Parādīt failu

@@ -0,0 +1,24 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
3
+
4
+    <item
5
+            android:id="@+id/home"
6
+            android:icon="@mipmap/ic_launcher"
7
+            android:title="Home"/>
8
+
9
+    <item
10
+            android:id="@+id/debugx5"
11
+            android:icon="@mipmap/ic_launcher"
12
+            android:title="debugx5"/>
13
+
14
+    <item
15
+            android:id="@+id/debugtbs"
16
+            android:icon="@mipmap/ic_launcher"
17
+            android:title="debugtbs"/>
18
+
19
+    <item
20
+            android:id="@+id/qrcode"
21
+            android:icon="@mipmap/ic_launcher"
22
+            android:title="扫一扫"/>
23
+
24
+</menu>

+ 5 - 0
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml Parādīt failu

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
+    <background android:drawable="@drawable/ic_launcher_background" />
4
+    <foreground android:drawable="@drawable/ic_launcher_foreground" />
5
+</adaptive-icon>

+ 5 - 0
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml Parādīt failu

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="utf-8"?>
2
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3
+    <background android:drawable="@drawable/ic_launcher_background" />
4
+    <foreground android:drawable="@drawable/ic_launcher_foreground" />
5
+</adaptive-icon>

Binārs
app/src/main/res/mipmap-hdpi/ic_launcher.png Parādīt failu


Binārs
app/src/main/res/mipmap-hdpi/ic_launcher_round.png Parādīt failu


Binārs
app/src/main/res/mipmap-hdpi/icon.png Parādīt failu


Binārs
app/src/main/res/mipmap-hdpi/x5_logo.png Parādīt failu


Binārs
app/src/main/res/mipmap-mdpi/ic_launcher.png Parādīt failu


Binārs
app/src/main/res/mipmap-mdpi/ic_launcher_round.png Parādīt failu


Binārs
app/src/main/res/mipmap-mdpi/icon.png Parādīt failu


Binārs
app/src/main/res/mipmap-xhdpi/ic_launcher.png Parādīt failu


Binārs
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png Parādīt failu


Binārs
app/src/main/res/mipmap-xhdpi/icon.png Parādīt failu


Binārs
app/src/main/res/mipmap-xxhdpi/ic_launcher.png Parādīt failu


Binārs
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png Parādīt failu


Binārs
app/src/main/res/mipmap-xxhdpi/icon.png Parādīt failu


Binārs
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png Parādīt failu


Binārs
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png Parādīt failu


+ 0 - 0
app/src/main/res/mipmap-xxxhdpi/icon.png Parādīt failu


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels