yc100 4 лет назад
Сommit
5ba46d703d
64 измененных файлов с 1523 добавлено и 0 удалено
  1. 58 0
      .gitignore
  2. 34 0
      README.md
  3. 1 0
      app/.gitignore
  4. 45 0
      app/build.gradle
  5. 21 0
      app/proguard-rules.pro
  6. 27 0
      app/src/androidTest/java/com/citycloud/agentwebview/ExampleInstrumentedTest.java
  7. 66 0
      app/src/main/AndroidManifest.xml
  8. BIN
      app/src/main/ic_launcher-playstore.png
  9. 143 0
      app/src/main/java/com/citycloud/androidweb/activy/GuideActivity.java
  10. 192 0
      app/src/main/java/com/citycloud/androidweb/activy/MainActivity.java
  11. 43 0
      app/src/main/java/com/citycloud/androidweb/common/AndroidInterface.java
  12. 9 0
      app/src/main/java/com/citycloud/androidweb/common/Constants.java
  13. 86 0
      app/src/main/java/com/citycloud/androidweb/web/CoolIndicatorLayout.java
  14. 47 0
      app/src/main/java/com/citycloud/androidweb/web/WebLayout.java
  15. 30 0
      app/src/main/res/drawable-v24/ic_launcher_foreground.xml
  16. BIN
      app/src/main/res/drawable/guide_1.png
  17. BIN
      app/src/main/res/drawable/guide_2.png
  18. BIN
      app/src/main/res/drawable/guide_3.png
  19. 74 0
      app/src/main/res/drawable/ic_launcher_background.xml
  20. BIN
      app/src/main/res/drawable/log1.png
  21. BIN
      app/src/main/res/drawable/log2.png
  22. BIN
      app/src/main/res/drawable/log3.png
  23. BIN
      app/src/main/res/drawable/point_focused_big.png
  24. BIN
      app/src/main/res/drawable/point_unfocused_small.png
  25. 5 0
      app/src/main/res/drawable/selector_banner_unequal.xml
  26. 16 0
      app/src/main/res/drawable/selector_btn_test.xml
  27. BIN
      app/src/main/res/drawable/uoko_guide_background_1.png
  28. BIN
      app/src/main/res/drawable/uoko_guide_background_2.png
  29. BIN
      app/src/main/res/drawable/uoko_guide_background_3.png
  30. BIN
      app/src/main/res/drawable/uoko_guide_foreground_1.png
  31. BIN
      app/src/main/res/drawable/uoko_guide_foreground_2.png
  32. BIN
      app/src/main/res/drawable/uoko_guide_foreground_3.png
  33. 55 0
      app/src/main/res/layout/activity_guide.xml
  34. 19 0
      app/src/main/res/layout/activity_main.xml
  35. 18 0
      app/src/main/res/layout/fragment_twk_web.xml
  36. 5 0
      app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  37. 5 0
      app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  38. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher.png
  39. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
  40. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  41. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher.png
  42. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
  43. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  44. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher.png
  45. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
  46. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  47. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  48. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
  49. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  50. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  51. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
  52. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  53. 6 0
      app/src/main/res/values/colors.xml
  54. 3 0
      app/src/main/res/values/strings.xml
  55. 62 0
      app/src/main/res/values/styles.xml
  56. 121 0
      app/src/main/res/values/styles_base.xml
  57. 17 0
      app/src/test/java/com/citycloud/agentwebview/ExampleUnitTest.java
  58. 31 0
      build.gradle
  59. 20 0
      gradle.properties
  60. BIN
      gradle/wrapper/gradle-wrapper.jar
  61. 6 0
      gradle/wrapper/gradle-wrapper.properties
  62. 172 0
      gradlew
  63. 84 0
      gradlew.bat
  64. 2 0
      settings.gradle

+ 58 - 0
.gitignore

@@ -0,0 +1,58 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
+
+# Built application files
+*.apk
+*.ap_
+
+# Files for the ART/Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+out/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
+# Android Studio captures folder
+captures/
+
+# Intellij
+*.iml
+.idea
+
+# Keystore files
+
+
+# MacOS
+.DS_Store

+ 34 - 0
README.md

