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;
|
AdditionalKeyboardView kbd;
|
||||||
|
FrameLayout frm;
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -46,6 +46,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
setContentView(R.layout.main_activity);
|
setContentView(R.layout.main_activity);
|
||||||
|
|
||||||
kbd = findViewById(R.id.additionalKbd);
|
kbd = findViewById(R.id.additionalKbd);
|
||||||
|
frm = findViewById(R.id.frame);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
getWindow().
|
getWindow().
|
||||||
@ -126,10 +127,15 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
if (isInPictureInPictureMode) {
|
if (isInPictureInPictureMode) {
|
||||||
if (kbd.getVisibility() != View.GONE)
|
if (kbd.getVisibility() != View.GONE)
|
||||||
kbd.setVisibility(View.GONE);
|
kbd.setVisibility(View.GONE);
|
||||||
|
frm.setPadding(0,0,0,0);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (kbd.getVisibility() != View.VISIBLE)
|
if (kbd.getVisibility() != View.VISIBLE)
|
||||||
kbd.setVisibility(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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:paddingBottom="35dp">
|
android:paddingBottom="35dp"
|
||||||
|
android:id="@+id/frame">
|
||||||
|
|
||||||
<SurfaceView
|
<SurfaceView
|
||||||
android:id="@+id/lorieView"
|
android:id="@+id/lorieView"
|
||||||
|
Loading…
Reference in New Issue
Block a user