Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Update to Picasso 2.71828 #158

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
language: android
jdk: oraclejdk7
jdk: oraclejdk8
android:
components:
# Workaround to get build tools 23.0.3
# Workaround to get build tools 26.0.2
# https://github.com/travis-ci/travis-ci/issues/5036
- tools
- platform-tools
- build-tools-23.0.3
- android-23
- build-tools-26.0.2
- android-26
- extra-android-m2repository

script:
Expand Down
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ext {
dexmakerMockito : 'com.linkedin.dexmaker:dexmaker-mockito:2.2.0',

// Other
picasso : 'com.squareup.picasso:picasso:2.5.2',
picasso : 'com.squareup.picasso:picasso:2.71828',
supportCompatV4 : 'com.android.support:support-compat:26.1.0',
supportCoreV4 : 'com.android.support:support-core-ui:26.1.0',
retrofit : 'com.squareup.retrofit2:retrofit:2.3.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public ComposerView(Context context, AttributeSet attrs, int defStyle) {
}

private void init(Context context) {
imageLoader = Picasso.with(getContext());
imageLoader = Picasso.get();
// TODO: make color vary depending on the style
mediaBg = new ColorDrawable(context.getResources()
.getColor(R.color.tw__composer_light_gray));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public Object instantiateItem(ViewGroup container, int position) {
container.addView(root);

final MediaEntity entity = items.get(position);
Picasso.with(context).load(entity.mediaUrlHttps).into(root);
Picasso.get().load(entity.mediaUrlHttps).into(root);

return root;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static TweetUi getInstance() {
guestSessionProvider = twitterCore.getGuestSessionProvider();
tweetRepository = new TweetRepository(new Handler(Looper.getMainLooper()),
twitterCore.getSessionManager());
imageLoader = Picasso.with(Twitter.getInstance().getContext(getIdentifier()));
imageLoader = Picasso.get();
}

public String getIdentifier() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.Gravity;
import android.view.View;
import android.widget.FrameLayout;
Expand Down Expand Up @@ -66,7 +68,7 @@ public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
}

@Override
public void onBitmapFailed(Drawable errorDrawable) {
public void onBitmapFailed(@NonNull Exception e, @Nullable Drawable errorDrawable) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ public void onSuccess() {
}

@Override
public void onError() { /* intentionally blank */ }
public void onError(Exception e) { /* intentionally blank */ }
}

static class Size {
Expand Down
31 changes: 30 additions & 1 deletion twitter-core/proguard.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,33 @@
# Retain class members for annotations
-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}
}

#okhttp (partially from https://github.com/square/okhttp/blob/master/okhttp/src/main/resources/META-INF/proguard/okhttp3.pro)
-dontwarn com.squareup.okhttp.*

# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase

# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*

# OkHttp platform used only on JVM and when Conscrypt dependency is available.
-dontwarn okhttp3.internal.platform.ConscryptPlatform

#mopub (https://raw.githubusercontent.com/mopub/mopub-android-sdk/master/mopub-sample/proguard.cfg0
# Keep public classes and methods.
-keepclassmembers class com.mopub.** { public *; }
-keep public class com.mopub.**
-keep public class android.webkit.JavascriptInterface {}

# Explicitly keep any custom event classes in any package.
-keep class * extends com.mopub.mobileads.CustomEventBanner {}
-keep class * extends com.mopub.mobileads.CustomEventInterstitial {}
-keep class * extends com.mopub.mobileads.CustomEventRewardedAd {}
-keep class * extends com.mopub.nativeads.CustomEventNative {}

# Keep methods that are accessed via reflection
-keepclassmembers class ** { @com.mopub.common.util.ReflectionTarget *; }

-dontwarn com.twitter.*