@@ -0,0 +1,34 @@
+# ec-android
+
+ec-android
+使用AgentWeb框架 编写的原生套壳H5项目 实现智慧疫控安卓端原生功能
+基本功能
+
+ * 实现了回退和退出操作
+ * 实现了启动页 轮播图形式启动页 自动轮播等功能
+ 
+ BGABanner-Android 功能效果
+ - [x] 引导界面导航效果
+ - [x] 支持根据服务端返回的数据动态设置广告条的总页数
+ - [x] 支持大于等于1页时的无限循环自动轮播、手指按下暂停轮播、抬起手指开始轮播
+ - [x] 支持自定义指示器位置和广告文案位置
+ - [x] 支持图片指示器和数字指示器
+ - [x] 支持 ViewPager 各种切换动画
+ - [x] 支持选中特定页面
+ - [x] 支持监听 item 点击事件
+ - [x] 加载网络数据时支持占位图设置,避免出现整个广告条空白的情况
+ - [x] 多个 ViewPager 跟随滚动
+
+## 功能 & 库
+1. [`AgentWeb` AgentWeb 是一个基于的 Android WebView ,极度容易使用以及功能强大的库,提供了 Android WebView 一系列的问题解决方案 ,并且轻量和极度灵活](https://github.com/Justson/AgentWeb)
+2. [`BGABanner-Android` 非常好用的轮播图框架,图片采用的是Fresco框架加载](https://github.com/bingoogolapple/BGABanner-Android)
+
+
+
+
+
+
+ 
+ 
+ 
+#android

+ 1 - 0
app/.gitignore

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

+ 45 - 0
app/build.gradle

@@ -0,0 +1,45 @@
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion 29
+    buildToolsVersion "29.0.3"
+
+    defaultConfig {
+        applicationId 'com.citycloud.androidweb'
+        minSdkVersion 29
+        targetSdkVersion 29
+        versionCode 1
+        versionName "1.0"
+
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+
+}
+
+dependencies {
+
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+    implementation 'androidx.appcompat:appcompat:1.2.0'
+    implementation 'androidx.constraintlayout:constraintlayout:2.0.0'
+    testImplementation 'junit:junit:4.12'
+    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+    implementation 'com.just.agentweb:agentweb:4.1.4' // (必选)
+    implementation 'com.just.agentweb:filechooser:4.1.4'// (可选)
+    //implementation 'com.download.library:Downloader:4.1.4'// (可选)
+    implementation 'com.lcodecorex:tkrefreshlayout:1.0.7'
+    implementation 'com.coolindicator.sdk:coolindicator:1.0.0-beta'
+    //noinspection GradleCompatible
+    compile 'com.android.support:support-v4:latestVersion'
+    compile 'cn.bingoogolapple:bga-banner:2.2.7@aar'
+    implementation 'com.facebook.fresco:fresco:0.12.0'
+    implementation 'androidx.cardview:cardview:1.0.0'
+}

+ 21 - 0
app/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 27 - 0
app/src/androidTest/java/com/citycloud/agentwebview/ExampleInstrumentedTest.java

@@ -0,0 +1,27 @@
+package com.citycloud.agentwebview;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+    @Test
+    public void useAppContext() {
+        // Context of the app under test.
+        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+
+        assertEquals("com.citycloud.agentwebview", appContext.getPackageName());
+    }
+}

+ 66 - 0
app/src/main/AndroidManifest.xml

@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.citycloud.androidweb">
+    <!--网络权限-->
+    <!--<uses-permission android:name="android.permission.INTERNET"></uses-permission>-->
+    <!--wifi-->
+    <!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
+    <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>-->
+    <!--内存卡权限-->
+    <!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"></uses-permission>-->
+    <!--定位-->
+   <!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>-->
+    <!--相机-->
+    <!--<uses-permission android:name="android.permission.CAMERA"></uses-permission>
+    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"></uses-permission>-->
+
+
+    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"></uses-permission>
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
+    <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
+    <uses-permission android:name="android.permission.CAMERA"></uses-permission>
+    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"></uses-permission>
+
+    <application
+        android:allowBackup="true"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:roundIcon="@mipmap/ic_launcher_round"
+        android:supportsRtl="true"
+        android:theme="@style/sTheme"
+        android:usesCleartextTraffic="true"
+        android:hardwareAccelerated ="true"
+        >
+        <activity
+            android:label="@string/app_name"
+            android:name=".activy.GuideActivity"
+            android:launchMode="singleTask"
+            android:screenOrientation="portrait"
+            android:theme="@style/AppTheme.Splash"
+            >
+            <intent-filter>
+                <!--<action android:name="android.intent.action.MAIN" />-->
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <activity android:name=".activy.MainActivity"
+            android:launchMode="singleTask"
+            android:theme="@style/AppTheme.Splash">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>

BIN
app/src/main/ic_launcher-playstore.png


+ 143 - 0
app/src/main/java/com/citycloud/androidweb/activy/GuideActivity.java

@@ -0,0 +1,143 @@
+package com.citycloud.androidweb.activy;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.os.CountDownTimer;
+import android.widget.ImageView;
+
+import com.citycloud.androidweb.R;
+
+import cn.bingoogolapple.bgabanner.BGABanner;
+import cn.bingoogolapple.bgabanner.BGALocalImageSize;
+
+/**
+ * 启动页、引导页 支持图片自动轮播
+ * @author Yc
+ */
+public class GuideActivity extends Activity  {
+    private static final String TAG = GuideActivity.class.getSimpleName();
+    private BGABanner backgroundBanner;
+    //private BGABanner mBackgroundBanner;
+    //private BGABanner mForegroundBanner;
+    private CountDownTimer countDownTimer;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        initView();
+        setListener();
+        processLogic();
+    }
+
+    private void initView() {
+        setContentView(R.layout.activity_guide);
+        backgroundBanner = findViewById(R.id.banner_guide_background);
+        //mBackgroundBanner = findViewById(R.id.banner_guide_background);
+        //mForegroundBanner = findViewById(R.id.banner_guide_foreground);
+    }
+
+    private void setListener() {
+        /**
+         * 设置进入按钮和跳过按钮控件资源 id 及其点击事件
+         * 如果进入按钮和跳过按钮有一个不存在的话就传 0
+         * 在 BGABanner 里已经帮开发者处理了防止重复点击事件
+         * 在 BGABanner 里已经帮开发者处理了「跳过按钮」和「进入按钮」的显示与隐藏
+         */
+       /* mForegroundBanner.setEnterSkipViewIdAndDelegate(R.id.btn_guide_enter, R.id.tv_guide_skip, new BGABanner.GuideDelegate() {
+            @Override
+            public void onClickEnterOrSkip() {
+                //startActivity(new Intent(GuideActivity.this, MainActivity.class));
+                finish();
+            }
+        });*/
+
+        backgroundBanner.setEnterSkipViewIdAndDelegate(0, R.id.tv_guide_skip, new BGABanner.GuideDelegate() {
+            @Override
+            public void onClickEnterOrSkip() {
+                //startActivity(new Intent(GuideActivity.this, MainActivity.class));
+                finish();
+            }
+
+        });
+        backgroundBanner.setAdapter(new BGABanner.Adapter<ImageView, String>() {//监听轮播改变
+            @Override
+            public void fillBannerItem(BGABanner banner, ImageView itemView, String model, int position) {
+                if(backgroundBanner.getCurrentItem()+1==backgroundBanner.getItemCount()){//最后一页停止自动轮播
+                    backgroundBanner.stopAutoPlay();
+                }
+            }
+        });
+
+       /* mForegroundBanner.setDelegate(new BGABanner.Delegate<ImageView, String>() {
+            @Override
+            public void onBannerItemClick(BGABanner banner, ImageView itemView, String model, int position) {
+                //Toast.makeText(banner.getContext(), "点击了" + position, Toast.LENGTH_SHORT).show();
+            }
+
+
+        });*/
+
+        /*mForegroundBanner.setAdapter(new BGABanner.Adapter<ImageView, String>() {//监听轮播改变
+            @Override
+            public void fillBannerItem(BGABanner banner, ImageView itemView, String model, int position) {
+                if(mForegroundBanner.getCurrentItem()+1==mForegroundBanner.getItemCount()){//最后一页停止自动轮播
+                    mForegroundBanner.stopAutoPlay();
+                }
+            }
+        });*/
+        /*mBackgroundBanner.setAdapter(new BGABanner.Adapter<ImageView, String>() {//监听轮播改变
+            @Override
+            public void fillBannerItem(BGABanner banner, ImageView itemView, String model, int position) {
+                if(mBackgroundBanner.getCurrentItem()+1==mBackgroundBanner.getItemCount()){//最后一页停止自动轮播
+                    mBackgroundBanner.stopAutoPlay();
+                }
+            }
+        });*/
+
+        //定义一个CountDownTimer,这个类是Android SDK提供用来进行倒计时的。CountDownTimer(long millisInFuture, long countDownInterval)有两个参数,第一个是计时的总时长,第二个是间隔。
+        countDownTimer = new CountDownTimer(5000,1000) {
+            @Override
+            public void onTick(long millisUntilFinished) {
+                //tvAds.setText("点击跳过"+(millisUntilFinished/1000)+"秒");
+            }
+
+            @Override
+            public void onFinish() {
+                finish();
+            }
+        }.start();
+    }
+
+    private void processLogic() {
+        // Bitmap 的宽高在 maxWidth maxHeight 和 minWidth minHeight 之间
+        BGALocalImageSize localImageSize = new BGALocalImageSize(720, 1280, 320, 640);
+        backgroundBanner.setAutoPlayAble(true);//自动轮播
+        // 设置数据源
+        backgroundBanner.setData(localImageSize, ImageView.ScaleType.CENTER_CROP,
+                R.drawable.guide_1);
+        //BackgroundBanner.startAutoPlay();
+        /*原数据======================================================================*/
+
+        /*mBackgroundBanner.setAutoPlayAble(true);//自动轮播
+        mBackgroundBanner.setData(localImageSize, ImageView.ScaleType.CENTER_CROP,
+                R.drawable.uoko_guide_background_1,
+                R.drawable.uoko_guide_background_2,
+                R.drawable.uoko_guide_background_3);*/
+
+        /*mForegroundBanner.setAutoPlayAble(true);//自动轮播
+        mForegroundBanner.setData(localImageSize, ImageView.ScaleType.CENTER_CROP,
+                R.drawable.uoko_guide_foreground_1,
+                R.drawable.uoko_guide_foreground_2,
+                R.drawable.uoko_guide_foreground_3);*/
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        // 如果开发者的引导页主题是透明的,需要在界面可见时给背景 Banner 设置一个白色背景,避免滑动过程中两个 Banner 都设置透明度后能看到 Launcher
+        //mBackgroundBanner.setBackgroundResource(android.R.color.white);
+        backgroundBanner.setBackgroundResource(android.R.color.white);
+    }
+
+}

