Pass source rect to PiP to smoothly animate to 16:9

This commit is contained in:
Cameron Gutman 2017-11-18 16:29:03 -08:00
parent 44a3a141c0
commit f55d6308ce

View File

@ -38,6 +38,7 @@ import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.graphics.Point;
import android.graphics.Rect;
import android.hardware.input.InputManager;
import android.media.AudioManager;
import android.net.ConnectivityManager;
@ -368,6 +369,9 @@ public class Game extends Activity implements SurfaceHolder.Callback,
enterPictureInPictureMode(
new PictureInPictureParams.Builder()
.setAspectRatio(new Rational(prefConfig.width, prefConfig.height))
.setSourceRectHint(new Rect(
streamView.getLeft(), streamView.getTop(),
streamView.getRight(), streamView.getBottom()))
.build());
}
}