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 7ccd2c5 commit a0c425e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected void setData() {
Drawable drawable = findResource(pictogramsLibraryGameGroup.getPictogram());
glideAttatcher.setHeight(IconHeight).setWidth(IconWidth).useDiskCacheStrategy().loadDrawable(drawable, this.icon);
} else {
selectIcon(pictogramsLibraryGameGroup,glideAttatcher);
selectIcon(pictogramsLibraryGameGroup, this.icon);
}
}

Expand Down Expand Up @@ -134,7 +134,7 @@ public void setData(int height, int with) {
Drawable drawable = findResource(pictogramsLibraryGameGroup.getPictogram());
glideAttatcher.setHeight(height).setWidth(with).useDiskCacheStrategy().loadDrawable(drawable, this.icon);
} else {
selectIcon(pictogramsLibraryGameGroup,glideAttatcher);
selectIcon(pictogramsLibraryGameGroup, this.icon);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected void setData() {
Drawable drawable = findResource(pictogramsLibraryGroup.getPictogram());
glideAttatcher.setHeight(IconHeight).setWidth(IconWidth).useDiskCacheStrategy().setRadius(25).UseCornerRadius(true).loadDrawable(drawable, this.icon);
} else {
selectIcon(pictogramsLibraryGroup,glideAttatcher);
selectIcon(pictogramsLibraryGroup,this.icon);
}
}

Expand Down Expand Up @@ -141,7 +141,7 @@ public void setData(int height, int with) {
Drawable drawable = findResource(pictogramsLibraryGroup.getPictogram());
glideAttatcher.setHeight(height).setWidth(with).useDiskCacheStrategy().setRadius(25).UseCornerRadius(true).loadDrawable(drawable, this.icon);
} else {
selectIcon(pictogramsLibraryGroup,glideAttatcher);
selectIcon(pictogramsLibraryGroup,this.icon);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ protected void setData(){
glideAttatcher.useDiskCacheStrategy().loadDrawable(Uri.parse(pictogramsLibraryPictogram.getPictogram()),this.icon);
}
}else{
selectIcon(pictogramsLibraryPictogram,glideAttatcher);
selectIcon(pictogramsLibraryPictogram,this.icon);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ public void selectIcon(){

}

protected void selectIcon(final OTTAAProjectObjects object,GlideAttatcher glideAttatcher) {
protected void selectIcon(final OTTAAProjectObjects object,ImageView icon) {
String path = object.getEditedPictogram();
File picture=new File(path);
if(picture.exists())
glideAttatcher.useDiskCacheStrategy().loadDrawable(object,this.icon);
glideAttatcher.useDiskCacheStrategy().loadDrawable(object,icon);
else
glideAttatcher.useDiskCacheStrategy().loadDrawable(Uri.parse(object.getUrl()),this.icon);
glideAttatcher.useDiskCacheStrategy().loadDrawable(Uri.parse(object.getUrl()),icon);
}

public void setGlideAttatcher(GlideAttatcher glideAttatcher) {
Expand Down

0 comments on commit a0c425e

Please sign in to comment.