Skip to content

Commit 1e63618

Browse files
authored
Merge pull request #5 from whisp-internet/develop
2.1.0
2 parents af8d9e9 + a6d854b commit 1e63618

File tree

13 files changed

+41
-34
lines changed

13 files changed

+41
-34
lines changed

auth/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ android {
3232
versionCode 1
3333
versionName "1.0"
3434

35-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
35+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
3636

3737
}
3838

@@ -52,8 +52,8 @@ dependencies {
5252
implementation fileTree(dir: 'libs', include: ['*.jar'])
5353
api project(":core")
5454

55-
implementation 'com.android.support:support-annotations:28.0.0'
56-
testImplementation 'junit:junit:4.13'
55+
implementation 'androidx.annotation:annotation:1.1.0'
56+
testImplementation 'junit:junit:4.13.1'
5757

5858
compileOnly 'com.squareup.retrofit2:retrofit:2.9.0'
5959
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2424

2525
buildscript {
26-
ext.kotlin_version = '1.4.0'
27-
ext.okhttp_version = '4.8.1'
26+
ext.kotlin_version = '1.4.20'
27+
ext.okhttp_version = '4.9.0'
2828
repositories {
2929
google()
3030
jcenter()
@@ -33,7 +33,7 @@ buildscript {
3333
}
3434
}
3535
dependencies {
36-
classpath 'com.android.tools.build:gradle:4.2.0-alpha07'
36+
classpath 'com.android.tools.build:gradle:4.2.0-alpha15'
3737
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
3838
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.3.0"
3939

cache/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ android {
3232
versionCode 1
3333
versionName "1.0"
3434

35-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
35+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
3636

3737
}
3838

@@ -52,6 +52,6 @@ dependencies {
5252
implementation fileTree(dir: 'libs', include: ['*.jar'])
5353
api project(":core")
5454

55-
implementation 'com.android.support:support-annotations:28.0.0'
55+
implementation 'androidx.annotation:annotation:1.1.0'
5656
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
5757
}

cache/src/main/java/io/stanwood/framework/network/cache/CacheInterceptor.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
package io.stanwood.framework.network.cache;
2424

2525
import android.content.Context;
26-
import android.support.annotation.NonNull;
27-
import android.support.annotation.Nullable;
26+
import androidx.annotation.NonNull;
27+
import androidx.annotation.Nullable;
28+
29+
import org.jetbrains.annotations.NotNull;
2830

2931
import java.io.IOException;
3032

@@ -78,11 +80,12 @@ public CacheInterceptor(
7880
this.errorCallback = errorCallback;
7981
}
8082

83+
@NotNull
8184
@Override
8285
public Response intercept(@NonNull Chain chain) throws IOException {
8386
Request request = chain.request();
8487
String offlineCacheHeader = request.header(CacheHeaderKeys.APPLY_OFFLINE_CACHE);
85-
if (Boolean.valueOf(offlineCacheHeader) && !connectionState.isConnected()) {
88+
if (Boolean.parseBoolean(offlineCacheHeader) && !connectionState.isConnected()) {
8689
Request.Builder builder = request.newBuilder();
8790
if (queryAuthParameterKey != null) {
8891
builder.url(request
@@ -100,7 +103,7 @@ public Response intercept(@NonNull Chain chain) throws IOException {
100103
}
101104

102105
String responseCacheHeader = request.header(CacheHeaderKeys.REFRESH);
103-
if (Boolean.valueOf(responseCacheHeader)) {
106+
if (Boolean.parseBoolean(responseCacheHeader)) {
104107
try {
105108
return chain.proceed(request.newBuilder().cacheControl(CacheControl.FORCE_NETWORK).build());
106109
} catch (IOException e) {

cache/src/main/java/io/stanwood/framework/network/cache/CacheNetworkInterceptor.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222

2323
package io.stanwood.framework.network.cache;
2424

25-
import android.support.annotation.NonNull;
26-
import android.support.annotation.Nullable;
25+
import androidx.annotation.NonNull;
26+
import androidx.annotation.Nullable;
27+
28+
import org.jetbrains.annotations.NotNull;
2729

2830
import java.io.IOException;
2931

@@ -80,13 +82,14 @@ public CacheNetworkInterceptor(@Nullable String queryAuthParameterKey, long cach
8082
this.cacheForSeconds = cacheForSeconds;
8183
}
8284

85+
@NotNull
8386
@Override
8487
public Response intercept(@NonNull Chain chain) throws IOException {
8588
Request request = chain.request();
8689
String responseCacheHeader = request.header(CacheHeaderKeys.APPLY_RESPONSE_CACHE);
8790
String offlineCacheHeader = request.header(CacheHeaderKeys.APPLY_OFFLINE_CACHE);
88-
boolean isGeneralCache = Boolean.valueOf(responseCacheHeader);
89-
boolean isOfflineCache = Boolean.valueOf(offlineCacheHeader);
91+
boolean isGeneralCache = Boolean.parseBoolean(responseCacheHeader);
92+
boolean isOfflineCache = Boolean.parseBoolean(offlineCacheHeader);
9093
if (isGeneralCache || isOfflineCache) {
9194
Response originalResponse = chain.proceed(request);
9295
Response.Builder builder = originalResponse.newBuilder();

core/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ android {
3232
versionCode 1
3333
versionName "1.0"
3434

35-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
35+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
3636

3737
}
3838

@@ -51,13 +51,13 @@ android {
5151
dependencies {
5252
implementation fileTree(dir: 'libs', include: ['*.jar'])
5353

54-
implementation 'com.android.support:support-annotations:28.0.0'
55-
testImplementation 'junit:junit:4.13'
54+
implementation 'androidx.annotation:annotation:1.1.0'
55+
testImplementation 'junit:junit:4.13.1'
5656

5757
api "com.squareup.okhttp3:okhttp:$okhttp_version"
5858
compileOnly 'com.squareup.retrofit2:retrofit:2.9.0'
5959
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
60-
api 'org.jetbrains.kotlinx:kotlinx-serialization-core:1.0.0-RC'
60+
api "org.jetbrains.kotlinx:kotlinx-serialization-json:1.0.1"
6161
api 'com.nytimes.android:store3:3.1.1'
6262
api 'com.nytimes.android:filesystem3:3.1.1'
6363
implementation 'io.reactivex.rxjava2:rxjava:2.2.3' // same version as defined within store

core/src/main/java/io/stanwood/framework/network/core/store/SerializationParserFactory.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ package io.stanwood.framework.network.core.store
2424
import com.nytimes.android.external.store3.base.Parser
2525
import kotlinx.serialization.KSerializer
2626
import kotlinx.serialization.json.Json
27-
import kotlinx.serialization.json.JsonConfiguration
2827
import okio.BufferedSource
2928
import java.io.Reader
3029

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131

3232
# Specifies the JVM arguments used for the daemon process.
3333
# The setting is particularly useful for tweaking memory settings.
34+
android.enableJetifier=true
35+
android.useAndroidX=true
3436
org.gradle.jvmargs=-Xmx1536m
3537

3638
# When configured, Gradle will run in incubating parallel mode.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip
6+
distributionUrl=https://services.gradle.org/distributions/gradle-6.7-bin.zip

sample/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ android {
3535
versionCode 1
3636
versionName "1.0"
3737

38-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
38+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
3939

4040
}
4141

@@ -57,10 +57,10 @@ dependencies {
5757
implementation project(':auth')
5858
implementation project(':cache')
5959

60-
implementation 'com.android.support:appcompat-v7:27.1.1'
61-
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
62-
testImplementation 'junit:junit:4.13'
63-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
64-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
60+
implementation 'androidx.appcompat:appcompat:1.2.0'
61+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
62+
testImplementation 'junit:junit:4.13.1'
63+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
64+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
6565
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
6666
}

0 commit comments

Comments
 (0)