Skip to content

Commit

Permalink
clean code pictograms view
Browse files Browse the repository at this point in the history
  • Loading branch information
gonojuarez committed Nov 22, 2022
1 parent 605e76f commit e2bb8cf
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.stonefacesoft.pictogramslibrary.utils.GlideAttatcher;

import java.io.File;
import java.io.IOException;

public class TarjetView extends ConstraintLayout {
protected TextView StrTittle;
Expand Down Expand Up @@ -78,18 +79,13 @@ public void selectIcon(){

}

public void selectIcon(OTTAAProjectObjects object) {
try{
String path = object.getEditedPictogram();
File picture=new File(path);
if(picture.exists())
glideAttatcher.useDiskCacheStrategy().loadDrawable(object,this.icon);
else
glideAttatcher.useDiskCacheStrategy().loadDrawable(Uri.parse(object.getUrl()),this.icon);
}catch (Exception ex){
Drawable aux = mContext.getResources().getDrawable(R.drawable.ic_baseline_cloud_download_24);
glideAttatcher.useDiskCacheStrategy().loadDrawable(aux,this.icon);
}
protected void selectIcon(OTTAAProjectObjects object) {
String path = object.getEditedPictogram();
File picture=new File(path);
if(picture.exists())
glideAttatcher.useDiskCacheStrategy().loadDrawable(object,this.icon);
else
glideAttatcher.useDiskCacheStrategy().loadDrawable(Uri.parse(object.getUrl()),this.icon);
}

public void setGlideAttatcher(GlideAttatcher glideAttatcher) {
Expand Down

0 comments on commit e2bb8cf

Please sign in to comment.