Fix bugs with PIP mode
This commit is contained in:
parent
c1ce878b06
commit
051a9a1620
@ -30,7 +30,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
};
|
||||
|
||||
AdditionalKeyboardView kbd;
|
||||
|
||||
FrameLayout frm;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@ -46,6 +46,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
setContentView(R.layout.main_activity);
|
||||
|
||||
kbd = findViewById(R.id.additionalKbd);
|
||||
frm = findViewById(R.id.frame);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
getWindow().
|
||||
@ -126,10 +127,15 @@ public class MainActivity extends AppCompatActivity {
|
||||
if (isInPictureInPictureMode) {
|
||||
if (kbd.getVisibility() != View.GONE)
|
||||
kbd.setVisibility(View.GONE);
|
||||
frm.setPadding(0,0,0,0);
|
||||
return;
|
||||
} else {
|
||||
if (kbd.getVisibility() != View.VISIBLE)
|
||||
kbd.setVisibility(View.VISIBLE);
|
||||
int paddingDp = 35;
|
||||
float density = context.getResources().getDisplayMetrics().density;
|
||||
int paddingPixel = (int)(paddingDp * density);
|
||||
frm.setPadding(0,0,0,paddingPixel);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,8 @@
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="35dp">
|
||||
android:paddingBottom="35dp"
|
||||
android:id="@+id/frame">
|
||||
|
||||
<SurfaceView
|
||||
android:id="@+id/lorieView"
|
||||
|
Loading…
Reference in New Issue
Block a user