mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
Remove unused file.
This commit is contained in:
parent
c513d7bd25
commit
d56c4e33af
@ -1,22 +0,0 @@
|
|||||||
package com.github.libretube.ui.extensions
|
|
||||||
|
|
||||||
import android.app.PictureInPictureParams
|
|
||||||
import android.os.Build
|
|
||||||
import android.util.Rational
|
|
||||||
import androidx.annotation.RequiresApi
|
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
fun PictureInPictureParams.Builder.setAspectRatio(
|
|
||||||
width: Int,
|
|
||||||
height: Int
|
|
||||||
): PictureInPictureParams.Builder {
|
|
||||||
val ratio = (width.toFloat() / height).let {
|
|
||||||
when {
|
|
||||||
it.isNaN() -> Rational(4, 3)
|
|
||||||
it <= 0.418410 -> Rational(41841, 100000)
|
|
||||||
it >= 2.390000 -> Rational(239, 100)
|
|
||||||
else -> Rational(width, height)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return setAspectRatio(ratio)
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user