Fix bottom controls being out of the screen
This was caused by too large end screen thumbnails enlarging the whole palyer. Fixed by scaling the thumbnail. Ensure that the player does not use the whole screen height in detail fragment to keep the additional content like title, comments, etc. available.
This commit is contained in:
parent
9727df5abc
commit
3d713a27a5
2 changed files with 108 additions and 6 deletions
|
|
@ -6,8 +6,10 @@ import android.content.pm.PackageManager;
|
|||
import android.content.res.Configuration;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.Build;
|
||||
import android.util.TypedValue;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
import androidx.annotation.Dimension;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
|
|
@ -70,4 +72,20 @@ public final class DeviceUtils {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static int dpToPx(@Dimension(unit = Dimension.DP) final int dp,
|
||||
@NonNull final Context context) {
|
||||
return (int) TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP,
|
||||
dp,
|
||||
context.getResources().getDisplayMetrics());
|
||||
}
|
||||
|
||||
public static int spToPx(@Dimension(unit = Dimension.SP) final int sp,
|
||||
@NonNull final Context context) {
|
||||
return (int) TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_SP,
|
||||
sp,
|
||||
context.getResources().getDisplayMetrics());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue