Add activity-wise Multiwindow support
This commit is contained in:
parent
0e83bc40d9
commit
6d0cbbf62d
@ -18,9 +18,7 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:ignore="GoogleAppIndexingWarning"
|
||||
android:resizeableActivity="true"
|
||||
android:debuggable="true"
|
||||
android:supportsPictureInPicture="true">
|
||||
android:debuggable="true">
|
||||
<service
|
||||
android:name=".LorieService"
|
||||
android:enabled="true"
|
||||
@ -33,7 +31,9 @@
|
||||
<activity android:name=".MainActivity"
|
||||
android:theme="@style/NoActionBar"
|
||||
android:launchMode="singleInstance"
|
||||
android:configChanges="fontScale|orientation|screenSize|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|screenLayout|touchscreen|uiMode|smallestScreenSize|density">
|
||||
android:supportsPictureInPicture="true"
|
||||
android:configChanges="fontScale|orientation|screenSize|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|screenLayout|touchscreen|uiMode|smallestScreenSize|density"
|
||||
android:resizeableActivity="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@ -46,7 +46,9 @@
|
||||
<activity
|
||||
android:theme="@style/Theme.AppCompat.DayNight"
|
||||
android:excludeFromRecents="true"
|
||||
android:name=".LoriePreferences" >
|
||||
android:name=".LoriePreferences"
|
||||
android:supportsPictureInPicture="false"
|
||||
android:resizeableActivity="true">
|
||||
</activity>
|
||||
<meta-data android:name="com.samsung.android.multidisplay.keep_process_alive" android:value="true"/>
|
||||
<meta-data android:name="android.allow_multiple_resumed_activities" android:value="true" />
|
||||
|
@ -70,6 +70,12 @@ public class AdditionalKeyboardView extends HorizontalScrollView implements View
|
||||
return;
|
||||
}
|
||||
|
||||
if (isInPictureInPictureMode()) {
|
||||
if (getVisibility() != View.GONE)
|
||||
setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
|
||||
Rect r = new Rect();
|
||||
getWindowVisibleDisplayFrame(r);
|
||||
|
||||
|
@ -113,4 +113,11 @@ public class MainActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onBackPressed() {}
|
||||
|
||||
@Override
|
||||
public void onUserLeaveHint () {
|
||||
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
if (preferences.getBooolean("PIP", true)) {
|
||||
enterPictureInPictureMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<CheckBoxPreference android:title="Show additional keyboard"
|
||||
|
||||
<CheckBoxPreference
|
||||
android:title="Show additional keyboard"
|
||||
android:defaultValue="true"
|
||||
android:summary="Show keyboard with additional keys if soft keyboard is visible"
|
||||
android:key="showAdditionalKbd" />
|
||||
<CheckBoxPreference android:title="Fullscreen mode"
|
||||
|
||||
<CheckBoxPreference
|
||||
android:title="Fullscreen mode"
|
||||
android:defaultValue="false"
|
||||
android:key="fullscreen" />
|
||||
|
||||
<ListPreference
|
||||
android:title="Touchscreen input mode"
|
||||
android:key="touchMode"
|
||||
android:defaultValue="1"
|
||||
android:entries="@array/touchscreenInputModesEntries"
|
||||
android:entryValues="@array/touchscreenInputModesValues" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:title="Show IME with external keyboard"
|
||||
android:defaultValue="false"
|
||||
@ -24,4 +30,10 @@
|
||||
android:key="Reseed"
|
||||
android:summary="The screen size will be adjusted while Soft Keybourd is open. Additional Keybaord is not supported by this option." />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:title="PIP Mode"
|
||||
android:defaultValue="true"
|
||||
android:key="PIP"
|
||||
android:summary="Show app in picture-in-picture mode when home button or recents button is pressed" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
Loading…
Reference in New Issue
Block a user