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
import com.reactlibrary.RNAndroidPipPackage;
to the imports at the top of the file
- Add new RNAndroidPipPackage()
to the list returned by the getPackages()
method- Append the following lines to
android/settings.gradle
:
3. Insert the following lines inside the dependencies block in
android/app/build.gradle`:
```compile project(':react-native-android-pip')
```Usage
import AndroidPip from 'react-native-android-pip';
AndroidPip.enterPictureInPictureMode()