Display contact color in background for generated avatars

Fixes #7028
// FREEBIE
This commit is contained in:
Moxie Marlinspike
2017-10-04 15:23:33 -07:00
parent 42f613e722
commit ac282ccf70
9 changed files with 33 additions and 6 deletions

View File

@@ -37,4 +37,9 @@ public class BitmapContactPhoto implements ContactPhoto {
public boolean isGenerated() {
return false;
}
@Override
public boolean isResource() {
return false;
}
}

View File

@@ -9,5 +9,6 @@ public interface ContactPhoto {
public Drawable asDrawable(Context context, int color, boolean inverted);
public Drawable asCallCard(Context context);
public boolean isGenerated();
public boolean isResource();
}

View File

@@ -55,4 +55,9 @@ public class GeneratedContactPhoto implements ContactPhoto {
public boolean isGenerated() {
return true;
}
@Override
public boolean isResource() {
return false;
}
}

View File

@@ -56,6 +56,11 @@ public class ResourceContactPhoto implements ContactPhoto {
return false;
}
@Override
public boolean isResource() {
return true;
}
private static class ExpandingLayerDrawable extends LayerDrawable {
public ExpandingLayerDrawable(Drawable[] layers) {
super(layers);

View File

@@ -31,4 +31,9 @@ public class TransparentContactPhoto implements ContactPhoto {
public boolean isGenerated() {
return false;
}
@Override
public boolean isResource() {
return false;
}
}