-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #811 from Yalantis/improve/native/2.2.8-prs_integr…
…ation Improve/native/2.2.8 prs integration
- Loading branch information
Showing
24 changed files
with
200 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
sample/src/main/java/com/yalantis/ucrop/sample/SampleApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.yalantis.ucrop.sample; | ||
|
||
import android.app.Application; | ||
|
||
import com.yalantis.ucrop.UCropHttpClientStore; | ||
|
||
import java.util.Collections; | ||
|
||
import okhttp3.ConnectionSpec; | ||
import okhttp3.OkHttpClient; | ||
|
||
public class SampleApp extends Application { | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
setUcropHttpClient(); | ||
} | ||
|
||
private void setUcropHttpClient() { | ||
ConnectionSpec cs = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS) | ||
.allEnabledCipherSuites() | ||
.allEnabledTlsVersions() | ||
.build(); | ||
|
||
OkHttpClient client = new OkHttpClient.Builder() | ||
.connectionSpecs(Collections.singletonList(cs)) | ||
.build(); | ||
|
||
UCropHttpClientStore.INSTANCE.setClient(client); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
ucrop/src/main/java/com/yalantis/ucrop/UCropHttpClientStore.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.yalantis.ucrop; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import okhttp3.OkHttpClient; | ||
|
||
public class UCropHttpClientStore { | ||
|
||
private UCropHttpClientStore() {} | ||
|
||
public final static UCropHttpClientStore INSTANCE = new UCropHttpClientStore(); | ||
|
||
private OkHttpClient client; | ||
|
||
@NonNull | ||
public OkHttpClient getClient() { | ||
if (client == null) { | ||
client = new OkHttpClient(); | ||
} | ||
return client; | ||
} | ||
|
||
public void setClient(@NonNull OkHttpClient client) { | ||
this.client = client; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.