Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
qii committed Aug 31, 2013
1 parent f942820 commit e28f46d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/org/qii/weiciyuan/support/asyncdrawable/ReadWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public ReadWorker(TimeLineImageView view, String url, FileLocationMethod method)
view.getProgressBar().setVisibility(View.VISIBLE);
view.getProgressBar().setProgress(0);
} else {
view.getProgressBar().setVisibility(View.GONE);
view.getProgressBar().setVisibility(View.INVISIBLE);
view.getProgressBar().setProgress(0);
}
}
Expand Down Expand Up @@ -194,7 +194,7 @@ private void displayBitmap(Bitmap bitmap) {
if (pbWeakReference != null) {
ProgressBar pb = pbWeakReference.get();
if (pb != null) {
pb.setVisibility(View.GONE);
pb.setVisibility(View.INVISIBLE);
}
}

Expand Down Expand Up @@ -231,7 +231,7 @@ private void resetProgressBarStatues() {
return;
ProgressBar pb = pbWeakReference.get();
if (pb != null) {
pb.setVisibility(View.GONE);
pb.setVisibility(View.INVISIBLE);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private void display(final TimeLineImageView view, final String urlKey, final Fi
if (bitmap != null) {
view.setImageBitmap(bitmap);
view.getImageView().setTag(urlKey);
view.getProgressBar().setVisibility(View.GONE);
view.getProgressBar().setVisibility(View.INVISIBLE);
if (view.getAlpha() != 1.0f) {
view.setAlpha(1.0f);
}
Expand All @@ -265,7 +265,7 @@ private void display(final TimeLineImageView view, final String urlKey, final Fi

if (isFling) {
view.setImageDrawable(defaultBG);
view.getProgressBar().setVisibility(View.GONE);
view.getProgressBar().setVisibility(View.INVISIBLE);
return;
}

Expand Down
5 changes: 5 additions & 0 deletions src/org/qii/weiciyuan/support/imagetool/ImageTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.graphics.BitmapFactory;
import android.graphics.BitmapRegionDecoder;
import android.graphics.Rect;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import org.qii.weiciyuan.support.error.WeiboException;
import org.qii.weiciyuan.support.file.FileDownloaderHttpHelper;
Expand Down Expand Up @@ -794,6 +795,10 @@ public static String compressPic(Context context, String picPath) {
}
return tmp;
}

public static boolean isThisPictureGif(String url) {
return !TextUtils.isEmpty(url) && url.endsWith(".gif");
}
}


0 comments on commit e28f46d

Please sign in to comment.