+ 192 - 0
app/src/main/java/com/citycloud/androidweb/activy/MainActivity.java

@@ -0,0 +1,192 @@
+package com.citycloud.androidweb.activy;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.webkit.ValueCallback;
+import android.webkit.WebResourceRequest;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.citycloud.androidweb.common.Constants;
+import com.citycloud.androidweb.web.CoolIndicatorLayout;
+import com.citycloud.androidweb.R;
+import com.citycloud.androidweb.common.AndroidInterface;
+import com.just.agentweb.AgentWeb;
+import com.just.agentweb.DefaultWebClient;
+import com.just.agentweb.WebChromeClient;
+import com.just.agentweb.WebViewClient;
+
+import org.json.JSONObject;
+
+import cn.bingoogolapple.bgabanner.BGABanner;
+
+/**
+ * AgentWeb框架实现 安卓壳子
+ * BGA Banner实现的启动页 支持自动轮播等功能
+ * 实现了回退、退出功能
+ * @author Yc
+ */
+public class MainActivity extends AppCompatActivity {
+
+    private ImageView ivback;
+    private TextView receiveTitle;
+    /**
+     * 用来承载AgentWebView
+     */
+    private LinearLayout mLinearLayout;
+
+    private AgentWeb mAgentWeb;
+    private long exitTime;
+    BGABanner guide_banner;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        Intent in=new Intent(getApplicationContext(), GuideActivity.class);//启动页start
+        startActivity(in);
+        //requestWindowFeature(Window.FEATURE_NO_TITLE);//隐藏标题栏
+        setContentView(R.layout.activity_main);
+
+        //initView();
+        //mLinearLayout = (LinearLayout) this.findViewById(R.id.container);
+
+        initAgentWeb();
+
+
+
+}
+
+
+    private void initAgentWeb() {
+        CoolIndicatorLayout mCoolIndicatorLayout = new CoolIndicatorLayout(this);//彩色进度条
+        mAgentWeb = AgentWeb.with(this)
+                .setAgentWebParent(mLinearLayout, new LinearLayout.LayoutParams(-1, -1))
+                .setCustomIndicator(mCoolIndicatorLayout)
+                //.useDefaultIndicator(0,0)
+                //.useDefaultIndicator()
+                .setWebChromeClient(webChromeClient)
+                .setWebViewClient(webViewClient)
+                .setMainFrameErrorView(R.layout.agentweb_error_page, -1)
+                .setSecurityType(AgentWeb.SecurityType.STRICT_CHECK)
+                //.setWebLayout(new WebLayout(this))
+                .setOpenOtherPageWays(DefaultWebClient.OpenOtherPageWays.DISALLOW)//打开其他应用时,弹窗咨询用户是否前往其他应用
+                .interceptUnkownUrl() //拦截找不到相关页面的Scheme
+                .createAgentWeb()
+                .ready()
+                .go(Constants.TARGET_URL);
+
+        //getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
+        mAgentWeb.getWebCreator().getWebView().setOverScrollMode(WebView.OVER_SCROLL_NEVER);
+        mAgentWeb.getWebCreator().getWebView().getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);//不使用缓存,只从网络获取数据.
+        //支持屏幕缩放
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setSupportZoom(true);
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setMediaPlaybackRequiresUserGesture(false);
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setBuiltInZoomControls(true);
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setJavaScriptEnabled(true);
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setUseWideViewPort(true);
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setLoadWithOverviewMode(true);
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setAppCacheEnabled(true);
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setDomStorageEnabled(true);//开启本地DOM存储
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setLoadsImagesAutomatically(true); // 加载图片
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setMediaPlaybackRequiresUserGesture(false);//播放音频,多媒体需要用户手动?设置为false为可自动播放
+        //mAgentWeb.getWebCreator().getWebView().getSettings().setAllowFileAccess(true);
+
+
+        /*实现android与js通信 */
+        if(mAgentWeb!=null){
+            //注入对象
+            mAgentWeb.getJsInterfaceHolder().addJavaObject("android",new AndroidInterface(mAgentWeb,this));
+        }
+
+        /*安卓调用js*/
+        //一个参数
+        mAgentWeb.getJsAccessEntrace().quickCallJs("callByAndroidParam","Hello ! Agentweb");
+
+        //多个参数
+        mAgentWeb.getJsAccessEntrace().quickCallJs("callByAndroidMoreParams", new ValueCallback<String>() {
+            @Override
+            public void onReceiveValue(String value) {
+                Log.i("Info","value:"+value);
+            }
+        },getJson(),"say:", " Hello! Agentweb");
+
+        /*js调用安卓*/
+    }
+
+
+    private String getJson(){
+        String result="";
+        try {
+            JSONObject mJSONObject=new JSONObject();
+            mJSONObject.put("id",1);
+            mJSONObject.put("name","Agentweb");
+            mJSONObject.put("age",18);
+            result= mJSONObject.toString();
+        }catch (Exception e){
+
+        }
+        return result;
+    }
+
+    // 看导包 这些是第三方的 不是自带的
+    private WebChromeClient webChromeClient = new WebChromeClient() {
+        @Override
+        public void onReceivedTitle(WebView view, String title) {
+            super.onReceivedTitle(view, title);
+
+            // 设置接收到的 title
+            if (receiveTitle != null) {
+                receiveTitle.setText(title);
+            }
+
+        }
+    };
+
+    //看导包 这些是第三方的 不是自带的
+    private WebViewClient webViewClient = new WebViewClient() {
+        // 可以去看上一级已经写了
+        @Override
+        public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
+            return super.shouldOverrideUrlLoading(view, request);
+        }
+
+        @Override
+        public void onPageStarted(WebView view, String url, Bitmap favicon) {
+            super.onPageStarted(view, url, favicon);
+        }
+    };
+
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {//通用返回功能
+        if (keyCode == KeyEvent.KEYCODE_BACK) {
+            if (mAgentWeb.getWebCreator().getWebView().canGoBack()) {
+                // 返回键退回
+                mAgentWeb.getWebCreator().getWebView().goBack();
+                return true;
+            } else {
+                if ((System.currentTimeMillis() - exitTime) > 2000) {
+                    Toast.makeText(getApplicationContext(), "再按一次退出应用", Toast.LENGTH_SHORT).show();
+                    exitTime = System.currentTimeMillis();
+                } else {
+                    finish();
+                }
+                return true;
+            }
+
+        }
+        return super.onKeyDown(keyCode, event);
+    }
+
+}

