akoscz / YouTubePlaylist

A sample Android application which demonstrates the use of the YouTube Data v3 API.
Apache License 2.0
153 stars 84 forks source link

Black borders on thumbnails #27

Open houdayec opened 6 years ago

houdayec commented 6 years ago

Hey,

As everyone, I get black border on the top and the bottom.

The trick to not have any distorsion when pics loading is to use a default video thumbnail with the same borders.

Do you know how to get rid of the borders on the thumbnails ? Does it comes from Picasso ? The size ?

Thanks in Advance.

houdayec commented 6 years ago

I fixed it using another library using Picasso API.

Check out : Picasso Transformations

The aim is to crop the image to get rid of the black borders, using CropTransformation method.

Example of my use:

CropTransformation(the same width : , the new height : 170, GravityHorizontal.CENTER, GravityHorizontal.CENTER);

GravityHorizontal are used to define the point where the crop will be executed.

The height of the border is 35px each, so 70px in total to remove to your initial height to get the new one.