Move Glide-SSO integration into a separate module

This commit is contained in:
Stefan Niedermann 2020-06-20 12:08:52 +02:00
parent e8c744477e
commit 8f746f9e97
14 changed files with 68 additions and 9 deletions

View file

@ -65,6 +65,7 @@ dependencies {
// Glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation project(path: ':glide-sso-integration')
// Android X
implementation "androidx.appcompat:appcompat:1.1.0"

View file

@ -10,9 +10,9 @@ import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import it.niedermann.android.glidesso.SingleSignOnUrl;
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.databinding.ItemAccountChooseBinding;
import it.niedermann.owncloud.notes.glide.SingleSignOnUrl;
import it.niedermann.owncloud.notes.model.LocalAccount;
public class AccountSwitcherViewHolder extends RecyclerView.ViewHolder {

View file

@ -13,9 +13,9 @@ import com.bumptech.glide.request.RequestOptions;
import java.util.List;
import it.niedermann.android.glidesso.SingleSignOnUrl;
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.databinding.ItemAccountChooseBinding;
import it.niedermann.owncloud.notes.glide.SingleSignOnUrl;
import it.niedermann.owncloud.notes.model.LocalAccount;
import static it.niedermann.owncloud.notes.android.fragment.AccountChooserAdapter.AccountChooserViewHolder;

View file

@ -12,9 +12,9 @@ import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import it.niedermann.android.glidesso.SingleSignOnUrl;
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.databinding.ItemAccountChooseBinding;
import it.niedermann.owncloud.notes.glide.SingleSignOnUrl;
import it.niedermann.owncloud.notes.model.LocalAccount;
import static android.view.View.GONE;

1
glide-sso-integration/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build

View file

@ -0,0 +1,34 @@
apply plugin: 'com.android.library'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
minSdkVersion 14
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
// Nextcloud SSO
implementation "com.github.nextcloud:Android-SingleSignOn:0.5.1"
// Glide
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation fileTree(dir: "libs", include: ["*.jar"])
}

View file

View file

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View file

@ -0,0 +1 @@
<manifest package="it.niedermann.android.glidesso" />

View file

@ -1,4 +1,4 @@
package it.niedermann.owncloud.notes.glide;
package it.niedermann.android.glidesso;
import android.content.Context;
import android.util.Log;

View file

@ -1,4 +1,4 @@
package it.niedermann.owncloud.notes.glide;
package it.niedermann.android.glidesso;
import android.content.Context;
import android.util.Log;

View file

@ -1,4 +1,4 @@
package it.niedermann.owncloud.notes.glide;
package it.niedermann.android.glidesso;
import android.content.Context;
@ -14,7 +14,7 @@ import com.nextcloud.android.sso.model.SingleSignOnAccount;
import java.net.URL;
import java.util.Map;
import static it.niedermann.owncloud.notes.glide.SingleSignOnStreamFetcher.X_HEADER_SSO_ACCOUNT_NAME;
import static it.niedermann.android.glidesso.SingleSignOnStreamFetcher.X_HEADER_SSO_ACCOUNT_NAME;
/**
* Use this as kind of {@link GlideUrl} if you want to do a {@link Glide} request from a {@link SingleSignOnAccount} which is not set by {@link SingleAccountHelper#setCurrentAccount(Context, String)}.

View file

@ -1,4 +1,4 @@
package it.niedermann.owncloud.notes.glide;
package it.niedermann.android.glidesso;
import android.content.Context;

View file

@ -1 +1,2 @@
include ':app'
include ':app'
include ':glide-sso-integration'