+ 43 - 0
app/src/main/java/com/citycloud/androidweb/common/AndroidInterface.java

@@ -0,0 +1,43 @@
+package com.citycloud.androidweb.common;
+
+import android.content.Context;
+import android.os.Handler;
+import android.os.Looper;
+import android.util.Log;
+import android.webkit.JavascriptInterface;
+import android.widget.Toast;
+
+import com.just.agentweb.AgentWeb;
+
+/**
+ * Created by Yc on 2020/08/26.
+ *  source code  https://github.com/Justson/AgentWeb
+ */
+
+public class AndroidInterface {
+
+    private Handler deliver = new Handler(Looper.getMainLooper());
+    private AgentWeb agent;
+    private Context context;
+
+    public AndroidInterface(AgentWeb agent, Context context) {
+        this.agent = agent;
+        this.context = context;
+    }
+
+
+    /*js调用android*/
+    @JavascriptInterface
+    public void callAndroid(final String msg) {
+        deliver.post(new Runnable() {
+            @Override
+            public void run() {
+                Log.i("Info", "main Thread:" + Thread.currentThread());
+                Toast.makeText(context.getApplicationContext(), "" + msg, Toast.LENGTH_LONG).show();
+            }
+        });
+        Log.i("Info", "Thread:" + Thread.currentThread());
+
+    }
+
+}

