Skip to content

Commit

Permalink
迁移到Androidx 升级RxAndroidBle版本
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeSteven committed Dec 4, 2019
1 parent d1b65aa commit d7815d9
Show file tree
Hide file tree
Showing 26 changed files with 194 additions and 93 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
134 changes: 109 additions & 25 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 17 additions & 3 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'


Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Aug 06 16:53:02 CST 2018
#Tue Dec 03 17:44:04 CST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
6 changes: 3 additions & 3 deletions rxblelib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ apply plugin: 'com.github.dcendents.android-maven'


android {
compileSdkVersion 27
compileSdkVersion 28



defaultConfig {
minSdkVersion 18
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
Expand All @@ -26,6 +26,6 @@ group = 'com.github.JoeSteven' // 最好是你的 github 名字

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api 'com.polidea.rxandroidble2:rxandroidble:1.6.0'
api 'com.polidea.rxandroidble2:rxandroidble:1.10.5'
api 'io.reactivex.rxjava2:rxandroid:2.0.2'
}
2 changes: 1 addition & 1 deletion rxblelib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.joey.rxble" >
<application >
<activity android:name=".sample.permission.PermissionActivity"/>

</application>
</manifest>
5 changes: 1 addition & 4 deletions rxblelib/src/main/java/com/joey/rxble/RxBle.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@

import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothGattCharacteristic;
import android.content.Context;
import android.support.annotation.MainThread;
import android.util.Log;
import androidx.annotation.MainThread;

import com.polidea.rxandroidble2.RxBleClient;
import com.polidea.rxandroidble2.internal.RxBleLog;

import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.subjects.PublishSubject;


Expand Down
3 changes: 2 additions & 1 deletion rxblelib/src/main/java/com/joey/rxble/RxBleOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import android.annotation.SuppressLint;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothGattDescriptor;
import android.support.annotation.NonNull;

import androidx.annotation.NonNull;

import com.joey.rxble.exception.BleEnableException;
import com.polidea.rxandroidble2.NotificationSetupMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.UUID;

import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.functions.Function;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import java.util.UUID;

import io.reactivex.ObservableSource;
import io.reactivex.SingleSource;
import io.reactivex.functions.Function;

/**
Expand Down
12 changes: 6 additions & 6 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
compileSdkVersion 28
defaultConfig {
applicationId "com.joey.rxble"
applicationId "com.joey.sample"
minSdkVersion 18
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
Expand All @@ -24,7 +24,7 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation project(':rxblelib')
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
}
9 changes: 5 additions & 4 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.joey.rxble">
package="com.joey.sample">

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
Expand All @@ -10,21 +10,22 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

<application
android:name=".sample.BleApplication"
android:name=".BleApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".sample.ScanActivity">
<activity android:name="com.joey.sample.ScanActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".sample.connect.ConnectActivity"></activity>
<activity android:name=".connect.ConnectActivity"></activity>
<activity android:name=".permission.PermissionActivity"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.joey.rxble.sample;
package com.joey.sample;

import android.app.Activity;
import android.app.Application;
import android.os.Bundle;
import android.support.annotation.NonNull;
import androidx.annotation.NonNull;
import android.util.Log;

import com.joey.rxble.BuildConfig;
import com.joey.rxble.RxBle;
import com.joey.rxble.sample.permission.PermissionListener;
import com.joey.rxble.sample.permission.PermissionUtil;
import com.joey.sample.permission.PermissionListener;
import com.joey.sample.permission.PermissionUtil;


/**
Expand Down
Loading

0 comments on commit d7815d9

Please sign in to comment.