Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sharp corners on placeholders (#7142)
All placeholder now have round corners matching the corner radius of the image that will eventually load.
- Loading branch information
Showing
6 changed files
with
40 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
ui/common/src/main/java/de/danoeh/antennapod/ui/common/ImagePlaceholder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package de.danoeh.antennapod.ui.common; | ||
|
||
import android.content.Context; | ||
import android.graphics.drawable.Drawable; | ||
import android.graphics.drawable.GradientDrawable; | ||
|
||
import androidx.core.content.ContextCompat; | ||
|
||
|
||
public class ImagePlaceholder { | ||
public static Drawable getDrawable(Context context, float cornerRadius) { | ||
GradientDrawable drawable = new GradientDrawable(); | ||
drawable.setShape(GradientDrawable.RECTANGLE); | ||
int color = ContextCompat.getColor(context, R.color.light_gray); | ||
drawable.setColor(color); | ||
drawable.setCornerRadius(cornerRadius); | ||
return drawable; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters