Skip to content

Commit

Permalink
load image utils
Browse files Browse the repository at this point in the history
  • Loading branch information
AomineD committed Jun 7, 2022
1 parent 8896855 commit 24a2324
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ public void loadImg(int rawFile){
PicassoUtils.loadImageWithLoading(rawFile, img, loading_root);
}

public void loadImgPath(String path){
if(!path.isEmpty() && img != null && loading_root != null) {
PicassoUtils.loadImageLoadingPath(path, img, loading_root);
}
}

public void loadImg(String url, boolean faded){
if(!url.isEmpty() && img != null && loading_root != null) {
if(!faded)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,24 @@ public void onError(Exception e) {
}


public static void loadImageLoadingPath(String path, ImageView imgview, LottieAnimationView lt){
Picasso.get().load(path).fetch(new Callback(){
@Override
public void onSuccess() {
imgview.setAlpha(0f);
Picasso.get().load(path).fit().into(imgview);
lt.setVisibility(View.GONE);
imgview.animate().setDuration(1000).alpha(1f).start();
}

@Override
public void onError(Exception e) {
lt.setVisibility(View.GONE);
}
});
}


private static String apike = "79d54c96b390d98b80dbe6ca12d83615";

public interface UploadListener{
Expand Down

0 comments on commit 24a2324

Please sign in to comment.