Skip to content

Commit

Permalink
Increased default gif delay.
Browse files Browse the repository at this point in the history
  • Loading branch information
aerovulpe committed Jun 12, 2015
1 parent 773532d commit 378d7be
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/src/main/java/me/aerovulpe/crawler/ui/TouchImageView.java
Original file line number Diff line number Diff line change
Expand Up @@ -1303,8 +1303,7 @@ protected void onDetachedFromWindow() {

public void playGif(String url) {
try {
Handler handler = new Handler();
mGifThread = new GifThread(this, handler, url);
mGifThread = new GifThread(this, url);
mGifThread.start();
} catch (OutOfMemoryError e) {
e.printStackTrace();
Expand All @@ -1317,9 +1316,9 @@ static class GifThread extends Thread {
Handler mHandler;
String mUrl;

public GifThread(TouchImageView touchImageView, Handler handler, String url) {
public GifThread(TouchImageView touchImageView, String url) {
mTouchImageViewRef = new WeakReference<>(touchImageView);
mHandler = handler;
mHandler = new Handler();
mUrl = url;
}

Expand Down Expand Up @@ -1349,7 +1348,7 @@ public void run() {

final Bitmap nextBitmap = gifDecoder.getNextFrame();
int delay = gifDecoder.getDelay(i);
delay = delay != 0 ? delay : 33;
if (delay == 0) delay = 85;
mHandler.post(new Runnable() {
public void run() {
if (nextBitmap != null && !nextBitmap.isRecycled()) {
Expand Down

0 comments on commit 378d7be

Please sign in to comment.