Skip to content

Commit

Permalink
Merge pull request #10 from IRA-Team/dev
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
hluhovskyi committed Nov 1, 2015
2 parents 7947a61 + 23c72d4 commit c682c39
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.amulyakhare.textdrawable.TextDrawable;
import com.amulyakhare.textdrawable.util.ColorGenerator;
import com.irateam.vkplayer.models.Audio;
import com.vk.sdk.api.model.VKApiAudio;

public class AlbumCoverUtils {

Expand All @@ -26,9 +25,17 @@ public static Bitmap drawableToBitmap(Drawable drawable) {
return bitmap;
}

//TODO: Remove after refactoring class Audio
public static TextDrawable createFromAudio(Audio audio) {
String artist = audio.artist.trim();
String character;
if (artist.length() > 0) {
character = String.valueOf(artist.charAt(0));
} else {
character = " ";
}
return TextDrawable.builder()
.buildRound(String.valueOf(audio.artist.trim().charAt(0)), ColorGenerator.MATERIAL.getColor(audio.artist.trim()));
.buildRound(character, ColorGenerator.MATERIAL.getColor(audio.artist.trim()));
}

public static Bitmap createBitmapFromAudio(Audio audio) {
Expand Down

0 comments on commit c682c39

Please sign in to comment.