|
6 | 6 |
|
7 | 7 | import android.app.Activity; |
8 | 8 | import android.content.Context; |
| 9 | +import android.content.res.ColorStateList; |
9 | 10 | import android.os.Bundle; |
10 | 11 | import android.text.TextUtils; |
11 | 12 | import android.util.Log; |
|
19 | 20 | import androidx.annotation.NonNull; |
20 | 21 | import androidx.annotation.Nullable; |
21 | 22 | import androidx.appcompat.content.res.AppCompatResources; |
| 23 | +import androidx.core.content.ContextCompat; |
| 24 | + |
| 25 | +import com.google.android.material.shape.CornerFamily; |
| 26 | +import com.google.android.material.shape.ShapeAppearanceModel; |
22 | 27 |
|
23 | 28 | import org.reactivestreams.Subscriber; |
24 | 29 | import org.reactivestreams.Subscription; |
@@ -328,9 +333,14 @@ public void handleResult(@NonNull final PlaylistInfo result) { |
328 | 333 | && (YoutubeParsingHelper.isYoutubeMixId(result.getId()) |
329 | 334 | || YoutubeParsingHelper.isYoutubeMusicMixId(result.getId()))) { |
330 | 335 | // this is an auto-generated playlist (e.g. Youtube mix), so a radio is shown |
331 | | - headerBinding.uploaderAvatarView.setDisableCircularTransformation(true); |
332 | | - headerBinding.uploaderAvatarView.setBorderColor( |
333 | | - getResources().getColor(R.color.transparent_background_color)); |
| 336 | + final ShapeAppearanceModel model = ShapeAppearanceModel.builder() |
| 337 | + .setAllCorners(CornerFamily.ROUNDED, 0f) |
| 338 | + .build(); // this turns the image back into a square |
| 339 | + headerBinding.uploaderAvatarView.setShapeAppearanceModel(model); |
| 340 | + headerBinding.uploaderAvatarView.setStrokeColor( |
| 341 | + ColorStateList.valueOf(ContextCompat.getColor( |
| 342 | + requireContext(), R.color.transparent_background_color)) |
| 343 | + ); |
334 | 344 | headerBinding.uploaderAvatarView.setImageDrawable( |
335 | 345 | AppCompatResources.getDrawable(requireContext(), |
336 | 346 | R.drawable.ic_radio) |
|
0 commit comments