Skip to content

Commit c961d84

Browse files
committed
Oops, forgot about that one...
1 parent efd3fb0 commit c961d84

File tree

5 files changed

+14
-31
lines changed

5 files changed

+14
-31
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ ScreenLock.acquire();
126126
ScreenLock.release();
127127
```
128128

129-
This is an **experimental feature implementation** that hasn't been fully tested and finalised yet. We will be looking to improve or add more functionality in the future.
129+
This is an **experimental feature implementation** that hasn't been fully tested and finalised yet. We will be looking to improve and/or add more functionality in the future.
130+
For starters this will allow you to adjust the size of the Picture in Picture window, good for changing between landscape and portrait. We will be looking to implement some automated solution for that scenario.
130131

131132
```javascript
132133
// Android API 26+
@@ -141,22 +142,22 @@ PictureInPicture.toggleAutoEnter();
141142
```
142143

143144
Here are 3 different ways you can import icons ready for use with actions.
144-
**Make sure the icons are 24dp x 24dp or you will experience issues, all icons are rendered white as default.**
145+
**Make sure the icons are 24dp x 24dp or you will experience issues, all icons are rendered white as default.**
145146

146147
```javascript
147-
// Font Icon
148+
// Feathers Font Icon
148149
import Icon from 'react-native-vector-icons/dist/Feather';
149-
let camera = Icon.getImageSource( 'camera', 24 );
150+
const camera = Icon.getImageSource( 'camera', 24 );
150151

151-
// Image Icon
152+
// Image
152153
import { Image } from 'react-native';
153-
let mic = Image.resolveAssetSource( require( './assets/images/mic.png' ) );
154+
const mic = Image.resolveAssetSource( require( './assets/images/mic.png' ) );
154155

155-
// Font Icon
156-
let phone = 'font://Feather/phone/24';
156+
// Font URI
157+
const phone = 'font://Feather/phone/24';
157158
```
158159

159-
Here is an example of how to use Picture in Picture actions. In future we do plan to simplify and give more fine grained control over editing existing actions rather than replacing them each time, maybe even better event handling?
160+
Here is an example of how to use Picture in Picture actions. In future we do plan to simplify and give more fine grained control over editing existing actions rather than replacing them each time. Maybe even better event handling? **Make sure not to use spaces or weird characters for action ids.**
160161

161162
```javascript
162163
// Android API 26+

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ android {
1616
defaultConfig {
1717
minSdkVersion safeExtGet('minSdkVersion', 19)
1818
targetSdkVersion safeExtGet('targetSdkVersion', 28)
19-
versionCode 10
20-
versionName "0.2.0"
19+
versionCode 11
20+
versionName "0.2.1"
2121
}
2222
}
2323

android/src/main/java/app/stumble/utils/UtilsModule.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -448,22 +448,4 @@ public void enterPictureInPictureMode() {
448448

449449
activity.enterPictureInPictureMode();
450450
}
451-
452-
@TargetApi( Build.VERSION_CODES.N )
453-
@ReactMethod
454-
public void exitPictureInPictureMode() {
455-
if ( Build.VERSION.SDK_INT < Build.VERSION_CODES.N ) {
456-
return;
457-
}
458-
459-
final Activity activity = getCurrentActivity();
460-
461-
if ( activity == null ) {
462-
return;
463-
}
464-
465-
if ( !activity.isInPictureInPictureMode() ) {
466-
return;
467-
}
468-
}
469451
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-app-utils",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "A simple React Native utils library with useful functions.",
55
"nativePackage": true,
66
"main": "src/index.js",

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function setPictureInPictureActions( actions: Actions ) {
6464
};
6565

6666
function enterPictureInPictureMode() { return UtilsModule.enterPictureInPictureMode(); };
67-
function exitPictureInPictureMode() { return UtilsModule.exitPictureInPictureMode(); };
67+
function exitPictureInPictureMode() { return UtilsModule.startActivity(); };
6868

6969
export const PictureInPicture = {
7070
setAspectRatio: setPictureInPictureAspectRatio,

0 commit comments

Comments
 (0)