+ 9 - 0
app/src/main/java/com/citycloud/androidweb/common/Constants.java

@@ -0,0 +1,9 @@
+package com.citycloud.androidweb.common;
+
+public class Constants {
+    /*project*/
+    public static final String TARGET_URL="http://ecweb.aiyangniu.net/";/*测试环境*/
+
+
+
+}

+ 86 - 0
app/src/main/java/com/citycloud/androidweb/web/CoolIndicatorLayout.java

@@ -0,0 +1,86 @@
+
+/*
+ * Copyright (C)  Justson(https://github.com/Justson/AgentWeb)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.citycloud.androidweb.web;
+
+import android.app.Activity;
+import android.content.Context;
+import android.os.Build;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.FrameLayout;
+
+import androidx.annotation.Nullable;
+
+import com.coolindicator.sdk.CoolIndicator;
+import com.just.agentweb.AgentWebUtils;
+import com.just.agentweb.BaseIndicatorView;
+
+/**
+ * 非常炫酷的进度条
+ * @author Yc
+ * @date 2020/08/26
+ * @since 1.0.0
+ */
+public class CoolIndicatorLayout extends BaseIndicatorView {
+
+
+	private static final String TAG = CoolIndicatorLayout.class.getSimpleName();
+	private CoolIndicator mCoolIndicator = null;
+
+
+	public CoolIndicatorLayout(Context context) {
+		this(context, null);
+	}
+
+	public CoolIndicatorLayout(Context context, @Nullable AttributeSet attrs) {
+		this(context, attrs, -1);
+	}
+
+	public CoolIndicatorLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
+		super(context, attrs, defStyleAttr);
+		mCoolIndicator = CoolIndicator.create((Activity) context);
+		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+			mCoolIndicator.setProgressDrawable(context.getResources().getDrawable(com.coolindicator.sdk.R.drawable.default_drawable_indicator, context.getTheme()));
+		} else {
+			mCoolIndicator.setProgressDrawable(context.getResources().getDrawable(com.coolindicator.sdk.R.drawable.default_drawable_indicator));
+		}
+
+		this.addView(mCoolIndicator, offerLayoutParams());
+
+	}
+
+	@Override
+	public void show() {
+		this.setVisibility(View.VISIBLE);
+		mCoolIndicator.start();
+	}
+
+	@Override
+	public void setProgress(int newProgress) {
+	}
+
+	@Override
+	public void hide() {
+		mCoolIndicator.complete();
+	}
+
+	@Override
+	public LayoutParams offerLayoutParams() {
+		return new FrameLayout.LayoutParams(-1, AgentWebUtils.dp2px(getContext(), 3));
+	}
+}

+ 47 - 0
app/src/main/java/com/citycloud/androidweb/web/WebLayout.java

