Commit dcbca47c authored by tianyang's avatar tianyang

首次提交

parents
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
.idea
# keystore文件 再项目目录下
密码都配置在build.gradle
\ No newline at end of file
### STS ###
.git
#built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
out/
build/
caches/
# build/ 忽略所有的 build/ 目录下文件
# /build 只忽略此目录下build文件,子目录的build不忽略
# Local configuration file (sdk path, etc)
local.properties
# Windows thumbnail db
Thumbs.db
# OSX files
.DS_Store
# Eclipse project files
.classpath
.project
# Android Studio
*.iml
.idea
# Local IDEA workspace
.idea/workspace.xml
# Gradle cache
.gradle
#NDK
obj/
.settings/
# Log Files
*.log
debug/
release/
\ No newline at end of file
{
"config": {
"emas.appKey":"29419976",
"emas.appSecret":"021d9633de5a97eadf9219549286acd7",
"emas.packageName":"com.yunsx.zdap",
"hotfix.idSecret":"29419976-1",
"hotfix.rsaSecret":"MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDNUwqxfgSlvlmvQNHh7KtWFhk+VV7rtv1GdLBYb2gCFnm0Rib3nHJEObt/u4DPxvSyNJoV4YgQc1m/Nvxg4FvmiOF/ZgDzYjpSchaBtbg8zupQYMYuV5ugaYuxwpgYM1A8Fo86NreoeMYXidvO0Rg4COFC7Z3RCT5CNCPMPWvGG38KjfTzTjbHMaG28aDouOpktaGThLP5sMlPAVkTg26YVPM3hGPSGg74EYdOcnWs3Ab8xj7/F/mLpJweoq3lWfS1+f5zvR9d2RN81o5NMnADJJ3cqXtJ912d4g+aq2m0lad+G4FKZaHB0Af5ZcJ2BSp1hxo+jZ1d6N62ByMROZVTAgMBAAECggEBAJeeidf10eK+xKV4vUQTK5a/bNat3hE8KJ29j3dOlURtamPoJeBVQ8ADzeSOBpnoNkveMiaUS5CyTYS5SvcS1mpPjA0yuuL/F0hIfTw9f5ZPyZGfVNll0kNLjV+v7fZ49ffZRNzdCRQ8UzOQlqOLnlHKpOVyaEazh6kFraWleY9o7cE5sOQsVG0f3YAkx0jjNhVWKfXt8gbU451NiFXORQBEePY9Av/TI5ZJSNeCQmHOfjETrF+teoXLdUuXDJ487lrYNMDuB7VQoE3xkZFjva0ciVwjpDJCqbICfEWEvDGEyACFlHFgmMipiS3ZBiqV4qgsIRH3KJR1h0UgF+Wt17ECgYEA7WdaEo3+cGwkP/fTFIcZMLO21CnSsMJ+24IJ9uUhhUEvMutp9AGvaFywSW7sXrDa7OdxKkNut1t4pqxhBd+s1TUwFemcWDFKdD/z6e0BbdJNqpCfUa/OqqQOia3vLR5+6FtjEI5T48Rk4I59qH/qrljvV+v0Ws1XohCkLKPxPKkCgYEA3WhndvB9jg3MZ2QHBxMlpxmhsJEsdLLsiPBgIPovThJAJWRo+STATnCHIGedL4YAAx9g3px5KEWgk8klGy3+Avc9g4pnfR1v5UQ6bc/Iklaz81dP8ELgw2m8gtHSHIzGDZ/GC8IBFsh+DibHOEzoqgbhGdTTvb69z2nXtrZg45sCgYBi759p/CL9VxQEVJNzCppE4aBf6s4TO/sCH79nVTYTAodZASK2vb0MERSmhcOb8rhJ4moW4uNRJp2xWEVW3VB5yiCwARtW5bPRnpVX952Q1wPnAT5kHJBULOqiFgqHEx5wVyWB0M7FLSOdMcTMZAK5hfa4/WxoKwtKTwUcVXZDgQKBgQCD3UKB3AlrKVyr1y84T3cFZoaeGlhXyJiHlmIqQdcasFPz8TFz8Sd3kB1qd0tummg3c+DFtHuUOKPCYPHwlhvKuGWyiiPIqFeUPGZwMGhMf8b9DutVNP+YYskbQMvapRzv0FCrgAgWAaLR2tab+XI4kZBPSioxwABcH7WR5F0gMQKBgQDXISazpgKDTZHgyRlZ+zCFNmK1w5dN1DmwG8QKyHseLo2t98dLm4p+vH990XIfqonbWVdJQiXN2KRMY+Nr8/NKDZ5BBeIKLTXWliRJcBhUHY6P84lR83/RLndlYJEwtJMLLhTGboYeCjTHeoNA0iv7a6iYD4sztBoofRYmSMjrrA==",
"httpdns.accountId":"136827",
"httpdns.secretKey":"d6e22c5945f56cb4957f4be7d10cedac",
"appmonitor.tlog.rsaSecret":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdEa5j2KnVFhFURPG98eXIHpGbQ2Xr+DO0C4JH616s8iHF5eZQ93ciuYynBi8/LwjGvkkGHrA42R8YjcE2gxeBKmuw+oNnQyI/+Zn7LD/tp8v1cTS1Ca5FVwDsIaYNumYwtCtlM9AlreJZ+k1H7yeSb5LikISQLDxmFXzpC27i9wIDAQAB"
},
"services": {
"hotfix_service":{
"status":1,
"version":"3.2.14"
},
"ha-adapter_service":{
"status":0,
"version":"1.1.3.2-open"
},
"feedback_service":{
"status":0,
"version":"3.3.1"
},
"tlog_service":{
"status":0,
"version":"1.1.2.3-open"
},
"httpdns_service":{
"status":0,
"version":"1.3.2"
},
"apm_service":{
"status":0,
"version":"1.0.7.8-open"
},
"man_service":{
"status":0,
"version":"1.2.4"
},
"cps_service":{
"status":0,
"version":"3.1.9"
}
},
"use_maven":true,
"proguard_keeplist":"\n#httpdns\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n\n#cps\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n-keepclasseswithmembernames class ** {\nnative <methods>;\n}\n-keepattributes Signature\n-keep class sun.misc.Unsafe { *; }\n-keep class com.alipay.** {*;}\n-dontwarn com.alipay.**\n-keep class anet.**{*;}\n-keep class org.android.spdy.**{*;}\n-keep class org.android.agoo.**{*;}\n-dontwarn anet.**\n-dontwarn org.android.spdy.**\n-dontwarn org.android.agoo.**\n\n#hotfix\n#基线包使用,生成mapping.txt\n-printmapping mapping.txt\n#生成的mapping.txt在app/buidl/outputs/mapping/release路径下,移动到/app路径下\n#修复后的项目使用,保证混淆结果一致\n#-applymapping mapping.txt\n#hotfix\n-keep class com.taobao.sophix.**{*;}\n-keep class com.ta.utdid2.device.**{*;}\n#防止inline\n-dontoptimize\n\n#man\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n\n#feedback\n-keep class com.taobao.** {*;}\n-keep class com.alibaba.** {*;}\n-keep class com.ta.**{*;}\n-keep class com.ut.**{*;}\n-dontwarn com.taobao.**\n-dontwarn com.alibaba.**\n-dontwarn com.ta.**\n-dontwarn com.ut.**\n"
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
# 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
##################################通过混淆配置#################################
# 代码混淆压缩比,在0~7之间,默认为5,一般不做修改
-optimizationpasses 5
# 混合时不使用大小写混合,混合后的类名为小写
-dontusemixedcaseclassnames
# 指定不去忽略非公共库的类
-dontskipnonpubliclibraryclasses
# 这句话能够使我们的项目混淆后产生映射文件
# 包含有类名->混淆后类名的映射关系
-verbose
# 指定不去忽略非公共库的类成员
-dontskipnonpubliclibraryclassmembers
# 不做预校验,preverify是proguard的四个步骤之一,Android不需要preverify,去掉这一步能够加快混淆速度。
-dontpreverify
-dontoptimize
# 混淆时是否记录日志
-verbose
-ignorewarnings
# 保留Annotation不混淆
-keepattributes *Annotation*
# 避免混淆泛型
-keepattributes Signature
-keepattributes Exceptions,InnerClasses
-dontnote com.google.vending.licensing.ILicensingService
-dontnote com.android.vending.licensing.ILicensingService
# 抛出异常时保留代码行号
-keepattributes SourceFile,LineNumberTable
-keepattributes Deprecated,Synthetic,EnclosingMethod
# 重命名抛出异常时的文件名称
-renamesourcefileattribute SourceFile
-keep public class * extends android.app.Fragment
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.preference.Preference
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class * extends android.view.View
# 指定混淆是采用的算法,后面的参数是一个过滤器
# 这个过滤器是谷歌推荐的算法,一般不做更改
-optimizations !code/simplification/cast,!field/*,!class/merging/*
#fastjson 可以混淆也可以不混淆
-keep public class * extends com.chad.library.adapter.base.BaseQuickAdapter
-keep public class * extends com.chad.library.adapter.base.BaseViewHolder
-keepclassmembers class **$** extends com.chad.library.adapter.base.BaseViewHolder {
<init>(...);
}
-dontwarn com.tencent.bugly.**
-dontwarn com.tencent.bugly.**
# tinker混淆规则
-dontwarn com.tencent.tinker.**
#eventbus
-keepattributes *Annotation*
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
# Only required if you use AsyncExecutor
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
<init>(java.lang.Throwable);
}
#sharesdk
#OkHttp3混淆配置
-dontwarn com.squareup.okhttp3.**
-dontwarn okio.**
#RxJava、RxAndroid混淆配置
-dontwarn sun.misc.**
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}
#Retrofit2
-dontwarn retrofit2.**
-keepattributes Signature
-keepattributes Exceptions
-dontwarn com.tencent.smtt.export.external.**
#
#----------------------------- WebView(项目中没有可以忽略) -----------------------------
#
#webView需要进行特殊处理
-keepclassmembers class * extends android.webkit.WebViewClient {
public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap);
public boolean *(android.webkit.WebView, java.lang.String);
}
#在app中与HTML5的JavaScript的交互进行特殊处理
#我们需要确保这些js要调用的原生方法不能够被混淆,于是我们需要做如下处理:
-keepattributes Signature
# Addidional for x5.sdk classes for apps
-keepattributes InnerClasses
-keep public enum com.tencent.smtt.sdk.WebSettings$** {
*;
}
-keep public enum com.tencent.smtt.sdk.QbSdk$** {
*;
}
-keepclassmembers class * {
public <init> (org.json.JSONObject);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# weibo新浪
-dontwarn com.umeng.**
-dontwarn com.taobao.**
-dontwarn anet.channel.**
-dontwarn anetwork.channel.**
-dontwarn org.android.**
-dontwarn org.apache.thrift.**
-dontwarn com.xiaomi.**
-dontwarn com.huawei.**
-dontwarn com.meizu.**
-keepattributes *Annotation*
-keep public class **.R$*{
public static final int *;
}
-dontshrink
-dontoptimize
-dontwarn com.google.android.maps.**
-dontwarn android.webkit.WebView
-dontwarn com.umeng.**
-dontwarn com.tencent.weibo.sdk.**
-dontwarn com.facebook.**
-dontwarn android.support.v4.**
-keepattributes Exceptions,InnerClasses,Signature
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class com.umeng.socialize.* {*;}
-dontwarn com.kakao.**
-keep public class com.umeng.com.umeng.soexample.R$*{
public static final int *;
}
-keep public class com.linkedin.android.mobilesdk.R$*{
public static final int *;
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-dontwarn com.sina.**
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}
-keepattributes Signature
# glide 的混淆代码
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
#基线包使用,生成mapping.txt
-printmapping mapping.txt
#生成的mapping.txt在app/build/outputs/mapping/release路径下,移动到/app路径下
#修复后的项目使用,保证混淆结果一致
#-applymapping mapping.txt
#hotfix
-dontwarn com.alibaba.sdk.android.utils.**
#防止inline
-dontoptimize
-keepattributes *Annotation*
-keepclassmembers class com.bxzk.afxj.application.BApplication {
public <init>();
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.bxzk.afxj" >
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 获取运营商信息,用于支持提供运营商信息相关的接口 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位 -->
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 用于读取手机当前的状态 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- 访问网络,网络定位需要上网 -->
<uses-permission android:name="android.permission.INTERNET" /> <!-- SD卡读取权限,用户写入离线定位数据 -->
<!-- 获取手机录音机使用权限,听写、识别、语义理解需要用到此权限 -->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" /> <!-- 声明接收启动完成广播的权限 -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission
android:name="android.permission.WRITE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<application
android:name="com.bxzk.afxj.application.BApplication"
android:allowBackup="true"
android:icon="@mipmap/logo"
android:largeHeap="true"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:resizeableActivity="true"
android:roundIcon="@mipmap/logo"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity android:name="com.bxzk.afxj.View.LoginAct" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- 例如: -->
<!-- 发到 Google Play 的 APK 可以设置为 google-play; -->
<!-- 发到其他市场的 APK 可以设置为 xxx-market。 -->
<meta-data
android:name="JPUSH_CHANNEL"
android:value="developer-default" /> <!-- Required. AppKey copied from Portal -->
<meta-data
android:name="JPUSH_APPKEY"
android:value="3b00de200440c3d09f3d1dfd" />
<meta-data
android:name="com.baidu.lbsapi.API_KEY"
android:value="IG6LGLUj598jnOpjFf68Fhttiy6bhSYd" /> <!-- 以下为基本配置信息,需要自行添加至您的AndroidManifest文件中 start -->
<receiver
android:name="com.bxzk.afxj.View.BootCompleteReceiver"
android:enabled="true"
android:exported="true" >
<intent-filter android:priority="1000" >
<!-- .接收启动完成的广播 -->
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<!--
<receiver android:name="com.yunsx.test.Service.NetWorkStateReceiver">
<intent-filter>
//检测网络变化的acton
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
-->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.bxzk.afxj.fileProvider"
android:exported="false"
android:grantUriPermissions="true" >
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<meta-data
android:name="com.taobao.android.hotfix.IDSECRET"
android:value="29419976" />
<meta-data
android:name="com.taobao.android.hotfix.APPSECRET"
android:value="021d9633de5a97eadf9219549286acd7" />
<meta-data
android:name="com.taobao.android.hotfix.RSASECRET"
android:value="MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDNUwqxfgSlvlmvQNHh7KtWFhk+VV7rtv1GdLBYb2gCFnm0Rib3nHJEObt/u4DPxvSyNJoV4YgQc1m/Nvxg4FvmiOF/ZgDzYjpSchaBtbg8zupQYMYuV5ugaYuxwpgYM1A8Fo86NreoeMYXidvO0Rg4COFC7Z3RCT5CNCPMPWvGG38KjfTzTjbHMaG28aDouOpktaGThLP5sMlPAVkTg26YVPM3hGPSGg74EYdOcnWs3Ab8xj7/F/mLpJweoq3lWfS1+f5zvR9d2RN81o5NMnADJJ3cqXtJ912d4g+aq2m0lad+G4FKZaHB0Af5ZcJ2BSp1hxo+jZ1d6N62ByMROZVTAgMBAAECggEBAJeeidf10eK+xKV4vUQTK5a/bNat3hE8KJ29j3dOlURtamPoJeBVQ8ADzeSOBpnoNkveMiaUS5CyTYS5SvcS1mpPjA0yuuL/F0hIfTw9f5ZPyZGfVNll0kNLjV+v7fZ49ffZRNzdCRQ8UzOQlqOLnlHKpOVyaEazh6kFraWleY9o7cE5sOQsVG0f3YAkx0jjNhVWKfXt8gbU451NiFXORQBEePY9Av/TI5ZJSNeCQmHOfjETrF+teoXLdUuXDJ487lrYNMDuB7VQoE3xkZFjva0ciVwjpDJCqbICfEWEvDGEyACFlHFgmMipiS3ZBiqV4qgsIRH3KJR1h0UgF+Wt17ECgYEA7WdaEo3+cGwkP/fTFIcZMLO21CnSsMJ+24IJ9uUhhUEvMutp9AGvaFywSW7sXrDa7OdxKkNut1t4pqxhBd+s1TUwFemcWDFKdD/z6e0BbdJNqpCfUa/OqqQOia3vLR5+6FtjEI5T48Rk4I59qH/qrljvV+v0Ws1XohCkLKPxPKkCgYEA3WhndvB9jg3MZ2QHBxMlpxmhsJEsdLLsiPBgIPovThJAJWRo+STATnCHIGedL4YAAx9g3px5KEWgk8klGy3+Avc9g4pnfR1v5UQ6bc/Iklaz81dP8ELgw2m8gtHSHIzGDZ/GC8IBFsh+DibHOEzoqgbhGdTTvb69z2nXtrZg45sCgYBi759p/CL9VxQEVJNzCppE4aBf6s4TO/sCH79nVTYTAodZASK2vb0MERSmhcOb8rhJ4moW4uNRJp2xWEVW3VB5yiCwARtW5bPRnpVX952Q1wPnAT5kHJBULOqiFgqHEx5wVyWB0M7FLSOdMcTMZAK5hfa4/WxoKwtKTwUcVXZDgQKBgQCD3UKB3AlrKVyr1y84T3cFZoaeGlhXyJiHlmIqQdcasFPz8TFz8Sd3kB1qd0tummg3c+DFtHuUOKPCYPHwlhvKuGWyiiPIqFeUPGZwMGhMf8b9DutVNP+YYskbQMvapRzv0FCrgAgWAaLR2tab+XI4kZBPSioxwABcH7WR5F0gMQKBgQDXISazpgKDTZHgyRlZ+zCFNmK1w5dN1DmwG8QKyHseLo2t98dLm4p+vH990XIfqonbWVdJQiXN2KRMY+Nr8/NKDZ5BBeIKLTXWliRJcBhUHY6P84lR83/RLndlYJEwtJMLLhTGboYeCjTHeoNA0iv7a6iYD4sztBoofRYmSMjrrA==" />
</application>
</manifest>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Simditor</title>
<meta name="viewport" content="width=device-width,initial-scale=1.0;user-scalable=no">
<link media="all" rel="stylesheet" type="text/css" href="styles/simditor.css"/>
<script type="text/javascript" src="scripts/jquery.min.js"></script>
</head>
<body>
<textarea id="txt-content" data-autosave="editor-content" autofocus required style="width: 100%;border:none;">
</textarea>
<script type="text/javascript" src="scripts/module.js"></script>
<script type="text/javascript" src="scripts/hotkeys.js"></script>
<script type="text/javascript" src="scripts/simditor.js"></script>
<!--<script type="text/javascript" src="assets/scripts/page-demo.js"></script>-->
<script>
var editor;
var toolbar = ['title', 'bold', 'italic', 'underline', 'strikethrough', 'fontScale', 'color', '|', 'ol', 'ul', 'blockquote', 'code', 'table', '|', 'link', 'image', 'hr', '|', 'indent', 'outdent', 'alignment', 'alignLeft', 'alignCenter', 'alignRight', 'html'];
var defaultOptions = {
textarea: $('#txt-content'),
placeholder: '',
toolbar: toolbar,
toolbarHidden: true,
}
</script>
</body>
</html>
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define('simple-hotkeys', ["jquery","simple-module"], function ($, SimpleModule) {
return (root['hotkeys'] = factory($, SimpleModule));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require("jquery"),require("simple-module"));
} else {
root.simple = root.simple || {};
root.simple['hotkeys'] = factory(jQuery,SimpleModule);
}
}(this, function ($, SimpleModule) {
var Hotkeys, hotkeys,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Hotkeys = (function(superClass) {
extend(Hotkeys, superClass);
function Hotkeys() {
return Hotkeys.__super__.constructor.apply(this, arguments);
}
Hotkeys.count = 0;
Hotkeys.keyNameMap = {
8: "Backspace",
9: "Tab",
13: "Enter",
16: "Shift",
17: "Control",
18: "Alt",
19: "Pause",
20: "CapsLock",
27: "Esc",
32: "Spacebar",
33: "PageUp",
34: "PageDown",
35: "End",
36: "Home",
37: "Left",
38: "Up",
39: "Right",
40: "Down",
45: "Insert",
46: "Del",
91: "Meta",
93: "Meta",
48: "0",
49: "1",
50: "2",
51: "3",
52: "4",
53: "5",
54: "6",
55: "7",
56: "8",
57: "9",
65: "A",
66: "B",
67: "C",
68: "D",
69: "E",
70: "F",
71: "G",
72: "H",
73: "I",
74: "J",
75: "K",
76: "L",
77: "M",
78: "N",
79: "O",
80: "P",
81: "Q",
82: "R",
83: "S",
84: "T",
85: "U",
86: "V",
87: "W",
88: "X",
89: "Y",
90: "Z",
96: "0",
97: "1",
98: "2",
99: "3",
100: "4",
101: "5",
102: "6",
103: "7",
104: "8",
105: "9",
106: "Multiply",
107: "Add",
109: "Subtract",
110: "Decimal",
111: "Divide",
112: "F1",
113: "F2",
114: "F3",
115: "F4",
116: "F5",
117: "F6",
118: "F7",
119: "F8",
120: "F9",
121: "F10",
122: "F11",
123: "F12",
124: "F13",
125: "F14",
126: "F15",
127: "F16",
128: "F17",
129: "F18",
130: "F19",
131: "F20",
132: "F21",
133: "F22",
134: "F23",
135: "F24",
59: ";",
61: "=",
186: ";",
187: "=",
188: ",",
190: ".",
191: "/",
192: "`",
219: "[",
220: "\\",
221: "]",
222: "'"
};
Hotkeys.aliases = {
"escape": "esc",
"delete": "del",
"return": "enter",
"ctrl": "control",
"space": "spacebar",
"ins": "insert",
"cmd": "meta",
"command": "meta",
"wins": "meta",
"windows": "meta"
};
Hotkeys.normalize = function(shortcut) {
var i, j, key, keyname, keys, len;
keys = shortcut.toLowerCase().replace(/\s+/gi, "").split("+");
for (i = j = 0, len = keys.length; j < len; i = ++j) {
key = keys[i];
keys[i] = this.aliases[key] || key;
}
keyname = keys.pop();
keys.sort().push(keyname);
return keys.join("_");
};
Hotkeys.prototype.opts = {
el: document
};
Hotkeys.prototype._init = function() {
this.id = ++this.constructor.count;
this._map = {};
this._delegate = typeof this.opts.el === "string" ? document : this.opts.el;
return $(this._delegate).on("keydown.simple-hotkeys-" + this.id, this.opts.el, (function(_this) {
return function(e) {
var ref;
return (ref = _this._getHander(e)) != null ? ref.call(_this, e) : void 0;
};
})(this));
};
Hotkeys.prototype._getHander = function(e) {
var keyname, shortcut;
if (!(keyname = this.constructor.keyNameMap[e.which])) {
return;
}
shortcut = "";
if (e.altKey) {
shortcut += "alt_";
}
if (e.ctrlKey) {
shortcut += "control_";
}
if (e.metaKey) {
shortcut += "meta_";
}
if (e.shiftKey) {
shortcut += "shift_";
}
shortcut += keyname.toLowerCase();
return this._map[shortcut];
};
Hotkeys.prototype.respondTo = function(subject) {
if (typeof subject === 'string') {
return this._map[this.constructor.normalize(subject)] != null;
} else {
return this._getHander(subject) != null;
}
};
Hotkeys.prototype.add = function(shortcut, handler) {
this._map[this.constructor.normalize(shortcut)] = handler;
return this;
};
Hotkeys.prototype.remove = function(shortcut) {
delete this._map[this.constructor.normalize(shortcut)];
return this;
};
Hotkeys.prototype.destroy = function() {
$(this._delegate).off(".simple-hotkeys-" + this.id);
this._map = {};
return this;
};
return Hotkeys;
})(SimpleModule);
hotkeys = function(opts) {
return new Hotkeys(opts);
};
return hotkeys;
}));
This diff is collapsed.
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define('simple-module', ["jquery"], function (a0) {
return (root['Module'] = factory(a0));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require("jquery"));
} else {
root['SimpleModule'] = factory(jQuery);
}
}(this, function ($) {
var Module,
slice = [].slice;
Module = (function() {
Module.extend = function(obj) {
var key, ref, val;
if (!((obj != null) && typeof obj === 'object')) {
return;
}
for (key in obj) {
val = obj[key];
if (key !== 'included' && key !== 'extended') {
this[key] = val;
}
}
return (ref = obj.extended) != null ? ref.call(this) : void 0;
};
Module.include = function(obj) {
var key, ref, val;
if (!((obj != null) && typeof obj === 'object')) {
return;
}
for (key in obj) {
val = obj[key];
if (key !== 'included' && key !== 'extended') {
this.prototype[key] = val;
}
}
return (ref = obj.included) != null ? ref.call(this) : void 0;
};
Module.connect = function(cls) {
if (typeof cls !== 'function') {
return;
}
if (!cls.pluginName) {
throw new Error('Module.connect: cannot connect plugin without pluginName');
return;
}
cls.prototype._connected = true;
if (!this._connectedClasses) {
this._connectedClasses = [];
}
this._connectedClasses.push(cls);
if (cls.pluginName) {
return this[cls.pluginName] = cls;
}
};
Module.prototype.opts = {};
function Module(opts) {
var base, cls, i, instance, instances, len, name;
this.opts = $.extend({}, this.opts, opts);
(base = this.constructor)._connectedClasses || (base._connectedClasses = []);
instances = (function() {
var i, len, ref, results;
ref = this.constructor._connectedClasses;
results = [];
for (i = 0, len = ref.length; i < len; i++) {
cls = ref[i];
name = cls.pluginName.charAt(0).toLowerCase() + cls.pluginName.slice(1);
if (cls.prototype._connected) {
cls.prototype._module = this;
}
results.push(this[name] = new cls());
}
return results;
}).call(this);
if (this._connected) {
this.opts = $.extend({}, this.opts, this._module.opts);
} else {
this._init();
for (i = 0, len = instances.length; i < len; i++) {
instance = instances[i];
if (typeof instance._init === "function") {
instance._init();
}
}
}
this.trigger('initialized');
}
Module.prototype._init = function() {};
Module.prototype.on = function() {
var args, ref;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
(ref = $(this)).on.apply(ref, args);
return this;
};
Module.prototype.one = function() {
var args, ref;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
(ref = $(this)).one.apply(ref, args);
return this;
};
Module.prototype.off = function() {
var args, ref;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
(ref = $(this)).off.apply(ref, args);
return this;
};
Module.prototype.trigger = function() {
var args, ref;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
(ref = $(this)).trigger.apply(ref, args);
return this;
};
Module.prototype.triggerHandler = function() {
var args, ref;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
return (ref = $(this)).triggerHandler.apply(ref, args);
};
Module.prototype._t = function() {
var args, ref;
args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
return (ref = this.constructor)._t.apply(ref, args);
};
Module._t = function() {
var args, key, ref, result;
key = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : [];
result = ((ref = this.i18n[this.locale]) != null ? ref[key] : void 0) || '';
if (!(args.length > 0)) {
return result;
}
result = result.replace(/([^%]|^)%(?:(\d+)\$)?s/g, function(p0, p, position) {
if (position) {
return p + args[parseInt(position) - 1];
} else {
return p + args.shift();
}
});
return result.replace(/%%s/g, '%s');
};
Module.i18n = {
'zh-CN': {}
};
Module.locale = 'zh-CN';
return Module;
})();
return Module;
}));
This diff is collapsed.
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module unless amdModuleId is set
define('simple-uploader', ["jquery","simple-module"], function ($, SimpleModule) {
return (root['uploader'] = factory($, SimpleModule));
});
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require("jquery"),require("simple-module"));
} else {
root.simple = root.simple || {};
root.simple['uploader'] = factory(jQuery,SimpleModule);
}
}(this, function ($, SimpleModule) {
var Uploader, uploader,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
Uploader = (function(superClass) {
extend(Uploader, superClass);
function Uploader() {
return Uploader.__super__.constructor.apply(this, arguments);
}
Uploader.count = 0;
Uploader.prototype.opts = {
url: '',
params: null,
fileKey: 'upload_file',
connectionCount: 3
};
Uploader.prototype._init = function() {
this.files = [];
this.queue = [];
this.id = ++Uploader.count;
this.on('uploadcomplete', (function(_this) {
return function(e, file) {
_this.files.splice($.inArray(file, _this.files), 1);
if (_this.queue.length > 0 && _this.files.length < _this.opts.connectionCount) {
return _this.upload(_this.queue.shift());
} else if (_this.files.length === 0) {
return _this.uploading = false;
}
};
})(this));
return $(window).on('beforeunload.uploader-' + this.id, (function(_this) {
return function(e) {
if (!_this.uploading) {
return;
}
e.originalEvent.returnValue = _this._t('leaveConfirm');
return _this._t('leaveConfirm');
};
})(this));
};
Uploader.prototype.generateId = (function() {
var id;
id = 0;
return function() {
return id += 1;
};
})();
Uploader.prototype.upload = function(file, opts) {
var f, i, key, len;
if (opts == null) {
opts = {};
}
if (file == null) {
return;
}
if ($.isArray(file) || file instanceof FileList) {
for (i = 0, len = file.length; i < len; i++) {
f = file[i];
this.upload(f, opts);
}
} else if ($(file).is('input:file')) {
key = $(file).attr('name');
if (key) {
opts.fileKey = key;
}
this.upload($.makeArray($(file)[0].files), opts);
} else if (!file.id || !file.obj) {
file = this.getFile(file);
}
if (!(file && file.obj)) {
return;
}
$.extend(file, opts);
if (this.files.length >= this.opts.connectionCount) {
this.queue.push(file);
return;
}
if (this.triggerHandler('beforeupload', [file]) === false) {
return;
}
this.files.push(file);
this._xhrUpload(file);
return this.uploading = true;
};
Uploader.prototype.getFile = function(fileObj) {
var name, ref, ref1;
if (fileObj instanceof window.File || fileObj instanceof window.Blob) {
name = (ref = fileObj.fileName) != null ? ref : fileObj.name;
} else {
return null;
}
return {
id: this.generateId(),
url: this.opts.url,
params: this.opts.params,
fileKey: this.opts.fileKey,
name: name,
size: (ref1 = fileObj.fileSize) != null ? ref1 : fileObj.size,
ext: name ? name.split('.').pop().toLowerCase() : '',
obj: fileObj
};
};
Uploader.prototype._xhrUpload = function(file) {
var formData, k, ref, v;
formData = new FormData();
formData.append(file.fileKey, file.obj);
formData.append("original_filename", file.name);
if (file.params) {
ref = file.params;
for (k in ref) {
v = ref[k];
formData.append(k, v);
}
}
return file.xhr = $.ajax({
url: file.url,
data: formData,
processData: false,
contentType: false,
type: 'POST',
headers: {
'X-File-Name': encodeURIComponent(file.name)
},
xhr: function() {
var req;
req = $.ajaxSettings.xhr();
if (req) {
req.upload.onprogress = (function(_this) {
return function(e) {
return _this.progress(e);
};
})(this);
}
return req;
},
progress: (function(_this) {
return function(e) {
if (!e.lengthComputable) {
return;
}
return _this.trigger('uploadprogress', [file, e.loaded, e.total]);
};
})(this),
error: (function(_this) {
return function(xhr, status, err) {
return _this.trigger('uploaderror', [file, xhr, status]);
};
})(this),
success: (function(_this) {
return function(result) {
_this.trigger('uploadprogress', [file, file.size, file.size]);
_this.trigger('uploadsuccess', [file, result]);
return $(document).trigger('uploadsuccess', [file, result, _this]);
};
})(this),
complete: (function(_this) {
return function(xhr, status) {
return _this.trigger('uploadcomplete', [file, xhr.responseText]);
};
})(this)
});
};
Uploader.prototype.cancel = function(file) {
var f, i, len, ref;
if (!file.id) {
ref = this.files;
for (i = 0, len = ref.length; i < len; i++) {
f = ref[i];
if (f.id === file * 1) {
file = f;
break;
}
}
}
this.trigger('uploadcancel', [file]);
if (file.xhr) {
file.xhr.abort();
}
return file.xhr = null;
};
Uploader.prototype.readImageFile = function(fileObj, callback) {
var fileReader, img;
if (!$.isFunction(callback)) {
return;
}
img = new Image();
img.onload = function() {
return callback(img);
};
img.onerror = function() {
return callback();
};
if (window.FileReader && FileReader.prototype.readAsDataURL && /^image/.test(fileObj.type)) {
fileReader = new FileReader();
fileReader.onload = function(e) {
return img.src = e.target.result;
};
return fileReader.readAsDataURL(fileObj);
} else {
return callback();
}
};
Uploader.prototype.destroy = function() {
var file, i, len, ref;
this.queue.length = 0;
ref = this.files;
for (i = 0, len = ref.length; i < len; i++) {
file = ref[i];
this.cancel(file);
}
$(window).off('.uploader-' + this.id);
return $(document).off('.uploader-' + this.id);
};
Uploader.i18n = {
'zh-CN': {
leaveConfirm: '正在上传文件,如果离开上传会自动取消'
}
};
Uploader.locale = 'zh-CN';
return Uploader;
})(SimpleModule);
uploader = function(opts) {
return new Uploader(opts);
};
return uploader;
}));
This diff is collapsed.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>测试Gzip</title>
</head>
<body>
<script type="text/javascript" src="gzip.js"></script>
<script src="https://cdn.staticfile.org/pako/1.0.10/pako.min.js"></script>
<script>
// 解压
function unzip(b64Data){
var strData = atob(b64Data);
// Convert binary string to character-number array
var charData = strData.split('').map(function(x){return x.charCodeAt(0);});
// Turn number array into byte-array
var binData = new Uint8Array(charData);
// // unzip
var data = pako.inflate(binData);
// Convert gunzipped byteArray back to ascii string:
strData = String.fromCharCode.apply(null, new Uint16Array(data));
return strData;
}
RE.currentSelection = {
"startContainer": 0,
"startOffset": 0,
"endContainer": 0,
"endOffset": 0};
function callJS(code){
alert("Android调用了JS的callJS方法"+code);
}
</script>
</body>
</html>
\ No newline at end of file
var RE = {};
RE.unzip = function unzip(b64Data) {
alert('5');
let strData = atob(b64Data);
const charData = strData.split('').map(function (x) {
return x.charCodeAt(0);
});
const binData = new Uint8Array(charData);
const data = pako.inflate(binData);
strData = String.fromCharCode.apply(null, new Uint16Array(data));
return decodeURIComponent(strData);
}
\ No newline at end of file
package com.bxzk.afxj.Contract;
import com.bxzk.afxj.Entity.LoginBeanOut;
import com.bxzk.afxj.View.BaseActivity.BaseImp;
public interface LoginContract {
interface View extends BaseImp
{
void onLogin(LoginBeanOut loginBeanOut);
}
}
package com.bxzk.afxj.Contract;
import com.bxzk.afxj.View.BaseActivity.BaseImp;
import java.util.List;
public interface RefreshImp<T> extends BaseImp {
void refresh(List<T> taskListBeanOuts);
void loadMore(List<T> taskListBeanOuts);
}
package com.bxzk.afxj.Contract;
import com.bxzk.afxj.View.BaseActivity.BaseImp;
public interface RegisterContract {
interface View extends BaseImp
{
void onRegister();
void sendSuc();
}
}
package com.bxzk.afxj.DaggerComponent;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import javax.inject.Scope;
@Scope
@Retention(RetentionPolicy.RUNTIME)
public @interface ActivityScope {
}
package com.bxzk.afxj.DaggerComponent;
import com.bxzk.afxj.DaggerComponent.Module.MyServicesModule;
import com.bxzk.afxj.DaggerComponent.Module.OkhttpModule;
import com.bxzk.afxj.DaggerComponent.Module.RetrofitModule;
import com.bxzk.afxj.DaggerComponent.Module.RxbusModule;
import javax.inject.Singleton;
import dagger.Component;
@Singleton
@Component(modules ={ BaseModule.class, OkhttpModule.class, RetrofitModule.class, MyServicesModule.class, RxbusModule.class})
public interface BaseComponent {
// LginData provideLgin();
MainComponent addSub(MainModule mainModule);
}
package com.bxzk.afxj.DaggerComponent;
import android.content.Context;
import com.bxzk.afxj.util.SPUtils;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
@Module
public class BaseModule {
private Context context;
public BaseModule(Context context) {
this.context = context;
}
@Singleton
@Provides
public SPUtils providerSpUtils (Context context) {
return new SPUtils(context);
}
@Singleton
@Provides
public Context provierContext() {
return context;
}
/*
@Singleton
@Provides
LginData provideLgin() {
return new LginData();
}*/
}
package com.bxzk.afxj.DaggerComponent;
import com.bxzk.afxj.View.LoginAct;
import dagger.Subcomponent;
@ActivityScope
@Subcomponent(modules = {MainModule.class})
public interface MainComponent {
void inject(LoginAct loginAct);
}
package com.bxzk.afxj.DaggerComponent;
import com.bxzk.afxj.View.BaseActivity.BaseBarActivity;
import com.bxzk.afxj.View.BaseActivity.BaseFragment;
import com.bxzk.afxj.retrofit.HomeBean;
import com.bxzk.afxj.retrofit.News;
import dagger.Module;
import dagger.Provides;
@Module
public class MainModule {
private BaseBarActivity b;
private BaseFragment c;
public MainModule(BaseFragment c) {
this.c = c;
}
public MainModule(BaseBarActivity b) {
this.b = b;
}
public MainModule() {
}
@ActivityScope
@Provides
News provideLgin() {
return new News();
}
@ActivityScope
@Provides
HomeBean privateHomeBean(){
return new HomeBean();
}
}
package com.bxzk.afxj.DaggerComponent.Module;
import dagger.Module;
@Module
public class ContractModule {
}
package com.bxzk.afxj.DaggerComponent.Module;
import com.bxzk.afxj.retrofit.DownloadService;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import retrofit2.Retrofit;
@Module
public class MyServicesModule {
@Singleton
@Provides
DownloadService provideServices(Retrofit retrofit) {
return retrofit.create(DownloadService.class);
}
}
package com.bxzk.afxj.DaggerComponent.Module;
import com.bxzk.afxj.retrofit.DownloadUtils;
import com.bxzk.afxj.retrofit.RxDownloadInterceptor;
import com.bxzk.afxj.retrofit.RxDownloadListener;
import javax.inject.Named;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
@Module
public class OkhttpModule {
private RxDownloadListener listener;
public OkhttpModule(RxDownloadListener listener) {
this.listener = listener;
}
public OkhttpModule() {
}
@Singleton
@Provides
public DownloadUtils providerDownUtils(Retrofit retrofit) {
return new DownloadUtils(listener,retrofit);
}
@Singleton
@Provides
@Named("down")
public OkHttpClient providerDownOkhttpClient() {
RxDownloadInterceptor mInterceptor = new RxDownloadInterceptor(listener);
/* HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);*/
OkHttpClient client = new OkHttpClient.Builder()
//添加应用拦截器
.addInterceptor(mInterceptor)
//添加网络拦截器
// .addNetworkInterceptor(interceptor)
.build();
return client;
}
}
package com.bxzk.afxj.DaggerComponent.Module;
import javax.inject.Named;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
@Module
public class RetrofitModule {
@Singleton
@Provides
public Retrofit providerRetrofit(@Named("default")OkHttpClient okHttpClient) {
return new Retrofit.Builder()
.baseUrl("http://www.wanandroid.com/blogimgs/")
//将client与retrofit关联
.client(okHttpClient)
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create())
.build();
}
}
package com.bxzk.afxj.DaggerComponent.Module;
import com.bxzk.afxj.retrofit.RxBus;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
@Module
public class RxbusModule {
@Singleton
@Provides
RxBus provideRxbus() {
return new RxBus();
}
}
package com.bxzk.afxj;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.util.Log;
import org.greenrobot.greendao.AbstractDaoMaster;
import org.greenrobot.greendao.database.StandardDatabase;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseOpenHelper;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* Master of DAO (schema version 1): knows all DAOs.
*/
public class DaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 1;
/** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) {
UserDao.createTable(db, ifNotExists);
}
/** Drops underlying database table using DAOs. */
public static void dropAllTables(Database db, boolean ifExists) {
UserDao.dropTable(db, ifExists);
}
/**
* WARNING: Drops all table on Upgrade! Use only during development.
* Convenience method using a {@link DevOpenHelper}.
*/
public static DaoSession newDevSession(Context context, String name) {
Database db = new DevOpenHelper(context, name).getWritableDb();
DaoMaster daoMaster = new DaoMaster(db);
return daoMaster.newSession();
}
public DaoMaster(SQLiteDatabase db) {
this(new StandardDatabase(db));
}
public DaoMaster(Database db) {
super(db, SCHEMA_VERSION);
registerDaoClass(UserDao.class);
}
public DaoSession newSession() {
return new DaoSession(db, IdentityScopeType.Session, daoConfigMap);
}
public DaoSession newSession(IdentityScopeType type) {
return new DaoSession(db, type, daoConfigMap);
}
/**
* Calls {@link #createAllTables(Database, boolean)} in {@link #onCreate(Database)} -
*/
public static abstract class OpenHelper extends DatabaseOpenHelper {
public OpenHelper(Context context, String name) {
super(context, name, SCHEMA_VERSION);
}
public OpenHelper(Context context, String name, CursorFactory factory) {
super(context, name, factory, SCHEMA_VERSION);
}
@Override
public void onCreate(Database db) {
Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION);
createAllTables(db, false);
}
}
/** WARNING: Drops all table on Upgrade! Use only during development. */
public static class DevOpenHelper extends OpenHelper {
public DevOpenHelper(Context context, String name) {
super(context, name);
}
public DevOpenHelper(Context context, String name, CursorFactory factory) {
super(context, name, factory);
}
@Override
public void onUpgrade(Database db, int oldVersion, int newVersion) {
Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables");
dropAllTables(db, true);
onCreate(db);
}
}
}
package com.bxzk.afxj;
import java.util.Map;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;
import com.bxzk.afxj.database.bean.User;
import com.bxzk.afxj.UserDao;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* {@inheritDoc}
*
* @see org.greenrobot.greendao.AbstractDaoSession
*/
public class DaoSession extends AbstractDaoSession {
private final DaoConfig userDaoConfig;
private final UserDao userDao;
public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
daoConfigMap) {
super(db);
userDaoConfig = daoConfigMap.get(UserDao.class).clone();
userDaoConfig.initIdentityScope(type);
userDao = new UserDao(userDaoConfig, this);
registerDao(User.class, userDao);
}
public void clear() {
userDaoConfig.clearIdentityScope();
}
public UserDao getUserDao() {
return userDao;
}
}
package com.bxzk.afxj.Entity;
public class BaseEventBusBean<T> {
T data;
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
private boolean isPost;//
public boolean isPost() {
return isPost;
}
public void setPost(boolean post) {
isPost = post;
}
}
package com.bxzk.afxj.Entity;
public class BaseEventBusBean1<T> {
T data;
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}
package com.bxzk.afxj.Entity;
public class BaseListBean {
/**
* RecordCount : 0
* count : 0
* pageCount : 0
* pageIndex : 0
* pageSize : 0
*/
private int recordCount;
private int count;
private int pageCount;
private int pageIndex;
private int pageSize;
public int getRecordCount() {
return recordCount;
}
public void setRecordCount(int recordCount) {
this.recordCount = recordCount;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public int getPageCount() {
return pageCount;
}
public void setPageCount(int pageCount) {
this.pageCount = pageCount;
}
public int getPageIndex() {
return pageIndex;
}
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
}
package com.bxzk.afxj.Entity;
public class BaseResponse<T> {
T result;
int code = -1;
int RecordCount;
int Count;
int PageCount;
int PageIndex;
int PageSize;
String Msg;
String msg;
public int getReturnCode() {
return code;
}
public String getMessage() {
return msg;
}
public T getData() {
return result;
}
public boolean isSuccess() {
return code == 200;
}
@Override
public String toString() {
return this.msg + ",code:"+ code +",data:"+ result;
}
}
package com.bxzk.afxj.Entity;
public class BaseResponse1<T> {
int code;
String msg;
public int getCode() {
return code;
}
/**
* RecordCount : 0
* count : 0
* pageCount : 0
* pageIndex : 0
* pageSize : 0
*/
private int recordCount;
private int count;
private int pageCount;
private int pageIndex;
private int pageSize;
public String getMassage() {
return msg;
}
public boolean isSuccess() {
return code == 200;
}
private T result;//主要内容,因为不知道返回的会是什么类型,所以用泛型来表示
public T getData() {
return result;
}
public int getRecordCount() {
return recordCount;
}
public void setRecordCount(int recordCount) {
this.recordCount = recordCount;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public int getPageCount() {
return pageCount;
}
public void setPageCount(int pageCount) {
this.pageCount = pageCount;
}
public int getPageIndex() {
return pageIndex;
}
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
}
package com.bxzk.afxj.Entity;
public class LoginBeanOut {
private String token;
private float version;
private long version_time;
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public float getVersion() {
return version;
}
public long getVersion_time() {
return version_time;
}
public void setVersion_time(long version_time) {
this.version_time = version_time;
}
public void setVersion(float version) {
this.version = version;
}
}
package com.bxzk.afxj.Manage;
import android.app.Activity;
import java.util.ArrayList;
import java.util.List;
/**
* 创建人 Daniel
* 时间 2018/11/1.
* 简介 xxx
*/
public class ActivityManager {
private static ActivityManager CLASS_NAME;
public static List<Activity> activities = new ArrayList<>();
public static synchronized ActivityManager getInstance() {
if (CLASS_NAME == null) {
synchronized (ActivityManager.class) {
if (CLASS_NAME == null) {
CLASS_NAME = new ActivityManager();
}
}
}
return CLASS_NAME;
}
public void addActivity(Activity activity) {
activities.add(activity);
}
public void finishActivity(Activity activity) {
activity.finish();
}
public void removeActivity(Activity activity) {
activities.remove(activity);
}
public void removeAllActivity() {
for (Activity activity : activities) {
activity.finish();
}
}
public void finishActivityByName(String activityName) {
for (Activity activity : activities) {
if (activity.getClass().getSimpleName().equals(activityName)) {
activity.finish();
return;
}
}
}
public void finishActivities(int num) {
for (int i = activities.size() - num - 1; i < activities.size(); i++) {
activities.get(i).finish();
}
}
}
package com.bxzk.afxj.Model;
import com.bxzk.afxj.Entity.BaseResponse;
import com.bxzk.afxj.Entity.LoginBeanOut;
import com.bxzk.afxj.retrofit.ApiManager;
import com.bxzk.afxj.retrofit.ModelFilteredFactory;
import com.bxzk.afxj.util.CommonUtil;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import io.reactivex.Observable;
import okhttp3.RequestBody;
public class LoginModel {
@Inject
public LoginModel() {
}
public Observable<LoginBeanOut> login(String info) {
// Observable<BaseResponse<LoginBeanOut>> register = ApiManager.getInstence().getYunxService().login(info);
Observable<BaseResponse<LoginBeanOut>> register = null;
Observable<LoginBeanOut> booleanObservable = ModelFilteredFactory.compose2(register);
return booleanObservable;
}
}
package com.bxzk.afxj.Presenter;
import com.bxzk.afxj.Contract.LoginContract;
import com.bxzk.afxj.Entity.LoginBeanOut;
import com.bxzk.afxj.Model.LoginModel;
import com.bxzk.afxj.View.BaseActivity.BasePresenter;
import com.bxzk.afxj.retrofit.SimpleSubscriber;
import com.bxzk.afxj.util.SPULoginUtil;
import javax.inject.Inject;
import io.reactivex.Observable;
public class LoginPresenter extends BasePresenter<LoginContract.View> {
@Inject
LoginModel model;
@Inject
public LoginPresenter() {
model = new LoginModel();
}
public void login(String info) {
Observable<LoginBeanOut> loginObs = model.login(info);
loginObs.compose(getView().bindLifecycle()).subscribe(new SimpleSubscriber<LoginBeanOut>() {
@Override
public void call(LoginBeanOut loginBeanOut) {
getView().onLogin(loginBeanOut);
SPULoginUtil.saveLogin1(loginBeanOut);
}
});
}
}
package com.bxzk.afxj.Service;
public class MyJPushMessageReceiver {
}
package com.bxzk.afxj.Service;
public class MyJPushService {
}
package com.bxzk.afxj;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.internal.DaoConfig;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import com.bxzk.afxj.database.bean.User;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* DAO for table "USER".
*/
public class UserDao extends AbstractDao<User, Long> {
public static final String TABLENAME = "USER";
/**
* Properties of entity User.<br/>
* Can be used for QueryBuilder and for referencing column names.
*/
public static class Properties {
public final static Property Id = new Property(0, Long.class, "id", true, "_id");
public final static Property UserId = new Property(1, String.class, "userId", false, "USER_ID");
public final static Property UserName = new Property(2, String.class, "userName", false, "USER_NAME");
public final static Property Age = new Property(3, int.class, "age", false, "AGE");
}
public UserDao(DaoConfig config) {
super(config);
}
public UserDao(DaoConfig config, DaoSession daoSession) {
super(config, daoSession);
}
/** Creates the underlying database table. */
public static void createTable(Database db, boolean ifNotExists) {
String constraint = ifNotExists? "IF NOT EXISTS ": "";
db.execSQL("CREATE TABLE " + constraint + "\"USER\" (" + //
"\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id
"\"USER_ID\" TEXT UNIQUE ," + // 1: userId
"\"USER_NAME\" TEXT," + // 2: userName
"\"AGE\" INTEGER NOT NULL );"); // 3: age
}
/** Drops the underlying database table. */
public static void dropTable(Database db, boolean ifExists) {
String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"USER\"";
db.execSQL(sql);
}
@Override
protected final void bindValues(DatabaseStatement stmt, User entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String userId = entity.getUserId();
if (userId != null) {
stmt.bindString(2, userId);
}
String userName = entity.getUserName();
if (userName != null) {
stmt.bindString(3, userName);
}
stmt.bindLong(4, entity.getAge());
}
@Override
protected final void bindValues(SQLiteStatement stmt, User entity) {
stmt.clearBindings();
Long id = entity.getId();
if (id != null) {
stmt.bindLong(1, id);
}
String userId = entity.getUserId();
if (userId != null) {
stmt.bindString(2, userId);
}
String userName = entity.getUserName();
if (userName != null) {
stmt.bindString(3, userName);
}
stmt.bindLong(4, entity.getAge());
}
@Override
public Long readKey(Cursor cursor, int offset) {
return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
}
@Override
public User readEntity(Cursor cursor, int offset) {
User entity = new User( //
cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id
cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // userId
cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // userName
cursor.getInt(offset + 3) // age
);
return entity;
}
@Override
public void readEntity(Cursor cursor, User entity, int offset) {
entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
entity.setUserId(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
entity.setUserName(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
entity.setAge(cursor.getInt(offset + 3));
}
@Override
protected final Long updateKeyAfterInsert(User entity, long rowId) {
entity.setId(rowId);
return rowId;
}
@Override
public Long getKey(User entity) {
if(entity != null) {
return entity.getId();
} else {
return null;
}
}
@Override
public boolean hasKey(User entity) {
return entity.getId() != null;
}
@Override
protected final boolean isEntityUpdateable() {
return true;
}
}
package com.bxzk.afxj.View.BaseActivity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;
import com.bxzk.afxj.R;
import com.bxzk.afxj.util.ToastUtils;
import java.util.ArrayList;
import java.util.List;
import cn.bingoogolapple.swipebacklayout.BGASwipeBackHelper;
public abstract class BaseActivity extends RxAppCompatActivity implements BGASwipeBackHelper.Delegate {
private boolean isAlive = false;
private static final int PERMISSION_CODE = 1010;
private List<String> mPermission;
private boolean mContinueRequest = false;
private int mRequestCount = 0;
// protected List<String> threadNameList;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
initSwipeBackFinish();
super.onCreate(savedInstanceState);
super.setContentView(setBaseContextView());
initFirst();
// threadNameList = new ArrayList<String>();
initView(savedInstanceState);
Log.e("TAG","CLASSNAME"+getClass().getSimpleName());
}
protected abstract void initFirst();
protected abstract int setBaseContextView();
//初始化所有控件
public abstract void initView(@Nullable Bundle savedInstanceState);
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void onDestroy() {
super.onDestroy();
isAlive = false;
// threadNameList = null;
// ThreadManager.getInstance().destroyThread(threadNameList);
}
/**
* @param continueRequest 是否持续请求
* @param permissions 需要请求的权限
*/
public void requestBasePermissions(boolean continueRequest, String... permissions) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (mRequestCount >= 3){
ToastUtils.showToast(this, R.string.open_setting);
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", getPackageName(), null);
intent.setData(uri);
startActivityForResult(intent, 200);
}
mContinueRequest = continueRequest;
for (String permission : permissions) {
if (checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED) {
if (mPermission == null) {
mPermission = new ArrayList<>();
}
mPermission.add(permission);
}
}
if (mPermission != null && mPermission.size() > 0) {
String[] strings = new String[mPermission.size()];
requestPermissions(mPermission.toArray(strings), PERMISSION_CODE);
mRequestCount ++ ;
}else{
requestPermissionSuccess();
}
}else{
requestPermissionSuccess();
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == PERMISSION_CODE) {
mPermission.clear();
if (grantResults.length > 0) {
List<String> dangerPermissions = new ArrayList<>();
for (int i = 0; i < grantResults.length; i++) {
if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {
dangerPermissions.add(permissions[i]);
}
}
dangerPermission(dangerPermissions);
} else {
requestPermissionSuccess();
}
}
}
public void dangerPermission(List<String> dangerPermissions) {
if (mContinueRequest) {
requestBasePermissions(true, dangerPermissions.toArray(new String[dangerPermissions.size()]));
} else {
for (String dangerPermission : dangerPermissions) {
}
}
}
public void requestPermissionSuccess(){
}
protected BGASwipeBackHelper mSwipeBackHelper;
private void initSwipeBackFinish() {
mSwipeBackHelper = new BGASwipeBackHelper(this, this);
// 「必须在 Application 的 onCreate 方法中执行 BGASwipeBackHelper.init 来初始化滑动返回」
// 下面几项可以不配置,这里只是为了讲述接口用法。
// 设置滑动返回是否可用。默认值为 true
mSwipeBackHelper.setSwipeBackEnable(true);
// 设置是否仅仅跟踪左侧边缘的滑动返回。默认值为 true
mSwipeBackHelper.setIsOnlyTrackingLeftEdge(false);
// 设置是否是微信滑动返回样式。默认值为 true
mSwipeBackHelper.setIsWeChatStyle(true);
// 设置阴影资源 id。默认值为 R.drawable.bga_sbl_shadow
// mSwipeBackHelper.setShadowResId(R.drawable.bga_sbl_shadow);
// 设置是否显示滑动返回的阴影效果。默认值为 true
mSwipeBackHelper.setIsNeedShowShadow(true);
// 设置阴影区域的透明度是否根据滑动的距离渐变。默认值为 true
mSwipeBackHelper.setIsShadowAlphaGradient(true);
// 设置触发释放后自动滑动返回的阈值,默认值为 0.3f
mSwipeBackHelper.setSwipeBackThreshold(0.3f);
// 设置底部导航条是否悬浮在内容上,默认值为 false
mSwipeBackHelper.setIsNavigationBarOverlap(false);
}
/**
* 是否支持滑动返回。这里在父类中默认返回 true 来支持滑动返回,如果某个界面不想支持滑动返回则重写该方法返回 false 即可
*
* @return
*/
@Override
public boolean isSupportSwipeBack() {
return false;
}
/**
* 正在滑动返回
*
* @param slideOffset 从 0 到 1
*/
@Override
public void onSwipeBackLayoutSlide(float slideOffset) {
Log.e("yunxun","slideOffset:"+slideOffset);
}
/**
* 没达到滑动返回的阈值,取消滑动返回动作,回到默认状态
*/
@Override
public void onSwipeBackLayoutCancel() {
}
/**
* 滑动返回执行完毕,销毁当前 Activity
*/
@Override
public void onSwipeBackLayoutExecuted() {
mSwipeBackHelper.swipeBackward();
}
@Override
public void onBackPressed() {
// 正在滑动返回的时候取消返回按钮事件
/*if (mSwipeBackHelper.isSliding()) {
return;
}
mSwipeBackHelper.backward();*/
super.onBackPressed();
}
}
package com.bxzk.afxj.View.BaseActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.RelativeLayout;
import androidx.annotation.Nullable;
import com.tsy.sdk.myokhttp.util.LogUtils;
import com.bxzk.afxj.DaggerComponent.MainComponent;
import com.bxzk.afxj.DaggerComponent.MainModule;
import com.bxzk.afxj.R;
import com.bxzk.afxj.application.BApplication;
import com.bxzk.afxj.util.EventBusUtils;
import javax.inject.Inject;
import butterknife.ButterKnife;
//import com.shuanglu.green.dyf.DaggerComponent.DaggerMainComponent;
public abstract class BaseBarActivity<V, T extends BasePresenter<V>> extends BaseActivity {
public RelativeLayout rl_title;
@Inject
protected T mPresenter;
public View emptyvie;
public View emptyvie1;
protected View emptyvie_net;
protected boolean disableBack; //是否禁用返回
//Dagger2封装
protected MainComponent getActivityComponent() {
return BApplication.getBaseComponent().addSub(new MainModule(this));
}
@Override
protected void initFirst() {
inject();
if (null != mPresenter) {
mPresenter.attachView((V) this);
}
}
@Override
public void initView(@Nullable Bundle savedInstanceState) {
// emptyvie = View.inflate(this, R.layout.emptyview_data, null);
ButterKnife.bind(this);
initLHView(savedInstanceState);
initValue(savedInstanceState);
/* int x = (int) SPUtils.get(BApplication.getContext(), SpManage.Language,0);
LanguageUtils.switchLanguage(x);*/
LogUtils.e("BaseActivity", getClass().getName());
}
protected abstract void initLHView(@Nullable Bundle savedInstanceState);
public abstract void initValue(@Nullable Bundle savedInstanceState);
public abstract void inject();
@Override
public void onDestroy() {
super.onDestroy();
emptyvie1 = null;
emptyvie = null;
emptyvie_net = null;
if (null != mPresenter) {
mPresenter.detachView();
}
}
protected boolean interrupt;
}
package com.bxzk.afxj.View.BaseActivity;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.trello.rxlifecycle2.components.support.RxFragment;
import com.bxzk.afxj.DaggerComponent.MainComponent;
import com.bxzk.afxj.DaggerComponent.MainModule;
import com.bxzk.afxj.R;
import com.bxzk.afxj.application.BApplication;
import javax.inject.Inject;
import butterknife.ButterKnife;
import butterknife.Unbinder;
public abstract class BaseFragment<V,T extends BasePresenter<V>> extends RxFragment {
private int resId;
protected View view;
private Unbinder binder;
protected Activity activity;
private boolean isAlive;
private BaseActivity context = null;
private boolean isRunning;
private boolean isBindData;
protected LinearLayout ll_content;
private View mContentView;
public View emptyvie;
@Inject
protected T fPresenter;
private boolean isVisible;//是否可见
public BaseFragment() {
}
protected MainComponent getActivityComponent() {
return BApplication.getBaseComponent().addSub(new MainModule(this));
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
isAlive = true;
context = (BaseActivity) getActivity();
inject();
if(null != fPresenter) {
fPresenter.attachView((V)this);
}
if (resId == 0) {
// emptyvie = View.inflate(context, R.layout.emptyview_data, null);
mContentView = View.inflate(context, setBaseContextView(), null);
binder = ButterKnife.bind(this, mContentView);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
mContentView.setLayoutParams(layoutParams);
ll_content.addView(mContentView);
initView();
initListener();
initValue();
} else {
view = null;
}
return view;
}
protected abstract void inject();
protected abstract int setBaseContextView();
public Context getContext() {
if (activity == null) {
return BApplication.getInstances();
}
return activity;
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
activity = getActivity();
}
protected abstract void initValue();
protected void initListener() {
}
protected abstract void initView();
public final boolean isAlive() {
return isAlive && context != null;// & ! isRemoving();导致finish,onDestroy内runUiThread不可用
}
@Override
public void onDestroyView() {
super.onDestroyView();
if(null != fPresenter){
fPresenter.detachView();
}
binder.unbind();
}
@Override
public void onPause() {
super.onPause();
isRunning = false;
}
@Override
public void onResume() {
super.onResume();
isRunning = true;
}
@Override
public void onDestroy() {
if (view != null) {
try {
view.destroyDrawingCache();
} catch (Exception e) {
e.printStackTrace();
}
}
isAlive = false;
isRunning = false;
super.onDestroy();
view = null;
context = null;
}
/**快捷显示short toast方法,需要long toast就用 Toast.makeText(string, Toast.LENGTH_LONG).show(); ---不常用所以这个类里不写
* @param string
*/
public void showShortToast(String string) {
if (isAlive() == false) {
return;
}
}
public void requestBasePermissions(boolean continueRequest, String... permissions) {
if (isAlive() == false) {
return;
}
context.requestBasePermissions(continueRequest,permissions);
}
protected View removeContent() {
ll_content.removeView(mContentView);
return mContentView;
}
protected void recoverContent() {
ll_content.addView(mContentView);
}
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if(getUserVisibleHint()) {
isVisible = true;
onVisible();
} else {
isVisible = false;
onInvisible();
}
}
/**
* 可见
*/
protected void onVisible() {
// lazyLoad();
}
/**
* 不可见
*/
protected void onInvisible() {
}
//网络请求 在切换tab调用
public void netReq() {
}
}
package com.bxzk.afxj.View.BaseActivity;
import com.trello.rxlifecycle2.LifecycleTransformer;
public interface BaseImp {
LifecycleTransformer bindLifecycle();
}
package com.bxzk.afxj.View.BaseActivity;
public interface BaseNet {
void reqNet();
}
package com.bxzk.afxj.View.BaseActivity;
import android.content.Context;
import com.bxzk.afxj.application.BApplication;
import java.lang.ref.WeakReference;
public abstract class BasePresenter<T> {
protected Context mContext = BApplication.getContext();
protected WeakReference<T> mViewInterface;
public void attachView(T view) {
mViewInterface = new WeakReference<T>(view);
}
public T getView() {
return mViewInterface.get();
}
public boolean isAttached() {
return mViewInterface != null && mViewInterface.get() != null;
}
public void detachView() {
if(mViewInterface != null) {
mViewInterface.clear();
// OkGo.getInstance().cancelTag(getView());
mViewInterface = null;
}
}
}
package com.bxzk.afxj.View.BaseActivity;
import java.util.List;
public interface BaseRefreshImp<T> extends BaseImp{
void showList(List<T> data);
void showMore(List<T> data);
void showRefresh(List<T> data);
}
package com.bxzk.afxj.View;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class BootCompleteReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if(Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())){
Intent thisIntent = new Intent(context, LoginAct.class);
thisIntent.setAction("android.intent.action.MAIN");
thisIntent.addCategory("android.intent.category.LAUNCHER");
thisIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(thisIntent);
}
}
}
\ No newline at end of file
package com.bxzk.afxj.View.Holder.webview;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
public class ConfigerManagner {
private static ConfigerManagner configManger;
private static Context context;
ConfigerManagner(Context context) {
this.context = context.getApplicationContext();
}
public static ConfigerManagner getInstance(Context context) {
if (configManger == null) {
configManger = new ConfigerManagner(context);
}
return configManger;
}
protected SharedPreferences getMySharedPreferences() {
return PreferenceManager.getDefaultSharedPreferences(context);
}
public boolean setString(String name, String value) {
return getMySharedPreferences().edit().putString(name, value).commit();
}
public String getString(String name) {
return getMySharedPreferences().getString(name, "");
}
}
\ No newline at end of file
package com.bxzk.afxj.View.Holder.webview;
import android.annotation.SuppressLint;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
/**
* Created by 53kf on 2017/11/7.
*/
public class ContentUtil {
@SuppressLint("NewApi")
public static String getPath(final Context context, final Uri uri) {
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
// DocumentProvider
if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
// ExternalStorageProvider
if (isExternalStorageDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
if ("primary".equalsIgnoreCase(type)) {
return String.format("%s/%s", Environment.getExternalStorageDirectory().getPath(), split[1]);
}
// TODO handle non-primary volumes
}
// DownloadsProvider
else if (isDownloadsDocument(uri)) {
final String id = DocumentsContract.getDocumentId(uri);
final Uri contentUri = ContentUris.withAppendedId(
Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
return getDataColumn(context, contentUri, null, null);
}
// MediaProvider
else if (isMediaDocument(uri)) {
final String docId = DocumentsContract.getDocumentId(uri);
final String[] split = docId.split(":");
final String type = split[0];
Uri contentUri = null;
if ("image".equals(type)) {
contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
} else if ("video".equals(type)) {
contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
} else if ("audio".equals(type)) {
contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
}
final String selection = "_id=?";
final String[] selectionArgs = new String[]{split[1]};
return getDataColumn(context, contentUri, selection, selectionArgs);
}
}
// MediaStore (and general)
else if ("content".equalsIgnoreCase(uri.getScheme())) {
// Return the remote address
if (isGooglePhotosUri(uri)) {
return uri.getLastPathSegment();
}
return getDataColumn(context, uri, null, null);
}
// File
else if ("file".equalsIgnoreCase(uri.getScheme())) {
return uri.getPath();
}
return null;
}
/**
* Get the value of the data column for this Uri. This is useful for
* MediaStore Uris, and other file-based ContentProviders.
*
* @param context The context.
* @param uri The Uri to query.
* @param selection (Optional) Filter used in the query.
* @param selectionArgs (Optional) Selection arguments used in the query.
* @return The value of the _data column, which is typically a file path.
*/
public static String getDataColumn(Context context, Uri uri, String selection, String[] selectionArgs) {
Cursor cursor = null;
try {
cursor = context.getContentResolver().query(uri, new String[]{MediaStore.Images.Media.DATA}
, selection, selectionArgs, null);
if (cursor != null && cursor.moveToFirst()) {
final int index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
return cursor.getString(index);
}
} finally {
if (cursor != null) {
cursor.close();
}
}
return null;
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is ExternalStorageProvider.
*/
public static boolean isExternalStorageDocument(Uri uri) {
return "com.android.externalstorage.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is DownloadsProvider.
*/
public static boolean isDownloadsDocument(Uri uri) {
return "com.android.providers.downloads.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is MediaProvider.
*/
public static boolean isMediaDocument(Uri uri) {
return "com.android.providers.media.documents".equals(uri.getAuthority());
}
/**
* @param uri The Uri to check.
* @return Whether the Uri authority is Google Photos.
*/
public static boolean isGooglePhotosUri(Uri uri) {
return "com.google.android.apps.photos.content".equals(uri.getAuthority());
}
}
\ No newline at end of file
package com.bxzk.afxj.View.Holder.webview;
import android.app.Activity;
import android.content.Context;
import android.webkit.JavascriptInterface;
public class JSAndroid extends Object {
private Context context;
public JSAndroid(Context context) {
this.context=context;
}
private ConfigerManagner configerManagner;
@JavascriptInterface
public void openAndroid(String msg){
Activity activity = (Activity) context;
activity.finish();
}
@JavascriptInterface
public void writeData(String msg) {
configerManagner=ConfigerManagner.getInstance(context);
configerManagner.setString("js",msg);
}
@JavascriptInterface
public String giveInformation(String msg){
configerManagner=ConfigerManagner.getInstance(context);
String msg1= configerManagner.getString("js");
return msg1;
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
package com.bxzk.afxj.other;
import androidx.core.content.FileProvider;
public class BuglyFileProvider extends FileProvider {
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment