Merge remote-tracking branch 'origin/dev-AS' into dev-AS
Conflicts: app/src/main/java/com/hippo/ehviewer/widget/recyclerview/EasyRecyclerView.java
This commit is contained in:
commit
59dccfa513
2 files changed
+14
-17
No files matched your search
@@ -51,11 +51,9 @@ public final class ExDownloader implements Runnable {
|
||||
|
||||
private static final int IO_BUFFER_SIZE = 8 * 1024;
|
||||
|
||||
private static final String[] URL_ARRAY_509 = new String[] {
|
||||
"http://ehgt.org/g/509.gif",
|
||||
"http://ehgt.org/g/509s.gif",
|
||||
"http://st.exhentai.net/img/509.gif",
|
||||
"http://st.exhentai.net/img/509s.gif"
|
||||
private static final String[] URL_509_SUFFIX_ARRAY = {
|
||||
"/509.gif",
|
||||
"/509s.gif"
|
||||
};
|
||||
|
||||
private final Context mContext;
|
||||
@@ -786,9 +784,8 @@ public final class ExDownloader implements Runnable {
|
||||
|
||||
//Check 509 gif
|
||||
boolean get509 = false;
|
||||
int length = URL_ARRAY_509.length;
|
||||
for (int j = 0; j < length; j++) {
|
||||
if (URL_ARRAY_509[j].equals(imageUrl)) {
|
||||
for (String suffix : URL_509_SUFFIX_ARRAY) {
|
||||
if (imageUrl.endsWith(suffix)) {
|
||||
// Get 509 gif here
|
||||
get509 = true;
|
||||
break;
|
||||
|
||||
@@ -16,13 +16,8 @@
|
||||
|
||||
package com.hippo.ehviewer.gallery.data;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Movie;
|
||||
import android.util.SparseArray;
|
||||
|
||||
import com.hippo.ehviewer.AppHandler;
|
||||
import com.hippo.ehviewer.ehclient.ExDownloader;
|
||||
@@ -35,6 +30,12 @@ import com.hippo.ehviewer.util.EhUtils;
|
||||
import com.hippo.ehviewer.util.Log;
|
||||
import com.hippo.ehviewer.util.Utils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
public class ImageSet implements ExDownloader.ListenerForImageSet {
|
||||
|
||||
private static final String TAG = ImageSet.class.getSimpleName();
|
||||
@@ -52,8 +53,8 @@ public class ImageSet implements ExDownloader.ListenerForImageSet {
|
||||
private final File mDir;
|
||||
private final AutoExpandArray<String> mImageFilenameArray;
|
||||
private ImageListener mListener;
|
||||
private final Queue<DecodeInfo> mDecodeQueue = new ConcurrentLinkedQueue<DecodeInfo>();
|
||||
private final SparseArray<Float> mPercentMap = new SparseArray<Float>(5);
|
||||
private final Queue<DecodeInfo> mDecodeQueue = new ConcurrentLinkedQueue<>();
|
||||
private final Map<Integer, Float> mPercentMap = new ConcurrentHashMap<>(5);
|
||||
private final DecodeWorker mDecodeWorker;
|
||||
/** If true, then wake Worker, worker will stop **/
|
||||
private volatile boolean mStopWork = false;
|
||||
@@ -266,8 +267,7 @@ public class ImageSet implements ExDownloader.ListenerForImageSet {
|
||||
|
||||
@Override
|
||||
public void onDownloading(final int index, final float percent) {
|
||||
mPercentMap.append(index, percent);
|
||||
|
||||
mPercentMap.put(index, percent);
|
||||
AppHandler.getInstance().post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
Reference in new issue
Block a user