@@ -0,0 +1,47 @@
+package com.citycloud.androidweb.web;
+
+import android.app.Activity;
+import android.view.LayoutInflater;
+import android.view.ViewGroup;
+import android.webkit.WebView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.citycloud.androidweb.R;
+import com.just.agentweb.IWebLayout;
+import com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout;
+
+/**
+ * Created by Yc on 2020/08/25.
+ * source code  https://github.com/Justson/AgentWeb
+ */
+
+public class WebLayout implements IWebLayout {
+
+    private Activity mActivity;
+    private final TwinklingRefreshLayout mTwinklingRefreshLayout;
+    private WebView mWebView = null;
+
+    public WebLayout(Activity activity) {
+        this.mActivity = activity;
+        mTwinklingRefreshLayout = (TwinklingRefreshLayout) LayoutInflater.from(activity).inflate(R.layout.fragment_twk_web, null);
+        //mTwinklingRefreshLayout.setPureScrollModeOn();
+        mWebView = (WebView) mTwinklingRefreshLayout.findViewById(R.id.webView);
+    }
+
+    @NonNull
+    @Override
+    public ViewGroup getLayout() {
+        return mTwinklingRefreshLayout;
+    }
+
+    @Nullable
+    @Override
+    public WebView getWebView() {
+        return mWebView;
+    }
+
+
+
+}

Разница между файлами не показана из-за своего большого размера
+ 30 - 0
app/src/main/res/drawable-v24/ic_launcher_foreground.xml


BIN
app/src/main/res/drawable/guide_1.png


BIN
app/src/main/res/drawable/guide_2.png


BIN
app/src/main/res/drawable/guide_3.png


+ 74 - 0
app/src/main/res/drawable/ic_launcher_background.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector
+    android:height="108dp"
+    android:width="108dp"
+    android:viewportHeight="108"
+    android:viewportWidth="108"
+    xmlns:android="http://schemas.android.com/apk/res/android">
+    <path android:fillColor="#3DDC84"
+          android:pathData="M0,0h108v108h-108z"/>
+    <path android:fillColor="#00000000" android:pathData="M9,0L9,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,0L19,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M29,0L29,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M39,0L39,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M49,0L49,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M59,0L59,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M69,0L69,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M79,0L79,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M89,0L89,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M99,0L99,108"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,9L108,9"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,19L108,19"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,29L108,29"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,39L108,39"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,49L108,49"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,59L108,59"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,69L108,69"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,79L108,79"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,89L108,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M0,99L108,99"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,29L89,29"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,39L89,39"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,49L89,49"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,59L89,59"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,69L89,69"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M19,79L89,79"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M29,19L29,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M39,19L39,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M49,19L49,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M59,19L59,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M69,19L69,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+    <path android:fillColor="#00000000" android:pathData="M79,19L79,89"
+          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
+</vector>

BIN
app/src/main/res/drawable/log1.png


BIN
app/src/main/res/drawable/log2.png


BIN
app/src/main/res/drawable/log3.png


BIN
app/src/main/res/drawable/point_focused_big.png


BIN
app/src/main/res/drawable/point_unfocused_small.png


+ 5 - 0
app/src/main/res/drawable/selector_banner_unequal.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/point_focused_big" android:state_selected="true" />
+    <item android:drawable="@drawable/point_unfocused_small" />
+</selector>

+ 16 - 0
app/src/main/res/drawable/selector_btn_test.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true">
+        <shape android:shape="rectangle">
+            <solid android:color="@color/colorAccent" />
+            <corners android:radius="5dp" />
+        </shape>
+    </item>
+    <item>
+        <shape android:shape="rectangle">
+            <solid android:color="@color/colorAccent" />
+            <corners android:radius="5dp" />
+        </shape>
+    </item>
+
+</selector>

BIN
app/src/main/res/drawable/uoko_guide_background_1.png


BIN
app/src/main/res/drawable/uoko_guide_background_2.png


BIN
app/src/main/res/drawable/uoko_guide_background_3.png


BIN
app/src/main/res/drawable/uoko_guide_foreground_1.png


BIN
app/src/main/res/drawable/uoko_guide_foreground_2.png


BIN
app/src/main/res/drawable/uoko_guide_foreground_3.png


