Commit bc25d7a6 by chengchong

Initial commit

parent 103093f3
......@@ -15,6 +15,7 @@
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/FastBleLib" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/library" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
apply plugin: 'com.android.library'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
minSdkVersion 14
......
-keep class java.util.function.ToDoubleFunction {
double applyAsDouble(java.lang.Object);
}
-keep class j$.util.Map { *; }
-keep class java.util.function.Function { *; }
-keep class j$.util.function.ToLongFunction { *; }
-keep class j$.util.function.BiConsumer { *; }
-keep class java.util.function.ToLongFunction {
long applyAsLong(java.lang.Object);
}
-keep class j$.util.function.Function { *; }
-keep class java.util.function.ToIntFunction {
int applyAsInt(java.lang.Object);
}
-keep class j$.util.function.ToDoubleFunction { *; }
-keep class j$.util.function.ToIntFunction { *; }
-keep class j$.util.Map$-CC {
boolean $default$replace(java.util.Map, java.lang.Object, java.lang.Object, java.lang.Object);
void $default$forEach(java.util.Map, j$.util.function.BiConsumer);
java.lang.Object $default$computeIfAbsent(java.util.Map, java.lang.Object, j$.util.function.Function);
java.lang.Object $default$putIfAbsent(java.util.Map, java.lang.Object, java.lang.Object);
java.lang.Object $default$getOrDefault(java.util.Map, java.lang.Object, java.lang.Object);
java.lang.Object $default$replace(java.util.Map, java.lang.Object, java.lang.Object);
java.lang.Object $default$computeIfPresent(java.util.Map, java.lang.Object, j$.util.function.BiFunction);
java.lang.Object $default$compute(java.util.Map, java.lang.Object, j$.util.function.BiFunction);
boolean $default$remove(java.util.Map, java.lang.Object, java.lang.Object);
java.lang.Object $default$merge(java.util.Map, java.lang.Object, java.lang.Object, j$.util.function.BiFunction);
void $default$replaceAll(java.util.Map, j$.util.function.BiFunction);
}
-keep class j$.util.function.BiFunction { *; }
-keep class j$.util.Comparator { *; }
-keep class java.util.function.BiConsumer { *; }
-keep class j$.util.Comparator$-CC {
java.util.Comparator $default$thenComparingLong(java.util.Comparator, j$.util.function.ToLongFunction);
java.util.Comparator $default$thenComparingDouble(java.util.Comparator, j$.util.function.ToDoubleFunction);
java.util.Comparator $default$reversed(java.util.Comparator);
java.util.Comparator $default$thenComparing(java.util.Comparator, j$.util.function.Function, java.util.Comparator);
java.util.Comparator $default$thenComparing(java.util.Comparator, j$.util.function.Function);
java.util.Comparator $default$thenComparingInt(java.util.Comparator, j$.util.function.ToIntFunction);
java.util.Comparator $default$thenComparing(java.util.Comparator, java.util.Comparator);
}
-keep class java.util.function.BiFunction {
java.util.function.BiFunction andThen(java.util.function.Function);
java.lang.Object apply(java.lang.Object, java.lang.Object);
}
-keep class java.util.function.ToDoubleFunction {
double applyAsDouble(java.lang.Object);
}
-keep class j$.util.Map { *; }
-keep class java.util.function.Function { *; }
-keep class j$.util.function.ToLongFunction { *; }
-keep class j$.util.function.BiConsumer { *; }
-keep class java.util.function.ToLongFunction {
long applyAsLong(java.lang.Object);
}
-keep class j$.util.function.Function { *; }
-keep class java.util.function.ToIntFunction {
int applyAsInt(java.lang.Object);
}
-keep class j$.util.function.ToDoubleFunction { *; }
-keep class j$.util.function.ToIntFunction { *; }
-keep class j$.util.Map$-CC {
boolean $default$replace(java.util.Map, java.lang.Object, java.lang.Object, java.lang.Object);
void $default$forEach(java.util.Map, j$.util.function.BiConsumer);
java.lang.Object $default$computeIfAbsent(java.util.Map, java.lang.Object, j$.util.function.Function);
java.lang.Object $default$putIfAbsent(java.util.Map, java.lang.Object, java.lang.Object);
java.lang.Object $default$getOrDefault(java.util.Map, java.lang.Object, java.lang.Object);
java.lang.Object $default$replace(java.util.Map, java.lang.Object, java.lang.Object);
java.lang.Object $default$computeIfPresent(java.util.Map, java.lang.Object, j$.util.function.BiFunction);
java.lang.Object $default$compute(java.util.Map, java.lang.Object, j$.util.function.BiFunction);
boolean $default$remove(java.util.Map, java.lang.Object, java.lang.Object);
java.lang.Object $default$merge(java.util.Map, java.lang.Object, java.lang.Object, j$.util.function.BiFunction);
void $default$replaceAll(java.util.Map, j$.util.function.BiFunction);
}
-keep class j$.util.function.BiFunction { *; }
-keep class j$.util.Comparator { *; }
-keep class java.util.function.BiConsumer { *; }
-keep class j$.util.Comparator$-CC {
java.util.Comparator $default$thenComparingLong(java.util.Comparator, j$.util.function.ToLongFunction);
java.util.Comparator $default$thenComparingDouble(java.util.Comparator, j$.util.function.ToDoubleFunction);
java.util.Comparator $default$reversed(java.util.Comparator);
java.util.Comparator $default$thenComparing(java.util.Comparator, j$.util.function.Function, java.util.Comparator);
java.util.Comparator $default$thenComparing(java.util.Comparator, j$.util.function.Function);
java.util.Comparator $default$thenComparingInt(java.util.Comparator, j$.util.function.ToIntFunction);
java.util.Comparator $default$thenComparing(java.util.Comparator, java.util.Comparator);
}
-keep class java.util.function.BiFunction {
java.util.function.BiFunction andThen(java.util.function.Function);
java.lang.Object apply(java.lang.Object, java.lang.Object);
}
......@@ -6,13 +6,7 @@ package com.clj.fastble;
public final class BuildConfig {
public static final boolean DEBUG = false;
public static final String LIBRARY_PACKAGE_NAME = "com.clj.fastble";
/**
* @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
*/
@Deprecated
public static final String APPLICATION_ID = "com.clj.fastble";
public static final String BUILD_TYPE = "release";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 232;
public static final String VERSION_NAME = "2.3.2";
}
......@@ -6,7 +6,7 @@
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="22" />
android:targetSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
......
[{"outputType":{"type":"AAPT_FRIENDLY_MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":232,"versionName":"2.3.2","enabled":true,"outputFile":"FastBleLib-release.aar","fullName":"release","baseName":"release","dirName":""},"path":"AndroidManifest.xml","properties":{"packageId":"com.clj.fastble","split":""}}]
\ No newline at end of file
{
"version": 1,
"applicationId": "com.clj.fastble",
"variantType": "LIBRARY",
"elements": [
{
"outputType": {
"type": "AAPT_FRIENDLY_MERGED_MANIFESTS"
},
"apkData": {
"type": "MAIN",
"splits": [],
"versionCode": 232,
"versionName": "2.3.2",
"outputFile": "FastBleLib-release.aar",
"fullName": "release",
"baseName": "release",
"dirName": ""
},
"path": "AndroidManifest.xml",
"properties": {
"packageId": "com.clj.fastble",
"split": ""
}
}
]
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/jniLibs"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/release/jniLibs"/></dataSet></merger>
\ No newline at end of file
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="D:\androidProject\BluToysApplication\FastBleLib\src\main\jniLibs"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="D:\androidProject\BluToysApplication\FastBleLib\src\release\jniLibs"/></dataSet></merger>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/shaders"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/release/shaders"/></dataSet></merger>
\ No newline at end of file
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="D:\androidProject\BluToysApplication\FastBleLib\src\main\shaders"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="D:\androidProject\BluToysApplication\FastBleLib\src\release\shaders"/></dataSet></merger>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/assets"/><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/build/intermediates/shader_assets/release/out"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/release/assets"/></dataSet></merger>
\ No newline at end of file
<merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="D:\androidProject\BluToysApplication\FastBleLib\src\main\assets"/><source path="D:\androidProject\BluToysApplication\FastBleLib\build\intermediates\shader_assets\release\out"/></dataSet><dataSet config="release" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="D:\androidProject\BluToysApplication\FastBleLib\src\release\assets"/></dataSet></merger>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/res"/><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/build/generated/res/rs/release"/><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/build/generated/res/resValues/release"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/res"/><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/build/generated/res/rs/release"/><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/build/generated/res/resValues/release"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="release$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/release/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="release" generated-set="release$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/release/res"/></dataSet><mergedItems/></merger>
\ No newline at end of file
<merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="D:\androidProject\BluToysApplication\FastBleLib\src\main\res"/><source path="D:\androidProject\BluToysApplication\FastBleLib\build\generated\res\rs\release"/><source path="D:\androidProject\BluToysApplication\FastBleLib\build\generated\res\resValues\release"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="D:\androidProject\BluToysApplication\FastBleLib\src\main\res"/><source path="D:\androidProject\BluToysApplication\FastBleLib\build\generated\res\rs\release"/><source path="D:\androidProject\BluToysApplication\FastBleLib\build\generated\res\resValues\release"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="release$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="D:\androidProject\BluToysApplication\FastBleLib\src\release\res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="release" generated-set="release$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="D:\androidProject\BluToysApplication\FastBleLib\src\release\res"/></dataSet><mergedItems/></merger>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="22" />
android:targetSdkVersion="30" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
......
......@@ -6,21 +6,21 @@
6
7 <uses-sdk
8 android:minSdkVersion="14"
8-->/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
9 android:targetSdkVersion="22" />
9-->/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
8-->D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
9 android:targetSdkVersion="30" />
9-->D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
10
11 <uses-permission android:name="android.permission.BLUETOOTH" />
11-->/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:4:5-68
11-->/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:4:22-65
11-->D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:4:5-68
11-->D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:4:22-65
12 <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
12-->/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:5:5-74
12-->/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:5:22-71
12-->D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:5:5-74
12-->D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:5:22-71
13 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
13-->/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:6:5-81
13-->/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:6:22-78
13-->D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:6:5-81
13-->D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:6:22-78
14 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
14-->/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:7:5-79
14-->/Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:7:22-76
14-->D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:7:5-79
14-->D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:7:22-76
15
16</manifest>
[{"outputType":{"type":"MERGED_MANIFESTS"},"apkData":{"type":"MAIN","splits":[],"versionCode":232,"versionName":"2.3.2","enabled":true,"outputFile":"FastBleLib-release.aar","fullName":"release","baseName":"release","dirName":""},"path":"../../library_manifest/release/AndroidManifest.xml","properties":{"packageId":"com.clj.fastble","split":""}}]
\ No newline at end of file
{
"version": 1,
"applicationId": "com.clj.fastble",
"variantType": "LIBRARY",
"elements": [
{
"outputType": {
"type": "MERGED_MANIFESTS"
},
"apkData": {
"type": "MAIN",
"splits": [],
"versionCode": 232,
"versionName": "2.3.2",
"outputFile": "FastBleLib-release.aar",
"fullName": "release",
"baseName": "release",
"dirName": ""
},
"path": "../../library_manifest/release/AndroidManifest.xml",
"properties": {
"packageId": "com.clj.fastble",
"split": ""
}
}
]
}
\ No newline at end of file
-- Merging decision tree log ---
manifest
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:1:1-9:12
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:1:1-9:12
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:1:1-9:12
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:1:1-9:12
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:1:1-9:12
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:1:1-9:12
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:1:1-9:12
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:1:1-9:12
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:1:1-9:12
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:1:1-9:12
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:1:1-9:12
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:1:1-9:12
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:1:1-9:12
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:1:1-9:12
package
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:2:5-30
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:2:5-30
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
android:versionName
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:1:1-9:12
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:1:1-9:12
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
android:versionCode
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:1:1-9:12
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:1:1-9:12
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
xmlns:android
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:1:11-69
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:1:11-69
uses-permission#android.permission.BLUETOOTH
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:4:5-68
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:4:5-68
android:name
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:4:22-65
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:4:22-65
uses-permission#android.permission.BLUETOOTH_ADMIN
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:5:5-74
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:5:5-74
android:name
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:5:22-71
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:5:22-71
uses-permission#android.permission.ACCESS_COARSE_LOCATION
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:6:5-81
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:6:5-81
android:name
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:6:22-78
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:6:22-78
uses-permission#android.permission.ACCESS_FINE_LOCATION
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:7:5-79
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:7:5-79
android:name
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml:7:22-76
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml:7:22-76
uses-sdk
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml reason: use-sdk injection requested
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml reason: use-sdk injection requested
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
android:targetSdkVersion
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
android:minSdkVersion
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
ADDED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
INJECTED from /Users/liuxiaojie/Documents/work/android/bluetooth-voice/FastBleLib/src/main/AndroidManifest.xml
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
ADDED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
INJECTED from D:\androidProject\BluToysApplication\FastBleLib\src\main\AndroidManifest.xml
......@@ -50,7 +50,7 @@ public class BleManager {
public static final int DEFAULT_SCAN_TIME = 10000;
private static final int DEFAULT_MAX_MULTIPLE_DEVICE = 7;
private static final int DEFAULT_OPERATE_TIME = 5000;
private static final int DEFAULT_OPERATE_TIME = 3000;
private static final int DEFAULT_CONNECT_RETRY_COUNT = 0;
private static final int DEFAULT_CONNECT_RETRY_INTERVAL = 5000;
private static final int DEFAULT_MTU = 23;
......
......@@ -532,7 +532,7 @@ public class BleConnector {
bleWriteCallback.setHandler(mHandler);
mBleBluetooth.addWriteCallback(uuid_write, bleWriteCallback);
mHandler.sendMessageDelayed(
mHandler.obtainMessage(BleMsg.MSG_CHA_WRITE_START, bleWriteCallback),
mHandler.obtainMessage(BleMsg.MSG_CHA_WRITE_RESULT, bleWriteCallback),
BleManager.getInstance().getOperateTimeout());
}
}
......
......@@ -62,6 +62,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation project(path: ':FastBleLib')
implementation project(path: ':library')
testImplementation 'junit:junit:4.12'
......@@ -80,8 +81,8 @@ dependencies {
implementation 'com.hjq:xxpermissions:8.6'
implementation "androidx.multidex:multidex:2.0.0"
implementation 'androidx.recyclerview:recyclerview:1.1.0'
/// implementation 'com.github.tbruyelle:rxpermissions:0.12'
......@@ -115,14 +116,13 @@ dependencies {
implementation 'com.contrarywind:Android-PickerView:4.1.9'
// implementation 'com.wx.wheelview:wheelview:1.3.3'
//工具类
implementation 'com.blankj:utilcodex:1.28.0'
implementation group: 'com.alibaba', name: 'fastjson', version: '1.2.73'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.alibaba:fastjson:1.2.73'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'com.orhanobut:logger:1.15'
implementation 'top.zibin:Luban:1.1.8'
//implementation 'com.vise.xiaoyaoyou:baseble:2.0.5'
}
\ No newline at end of file
......@@ -22,7 +22,7 @@
android:name="android.permission.BLUETOOTH_PRIVILEGED"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" />
......@@ -30,7 +30,6 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-feature android:name="android.hardware.location.gps" />
<uses-feature
android:name="android.hardware.bluetooth_le"
......@@ -39,15 +38,17 @@
<application
android:name=".app.App"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/timerlogo"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/timerlogo"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:targetApi="n">
<activity android:name=".activity.SelectTimerActivity"></activity>
<activity android:name=".activity.SettingMusicActivity"></activity>
<activity android:name=".activity.MusicActivity" />
<activity android:name=".activity.SelectTimerActivity" />
<activity android:name=".activity.PlayActivity" />
<activity android:name=".activity.SetTimeActivity" />
<activity android:name=".activity.SelectDeviceActivity" />
......@@ -61,13 +62,11 @@
</intent-filter>
</activity>
<receiver android:name=".ble.receiver.BluetoothOpenAndClose">
<intent-filter>
<action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />
</intent-filter>
</receiver>
</application>
</manifest>
\ No newline at end of file
package com.example.blu.toys;
import android.Manifest;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.os.Handler;
import com.example.blu.toys.activity.AddDeviceActivity;
import com.example.blu.toys.activity.BaseActivity;
import com.hjq.permissions.OnPermission;
import com.hjq.permissions.Permission;
import com.hjq.permissions.XXPermissions;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.OnClick;
public class MainActivity extends BaseActivity {
@BindView(R.id.stoplight_but)
LinearLayout stoplightBut;
String[] permissions = new String[]{
Manifest.permission.ACCESS_COARSE_LOCATION,
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.READ_PHONE_STATE
};
// 声明一个集合,在后面的代码中用来存储用户拒绝授权的权
List<String> mPermissionList = new ArrayList<>();
private static final int MY_PERMISSIONS_REQUEST_CALL_PHONE = 1;
private static final int MY_PERMISSIONS_REQUEST_CALL_CAMERA = 2;
private BluetoothHelper bluetoothHelper;
@Override
public int getLayout() {
......@@ -42,139 +16,15 @@ public class MainActivity extends BaseActivity {
@Override
public void init(Bundle savedInstanceState) {
// for (int i = 0; i < permissions.length; i++) {
// if (ContextCompat.checkSelfPermission(MainActivity.this, permissions[i]) != PackageManager.PERMISSION_GRANTED) {
// mPermissionList.add(permissions[i]);
// }
// }
// if (mPermissionList.isEmpty()) {//未授予的权限为空,表示都授予了
// Toast.makeText(MainActivity.this, "已经授权", Toast.LENGTH_LONG).show();
// } else {//请求权限方法
// String[] permissions = mPermissionList.toArray(new String[mPermissionList.size()]);//将List转为数组
// ActivityCompat.requestPermissions(MainActivity.this, permissions, MY_PERMISSIONS_REQUEST_CALL_CAMERA);
// }
}
private void checkPermission() {
XXPermissions.with(this) // 申请安装包权限
.permission(Permission.CAMERA, Permission.ACCESS_FINE_LOCATION, Permission.ACCESS_FINE_LOCATION) // 申请多个权限
.request(new OnPermission() {
@Override
public void hasPermission(List<String> granted, boolean all) {
if (!all) {
checkPermission();
}
}
@Override
public void noPermission(List<String> denied, boolean never) {
if (never) {
XXPermissions.startPermissionActivity(MainActivity.this, denied);
} else {
checkPermission();
}
}
}
);
new Handler().postDelayed(() -> {
goActivity(AddDeviceActivity.class);
finish();
}, 1000); //延时1s执行
}
@Override
public void initData() {
checkPermission();
}
@OnClick(R.id.stoplight_but)
public void onViewClicked() {
goActivity(AddDeviceActivity.class);
}
// @Override
// public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
// if (requestCode == MY_PERMISSIONS_REQUEST_CALL_PHONE) {
// if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// showToast("权限已申请");
// } else {
// showToast("权限已拒绝");
// }
// } else if (requestCode == MY_PERMISSIONS_REQUEST_CALL_CAMERA) {
// for (int i = 0; i < grantResults.length; i++) {
// if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {
// //判断是否勾选禁止后不再询问
// boolean showRequestPermission = ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this, permissions[i]);
// if (showRequestPermission) {
// showToast("权限未申请");
// }
// }
// }
// }
// super.onRequestPermissionsResult(requestCode, permissions, grantResults);
// }
//
// private void showToast(String string) {
// Toast.makeText(MainActivity.this, string, Toast.LENGTH_LONG).show();
// }
// private void checkBluetoothPermission() {
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// //校验是否已具有模糊定位权限
// if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// PermissionManager.instance().with(this).request(new OnPermissionCallback() {
// @Override
// public void onRequestAllow(String permissionName) {
// enableBluetooth();
// }
//
// @Override
// public void onRequestRefuse(String permissionName) {
// finish();
// }
//
// @Override
// public void onRequestNoAsk(String permissionName) {
// finish();
// }
// }, Manifest.permission.ACCESS_COARSE_LOCATION);
// } else {
// enableBluetooth();
// }
// } else {
// enableBluetooth();
// }
// }
//
// private void enableBluetooth() {
// if (!BleUtil.isBleEnable(this)) {
// BleUtil.enableBluetooth(this, 1);
// } else {
// boolean isSupport = BleUtil.isSupportBle(this);
// boolean isOpenBle = BleUtil.isBleEnable(this);
// if (isSupport) {
// supportTv.setText(getString(R.string.supported));
// } else {
// supportTv.setText(getString(R.string.not_supported));
// }
// if (isOpenBle) {
// statusTv.setText(getString(R.string.on));
// } else {
// statusTv.setText(getString(R.string.off));
// }
// invalidateOptionsMenu();
// updateConnectedDevice();
// }
// }
}
\ No newline at end of file
......@@ -19,9 +19,15 @@ import android.view.WindowManager;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.example.blu.toys.MainActivity;
import com.example.blu.toys.app.AppManager;
import com.example.blu.toys.utils.Utils;
import com.example.blu.toys.view.WrapContentGridLayoutManager;
import com.hjq.permissions.OnPermission;
import com.hjq.permissions.Permission;
import com.hjq.permissions.XXPermissions;
import java.util.ArrayList;
......@@ -32,7 +38,6 @@ import butterknife.ButterKnife;
import butterknife.Unbinder;
public abstract class BaseActivity extends AppCompatActivity {
private Unbinder mBinder;
......@@ -51,13 +56,44 @@ public abstract class BaseActivity extends AppCompatActivity {
setContentView(getLayout());
// getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
AppManager.getInstance().addActivity(this);
checkPermission();
mBinder = ButterKnife.bind(this);
init(savedInstanceState);
initData();
}
private void checkPermission() {
XXPermissions.with(this) // 申请安装包权限
.permission(Permission.CAMERA, Permission.ACCESS_FINE_LOCATION, Permission.ACCESS_FINE_LOCATION) // 申请多个权限
.request(new OnPermission() {
@Override
public void hasPermission(List<String> granted, boolean all) {
if (!all) {
checkPermission();
}
}
@Override
public void noPermission(List<String> denied, boolean never) {
if (never) {
XXPermissions.startPermissionActivity(BaseActivity.this, denied);
} else {
checkPermission();
}
}
}
);
}
protected LinearLayoutManager getLinearLayout() {
LinearLayoutManager layoutManager = new WrapContentGridLayoutManager(this);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
return layoutManager;
}
public abstract int getLayout();
public abstract void init(Bundle savedInstanceState);
......@@ -73,7 +109,6 @@ public abstract class BaseActivity extends AppCompatActivity {
}
@Override
protected void onDestroy() {
super.onDestroy();
......
package com.example.blu.toys.activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.example.blu.toys.R;
import com.example.blu.toys.view.TypefaceTextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class MusicActivity extends BaseActivity {
@BindView(R.id.open_music)
TypefaceTextView openMusic;
@BindView(R.id.close_music)
TypefaceTextView closeMusic;
@Override
public int getLayout() {
return R.layout.activity_music;
}
@Override
public void init(Bundle savedInstanceState) {
}
@Override
public void initData() {
}
@OnClick({R.id.open_music, R.id.close_music})
public void onViewClicked(View view) {
Intent intent = new Intent(MusicActivity.this, SettingMusicActivity.class);
switch (view.getId()) {
case R.id.open_music:
intent.putExtra("musicType", "open");
break;
case R.id.close_music:
intent.putExtra("musicType", "close");
break;
}
startActivity(intent);
}
}
\ No newline at end of file
package com.example.blu.toys.activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import com.clj.fastble.callback.BleWriteCallback;
import com.clj.fastble.exception.BleException;
import com.example.blu.toys.R;
import com.example.blu.toys.ble.BlePlay;
import com.example.blu.toys.ble.agreement.TrafficLightBean;
import com.example.blu.toys.utils.SpUtils;
import com.example.blu.toys.view.TypefaceTextView;
import com.example.blu.toys.view.WheelView;
import com.hjq.toast.ToastUtils;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class PlayActivity extends BaseActivity {
@BindView(R.id.task_time)
TypefaceTextView typefaceTextView;//倒计时
private int mDay = 0;
private int mHour = 0;
private int mMin = 0;
private int mSecond = 00;// 天 ,小时,分钟,秒
private boolean isRun = true;
private Handler timeHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (msg.what == 1) {
computeTime();
typefaceTextView.setText(mHour + ":" + mHour + ":" + mSecond);
}
}
};
/**
* 开启倒计时
*/
private void startRun() {
new Thread(() -> {
while (isRun) {
try {
Thread.sleep(1000); // sleep 1000ms
Message message = Message.obtain();
message.what = 1;
timeHandler.sendMessage(message);
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
}
/**
* 倒计时计算
*/
private void computeTime() {
mSecond--;
if (mSecond < 0) {
mMin--;
mSecond = 59;
if (mMin < 0) {
mMin = 59;
mHour--;
if (mHour < 0) {
// 倒计时结束
mHour = 23;
mDay--;
}
}
}
}
@Override
public int getLayout() {
return R.layout.activity_play;
......@@ -17,7 +92,11 @@ public class PlayActivity extends BaseActivity {
@Override
public void init(Bundle savedInstanceState) {
Intent intent = getIntent();
mHour = intent.getIntExtra("hour", 0);
mMin = intent.getIntExtra("min", 0);
mSecond = intent.getIntExtra("second", 0);
startRun();
}
@Override
......@@ -28,11 +107,73 @@ public class PlayActivity extends BaseActivity {
@OnClick({R.id.cancel_but, R.id.pause_but, R.id.resume_but})
public void onViewClicked(View view) {
SpUtils spUtils = SpUtils.getSpUtils(PlayActivity.this);
int close = spUtils.getSPValue("close", 1);
int open = spUtils.getSPValue("open", 10);
int alarm = spUtils.getSPValue("alarm", 1);
int green = spUtils.getSPValue("green", 1);
int brightness = spUtils.getSPValue("brightness", 50);
switch (view.getId()) {
case R.id.cancel_but:
case R.id.pause_but:
case R.id.resume_but:
goActivity(SelectTimerActivity.class);
case R.id.cancel_but://取消 关机
TrafficLightBean trafficLightBean = new TrafficLightBean(
1, 0,
0, 0, 0, 0, 0, 0);
byte[] bytes = trafficLightBean.toByte();
BlePlay.getInstance().sendStard(bytes, new BleWriteCallback() {
@Override
public void onWriteSuccess(int current, int total, byte[] justWrite) {
ToastUtils.show("关机-发送成功");
timeHandler.removeMessages(1);
}
@Override
public void onWriteFailure(BleException exception) {
}
});
case R.id.pause_but://暂停
int time = mHour * 360 + mMin * 60 + mSecond;
TrafficLightBean ttt = new TrafficLightBean(2, 0,
time, brightness, open, close, green, alarm);
byte[] bytes12 = ttt.toByte();
BlePlay.getInstance().sendPause(bytes12, new BleWriteCallback() {
@Override
public void onWriteSuccess(int current, int total, byte[] justWrite) {
ToastUtils.show("暂停-发送成功");
timeHandler.removeMessages(1);
}
@Override
public void onWriteFailure(BleException exception) {
}
});
case R.id.resume_but://开始
int hh = mHour * 360 + mMin * 60 + mSecond;
TrafficLightBean tt = new TrafficLightBean(2, 1,
hh, brightness, open, close, green, alarm);
byte[] byte11 = tt.toByte();
BlePlay.getInstance().sendStard(byte11, new BleWriteCallback() {
@Override
public void onWriteSuccess(int current, int total, byte[] justWrite) {
startRun();
ToastUtils.show("开始-发送成功");
}
@Override
public void onWriteFailure(BleException exception) {
}
});
break;
}
}
......
package com.example.blu.toys.activity;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.RequiresApi;
import com.clj.fastble.data.BleDevice;
import com.example.blu.toys.R;
import com.example.blu.toys.app.AppManager;
import com.example.blu.toys.ble.BlePlay;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.List;
import butterknife.ButterKnife;
import butterknife.OnClick;
public class SearchingActivity extends BaseActivity {
@Override
public int getLayout() {
return R.layout.activity_searching;
......@@ -27,22 +33,18 @@ public class SearchingActivity extends BaseActivity {
@Override
public void initData() {
BlePlay.getInstance().scanBle();
}
@OnClick(R.id.select_dev)
public void onViewClicked() {
@RequiresApi(api = Build.VERSION_CODES.N)
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
public void GoDeviceListPage(List<BleDevice> bleDevices) {
goActivity(SelectDeviceActivity.class);
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void GoDeviceListPage(String login) {
goActivity(SelectDeviceActivity.class);
@OnClick(R.id.back_but)
public void onViewClicked() {
finish();
}
}
\ No newline at end of file
package com.example.blu.toys.activity;
import android.os.Bundle;
import android.text.TextUtils;
import androidx.recyclerview.widget.RecyclerView;
import com.blankj.utilcode.util.CollectionUtils;
import com.blankj.utilcode.util.LogUtils;
import com.clj.fastble.data.BleDevice;
import com.example.blu.toys.R;
import com.example.blu.toys.adapter.BleDeviceAdapter;
import com.example.blu.toys.ble.BlePlay;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.util.ArrayList;
import java.util.List;
import butterknife.ButterKnife;
import butterknife.BindView;
import butterknife.OnClick;
public class SelectDeviceActivity extends BaseActivity {
@BindView(R.id.recyclerView)
RecyclerView mRecyclerView;
BleDeviceAdapter bleDeviceAdapter;
private List<BleDevice> bleDevices;
@Override
public int getLayout() {
return R.layout.activity_seleclt_device;
......@@ -16,17 +37,58 @@ public class SelectDeviceActivity extends BaseActivity {
@Override
public void init(Bundle savedInstanceState) {
EventBus.getDefault().register(this);
}
@Override
public void initData() {
if (bleDevices == null) {
bleDevices = new ArrayList<>();
}
mRecyclerView.setLayoutManager(getLinearLayout());
bleDeviceAdapter = new BleDeviceAdapter(R.layout.ble_devices_item, bleDevices);
mRecyclerView.setAdapter(bleDeviceAdapter);
bleDeviceAdapter.setOnItemClickListener((adapter, view, position) -> {
BleDevice bleDevice = (BleDevice) adapter.getItem(position);
BlePlay.getInstance().connectedBleDevice(bleDevice);
});
}
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
public void showBleDevices(List<BleDevice> bles) {
if (CollectionUtils.isEmpty(bles)) {
return;
}
if (bleDevices == null) {
bleDevices = new ArrayList<>();
}
@OnClick(R.id.go_start)
public void onViewClicked() {
bleDevices.clear();
for (int i = 0; i < bles.size(); i++) {
BleDevice bleDevice = bles.get(i);
String deviceName = bleDevice.getName();
if (!TextUtils.isEmpty(deviceName) && deviceName.contains("Traffic")) {
bleDevices.add(bleDevice);
}
}
if (bleDeviceAdapter != null) {
bleDeviceAdapter.notifyDataSetChanged();
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void connDevices(BleDevice ble) {
LogUtils.e("连接 成功");
goActivity(SetTimeActivity.class);
}
@OnClick(R.id.back_but)
public void onViewClicked() {
finish();
}
}
\ No newline at end of file
package com.example.blu.toys.activity;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.CompoundButton;
import android.widget.SeekBar;
import android.widget.Switch;
import com.example.blu.toys.R;
import com.example.blu.toys.utils.SpUtils;
import com.example.blu.toys.view.TypefaceTextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
//设置
public class SelectTimerActivity extends BaseActivity {
@BindView(R.id.back_but)
TypefaceTextView backBut;
@BindView(R.id.will)
TypefaceTextView will;
@BindView(R.id.alarm_switch)
Switch alarmSwitch;
@BindView(R.id.music_switch)
Switch musicSwitch;
@BindView(R.id.green_switch)
Switch greenSwitch;
@BindView(R.id.brightness_bar)
SeekBar brightnessBar;
@Override
public int getLayout() {
return R.layout.activity_select_timer;
......@@ -17,10 +39,59 @@ public class SelectTimerActivity extends BaseActivity {
@Override
public void init(Bundle savedInstanceState) {
SpUtils spUtils = SpUtils.getSpUtils(this);
// spUtils.putSPValue("close", 1);
// spUtils.putSPValue("open", 10);
spUtils.putSPValue("brightness", 50);
alarmSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
if (isChecked) {
spUtils.putSPValue("alarm", 1);
} else {
spUtils.putSPValue("alarm", 0);
}
});
musicSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
startActivity(new Intent(SelectTimerActivity.this, MusicActivity.class));
});
greenSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
if (isChecked) {
spUtils.putSPValue("green", 1);
} else {
spUtils.putSPValue("green", 0);
}
});
brightnessBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
spUtils.putSPValue("brightness", progress);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
}
@Override
public void initData() {
}
@OnClick(R.id.back_but)
public void onViewClicked() {
finish();
}
}
\ No newline at end of file
package com.example.blu.toys.activity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.clj.fastble.data.BleDevice;
import com.example.blu.toys.R;
import com.example.blu.toys.adapter.BleDeviceAdapter;
import com.example.blu.toys.adapter.MusicAdapter;
import com.example.blu.toys.utils.SpUtils;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
public class SettingMusicActivity extends BaseActivity {
@BindView(R.id.recyclerView)
RecyclerView mRecyclerView;
MusicAdapter musicAdapter;
private List<Integer> integerList;
private SpUtils spUtils;
@Override
public int getLayout() {
return R.layout.activity_setting_music;
}
@Override
public void init(Bundle savedInstanceState) {
spUtils = SpUtils.getSpUtils(SettingMusicActivity.this);
Intent intent = getIntent();
String musicType = intent.getStringExtra("musicType");
integerList = new ArrayList<>();
for (int i = 0; i < 20; i++) {
integerList.add(i);
}
mRecyclerView.setLayoutManager(getLinearLayout());
musicAdapter = new MusicAdapter(R.layout.ble_devices_item, integerList, musicType);
mRecyclerView.setAdapter(musicAdapter);
musicAdapter.setOnItemClickListener((adapter, view, position) -> {
Integer integer = integerList.get(position);
if (musicType.equals("close")) {
spUtils.putSPValue("close", integer);
} else {
spUtils.putSPValue("open", integer);
}
});
}
@Override
public void initData() {
}
}
\ No newline at end of file
package com.example.blu.toys.adapter;
import android.text.TextUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.clj.fastble.data.BleDevice;
import com.example.blu.toys.R;
import java.util.List;
public class BleDeviceAdapter extends BaseQuickAdapter<BleDevice, BaseViewHolder> {
public BleDeviceAdapter(int layoutResId, List<BleDevice> data) {
super(layoutResId, data);
}
@Override
protected void convert(BaseViewHolder helper, BleDevice item) {
String deviceName = item.getName();
if (!TextUtils.isEmpty(deviceName) && deviceName.contains("Traffic")) {
helper.setText(R.id.dv_name, item.getName() + "");
}
}
}
\ No newline at end of file
package com.example.blu.toys.adapter;
import android.text.TextUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.clj.fastble.data.BleDevice;
import com.example.blu.toys.R;
import com.example.blu.toys.utils.SpUtils;
import java.util.List;
public class MusicAdapter extends BaseQuickAdapter<Integer, BaseViewHolder> {
private String musicType;
public MusicAdapter(int layoutResId, List<Integer> data, String musicType) {
super(layoutResId, data);
this.musicType = musicType;
}
@Override
protected void convert(BaseViewHolder helper, Integer item) {
SpUtils spUtils = SpUtils.getSpUtils(mContext);
int spValue = spUtils.getSPValue(musicType, -1);
if (spValue == item) {
helper.setTextColor(R.id.dv_name, mContext.getResources().getColor(R.color.backer_back));
}
helper.setText(R.id.dv_name, item + "");
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import android.app.Application;
import android.util.DisplayMetrics;
import com.clj.fastble.BleManager;
import com.example.blu.toys.utils.SpUtils;
import com.hjq.toast.ToastUtils;
public class App extends Application {
......@@ -39,39 +40,15 @@ public class App extends Application {
.enableLog(true)
.setReConnectCount(3, 5000)
.setMaxConnectCount(7)
.setConnectOverTime(50000)
.setOperateTimeout(50000);
// DoohanBle.getInstance().init(this);
// DoohanBle.config().setScanTimeout(5000)//扫描超时时间,这里设置为永久扫描
// .setConnectTimeout(10 * 1000)//连接超时时间
// .setOperateTimeout(5 * 1000)//设置数据操作超时时间
// .setConnectRetryCount(5)//设置连接失败重试次数
// .setConnectRetryInterval(1000)//设置连接失败重试间隔时间
// .setOperateRetryCount(3)//设置数据操作失败重试次数
// .setOperateRetryInterval(1000)//设置数据操作失败重试间隔时间
// .setServiceUUID("0000fff0-0000-1000-8000-00805f9b34fb")
// .setNotifyUUID("0000fff4-0000-1000-8000-00805f9b34fb")
// .setWriteUUID("0000fff3-0000-1000-8000-00805f9b34fb");
// //蓝牙相关配置修改
// ViseBle.config()
// .setScanTimeout(-1)//扫描超时时间,这里设置为永久扫描
// .setConnectTimeout(10 * 1000)//连接超时时间
// .setOperateTimeout(5 * 1000)//设置数据操作超时时间
// .setConnectRetryCount(3)//设置连接失败重试次数
// .setConnectRetryInterval(1000)//设置连接失败重试间隔时间
// .setOperateRetryCount(3)//设置数据操作失败重试次数
// .setOperateRetryInterval(1000)//设置数据操作失败重试间隔时间
// .setMaxConnectCount(3);//设置最大连接设备数量
////蓝牙信息初始化,全局唯一,必须在应用初始化时调用
// ViseBle.getInstance().init(this);
.setSplitWriteNum(50000)
.setConnectOverTime(50000);
SpUtils spUtils = SpUtils.getSpUtils(this);
spUtils.putSPValue("close",1);
spUtils.putSPValue("open",10);
spUtils.putSPValue("alarm",1);
spUtils.putSPValue("green",1);
spUtils.putSPValue("brightness",50);
}
public static App getInstance() {
......
package com.example.blu.toys.ble.receiver;
package com.example.blu.toys.ble;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattService;
import com.blankj.utilcode.util.LogUtils;
import com.clj.fastble.BleManager;
......@@ -12,68 +14,92 @@ import com.clj.fastble.data.BleDevice;
import com.clj.fastble.exception.BleException;
import com.clj.fastble.scan.BleScanRuleConfig;
import com.example.blu.toys.app.App;
import com.example.blu.toys.ble.Notify;
import com.example.blu.toys.ble.agreement.HexStringUtils;
import com.example.blu.toys.utils.SpUtils;
import org.greenrobot.eventbus.EventBus;
import java.util.List;
import java.util.UUID;
@SuppressWarnings("all")
public class VehiclePlay {
public class BlePlay {
String UUID_SERVICE = "00001812-0000-1000-8000-00805f9b34fb";
String UUID_WRITE = "0000180f-0000-1000-8000-00805f9b34fb";
// String UUID_SERVICE = "00001812-0000-1000-8000-00805f9b34fb";
// String UUID_WRITE = "0000180f-0000-1000-8000-00805f9b34fb";
//
// String UUID_READ = "0000ae02-0000-1000-8000-00805f9b34fb";
//
//
// UUID[] serviceIds = {UUID.fromString("49535343-fe7d-4ae5-8fa9-9fafd205e455"),
// UUID.fromString("0000ffe0-0000-1000-8000-00805f9b34fb"),
// UUID.fromString("00001812-0000-1000-8000-00805f9b34fb")};
String UUID_NOTIFY = "0000ae02-0000-1000-8000-00805f9b34fb";
String UUID_SERVICE = "0000ffe0-0000-1000-8000-00805f9b34fb";
String UUID_WRITE = "0000ff4-0000-1000-8000-00805f9b34fb";
String UUID_READ = "0000ffe5-0000-1000-8000-00805f9b34fb";
private static VehiclePlay instance;
private static BlePlay instance;
private SpUtils mSpUtils;
public static VehiclePlay getInstance() {
public static BlePlay getInstance() {
if (instance == null) {
synchronized (VehiclePlay.class) {
synchronized (BlePlay.class) {
if (instance == null) {
instance = new VehiclePlay();
instance = new BlePlay();
}
}
}
return instance;
}
private BleDevice bleDevice;
private VehiclePlay() {
private BlePlay() {
mSpUtils = SpUtils.getSpUtils(App.getInstance());
}
public void scanBle() {
public BleDevice getBleDevice() {
return bleDevice;
}
public void setBleDevice(BleDevice bleDevice) {
this.bleDevice = bleDevice;
}
BleScanRuleConfig scanRuleConfig = new BleScanRuleConfig.Builder()
.setAutoConnect(false)
.setScanTimeOut(30000)
.build();
BleManager.getInstance().initScanRule(scanRuleConfig);
/**
* 扫描设备 30000
*/
public void scanBle() {
BleScanRuleConfig scanRuleConfig = new BleScanRuleConfig.Builder().setAutoConnect(false)
//.setServiceUuids(serviceIds)
.setScanTimeOut(1000).build();
BleManager.getInstance().initScanRule(scanRuleConfig);
BleManager.getInstance().scan(new BleScanCallback() {
@Override
public void onScanStarted(boolean success) {
LogUtils.e("===========0000");
LogUtils.e("开始扫描");
}
@Override
public void onScanning(BleDevice bleDevice) {
LogUtils.e("获取设备");
}
@Override
public void onScanFinished(List<BleDevice> scanResultList) {
EventBus.getDefault().post(scanResultList);
LogUtils.e("扫描介素获取设备列表");
EventBus.getDefault().postSticky(scanResultList);
}
});
}
......@@ -98,7 +124,6 @@ public class VehiclePlay {
* @param bleDevice 设备
*/
public void connectedBleDevice(BleDevice bleDevice) {
BleManager.getInstance().connect(bleDevice, new BleGattCallback() {
//开始链接
......@@ -116,7 +141,32 @@ public class VehiclePlay {
//链接成功
@Override
public void onConnectSuccess(BleDevice bleDevice, BluetoothGatt gatt, int status) {
setBleDevice(bleDevice);
List<BluetoothGattService> serviceList = gatt.getServices();
for (BluetoothGattService service : serviceList) {
UUID uuid_service = service.getUuid();
if (UUID_SERVICE.equals(uuid_service)){}
LogUtils.e("uuid_service----" + uuid_service);
List<BluetoothGattCharacteristic> characteristicList = service.getCharacteristics();
for (BluetoothGattCharacteristic characteristic : characteristicList) {
UUID uuid_chara = characteristic.getUuid();
int properties = characteristic.getProperties();
LogUtils.e("uuid_chara----" + uuid_service);
}
}
EventBus.getDefault().post(bleDevice);
}
//关闭链接
......@@ -132,7 +182,7 @@ public class VehiclePlay {
/**
* 暂停
*/
public void sendCance(BleDevice bleDevice, byte[] data) {
public void sendCance(byte[] data,BleWriteCallback callback) {
BleManager.getInstance().write(
bleDevice,
UUID_SERVICE,
......@@ -141,12 +191,12 @@ public class VehiclePlay {
new BleWriteCallback() {
@Override
public void onWriteSuccess(int current, int total, byte[] justWrite) {
callback.onWriteSuccess(current,total,justWrite);
}
@Override
public void onWriteFailure(BleException exception) {
callback.onWriteFailure(exception);
}
});
......@@ -156,32 +206,27 @@ public class VehiclePlay {
/**
* 开始/继续
*/
public void sendStard(BleDevice bleDevice, byte[] data) {
BleManager.getInstance().write(
bleDevice,
UUID_SERVICE,
UUID_WRITE,
data,
new BleWriteCallback() {
public void sendStard(byte[] data,BleWriteCallback callback) {
BleManager.getInstance().write(bleDevice, UUID_SERVICE, UUID_WRITE, data, new BleWriteCallback() {
@Override
public void onWriteSuccess(int current, int total, byte[] justWrite) {
callback.onWriteSuccess(current,total,justWrite);
}
@Override
public void onWriteFailure(BleException exception) {
callback.onWriteFailure(exception);
}
});
}
/**
* 暂停
*/
public void sendPause(BleDevice bleDevice, byte[] data) {
public void sendPause(byte[] data,BleWriteCallback callback) {
BleManager.getInstance().write(
bleDevice,
UUID_SERVICE,
......@@ -190,12 +235,12 @@ public class VehiclePlay {
new BleWriteCallback() {
@Override
public void onWriteSuccess(int current, int total, byte[] justWrite) {
callback.onWriteSuccess(current,total,justWrite);
}
@Override
public void onWriteFailure(BleException exception) {
callback.onWriteFailure(exception);
}
});
......@@ -216,14 +261,14 @@ public class VehiclePlay {
*
* @rturn
*/
public boolean isConnected(BleDevice bleDevice) {
public boolean isConnected() {
return BleManager.getInstance().isConnected(bleDevice);
}
/**
* 断开蓝牙链接
*/
public void closeBle(BleDevice bleDevice) {
public void closeBle() {
BleManager.getInstance().disconnect(bleDevice);
}
......
......@@ -67,11 +67,11 @@ public class TrafficLightBean {
* @param protocolNo 协议编号
* @param suspendAndContinue 暂停或者继续
* @param timeRemaining 剩余时间 毫秒
* @param brightness 亮度值 0-100
* @param openSoundNo 开机声音编号
* @param closeSoundNo 关机声音编号
* @param trafficLightUpdateSet 红绿灯变更方式
* @param alarm 报警状态
* @param brightness 亮度值 0-100 默认 50
* @param openSoundNo 开机声音编号 默认 1
* @param closeSoundNo 关机声音编号 默认 10
* @param trafficLightUpdateSet 红绿灯变更方式 默认 1
* @param alarm 报警状态 默认 0
*/
public TrafficLightBean(Integer protocolNo,Integer suspendAndContinue,Integer timeRemaining,Integer brightness,Integer openSoundNo,Integer closeSoundNo,Integer trafficLightUpdateSet,Integer alarm){
......@@ -107,7 +107,6 @@ public class TrafficLightBean {
}
public byte[] toByte(){
//数据要加密的
byte[] resData=new byte[17];
......
package com.example.blu.toys.view;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.Gravity;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.example.blu.toys.R;
import java.lang.ref.WeakReference;
public class PointWaitBar extends LinearLayout {
private static final int NUM = 3;
private Context context;
private String TAG = "PointWaitBar";
private ImageView mOldIM;
private UpdateHandler handler;
public PointWaitBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
this.context = context;
init();
}
public PointWaitBar(Context context, AttributeSet attrs) {
super(context, attrs);
this.context = context;
init();
}
public PointWaitBar(Context context) {
super(context);
this.context = context;
init();
}
private void init() {
//初始化数据
this.setOrientation(LinearLayout.HORIZONTAL);
this.setGravity(Gravity.CENTER);
handler = new UpdateHandler(context);
Bitmap bitmap = null;
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
Drawable vectorDrawable = context.getDrawable(R.drawable.point_waitingbar_black);
bitmap = Bitmap.createBitmap(vectorDrawable.getIntrinsicWidth(),
vectorDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
vectorDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
vectorDrawable.draw(canvas);
} else {
bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.point_waitingbar_black);
}
LinearLayout.LayoutParams tLayoutParams = new LinearLayout.LayoutParams(bitmap.getWidth(), bitmap.getHeight());
tLayoutParams.leftMargin = 10;
tLayoutParams.rightMargin = 10;
//添加5个小点省略号
for (int i = 0; i < NUM; i++) {
ImageView vDot = new ImageView(context);
vDot.setLayoutParams(tLayoutParams);
if (i == 0) {
vDot.setBackgroundResource(R.drawable.point_waitingbar_white);
} else {
vDot.setBackgroundResource(R.drawable.point_waitingbar_black);
}
this.addView(vDot);
}
mOldIM = (ImageView) this.getChildAt(0);
handler.sendEmptyMessage(0);
}
//提供给外部消除message
public void setDestroyCallBack() {
if (handler != null) {
handler.removeCallbacksAndMessages(null);
// LogUtil.i(TAG, "已经清除消息");
}
}
class UpdateHandler extends Handler {
WeakReference<Context> reference;
public UpdateHandler(Context context) {
reference = new WeakReference<Context>(context);
}
@Override
public void handleMessage(Message msg) {
// TODO Auto-generated method stub
super.handleMessage(msg);
int cPosition = msg.what;
if (mOldIM != null)
mOldIM.setBackgroundResource(R.drawable.point_waitingbar_black);
ImageView currentIM = (ImageView) PointWaitBar.this.getChildAt(cPosition);
currentIM.setBackgroundResource(R.drawable.point_waitingbar_white);
mOldIM = currentIM;
if (++cPosition == NUM)
cPosition = 0;
this.sendEmptyMessageDelayed(cPosition, 200);
}
}
}
\ No newline at end of file
package com.example.blu.toys.view;
import android.app.Activity;
import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
public class WheelView extends ScrollView {
public static final String TAG = WheelView.class.getSimpleName();
public static class OnWheelViewListener {
public void onSelected(int selectedIndex, String item) {
}
}
private Context context;
private LinearLayout views;
public WheelView(Context context) {
super(context);
init(context);
}
public WheelView(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public WheelView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context);
}
List<String> items;
private List<String> getItems() {
return items;
}
public void setItems(List<String> list) {
if (null == items) {
items = new ArrayList<String>();
}
items.clear();
items.addAll(list);
// 前面和后面补全
for (int i = 0; i < offset; i++) {
items.add(0, "");
items.add("");
}
initData();
}
public static final int OFF_SET_DEFAULT = 1;
int offset = OFF_SET_DEFAULT; // 偏移量(需要在最前面和最后面补全)
public int getOffset() {
return offset;
}
public void setOffset(int offset) {
this.offset = offset;
}
int displayItemCount; // 每页显示的数量
int selectedIndex = 1;
private void init(Context context) {
this.context = context;
this.setVerticalScrollBarEnabled(false);
views = new LinearLayout(context);
views.setOrientation(LinearLayout.VERTICAL);
this.addView(views);
scrollerTask = () -> {
int newY = getScrollY();
if (initialY - newY == 0) {
// stopped
final int remainder = initialY % itemHeight;
final int divided = initialY / itemHeight;
if (remainder == 0) {
selectedIndex = divided + offset;
onSeletedCallBack();
} else {
if (remainder > itemHeight / 2) {
WheelView.this.post(() -> {
WheelView.this.smoothScrollTo(0, initialY - remainder + itemHeight);
selectedIndex = divided + offset + 1;
onSeletedCallBack();
});
} else {
WheelView.this.post(() -> {
WheelView.this.smoothScrollTo(0, initialY - remainder);
selectedIndex = divided + offset;
onSeletedCallBack();
});
}
}
} else {
initialY = getScrollY();
WheelView.this.postDelayed(scrollerTask, newCheck);
}
};
}
int initialY;
Runnable scrollerTask;
int newCheck = 50;
public void startScrollerTask() {
initialY = getScrollY();
this.postDelayed(scrollerTask, newCheck);
}
private void initData() {
displayItemCount = offset * 2 + 1;
for (String item : items) {
views.addView(createView(item));
}
refreshItemView(0);
}
int itemHeight = 0;
private TextView createView(String item) {
TextView tv = new TextView(context);
tv.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
tv.setSingleLine(true);
tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 24);
tv.setText(item);
tv.setGravity(Gravity.CENTER);
AssetManager mgr = this.getContext().getAssets();
//根据路径得到Typeface
Typeface tf = Typeface.createFromAsset(mgr, "fonts/LittleOrion.otf");
tv.setTypeface(tf);
int padding = dip2px(15);
tv.setPadding(padding, 0, padding, 0);
if (0 == itemHeight) {
itemHeight = getViewMeasuredHeight(tv);
Log.d(TAG, "itemHeight: " + itemHeight);
views.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, itemHeight * displayItemCount));
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) this.getLayoutParams();
this.setLayoutParams(new LinearLayout.LayoutParams(lp.width, itemHeight * displayItemCount));
}
return tv;
}
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
super.onScrollChanged(l, t, oldl, oldt);
refreshItemView(t);
if (t > oldt) {
// Log.d(TAG, "向下滚动");
scrollDirection = SCROLL_DIRECTION_DOWN;
} else {
// Log.d(TAG, "向上滚动");
scrollDirection = SCROLL_DIRECTION_UP;
}
}
private void refreshItemView(int y) {
int position = y / itemHeight + offset;
int remainder = y % itemHeight;
int divided = y / itemHeight;
if (remainder == 0) {
position = divided + offset;
} else {
if (remainder > itemHeight / 2) {
position = divided + offset + 1;
}
}
int childSize = views.getChildCount();
for (int i = 0; i < childSize; i++) {
TextView itemView = (TextView) views.getChildAt(i);
if (null == itemView) {
return;
}
if (position == i) {
itemView.setTextColor(Color.parseColor("#eeeeee"));
} else {
itemView.setTextColor(Color.parseColor("#bbbbbb"));
}
}
}
/**
* 获取选中区域的边界
*/
int[] selectedAreaBorder;
private int[] obtainSelectedAreaBorder() {
if (null == selectedAreaBorder) {
selectedAreaBorder = new int[2];
selectedAreaBorder[0] = itemHeight * offset;
selectedAreaBorder[1] = itemHeight * (offset + 1);
}
return selectedAreaBorder;
}
private int scrollDirection = -1;
private static final int SCROLL_DIRECTION_UP = 0;
private static final int SCROLL_DIRECTION_DOWN = 1;
Paint paint;
int viewWidth;
@Override
public void setBackgroundDrawable(Drawable background) {
if (viewWidth == 0) {
viewWidth = ((Activity) context).getWindowManager().getDefaultDisplay().getWidth();
Log.d(TAG, "viewWidth: " + viewWidth);
}
if (null == paint) {
paint = new Paint();
paint.setColor(Color.parseColor("#ff000000"));
paint.setStrokeWidth(dip2px(1f));
}
background = new Drawable() {
@Override
public void draw(Canvas canvas) {
canvas.drawLine(viewWidth * 1 / 6, obtainSelectedAreaBorder()[0], viewWidth * 5 / 6, obtainSelectedAreaBorder()[0], paint);
canvas.drawLine(viewWidth * 1 / 6, obtainSelectedAreaBorder()[1], viewWidth * 5 / 6, obtainSelectedAreaBorder()[1], paint);
}
@Override
public void setAlpha(int alpha) {
}
@Override
public void setColorFilter(ColorFilter cf) {
}
@Override
public int getOpacity() {
return 0;
}
};
super.setBackgroundDrawable(background);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
Log.d(TAG, "w: " + w + ", h: " + h + ", oldw: " + oldw + ", oldh: " + oldh);
viewWidth = w;
setBackgroundDrawable(null);
}
/**
* 选中回调
*/
private void onSeletedCallBack() {
if (null != onWheelViewListener) {
onWheelViewListener.onSelected(selectedIndex, items.get(selectedIndex));
}
}
public void setSeletion(int position) {
final int p = position;
selectedIndex = p + offset;
this.post(new Runnable() {
@Override
public void run() {
WheelView.this.smoothScrollTo(0, p * itemHeight);
}
});
}
public String getSeletedItem() {
return items.get(selectedIndex);
}
public int getSeletedIndex() {
return selectedIndex - offset;
}
@Override
public void fling(int velocityY) {
super.fling(velocityY / 3);
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_UP) {
startScrollerTask();
}
return super.onTouchEvent(ev);
}
private OnWheelViewListener onWheelViewListener;
public OnWheelViewListener getOnWheelViewListener() {
return onWheelViewListener;
}
public void setOnWheelViewListener(OnWheelViewListener onWheelViewListener) {
this.onWheelViewListener = onWheelViewListener;
}
private int dip2px(float dpValue) {
final float scale = context.getResources().getDisplayMetrics().density;
return (int) (dpValue * scale + 0.5f);
}
private int getViewMeasuredHeight(View view) {
int width = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
int expandSpec = View.MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, View.MeasureSpec.AT_MOST);
view.measure(width, expandSpec);
return view.getMeasuredHeight();
}
}
\ No newline at end of file
package com.example.blu.toys.view;
import android.content.Context;
import android.util.AttributeSet;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
public class WrapContentGridLayoutManager extends LinearLayoutManager {
public WrapContentGridLayoutManager(Context context) {
super(context);
}
public WrapContentGridLayoutManager(Context context, int orientation, boolean reverseLayout) {
super(context, orientation, reverseLayout);
}
public WrapContentGridLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
try {
super.onLayoutChildren(recycler, state);
} catch (IndexOutOfBoundsException e) {
//手动catch住
e.printStackTrace();
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/black" />
<corners android:radius="150dp" />
<size
android:width="@dimen/dp_5"
android:height="@dimen/dp_5" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/white" />
<corners android:radius="150dp" />
<size
android:width="@dimen/dp_5"
android:height="@dimen/dp_5" />
</shape>
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFCA05"
android:orientation="vertical"
tools:context=".activity.MusicActivity">
<com.example.blu.toys.view.TypefaceTextView
android:id="@+id/open_music"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/back_but"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_14"
android:gravity="center"
android:text="开机音乐"
android:textColor="@color/backer_back"
android:textSize="@dimen/sp_24"
android:textStyle="bold"
app:typeface="@string/LittleOrion" />
<com.example.blu.toys.view.TypefaceTextView
android:id="@+id/close_music"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/back_but"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_14"
android:gravity="center"
android:text="关机音乐"
android:textColor="@color/backer_back"
android:textSize="@dimen/sp_24"
android:textStyle="bold"
app:typeface="@string/LittleOrion" />
</LinearLayout>
\ No newline at end of file
......@@ -18,6 +18,7 @@
android:gravity="center"
android:padding="@dimen/dp_5"
android:text="Back"
app:typeface="@string/LittleOrion"
android:textColor="@color/white"
android:textSize="@dimen/sp_28"
android:textStyle="bold" />
......@@ -37,6 +38,7 @@
android:gravity="center"
android:padding="@dimen/dp_10"
android:text="00:14:99"
app:typeface="@string/LittleOrion"
android:textColor="@color/white"
android:textSize="@dimen/sp_30"
android:textStyle="bold" />
......@@ -67,6 +69,7 @@
android:layout_centerVertical="true"
android:gravity="center"
android:text="Cancel"
app:typeface="@string/LittleOrion"
android:textColor="@color/white"
android:textSize="@dimen/sp_30"
android:textStyle="bold" />
......@@ -89,6 +92,7 @@
android:layout_centerVertical="true"
android:gravity="center"
android:text="Pause"
app:typeface="@string/LittleOrion"
android:textColor="@color/white"
android:textSize="@dimen/sp_30"
android:textStyle="bold" />
......@@ -111,6 +115,7 @@
android:layout_centerVertical="true"
android:gravity="center"
android:text="Resume"
app:typeface="@string/LittleOrion"
android:textColor="@color/white"
android:textSize="@dimen/sp_30"
android:textStyle="bold" />
......
......@@ -8,19 +8,26 @@
tools:context=".activity.SearchingActivity">
<com.example.blu.toys.view.TypefaceTextView
<LinearLayout
android:id="@+id/back_but"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/black_thumb"
android:gravity="center"
android:gravity="center">
<com.example.blu.toys.view.TypefaceTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_5"
android:text="Back"
android:textColor="@color/white"
android:textSize="@dimen/sp_28"
android:textStyle="bold" />
android:textStyle="bold"
app:typeface="@string/LittleOrion" />
</LinearLayout>
<com.example.blu.toys.view.TypefaceTextView
......@@ -57,16 +64,30 @@
android:orientation="vertical">
<com.example.blu.toys.view.TypefaceTextView
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Srearching..."
android:orientation="horizontal">
<com.example.blu.toys.view.TypefaceTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Srearching"
android:textColor="@color/black"
android:textSize="@dimen/sp_22"
android:textStyle="bold" />
<com.example.blu.toys.view.PointWaitBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="@dimen/dp_3" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/go_search_ble"
......
......@@ -47,34 +47,15 @@
android:textStyle="bold" />
<com.example.blu.toys.view.TypefaceTextView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/black_thumb"
android:gravity="center"
android:padding="@dimen/dp_10"
android:text="Stoplight Golight Time 1"
android:textColor="@color/white"
android:textSize="@dimen/sp_22"
android:textStyle="bold" />
<com.example.blu.toys.view.TypefaceTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/black_thumb"
android:gravity="center"
android:padding="@dimen/dp_10"
android:text="Stoplight Golight Time 1"
android:textColor="@color/white"
android:textSize="@dimen/sp_22"
android:textStyle="bold" />
app:layout_constraintTop_toBottomOf="@+id/include" />
<com.example.blu.toys.view.TypefaceTextView
......
......@@ -20,7 +20,8 @@
android:text="Back"
android:textColor="@color/white"
android:textSize="@dimen/sp_28"
android:textStyle="bold" />
android:textStyle="bold"
app:typeface="@string/LittleOrion" />
<LinearLayout
......@@ -47,7 +48,8 @@
android:text="Select Timer Type"
android:textColor="@color/backer_back"
android:textSize="@dimen/sp_24"
android:textStyle="bold" />
android:textStyle="bold"
app:typeface="@string/LittleOrion" />
<RelativeLayout
......@@ -71,6 +73,7 @@
<Switch
android:id="@+id/alarm_switch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
......@@ -109,6 +112,7 @@
<Switch
android:id="@+id/music_switch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
......@@ -147,6 +151,7 @@
<Switch
android:id="@+id/green_switch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
......@@ -196,6 +201,7 @@
<SeekBar
android:id="@+id/brightness_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......
......@@ -20,7 +20,8 @@
android:text="Back"
android:textColor="@color/white"
android:textSize="@dimen/sp_28"
android:textStyle="bold" />
android:textStyle="bold"
app:typeface="@string/LittleOrion" />
<ImageView
......@@ -44,7 +45,8 @@
android:text="Set Your Timer!"
android:textColor="@color/backer_back"
android:textSize="@dimen/sp_34"
android:textStyle="bold" />
android:textStyle="bold"
app:typeface="@string/LittleOrion" />
<LinearLayout
......@@ -71,27 +73,75 @@
android:text="Select End Timer"
android:textColor="@color/backer_back"
android:textSize="@dimen/sp_24"
android:textStyle="bold" />
android:textStyle="bold"
app:typeface="@string/LittleOrion" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/dp_75"
android:background="@drawable/black_thumb"
android:padding="@dimen/dp_5">
>
<com.example.blu.toys.view.TypefaceTextView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:gravity="center_horizontal"
android:padding="@dimen/dp_10"
android:text="08:00:00"
android:gravity="center">
<com.example.blu.toys.view.WheelView
android:id="@+id/wheel_hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
<com.example.blu.toys.view.TypefaceTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/back_but"
android:layout_centerHorizontal="true"
android:layout_gravity="center_vertical"
android:text=":"
android:textColor="@color/white"
android:textSize="@dimen/sp_28"
android:textStyle="bold"
android:textSize="@dimen/sp_24"
app:typeface="@string/LittleOrion" />
<com.example.blu.toys.view.WheelView
android:id="@+id/wheel_minute"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
<com.example.blu.toys.view.TypefaceTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/back_but"
android:layout_centerHorizontal="true"
android:layout_gravity="center_vertical"
android:text=":"
android:textColor="@color/white"
android:textSize="@dimen/sp_24"
app:typeface="@string/LittleOrion" />
<com.example.blu.toys.view.WheelView
android:id="@+id/wheel_second"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
<com.example.blu.toys.view.WheelView
android:id="@+id/wheel_am_pm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="20dp" />
</LinearLayout>
</RelativeLayout>
......@@ -107,26 +157,65 @@
android:text="Select Time Interval"
android:textColor="@color/backer_back"
android:textSize="@dimen/sp_24"
android:textStyle="bold" />
android:textStyle="bold"
app:typeface="@string/LittleOrion" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/dp_50"
android:background="@drawable/black_thumb"
android:padding="@dimen/dp_5">
<com.example.blu.toys.view.TypefaceTextView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:gravity="center"
android:padding="@dimen/dp_10"
android:text="00:15:00"
android:gravity="center">
<com.example.blu.toys.view.WheelView
android:id="@+id/wheel_hour_dw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
<com.example.blu.toys.view.TypefaceTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/back_but"
android:layout_centerHorizontal="true"
android:layout_gravity="center_vertical"
android:text=":"
android:textColor="@color/white"
android:textSize="@dimen/sp_28"
android:textStyle="bold"
android:textSize="@dimen/sp_24"
app:typeface="@string/LittleOrion" />
<com.example.blu.toys.view.WheelView
android:id="@+id/wheel_minute_dw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
<com.example.blu.toys.view.TypefaceTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/back_but"
android:layout_centerHorizontal="true"
android:layout_gravity="center_vertical"
android:text=":"
android:textColor="@color/white"
android:textSize="@dimen/sp_24"
app:typeface="@string/LittleOrion" />
<com.example.blu.toys.view.WheelView
android:id="@+id/wheel_second_dw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
</LinearLayout>
</RelativeLayout>
......
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFCA05"
tools:context=".activity.SettingMusicActivity">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20"
android:padding="@dimen/dp_10"
app:layout_constraintTop_toBottomOf="@+id/include" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<com.example.blu.toys.view.TypefaceTextView 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/dv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_20"
android:background="@drawable/black_thumb"
android:gravity="center"
android:padding="@dimen/dp_10"
android:text="Stoplight Golight Time 1"
android:textColor="@color/white"
android:textSize="@dimen/sp_22"
android:textStyle="bold">
</com.example.blu.toys.view.TypefaceTextView>
\ No newline at end of file
<?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:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFCA05"
android:gravity="center"
android:padding="@dimen/dp_10">
<com.example.blu.toys.view.TypefaceTextView
android:id="@+id/dv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_20"
android:gravity="center"
android:padding="@dimen/dp_10"
android:text="Stoplight Golight Time 1"
android:textColor="@color/white"
android:textSize="@dimen/sp_22"
android:textStyle="bold" />
</LinearLayout>
\ No newline at end of file
<?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="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?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="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
......@@ -3,8 +3,8 @@ buildscript {
repositories {
google()
jcenter()
// maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
// maven { url 'https://jitpack.io' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://jitpack.io' }
}
dependencies {
......@@ -16,9 +16,9 @@ buildscript {
allprojects {
repositories {
google()
mavenCentral()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
// maven { url 'https://www.jitpack.io' }
maven { url "https://jitpack.io" }
jcenter()
}
}
......
.gradle/
.DS_Store
local.properties
# build files
build/
bin/
gen/
output/
# android studio
*.iml
.idea
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