Skip to content

Commit d276ae9

Browse files
committed
Update repos since jcenter is ded, fix refresh hanging due to cdn change
1 parent eb9bedf commit d276ae9

3 files changed

Lines changed: 14 additions & 16 deletions

File tree

build.gradle

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,18 @@
22

33
buildscript {
44
repositories {
5-
jcenter()
6-
maven {
7-
url 'https://maven.google.com/'
8-
name 'Google'
9-
}
5+
mavenCentral()
6+
google()
107
}
118
dependencies {
12-
classpath 'com.android.tools.build:gradle:7.0.1'
13-
14-
// NOTE: Do not place your application dependencies here; they belong
15-
// in the individual module build.gradle files
9+
classpath 'com.android.tools.build:gradle:7.0.4'
1610
}
1711
}
1812

1913
allprojects {
2014
repositories {
21-
jcenter()
22-
maven {
23-
url 'https://maven.google.com/'
24-
name 'Google'
25-
}
15+
mavenCentral()
16+
google()
2617
}
2718
}
2819

theadwatch/src/main/java/honkhonk/threadwatch/retrievers/PostsRetriever.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package honkhonk.threadwatch.retrievers;
22

33
import android.content.Context;
4+
import android.content.SharedPreferences;
45
import android.net.ConnectivityManager;
56
import android.net.NetworkInfo;
7+
import android.preference.PreferenceManager;
68
import android.util.Log;
79

810
import com.android.volley.Request;
@@ -120,7 +122,12 @@ public void onResponse(JSONObject response) {
120122
PostsRetriever.this.response.posts.get(0).attachmentId;
121123

122124
// Try to get OP thumbnail, too, if needed
123-
if (PostsRetriever.this.thread.thumbnail == null) {
125+
final SharedPreferences appSettings =
126+
PreferenceManager.getDefaultSharedPreferences(context);
127+
final boolean shouldGetThumbnail =
128+
appSettings.getBoolean("pref_view_thumbnails", true);
129+
130+
if (shouldGetThumbnail && PostsRetriever.this.thread.thumbnail == null) {
124131
ThumbnailRetriever thumbnailRetriever = new ThumbnailRetriever();
125132
thumbnailRetriever.addListener(PostsRetriever.this);
126133
thumbnailRetriever.retrieveThumbnail(context, PostsRetriever.this.thread);

theadwatch/src/main/java/honkhonk/threadwatch/retrievers/ThumbnailRetriever.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void retrieveThumbnail(final Context context, final ThreadModel thread) {
7979
}
8080

8181
final String url =
82-
"https://is2.4chan.org/"+ thread.board + "/" + thread.attachmentId + "s.jpg";
82+
"https://i.4cdn.org/"+ thread.board + "/" + thread.attachmentId + "s.jpg";
8383

8484
final ImageRequest retrieveRequest = new ImageRequest(url,
8585
new Response.Listener<Bitmap>() {

0 commit comments

Comments
 (0)