+ 55 - 0
app/src/main/res/layout/activity_guide.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                xmlns:app="http://schemas.android.com/apk/res-auto"
+                xmlns:tools="http://schemas.android.com/tools"
+                style="@style/MatchMatch">
+
+    <cn.bingoogolapple.bgabanner.BGAGuideLinkageLayout style="@style/MatchMatch">
+
+        <cn.bingoogolapple.bgabanner.BGABanner
+            android:id="@+id/banner_guide_background"
+            style="@style/MatchMatch"
+            app:banner_pageChangeDuration="1000"
+            app:banner_pointAutoPlayAble="false"
+            app:banner_pointContainerBackground="@android:color/transparent"
+            app:banner_pointDrawable="@drawable/selector_banner_unequal"
+            app:banner_pointTopBottomMargin="15dp"
+            app:banner_transitionEffect="fade"/>
+
+        <cn.bingoogolapple.bgabanner.BGABanner
+            android:id="@+id/banner_guide_foreground"
+            style="@style/MatchMatch"
+            app:banner_pageChangeDuration="1000"
+            app:banner_pointAutoPlayAble="false"
+            app:banner_pointContainerBackground="@android:color/transparent"
+            app:banner_pointDrawable="@drawable/selector_banner_unequal"
+            app:banner_pointTopBottomMargin="15dp"
+            app:banner_transitionEffect="alpha"/>
+    </cn.bingoogolapple.bgabanner.BGAGuideLinkageLayout>
+
+    <TextView
+        android:id="@+id/tv_guide_skip"
+        style="@style/WrapWrap"
+        android:layout_alignParentRight="true"
+        android:layout_marginRight="8dp"
+        android:layout_marginTop="8dp"
+        android:clickable="true"
+        android:padding="4dp"
+        android:text="跳过 >"
+        android:textColor="@android:color/secondary_text_light"
+        android:textSize="16sp"/>
+
+    <Button
+        android:id="@+id/btn_guide_enter"
+        style="@style/WrapWrap"
+        android:layout_alignParentBottom="true"
+        android:layout_centerHorizontal="true"
+        android:layout_marginBottom="60dp"
+        android:background="@drawable/selector_btn_test"
+        android:padding="8dp"
+        android:text="进入主界面"
+        android:textColor="@android:color/white"
+        android:textSize="20sp"
+        android:visibility="gone"
+        tools:visibility="visible"/>
+</RelativeLayout>

+ 19 - 0
app/src/main/res/layout/activity_main.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        xmlns:app="http://schemas.android.com/apk/res-auto"
+        xmlns:tools="http://schemas.android.com/tools"
+        android:id="@+id/container"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        tools:context=".activy.MainActivity">
+
+
+    <!--<WebView
+        android:text="Hello World!"
+        android:id="@+id/imageView"
+        android:scrollbars="none"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        />-->
+</LinearLayout>

+ 18 - 0
app/src/main/res/layout/fragment_twk_web.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/refreshLayout"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@android:color/transparent"
+    app:tr_pureScrollMode_on="true">
+
+    <WebView
+        android:id="@+id/webView"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="#fff"
+        android:visibility="visible"
+        />
+</com.lcodecore.tkrefreshlayout.TwinklingRefreshLayout>

+ 5 - 0
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml

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

+ 5 - 0
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml

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

BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png


BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png


+ 6 - 0
app/src/main/res/values/colors.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="colorPrimary">#6200EE</color>
+    <color name="colorPrimaryDark">#3700B3</color>
+    <color name="colorAccent">#03DAC5</color>
+</resources>

+ 3 - 0
app/src/main/res/values/strings.xml

@@ -0,0 +1,3 @@
+<resources>
+    <string name="app_name">智慧疫控</string>
+</resources>

+ 62 - 0
app/src/main/res/values/styles.xml

@@ -0,0 +1,62 @@
+<resources>
+
+    <!-- Base application theme. -->
+    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+        <!-- Customize your theme here. -->
+        <item name="colorPrimary">@color/colorPrimary</item>
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+        <item name="colorAccent">@color/colorAccent</item>
+    </style>
+
+    <style name="sTheme" parent="@style/Theme.AppCompat.NoActionBar">
+        <!-- Customize your theme here. -->
+        <item name="colorPrimary">#fff</item>
+        <item name="colorPrimaryDark">#fff</item>
+        <item name="colorAccent">@color/colorAccent</item>
+    </style>
+
+    <style name="AppTheme.Splash" parent="@style/Theme.AppCompat.NoActionBar">
+        <item name="android:windowDisablePreview">true</item><!--解决启动页白屏问题-->
+        <item name="windowActionBar">false</item>
+        <item name="windowNoTitle">true</item>
+        <!--<item name="android:windowFullscreen">true</item>-->
+        <item name="android:windowContentOverlay">@null</item>
+    </style>
+    <!--自己的-->
+    <style name="AppSplash" parent="android:Theme">
+        <!-- <item name="android:windowBackground">@drawable/boot_start</item>-->
+        <item name="android:windowNoTitle">true</item>
+        <item name="android:windowIsTranslucent">true</item>
+    </style>
+
+    <style name="BannerDefaultStyle">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">100dp</item>
+        <item name="android:layout_marginTop">10dp</item>
+        <!-- 自定义属性在styles.xml中不需要命名空间,直接用属性名就可以了 -->
+        <!-- 开启自动轮播 -->
+        <item name="banner_pointAutoPlayAble">true</item>
+        <!-- 自动轮播的时间间隔 -->
+        <item name="banner_pointAutoPlayInterval">4000</item>
+        <!-- 指示点容器背景 -->
+        <item name="banner_pointContainerBackground">#44aaaaaa</item>
+        <!-- 指示点背景 -->
+        <item name="banner_pointDrawable">@drawable/bga_banner_selector_point_hollow</item>
+        <!-- 指示点容器左右内间距 -->
+        <item name="banner_pointContainerLeftRightPadding">10dp</item>
+        <!-- 指示点上下外间距 -->
+        <item name="banner_pointTopBottomMargin">6dp</item>
+        <!-- 指示点左右外间距 -->
+        <item name="banner_pointLeftRightMargin">3dp</item>
+        <!-- 指示器的位置 -->
+        <item name="banner_indicatorGravity">bottom|center_horizontal</item>
+        <!-- 页码切换过程的时间长度 -->
+        <item name="banner_pageChangeDuration">800</item>
+        <!-- 提示文案的文字大小 -->
+        <item name="banner_tipTextSize">10sp</item>
+        <!-- 提示文案的文字颜色 -->
+        <item name="banner_tipTextColor">@android:color/white</item>
+        <!-- 加载网络数据时覆盖在BGABanner最上层的占位图 -->
+        <item name="banner_placeholderDrawable">@drawable/log1</item>
+    </style>
+</resources>

