react-native-android-pip
Getting started
Ensure that Android SDK > 24 and include in your AndroidManifest.xml activity:
android:resizeableActivity="true" android:supportsPictureInPicture="true" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|smallestScreenSize|orientation"
$ npm install react-native-android-pip --save
Mostly automatic installation
$ react-native link react-native-android-pip
Manual installation
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNAndroidPipPackage;
to the imports at the top of the file - Add
new RNAndroidPipPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-android-pip' project(':react-native-android-pip').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-android-pip/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-android-pip')
Usage
; AndroidPip