Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Phecda
/
NGPlay
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Phecda
2020-04-28 14:55:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e48097a606d072694576c155b9b0cd0f93d7e696
e48097a6
1 parent
306fb7e3
feat: add RNQuickAction
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
0 deletions
ios/NGPlay/AppDelegate.m
ios/Podfile.lock
package.json
src/screen/Library.tsx
src/screen/ShortcutItem.tsx
yarn.lock
ios/NGPlay/AppDelegate.m
View file @
e48097a
...
...
@@ -11,6 +11,7 @@
#import <React/RCTBundleURLProvider.h>
#import <React/RCTLinkingManager.h>
#import <React/RCTRootView.h>
#import "RNQuickActionManager.h"
#if DEBUG
#import <FlipperKit/FlipperClient.h>
...
...
@@ -58,6 +59,10 @@ static void InitializeFlipper(UIApplication *application) {
return
YES
;
}
-
(
void
)
application
:(
UIApplication
*
)
application
performActionForShortcutItem
:(
UIApplicationShortcutItem
*
)
shortcutItem
completionHandler
:(
void
(
^
)(
BOOL
succeeded
))
completionHandler
{
[
RNQuickActionManager
onQuickActionPress
:
shortcutItem
completionHandler
:
completionHandler
];
}
-
(
NSURL
*
)
sourceURLForBridge
:
(
RCTBridge
*
)
bridge
{
#if DEBUG
...
...
ios/Podfile.lock
View file @
e48097a
...
...
@@ -337,6 +337,8 @@ PODS:
- React
- RNPermissions (2.1.2):
- React
- RNQuickAction (0.3.13):
- React
- RNReanimated (1.7.1):
- React
- RNScreens (2.4.0):
...
...
@@ -399,6 +401,7 @@ DEPENDENCIES:
- RNImageCropPicker (from `../node_modules/react-native-image-crop-picker`)
- RNLocalize (from `../node_modules/react-native-localize`)
- RNPermissions (from `../node_modules/react-native-permissions`)
- RNQuickAction (from `../node_modules/react-native-quick-actions`)
- RNReanimated (from `../node_modules/react-native-reanimated`)
- RNScreens (from `../node_modules/react-native-screens`)
- RNSVG (from `../node_modules/react-native-svg`)
...
...
@@ -502,6 +505,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-localize"
RNPermissions:
:path: "../node_modules/react-native-permissions"
RNQuickAction:
:path: "../node_modules/react-native-quick-actions"
RNReanimated:
:path: "../node_modules/react-native-reanimated"
RNScreens:
...
...
@@ -565,6 +570,7 @@ SPEC CHECKSUMS:
RNImageCropPicker: cf129d17e042ce3e96fb9ada967c28f21f977c82
RNLocalize: b6df30cc25ae736d37874f9bce13351db2f56796
RNPermissions: a96580116f7894146552e92b000ac30bf1661947
RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93
RNReanimated: 4e102df74a9674fa943e05f97f3362b6e44d0b48
RNScreens: b5c0e1b2b04512919e78bd3898e144a157ce2363
RNSVG: ce9d996113475209013317e48b05c21ee988d42e
...
...
package.json
View file @
e48097a
...
...
@@ -35,6 +35,7 @@
"react-native-localize"
:
"^1.4.0"
,
"react-native-permissions"
:
"^2.1.2"
,
"react-native-progress"
:
"^4.1.2"
,
"react-native-quick-actions"
:
"https://github.com/Phecda/react-native-quick-actions#master"
,
"react-native-reanimated"
:
"^1.7.1"
,
"react-native-safe-area-context"
:
"^0.7.3"
,
"react-native-screens"
:
"^2.4.0"
,
...
...
src/screen/Library.tsx
View file @
e48097a
...
...
@@ -41,6 +41,12 @@ const Library = ({ navigation }: MainTabScreenProps<'Library'>) => {
onPress={() => navigation.navigate('RNCode')}
chevron
/>
<Divider />
<ListItem
title={'Shortcut'}
onPress={() => navigation.navigate('ShortcutItem')}
chevron
/>
</BGScroll>
);
};
...
...
src/screen/ShortcutItem.tsx
0 → 100644
View file @
e48097a
import React from 'react';
import { BGScroll, Card, ListItem } from '../component/View';
import {
clearShortcutItems,
ShortcutItem,
setShortcutItems,
} from 'react-native-quick-actions';
import { NativeModules, Alert } from 'react-native';
const items: ShortcutItem[] = [
{
type: 'Library',
title: 'Shortcut',
subtitle: 'Show shortcut page',
userInfo: { url: 'ngplay://open.my.app/ShortcutItem?id=trigger' },
icon: 'Compose',
},
];
const ShortcutPage = () => {
return (
<BGScroll>
<Card round>
<ListItem title="set" onPress={() => setShortcutItems(items)} />
<ListItem title="clear" onPress={clearShortcutItems} />
<ListItem
title="post"
onPress={() => {
NativeModules.RNQuickActionManager.postLaunchOptions();
}}
/>
<ListItem
title="initial"
onPress={() => {
Alert.alert(
'',
JSON.stringify(NativeModules.RNQuickActionManager.initialAction)
);
}}
/>
</Card>
</BGScroll>
);
};
export default ShortcutPage;
...
...
yarn.lock
View file @
e48097a
...
...
@@ -7098,6 +7098,10 @@ react-native-progress@^4.1.2:
"@react-native-community/art" "^1.1.2"
prop-types "^15.7.2"
"react-native-quick-actions@https://github.com/Phecda/react-native-quick-actions#master":
version "0.3.13"
resolved "https://github.com/Phecda/react-native-quick-actions#63d7680ed97e23c99889fb8573bcc8c0693e8e42"
react-native-ratings@^6.3.0:
version "6.5.0"
resolved "https://registry.npm.taobao.org/react-native-ratings/download/react-native-ratings-6.5.0.tgz#a1606ccba3c5b54eec8e6cfa4765a45cf0e4ab8d"
...
...
Please
register
or
login
to post a comment