+ 121 - 0
app/src/main/res/values/styles_base.xml

@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <style name="WrapMatch">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">match_parent</item>
+    </style>
+
+    <style name="MatchWrap">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">wrap_content</item>
+    </style>
+
+    <style name="WrapWrap">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+    </style>
+
+    <style name="MatchMatch">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">match_parent</item>
+    </style>
+
+    <style name="MatchAuto">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_weight">1</item>
+        <item name="android:layout_height">0dp</item>
+    </style>
+
+    <style name="AutoMatch">
+        <item name="android:layout_width">0dp</item>
+        <item name="android:layout_weight">1</item>
+        <item name="android:layout_height">match_parent</item>
+    </style>
+
+    <style name="WrapAuto">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_weight">1</item>
+        <item name="android:layout_height">0dp</item>
+    </style>
+
+    <style name="AutoWrap">
+        <item name="android:layout_width">0dp</item>
+        <item name="android:layout_weight">1</item>
+        <item name="android:layout_height">wrap_content</item>
+    </style>
+
+    <style name="WrapMatch.Vertical">
+        <item name="android:orientation">vertical</item>
+    </style>
+
+    <style name="WrapMatch.Horizontal">
+        <item name="android:orientation">horizontal</item>
+    </style>
+
+    <style name="MatchWrap.Vertical">
+        <item name="android:orientation">vertical</item>
+    </style>
+
+    <style name="MatchWrap.Horizontal">
+        <item name="android:orientation">horizontal</item>
+    </style>
+
+    <style name="WrapWrap.Vertical">
+        <item name="android:orientation">vertical</item>
+    </style>
+
+    <style name="WrapWrap.Horizontal">
+        <item name="android:orientation">horizontal</item>
+    </style>
+
+    <style name="MatchMatch.Vertical">
+        <item name="android:orientation">vertical</item>
+    </style>
+
+    <style name="MatchMatch.Horizontal">
+        <item name="android:orientation">horizontal</item>
+    </style>
+
+    <style name="MatchAuto.Vertical">
+        <item name="android:orientation">vertical</item>
+    </style>
+
+    <style name="MatchAuto.Horizontal">
+        <item name="android:orientation">horizontal</item>
+    </style>
+
+    <style name="AutoMatch.Vertical">
+        <item name="android:orientation">vertical</item>
+    </style>
+
+    <style name="AutoMatch.Horizontal">
+        <item name="android:orientation">horizontal</item>
+    </style>
+
+    <style name="WrapAuto.Vertical">
+        <item name="android:orientation">vertical</item>
+    </style>
+
+    <style name="WrapAuto.Horizontal">
+        <item name="android:orientation">horizontal</item>
+    </style>
+
+    <style name="AutoWrap.Vertical">
+        <item name="android:orientation">vertical</item>
+    </style>
+
+    <style name="AutoWrap.Horizontal">
+        <item name="android:orientation">horizontal</item>
+    </style>
+
+    <style name="MatchOne">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">1px</item>
+    </style>
+
+    <style name="OneMatch">
+        <item name="android:layout_width">1px</item>
+        <item name="android:layout_height">match_parent</item>
+    </style>
+</resources>

+ 17 - 0
app/src/test/java/com/citycloud/agentwebview/ExampleUnitTest.java

@@ -0,0 +1,17 @@
+package com.citycloud.androidweb;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+public class ExampleUnitTest {
+    @Test
+    public void addition_isCorrect() {
+        assertEquals(4, 2 + 2);
+    }
+}

+ 31 - 0
build.gradle

@@ -0,0 +1,31 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+    
+    repositories {
+        google()
+        jcenter()
+        mavenCentral()
+        maven { url 'https://jitpack.io' }
+        
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:3.6.2'
+        
+
+        // NOTE: Do not place your application dependencies here; they belong
+        // in the individual module build.gradle files
+    }
+}
+
+allprojects {
+    repositories {
+        google()
+        jcenter()
+        
+    }
+}
+
+task clean(type: Delete) {
+    delete rootProject.buildDir
+}

+ 20 - 0
gradle.properties

@@ -0,0 +1,20 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app's APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Automatically convert third-party libraries to use AndroidX
+android.enableJetifier=true
+

BIN
gradle/wrapper/gradle-wrapper.jar


+ 6 - 0
gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,6 @@
+#Tue Aug 25 13:51:26 CST 2020
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

+ 172 - 0
gradlew

@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+    echo "$*"
+}
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"

+ 84 - 0
gradlew.bat

@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

+ 2 - 0
settings.gradle

@@ -0,0 +1,2 @@
+rootProject.name='ec-android'
+include ':app'