├── .directory
├── .github
├── issue_template.md
└── pull_request_template.md
├── .gitignore
├── .travis.yml
├── LICENSE.md
├── README.md
├── demo
├── App_Resources
│ ├── Android
│ │ ├── app.gradle
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ └── res
│ │ │ ├── drawable-hdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ │ ├── drawable-ldpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ │ ├── drawable-mdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ │ ├── drawable-nodpi
│ │ │ └── splash_screen.xml
│ │ │ ├── drawable-xhdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ │ ├── drawable-xxhdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ ├── background.png
│ │ │ ├── icon.png
│ │ │ └── logo.png
│ │ │ ├── values-v21
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ └── iOS
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── icon-29.png
│ │ │ ├── icon-29@2x.png
│ │ │ ├── icon-29@3x.png
│ │ │ ├── icon-40.png
│ │ │ ├── icon-40@2x.png
│ │ │ ├── icon-40@3x.png
│ │ │ ├── icon-50.png
│ │ │ ├── icon-50@2x.png
│ │ │ ├── icon-57.png
│ │ │ ├── icon-57@2x.png
│ │ │ ├── icon-60@2x.png
│ │ │ ├── icon-60@3x.png
│ │ │ ├── icon-72.png
│ │ │ ├── icon-72@2x.png
│ │ │ ├── icon-76.png
│ │ │ ├── icon-76@2x.png
│ │ │ └── icon-83.5@2x.png
│ │ ├── Contents.json
│ │ ├── LaunchImage.launchimage
│ │ │ ├── Contents.json
│ │ │ ├── Default-568h@2x.png
│ │ │ ├── Default-667h@2x.png
│ │ │ ├── Default-736h@3x.png
│ │ │ ├── Default-Landscape.png
│ │ │ ├── Default-Landscape@2x.png
│ │ │ ├── Default-Landscape@3x.png
│ │ │ ├── Default-Portrait.png
│ │ │ ├── Default-Portrait@2x.png
│ │ │ ├── Default.png
│ │ │ └── Default@2x.png
│ │ ├── LaunchScreen.AspectFill.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchScreen-AspectFill.png
│ │ │ └── LaunchScreen-AspectFill@2x.png
│ │ └── LaunchScreen.Center.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchScreen-Center.png
│ │ │ └── LaunchScreen-Center@2x.png
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ └── build.xcconfig
├── app
│ ├── app.css
│ ├── app.ts
│ ├── main-page.ts
│ ├── main-page.xml
│ ├── main-view-model.ts
│ ├── package.json
│ └── tests
│ │ └── tests.js
├── karma.conf.js
├── nativescript.config.ts
├── package-lock.json
├── package.json
├── references.d.ts
├── tsconfig.json
└── tsfmt.json
├── publish
├── pack.sh
├── package-lock.json
├── package.json
└── publish.sh
├── screenshots
├── screenshotAndroid.gif
└── screenshotIos.gif
├── src
├── .directory
├── .npmignore
├── index.d.ts
├── menu.android.ts
├── menu.common.ts
├── menu.ios.ts
├── package.json
├── references.d.ts
├── scripts
│ └── build-native.js
├── tsconfig.json
└── tsfmt.json
└── tslint.json
/.directory:
--------------------------------------------------------------------------------
1 | [Dolphin]
2 | Timestamp=2019,1,9,12,4,43
3 | Version=4
4 |
5 | [Settings]
6 | HiddenFilesShown=true
7 |
--------------------------------------------------------------------------------
/.github/issue_template.md:
--------------------------------------------------------------------------------
1 | ### Make sure to check the demo app(s) for sample usage
2 |
3 | ### Make sure to check the existing issues in this repository
4 |
5 | ### If the demo apps cannot help and there is no issue for your problem, tell us about it
6 | Please, ensure your title is less than 63 characters long and starts with a capital
7 | letter.
8 |
9 | ### Which platform(s) does your issue occur on?
10 | - iOS/Android/Both
11 | - iOS/Android versions
12 | - emulator or device. What type of device?
13 |
14 | ### Please, provide the following version numbers that your issue occurs with:
15 |
16 | - CLI: (run `tns --version` to fetch it)
17 | - Cross-platform modules: (check the 'version' attribute in the
18 | `node_modules/tns-core-modules/package.json` file in your project)
19 | - Runtime(s): (look for the `"tns-android"` and `"tns-ios"` properties in the `package.json` file of your project)
20 | - Plugin(s): (look for the version numbers in the `package.json` file of your
21 | project and paste your dependencies and devDependencies here)
22 |
23 | ### Please, tell us how to recreate the issue in as much detail as possible.
24 | Describe the steps to reproduce it.
25 |
26 | ### Is there any code involved?
27 | - provide a code example to recreate the problem
28 | - (EVEN BETTER) provide a .zip with application or refer to a repository with application where the problem is reproducible.
29 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 | ## PR Checklist
11 |
12 | - [ ] The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#commit-messages.
13 | - [ ] There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
14 | - [ ] All existing tests are passing
15 | - [ ] Tests for the changes are included
16 |
17 | ## What is the current behavior?
18 |
19 |
20 | ## What is the new behavior?
21 |
22 |
23 | Fixes/Implements/Closes #[Issue Number].
24 |
25 |
26 |
27 |
36 |
37 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .vscode
2 | .idea
3 | .DS_Store
4 | *.esm.json
5 | *.js
6 | *.js.map
7 | *.log
8 | src/*.d.ts
9 | !src/index.d.ts
10 | !src/references.d.ts
11 | !src/scripts/*.js
12 | !seed-tests/*.js
13 | seed-tests/seed-copy/**/*.*
14 | seed-tests/seed-copy-new-git-repo/**/*.*
15 | !demo/karma.conf.js
16 | !demo/app/tests/*.js
17 | demo/*.d.ts
18 | !demo/references.d.ts
19 | demo/lib
20 | demo/platforms
21 | node_modules
22 | publish/src
23 | publish/package
24 | demo/report/report.html
25 | demo/report/stats.json
26 | src/platforms/android/nativescript_menu.aar
27 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | matrix:
2 | include:
3 | - stage: "Lint"
4 | language: node_js
5 | os: linux
6 | node_js: "8"
7 | script: cd src && npm run ci.tslint && cd ../demo && npm run ci.tslint
8 | - stage: "WebPack, Build and Test"
9 | os: osx
10 | env:
11 | - WebPack="iOS"
12 | osx_image: xcode9.2
13 | language: node_js
14 | node_js: "8"
15 | jdk: oraclejdk8
16 | script: cd demo && npm run build.plugin && npm i && tns build ios --bundle --env.uglify
17 | - language: android
18 | os: linux
19 | env:
20 | - WebPack="Android"
21 | jdk: oraclejdk8
22 | before_install: nvm install 8
23 | script: cd demo && npm run build.plugin && npm i && tns build android --bundle --env.uglify --env.snapshot
24 | - language: android
25 | env:
26 | - BuildAndroid="26"
27 | os: linux
28 | jdk: oraclejdk8
29 | before_install: nvm install stable
30 | script:
31 | - cd src && npm i && npm run tsc && cd ../demo && tns build android
32 | - os: osx
33 | env:
34 | - BuildiOS="11"
35 | - Xcode="9.2"
36 | osx_image: xcode9.2
37 | language: node_js
38 | node_js: "8"
39 | jdk: oraclejdk8
40 | script:
41 | - cd src && npm i && npm run tsc && cd ../demo && tns build ios
42 | - os: linux
43 | language: android
44 | dist: precise
45 | sudo: required
46 | jdk: oraclejdk8
47 | before_script:
48 | - echo no | android create avd --force -n test -t android-21 -b armeabi-v7a
49 | - emulator -avd test -no-audio -no-window &
50 | - android-wait-for-emulator
51 | before_install:
52 | - nvm install 8
53 | script: cd src && npm run test.android
54 | - os: osx
55 | language: node_js
56 | node_js: "8"
57 | jdk: oraclejdk8
58 | osx_image: xcode9.2
59 | script: cd src && npm run test.ios
60 |
61 | android:
62 | components:
63 | - tools
64 | - platform-tools
65 | - build-tools-26.0.1
66 | - android-26
67 | - android-23
68 | - extra-android-m2repository
69 | - sys-img-armeabi-v7a-android-21
70 |
71 | install:
72 | - echo no | npm install -g nativescript tsc typescript
73 | - tns usage-reporting disable
74 | - tns error-reporting disable
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2018 Salem Yaslem
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # nativescript-menu [](https://travis-ci.org/xlmnxp/nativescript-menu)
2 |
3 | A plugin that adds a pop-up menu to NativeScript
4 |
5 | ### Installation
6 |
7 | From your command prompt/terminal go to your app's root folder and execute:
8 | `tns plugin add nativescript-menu`
9 |
10 | #### Version lower then NativeScript 7
11 | `tns plugin add nativescript-menu@1.1.6`
12 |
13 | ## Demo
14 |
15 | | Android | iOS |
16 | | ------------ | ------------ |
17 | |
|
|
18 |
19 | ## Usage
20 |
21 | ###
22 |
23 | ```XML
24 |
26 |
27 |
28 |
29 |
30 | ```
31 |
32 | ```typescript
33 | import { Menu } from "nativescript-menu";
34 |
35 | export class HelloWorldModel extends Observable {
36 | public message: string;
37 | private menu: Menu;
38 |
39 | constructor(public page: Page) {
40 | super();
41 | }
42 |
43 | buttonTap() {
44 | Menu.popup({
45 | view: this.page.getViewById("menuBtn"),
46 | actions: ["Example", "NativeScript", "Menu"]
47 | })
48 | .then(action => {
49 | alert(action.id + " - " + action.title);
50 | })
51 | .catch(console.log);
52 | }
53 | }
54 | ```
55 |
56 | with custom options
57 |
58 | ```typescript
59 | import { Menu } from "nativescript-menu";
60 |
61 | export class HelloWorldModel extends Observable {
62 | public message: string;
63 | private menu: Menu;
64 |
65 | constructor(public page: Page) {
66 | super();
67 | }
68 |
69 | buttonTap() {
70 | Menu.popup({
71 | view: this.page.getViewById("menuBtn"),
72 | actions: [
73 | { id: "one", title: "Example" },
74 | { id: "two", title: "NativeScript", customOption: "Hello" },
75 | { id: "three", title: "Menu" }
76 | ]
77 | })
78 | .then(action => {
79 | alert(JSON.stringify(action));
80 | })
81 | .catch(console.log);
82 | }
83 | }
84 | ```
85 |
86 | ## API
87 |
88 | - MenuOptions
89 |
90 | ```typescript
91 | export interface MenuOptions {
92 | title?: string; // IOS Only
93 | message?: string; // IOS Only
94 | view: View;
95 | actions: object[] | string[];
96 | cancelButtonText?: string; // IOS Only
97 | }
98 | ```
99 |
100 | | Method | Description |
101 | | ------------------------------------------------------------------------------------------------ | -------------------------------- |
102 | | **popup(options: MenuOptions)**: Promise<{id: number, title: string} \| actionObject \| boolean> | Create a pop-up menu and show it |
103 |
--------------------------------------------------------------------------------
/demo/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // compile 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | android {
9 | defaultConfig {
10 | generatedDensities = []
11 | applicationId = "org.nativescript.demo"
12 | }
13 | aaptOptions {
14 | additionalParameters "--no-version-vectors"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-ldpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-ldpi/logo.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-mdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-mdpi/logo.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-xhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3d5afe
4 |
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #33B5E5
6 | #272734
7 |
--------------------------------------------------------------------------------
/demo/App_Resources/Android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
21 |
22 |
23 |
31 |
32 |
34 |
35 |
36 |
42 |
43 |
45 |
46 |
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "29x29",
5 | "idiom" : "iphone",
6 | "filename" : "icon-29.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "29x29",
11 | "idiom" : "iphone",
12 | "filename" : "icon-29@2x.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29@3x.png",
19 | "scale" : "3x"
20 | },
21 | {
22 | "size" : "40x40",
23 | "idiom" : "iphone",
24 | "filename" : "icon-40@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "icon-40@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "57x57",
35 | "idiom" : "iphone",
36 | "filename" : "icon-57.png",
37 | "scale" : "1x"
38 | },
39 | {
40 | "size" : "57x57",
41 | "idiom" : "iphone",
42 | "filename" : "icon-57@2x.png",
43 | "scale" : "2x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "icon-60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "icon-60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "29x29",
59 | "idiom" : "ipad",
60 | "filename" : "icon-29.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "29x29",
65 | "idiom" : "ipad",
66 | "filename" : "icon-29@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "40x40",
71 | "idiom" : "ipad",
72 | "filename" : "icon-40.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "40x40",
77 | "idiom" : "ipad",
78 | "filename" : "icon-40@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "50x50",
83 | "idiom" : "ipad",
84 | "filename" : "icon-50.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "50x50",
89 | "idiom" : "ipad",
90 | "filename" : "icon-50@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "72x72",
95 | "idiom" : "ipad",
96 | "filename" : "icon-72.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "72x72",
101 | "idiom" : "ipad",
102 | "filename" : "icon-72@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "76x76",
107 | "idiom" : "ipad",
108 | "filename" : "icon-76.png",
109 | "scale" : "1x"
110 | },
111 | {
112 | "size" : "76x76",
113 | "idiom" : "ipad",
114 | "filename" : "icon-76@2x.png",
115 | "scale" : "2x"
116 | },
117 | {
118 | "size" : "83.5x83.5",
119 | "idiom" : "ipad",
120 | "filename" : "icon-83.5@2x.png",
121 | "scale" : "2x"
122 | }
123 | ],
124 | "info" : {
125 | "version" : 1,
126 | "author" : "xcode"
127 | }
128 | }
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "extent" : "full-screen",
5 | "idiom" : "iphone",
6 | "subtype" : "736h",
7 | "filename" : "Default-736h@3x.png",
8 | "minimum-system-version" : "8.0",
9 | "orientation" : "portrait",
10 | "scale" : "3x"
11 | },
12 | {
13 | "extent" : "full-screen",
14 | "idiom" : "iphone",
15 | "subtype" : "736h",
16 | "filename" : "Default-Landscape@3x.png",
17 | "minimum-system-version" : "8.0",
18 | "orientation" : "landscape",
19 | "scale" : "3x"
20 | },
21 | {
22 | "extent" : "full-screen",
23 | "idiom" : "iphone",
24 | "subtype" : "667h",
25 | "filename" : "Default-667h@2x.png",
26 | "minimum-system-version" : "8.0",
27 | "orientation" : "portrait",
28 | "scale" : "2x"
29 | },
30 | {
31 | "orientation" : "portrait",
32 | "idiom" : "iphone",
33 | "filename" : "Default@2x.png",
34 | "extent" : "full-screen",
35 | "minimum-system-version" : "7.0",
36 | "scale" : "2x"
37 | },
38 | {
39 | "extent" : "full-screen",
40 | "idiom" : "iphone",
41 | "subtype" : "retina4",
42 | "filename" : "Default-568h@2x.png",
43 | "minimum-system-version" : "7.0",
44 | "orientation" : "portrait",
45 | "scale" : "2x"
46 | },
47 | {
48 | "orientation" : "portrait",
49 | "idiom" : "ipad",
50 | "filename" : "Default-Portrait.png",
51 | "extent" : "full-screen",
52 | "minimum-system-version" : "7.0",
53 | "scale" : "1x"
54 | },
55 | {
56 | "orientation" : "landscape",
57 | "idiom" : "ipad",
58 | "filename" : "Default-Landscape.png",
59 | "extent" : "full-screen",
60 | "minimum-system-version" : "7.0",
61 | "scale" : "1x"
62 | },
63 | {
64 | "orientation" : "portrait",
65 | "idiom" : "ipad",
66 | "filename" : "Default-Portrait@2x.png",
67 | "extent" : "full-screen",
68 | "minimum-system-version" : "7.0",
69 | "scale" : "2x"
70 | },
71 | {
72 | "orientation" : "landscape",
73 | "idiom" : "ipad",
74 | "filename" : "Default-Landscape@2x.png",
75 | "extent" : "full-screen",
76 | "minimum-system-version" : "7.0",
77 | "scale" : "2x"
78 | },
79 | {
80 | "orientation" : "portrait",
81 | "idiom" : "iphone",
82 | "filename" : "Default.png",
83 | "extent" : "full-screen",
84 | "scale" : "1x"
85 | },
86 | {
87 | "orientation" : "portrait",
88 | "idiom" : "iphone",
89 | "filename" : "Default@2x.png",
90 | "extent" : "full-screen",
91 | "scale" : "2x"
92 | },
93 | {
94 | "orientation" : "portrait",
95 | "idiom" : "iphone",
96 | "filename" : "Default-568h@2x.png",
97 | "extent" : "full-screen",
98 | "subtype" : "retina4",
99 | "scale" : "2x"
100 | },
101 | {
102 | "orientation" : "portrait",
103 | "idiom" : "ipad",
104 | "extent" : "to-status-bar",
105 | "scale" : "1x"
106 | },
107 | {
108 | "orientation" : "portrait",
109 | "idiom" : "ipad",
110 | "filename" : "Default-Portrait.png",
111 | "extent" : "full-screen",
112 | "scale" : "1x"
113 | },
114 | {
115 | "orientation" : "landscape",
116 | "idiom" : "ipad",
117 | "extent" : "to-status-bar",
118 | "scale" : "1x"
119 | },
120 | {
121 | "orientation" : "landscape",
122 | "idiom" : "ipad",
123 | "filename" : "Default-Landscape.png",
124 | "extent" : "full-screen",
125 | "scale" : "1x"
126 | },
127 | {
128 | "orientation" : "portrait",
129 | "idiom" : "ipad",
130 | "extent" : "to-status-bar",
131 | "scale" : "2x"
132 | },
133 | {
134 | "orientation" : "portrait",
135 | "idiom" : "ipad",
136 | "filename" : "Default-Portrait@2x.png",
137 | "extent" : "full-screen",
138 | "scale" : "2x"
139 | },
140 | {
141 | "orientation" : "landscape",
142 | "idiom" : "ipad",
143 | "extent" : "to-status-bar",
144 | "scale" : "2x"
145 | },
146 | {
147 | "orientation" : "landscape",
148 | "idiom" : "ipad",
149 | "filename" : "Default-Landscape@2x.png",
150 | "extent" : "full-screen",
151 | "scale" : "2x"
152 | }
153 | ],
154 | "info" : {
155 | "version" : 1,
156 | "author" : "xcode"
157 | }
158 | }
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-AspectFill.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-AspectFill@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-Center.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-Center@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/demo/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiresFullScreen
28 |
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/demo/App_Resources/iOS/build.xcconfig:
--------------------------------------------------------------------------------
1 | // You can add custom settings here
2 | // for example you can uncomment the following line to force distribution code signing
3 | // CODE_SIGN_IDENTITY = iPhone Distribution
4 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
5 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
6 |
--------------------------------------------------------------------------------
/demo/app/app.css:
--------------------------------------------------------------------------------
1 | @import '~nativescript-theme-core/css/core.light.css';
2 |
--------------------------------------------------------------------------------
/demo/app/app.ts:
--------------------------------------------------------------------------------
1 | import * as application from "@nativescript/core/application";
2 | application.run({ moduleName: "main-page" });
3 |
--------------------------------------------------------------------------------
/demo/app/main-page.ts:
--------------------------------------------------------------------------------
1 | import * as observable from '@nativescript/core/data/observable';
2 | import * as pages from '@nativescript/core/ui/page';
3 | import {HelloWorldModel} from './main-view-model';
4 |
5 | // Event handler for Page 'loaded' event attached in main-page.xml
6 | export function pageLoaded(args: observable.EventData) {
7 | // Get the event sender
8 | let page = args.object;
9 | page.bindingContext = new HelloWorldModel(page);
10 | }
11 |
--------------------------------------------------------------------------------
/demo/app/main-page.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/app/main-view-model.ts:
--------------------------------------------------------------------------------
1 | import { Observable } from '@nativescript/core';
2 | import { Menu } from 'nativescript-menu';
3 | import { Page } from '@nativescript/core';
4 |
5 | export class HelloWorldModel extends Observable {
6 | public message: string;
7 |
8 | constructor(public page: Page) {
9 | super();
10 | }
11 |
12 | buttonTap() {
13 | Menu.popup({
14 | view: this.page.getViewById("menuBtn"),
15 | actions: [{ id: "one", title: "Example" }, { id: "two", title: "NativeScript" }, { id: "three", title: "Menu" }]
16 | }).then(action => {
17 | if (action.id === 0) {
18 | alert(action.title);
19 | } else {
20 | alert("else action2");
21 | }
22 | }).catch(console.log);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/demo/app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tns-template-hello-world-ts",
3 | "main": "app.js",
4 | "version": "1.6.0",
5 | "author": {
6 | "name": "Telerik",
7 | "email": "support@telerik.com"
8 | },
9 | "description": "Nativescript hello-world-ts project template",
10 | "license": "Apache-2.0",
11 | "keywords": [
12 | "telerik",
13 | "mobile",
14 | "nativescript",
15 | "{N}",
16 | "tns",
17 | "appbuilder",
18 | "template"
19 | ],
20 | "repository": {
21 | "type": "git",
22 | "url": "git+ssh://git@github.com/NativeScript/template-hello-world-ts.git"
23 | },
24 | "bugs": {
25 | "url": "https://github.com/NativeScript/template-hello-world-ts/issues"
26 | },
27 | "homepage": "https://github.com/NativeScript/template-hello-world-ts",
28 | "android": {
29 | "v8Flags": "--expose_gc",
30 | "requireModules": ["nativescript-menu"]
31 | },
32 | "devDependencies": {
33 | "nativescript-dev-typescript": "^0.3.0"
34 | },
35 | "_id": "tns-template-hello-world-ts@1.6.0",
36 | "_shasum": "a567c2b9a56024818c06596dab9629d155c5b8a8",
37 | "_resolved": "https://registry.npmjs.org/tns-template-hello-world-ts/-/tns-template-hello-world-ts-1.6.0.tgz",
38 | "_from": "tns-template-hello-world-ts@latest",
39 | "scripts": {
40 | "build.plugin": "cd ../src && npm run build",
41 | "ci.tslint": "npm i && tslint --config '../tslint.json' 'app/**/*.ts' --exclude '**/node_modules/**'"
42 | },
43 | "_npmVersion": "2.14.7",
44 | "_nodeVersion": "4.2.2",
45 | "_npmUser": {
46 | "name": "enchev",
47 | "email": "vladimir.enchev@gmail.com"
48 | },
49 | "dist": {
50 | "shasum": "a567c2b9a56024818c06596dab9629d155c5b8a8",
51 | "tarball": "http://registry.npmjs.org/tns-template-hello-world-ts/-/tns-template-hello-world-ts-1.6.0.tgz"
52 | },
53 | "maintainers": [
54 | {
55 | "name": "enchev",
56 | "email": "vladimir.enchev@gmail.com"
57 | },
58 | {
59 | "name": "erjangavalji",
60 | "email": "erjan.gavalji@gmail.com"
61 | },
62 | {
63 | "name": "fatme",
64 | "email": "hfatme@gmail.com"
65 | },
66 | {
67 | "name": "hdeshev",
68 | "email": "hristo@deshev.com"
69 | },
70 | {
71 | "name": "kerezov",
72 | "email": "d.kerezov@gmail.com"
73 | },
74 | {
75 | "name": "ligaz",
76 | "email": "stefan.dobrev@gmail.com"
77 | },
78 | {
79 | "name": "nsndeck",
80 | "email": "nedyalko.nikolov@telerik.com"
81 | },
82 | {
83 | "name": "rosen-vladimirov",
84 | "email": "rosen.vladimirov.91@gmail.com"
85 | },
86 | {
87 | "name": "sdobrev",
88 | "email": "stefan.dobrev@gmail.com"
89 | },
90 | {
91 | "name": "tailsu",
92 | "email": "tailsu@gmail.com"
93 | },
94 | {
95 | "name": "teobugslayer",
96 | "email": "teobugslayer@gmail.com"
97 | },
98 | {
99 | "name": "valio.stoychev",
100 | "email": "valio.stoychev@gmail.com"
101 | }
102 | ],
103 | "_npmOperationalInternal": {
104 | "host": "packages-5-east.internal.npmjs.com",
105 | "tmp": "tmp/tns-template-hello-world-ts-1.6.0.tgz_1455717516189_0.6427943941671401"
106 | },
107 | "directories": {},
108 | "readme": "ERROR: No README data found!"
109 | }
110 |
--------------------------------------------------------------------------------
/demo/app/tests/tests.js:
--------------------------------------------------------------------------------
1 | var Menu = require("nativescript-menu").Menu;
2 | var menu = new Menu();
3 |
4 | describe("greet function", function() {
5 | it("exists", function() {
6 | expect(menu.greet).toBeDefined();
7 | });
8 |
9 | it("returns a string", function() {
10 | expect(menu.greet()).toEqual("Hello, NS");
11 | });
12 | });
--------------------------------------------------------------------------------
/demo/karma.conf.js:
--------------------------------------------------------------------------------
1 | module.exports = function (config) {
2 | const options = {
3 |
4 | // base path that will be used to resolve all patterns (eg. files, exclude)
5 | basePath: '',
6 |
7 |
8 | // frameworks to use
9 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
10 | frameworks: ['jasmine'],
11 |
12 |
13 | // list of files / patterns to load in the browser
14 | files: ['app/tests/**/*.*'],
15 |
16 |
17 | // list of files to exclude
18 | exclude: [
19 | ],
20 |
21 |
22 | // preprocess matching files before serving them to the browser
23 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
24 | preprocessors: {
25 | },
26 |
27 |
28 | // test results reporter to use
29 | // possible values: 'dots', 'progress'
30 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter
31 | reporters: ['progress'],
32 |
33 |
34 | // web server port
35 | port: 9876,
36 |
37 |
38 | // enable / disable colors in the output (reporters and logs)
39 | colors: true,
40 |
41 |
42 | // level of logging
43 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
44 | logLevel: config.LOG_INFO,
45 |
46 |
47 | // enable / disable watching file and executing tests whenever any file changes
48 | autoWatch: true,
49 |
50 |
51 | // start these browsers
52 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
53 | browsers: [],
54 |
55 | customLaunchers: {
56 | android: {
57 | base: 'NS',
58 | platform: 'android'
59 | },
60 | ios: {
61 | base: 'NS',
62 | platform: 'ios'
63 | },
64 | ios_simulator: {
65 | base: 'NS',
66 | platform: 'ios',
67 | arguments: ['--emulator']
68 | }
69 | },
70 |
71 | // Continuous Integration mode
72 | // if true, Karma captures browsers, runs the tests and exits
73 | singleRun: false
74 | };
75 |
76 | setWebpackPreprocessor(config, options);
77 | setWebpack(config, options);
78 |
79 | config.set(options);
80 | }
81 |
82 | function setWebpackPreprocessor(config, options) {
83 | if (config && config.bundle) {
84 | if (!options.preprocessors) {
85 | options.preprocessors = {};
86 | }
87 |
88 | options.files.forEach(file => {
89 | if (!options.preprocessors[file]) {
90 | options.preprocessors[file] = [];
91 | }
92 | options.preprocessors[file].push('webpack');
93 | });
94 | }
95 | }
96 |
97 | function setWebpack(config, options) {
98 | if (config && config.bundle) {
99 | const env = {};
100 | env[config.platform] = true;
101 | env.sourceMap = config.debugBrk;
102 | options.webpack = require('./webpack.config')(env);
103 | delete options.webpack.entry;
104 | delete options.webpack.output.libraryTarget;
105 | const invalidPluginsForUnitTesting = ["GenerateBundleStarterPlugin", "GenerateNativeScriptEntryPointsPlugin"];
106 | options.webpack.plugins = options.webpack.plugins.filter(p => !invalidPluginsForUnitTesting.includes(p.constructor.name));
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/demo/nativescript.config.ts:
--------------------------------------------------------------------------------
1 | import { NativeScriptConfig } from '@nativescript/core';
2 |
3 | export default {
4 | id: 'com.skiltii.app',
5 | appResourcesPath: 'App_Resources',
6 | android: {
7 | v8Flags: '--expose_gc',
8 | markingMode: 'none'
9 | }
10 | } as NativeScriptConfig;
--------------------------------------------------------------------------------
/demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {
3 | "nativescript-theme-core": "^1.0.4",
4 | "nativescript-unit-test-runner": "0.7.0",
5 | "nativescript-menu": "file:../src",
6 | "@nativescript/core": "^7.0.13"
7 | },
8 | "devDependencies": {
9 | "@nativescript/android": "7.0.1",
10 | "@nativescript/types": "^7.0.4",
11 | "@nativescript/webpack": "~3.0.0",
12 | "jasmine-core": "^2.5.2",
13 | "karma": "4.1.0",
14 | "karma-jasmine": "2.0.1",
15 | "karma-nativescript-launcher": "^0.4.0",
16 | "karma-webpack": "3.0.5",
17 | "nativescript-css-loader": "~0.26.1",
18 | "nativescript-dev-webpack": "1.0.1",
19 | "tslint": "~5.4.3",
20 | "typescript": "~3.9.0"
21 | },
22 | "scripts": {
23 | "build.plugin": "cd ../src && npm run build",
24 | "ci.tslint": "npm i && tslint --config '../tslint.json' 'app/**/*.ts' --exclude '**/node_modules/**'"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/demo/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
--------------------------------------------------------------------------------
/demo/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext",
4 | "target": "es2017",
5 | "moduleResolution": "node",
6 | "experimentalDecorators": true,
7 | "emitDecoratorMetadata": true,
8 | "noEmitHelpers": true,
9 | "noEmitOnError": true,
10 | "skipLibCheck": true,
11 | "lib": [
12 | "es2018", "es2017", "dom", "es6"
13 | ],
14 | "baseUrl": ".",
15 | "paths": {
16 | "~/*": [
17 | "app/*"
18 | ]
19 | }
20 | },
21 | "include": [
22 | "src/tests/**/*.ts",
23 | "src/**/*.ios.ts",
24 | "src/**/*.android.ts"
25 | ],
26 | "files": [
27 | "./references.d.ts",
28 | "./src/main.ts"
29 | ],
30 | "exclude": [
31 | "node_modules",
32 | "platforms",
33 | "e2e"
34 | ],
35 | "angularCompilerOptions": {
36 | "enableIvy": true
37 | }
38 | }
--------------------------------------------------------------------------------
/demo/tsfmt.json:
--------------------------------------------------------------------------------
1 | {
2 | "indentSize": 2,
3 | "tabSize": 2
4 | }
5 |
--------------------------------------------------------------------------------
/publish/pack.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SOURCE_DIR=../src;
4 | TO_SOURCE_DIR=src;
5 | PACK_DIR=package;
6 | ROOT_DIR=..;
7 | PUBLISH=--publish
8 |
9 | install(){
10 | npm i
11 | }
12 |
13 | pack() {
14 |
15 | echo 'Clearing /src and /package...'
16 | node_modules/.bin/rimraf "$TO_SOURCE_DIR"
17 | node_modules/.bin/rimraf "$PACK_DIR"
18 |
19 | # copy src
20 | echo 'Copying src...'
21 | node_modules/.bin/ncp "$SOURCE_DIR" "$TO_SOURCE_DIR"
22 |
23 | # copy README & LICENSE to src
24 | echo 'Copying README and LICENSE to /src...'
25 | node_modules/.bin/ncp "$ROOT_DIR"/LICENSE "$TO_SOURCE_DIR"/LICENSE
26 | node_modules/.bin/ncp "$ROOT_DIR"/README.md "$TO_SOURCE_DIR"/README.md
27 |
28 | # compile package and copy files required by npm
29 | echo 'Building /src...'
30 | cd "$TO_SOURCE_DIR"
31 | node_modules/.bin/tsc
32 | cd ..
33 |
34 | echo 'Creating package...'
35 | # create package dir
36 | mkdir "$PACK_DIR"
37 |
38 | # create the package
39 | cd "$PACK_DIR"
40 | npm pack ../"$TO_SOURCE_DIR"
41 |
42 | # delete source directory used to create the package
43 | cd ..
44 | node_modules/.bin/rimraf "$TO_SOURCE_DIR"
45 | }
46 |
47 | install && pack
--------------------------------------------------------------------------------
/publish/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nativescript-publish",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "balanced-match": {
8 | "version": "1.0.0",
9 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
10 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
11 | "dev": true
12 | },
13 | "brace-expansion": {
14 | "version": "1.1.11",
15 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
16 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
17 | "dev": true,
18 | "requires": {
19 | "balanced-match": "^1.0.0",
20 | "concat-map": "0.0.1"
21 | }
22 | },
23 | "concat-map": {
24 | "version": "0.0.1",
25 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
26 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
27 | "dev": true
28 | },
29 | "fs.realpath": {
30 | "version": "1.0.0",
31 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
32 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
33 | "dev": true
34 | },
35 | "glob": {
36 | "version": "7.1.3",
37 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
38 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
39 | "dev": true,
40 | "requires": {
41 | "fs.realpath": "^1.0.0",
42 | "inflight": "^1.0.4",
43 | "inherits": "2",
44 | "minimatch": "^3.0.4",
45 | "once": "^1.3.0",
46 | "path-is-absolute": "^1.0.0"
47 | }
48 | },
49 | "inflight": {
50 | "version": "1.0.6",
51 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
52 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
53 | "dev": true,
54 | "requires": {
55 | "once": "^1.3.0",
56 | "wrappy": "1"
57 | }
58 | },
59 | "inherits": {
60 | "version": "2.0.3",
61 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
62 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
63 | "dev": true
64 | },
65 | "minimatch": {
66 | "version": "3.0.4",
67 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
68 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
69 | "dev": true,
70 | "requires": {
71 | "brace-expansion": "^1.1.7"
72 | }
73 | },
74 | "ncp": {
75 | "version": "2.0.0",
76 | "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz",
77 | "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=",
78 | "dev": true
79 | },
80 | "once": {
81 | "version": "1.4.0",
82 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
83 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
84 | "dev": true,
85 | "requires": {
86 | "wrappy": "1"
87 | }
88 | },
89 | "path-is-absolute": {
90 | "version": "1.0.1",
91 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
92 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
93 | "dev": true
94 | },
95 | "rimraf": {
96 | "version": "2.6.2",
97 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
98 | "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
99 | "dev": true,
100 | "requires": {
101 | "glob": "^7.0.5"
102 | }
103 | },
104 | "wrappy": {
105 | "version": "1.0.2",
106 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
107 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
108 | "dev": true
109 | }
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/publish/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nativescript-publish",
3 | "version": "1.0.0",
4 | "description": "Publish helper",
5 | "devDependencies": {
6 | "ncp": "^2.0.0",
7 | "rimraf": "^2.5.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/publish/publish.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | PACK_DIR=package;
4 |
5 | publish() {
6 | cd $PACK_DIR
7 | echo 'Publishing to npm...'
8 | npm publish *.tgz
9 | }
10 |
11 | ./pack.sh && publish
--------------------------------------------------------------------------------
/screenshots/screenshotAndroid.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/screenshots/screenshotAndroid.gif
--------------------------------------------------------------------------------
/screenshots/screenshotIos.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xlmnxp/nativescript-menu/7ee01eced586765202d7cc8f2d4d99a0bb8ecbbf/screenshots/screenshotIos.gif
--------------------------------------------------------------------------------
/src/.directory:
--------------------------------------------------------------------------------
1 | [Dolphin]
2 | Timestamp=2019,1,9,12,3,43
3 | Version=4
4 |
5 | [Settings]
6 | HiddenFilesShown=true
7 |
--------------------------------------------------------------------------------
/src/.npmignore:
--------------------------------------------------------------------------------
1 | *.map
2 | *.ts
3 | !*.d.ts
4 | tsconfig.json
5 | scripts/*
6 | platforms/android/*
7 | !platforms/android/include.gradle
8 | !platforms/android/*.aar
9 | !platforms/android/*.jar
--------------------------------------------------------------------------------
/src/index.d.ts:
--------------------------------------------------------------------------------
1 | import { Common } from "./menu.common";
2 | import { View } from "@nativescript/core";
3 |
4 | export declare interface MenuOptions {
5 | title?: string; // IOS Only
6 | message?: string; // IOS Only
7 | view: View;
8 | actions: object[] | string[];
9 | cancelButtonText?: string; // IOS Only
10 | }
11 |
12 | export declare class Menu extends Common {
13 | public static popup(options: MenuOptions): Promise<{ id: number, title: string } | string | boolean | any>;
14 | }
15 |
--------------------------------------------------------------------------------
/src/menu.android.ts:
--------------------------------------------------------------------------------
1 | import { Common, MenuOptions } from "./menu.common";
2 | import { Application as app } from "@nativescript/core";
3 | export { MenuOptions } from "./menu.common";
4 | import * as Types from '@nativescript/core/utils/types';
5 |
6 | export class Menu extends Common {
7 |
8 | public static popup(options: MenuOptions): Promise<{ id: number, title: string } | string | boolean | any> {
9 | return new Promise((resolve, reject) => {
10 | try {
11 | let popupMenu = new android.widget.PopupMenu(
12 | app.android.foregroundActivity,
13 | options.view.android
14 | );
15 |
16 | if (options.actions[0] !== undefined) {
17 | if (Types.isString(options.actions[0])) {
18 | for (let i = 0; i < options.actions.length; i++) {
19 | const action = options.actions[i];
20 | popupMenu.getMenu().add(action);
21 | }
22 |
23 | popupMenu.setOnMenuItemClickListener(
24 | new android.widget.PopupMenu.OnMenuItemClickListener({
25 | onMenuItemClick: (item): boolean => {
26 | resolve({
27 | id: options.actions.indexOf(item.getTitle()),
28 | title: item.getTitle()
29 | });
30 | return true;
31 | }
32 | })
33 | );
34 | } else {
35 | for (let i = 0; i < options.actions.length; i++) {
36 | const action = options.actions[i];
37 | if (action.title !== undefined) {
38 | popupMenu.getMenu().add(action.title);
39 | }
40 | }
41 |
42 | popupMenu.setOnMenuItemClickListener(
43 | new android.widget.PopupMenu.OnMenuItemClickListener({
44 | onMenuItemClick: (item): boolean => {
45 | resolve(Object.assign({
46 | id: options.actions.find(actionItem => actionItem.title === item.getTitle()).id || options.actions.indexOf(options.actions.find(actionItem => actionItem.title === item.getTitle()))
47 | }, options.actions.find(actionItem => actionItem.title === item.getTitle())));
48 | return true;
49 | }
50 | })
51 | );
52 | }
53 | }
54 |
55 | popupMenu.setOnDismissListener(
56 | new android.widget.PopupMenu.OnDismissListener({
57 | onDismiss: () => {
58 | resolve(false);
59 | }
60 | })
61 | );
62 |
63 | setTimeout(() => {
64 | popupMenu.show();
65 | }, 1);
66 | } catch (error) {
67 | reject(error);
68 | }
69 | });
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/menu.common.ts:
--------------------------------------------------------------------------------
1 | import { View } from "@nativescript/core";
2 |
3 | export interface MenuOptions {
4 | title: string;
5 | message: string;
6 | view: View;
7 | actions: any[];
8 | cancelButtonText?: string;
9 | }
10 |
11 | export class Common {}
12 |
--------------------------------------------------------------------------------
/src/menu.ios.ts:
--------------------------------------------------------------------------------
1 | import { Common, MenuOptions } from './menu.common';
2 | export { MenuOptions } from './menu.common';
3 | import { action } from "@nativescript/core/ui/dialogs";
4 |
5 | export class Menu extends Common {
6 | public static popup(options: MenuOptions): Promise<{ id: number, title: string } | string | boolean | any> {
7 | return new Promise(function (resolve, reject) {
8 | try {
9 | action({
10 | title: options.title,
11 | message: options.message,
12 | cancelButtonText: options.cancelButtonText,
13 | actions: options.actions.map(r => r.title || r)
14 | }).then(result => {
15 | if (result) {
16 | let action = options.actions.filter(action => action.title == result)[0];
17 | if(action) {
18 | resolve(action)
19 | } else {
20 | resolve({
21 | id: options.actions.indexOf(result),
22 | title: result
23 | })
24 | }
25 |
26 | if(result == options.cancelButtonText) {
27 | resolve(false);
28 | }
29 | }
30 | }).catch(reject);
31 | }
32 | catch (error) {
33 | reject(error);
34 | }
35 | });
36 | }
37 | }
--------------------------------------------------------------------------------
/src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nativescript-menu",
3 | "version": "1.1.7",
4 | "description": "an plugin that adds a pop-up menu to NativeScript.",
5 | "main": "menu",
6 | "typings": "index.d.ts",
7 | "nativescript": {
8 | "platforms": {
9 | "android": "4.0.0",
10 | "ios": "4.0.0"
11 | }
12 | },
13 | "scripts": {
14 | "tsc": "tsc",
15 | "build": "npm run tsc && npm run build.native",
16 | "build.native": "node scripts/build-native.js",
17 | "postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && npx rimraf -- package-lock.json && cd ../src",
18 | "test.android": "npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch",
19 | "test.ios": "npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch",
20 | "tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\"",
21 | "plugin.tscwatch": "npm run tsc -- -w",
22 | "demo.ios": "npm run tsc && cd ../demo && tns run ios --syncAllFiles --emulator",
23 | "demo.android": "npm run tsc && cd ../demo && tns run android --syncAllFiles --emulator",
24 | "demo.reset": "cd ../demo && npx rimraf -- hooks node_modules platforms package-lock.json",
25 | "plugin.prepare": "npm run build && cd ../demo && tns plugin remove nativescript-menu && tns plugin add ../src",
26 | "clean": "npm run demo.reset && npx rimraf -- node_modules package-lock.json && npm i",
27 | "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'",
28 | "prepack": "npm run build.native"
29 | },
30 | "keywords": [
31 | "NativeScript",
32 | "JavaScript",
33 | "Android",
34 | "iOS"
35 | ],
36 | "author": {
37 | "name": "xlmnxp",
38 | "email": "xlmnxp@outlook.sa"
39 | },
40 | "bugs": {
41 | "url": "https://github.com/xlmnxp/nativescript-menu/issues"
42 | },
43 | "license": "MIT",
44 | "homepage": "https://github.com/xlmnxp/nativescript-menu",
45 | "readmeFilename": "README.md",
46 | "devDependencies": {
47 | "@nativescript/core": "^7.0.13",
48 | "@nativescript/types": "^7.0.4",
49 | "typescript": "~3.9.0",
50 | "prompt": "^1.0.0",
51 | "rimraf": "^2.6.2",
52 | "tslint": "^5.11.0",
53 | "semver": "^5.5.0"
54 | },
55 | "dependencies": {},
56 | "bootstrapper": "nativescript-plugin-seed"
57 | }
--------------------------------------------------------------------------------
/src/references.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 | ///
3 |
--------------------------------------------------------------------------------
/src/scripts/build-native.js:
--------------------------------------------------------------------------------
1 | const { exec } = require('child_process');
2 | const semver = require('semver');
3 |
4 | exec('tns --version', (err, stdout, stderr) => {
5 | if (err) {
6 | // node couldn't execute the command
7 | console.log(`tns --version err: ${err}`);
8 | return;
9 | }
10 |
11 | const tnsVersion = semver.major(stdout);
12 |
13 | // execute 'tns plugin build' for {N} version > 4. This command builds .aar in platforms/android folder.
14 | if (tnsVersion >= 4) {
15 | console.log(`executing 'tns plugin build'`);
16 | exec('tns plugin build', (err, stdout, stderr) => {
17 | if (err) {
18 | // node couldn't execute the command
19 | console.log(`${err}`);
20 | return;
21 | }
22 | });
23 | }
24 | });
25 |
--------------------------------------------------------------------------------
/src/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "esnext",
4 | "target": "es2017",
5 | "moduleResolution": "node",
6 | "experimentalDecorators": true,
7 | "emitDecoratorMetadata": true,
8 | "noEmitHelpers": true,
9 | "noEmitOnError": true,
10 | "skipLibCheck": true,
11 | "lib": [
12 | "es2018", "es2017", "dom", "es6"
13 | ],
14 | "baseUrl": ".",
15 | "paths": {
16 | "~/*": [
17 | "app/*"
18 | ]
19 | }
20 | },
21 | "include": [
22 | "src/tests/**/*.ts",
23 | "src/**/*.ios.ts",
24 | "src/**/*.android.ts"
25 | ],
26 | "files": [
27 | "./references.d.ts",
28 | "./src/main.ts"
29 | ],
30 | "exclude": [
31 | "node_modules",
32 | "platforms",
33 | "e2e"
34 | ],
35 | "angularCompilerOptions": {
36 | "enableIvy": true
37 | }
38 | }
--------------------------------------------------------------------------------
/src/tsfmt.json:
--------------------------------------------------------------------------------
1 | {
2 | "indentSize": 2,
3 | "tabSize": 2
4 | }
5 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "class-name": true,
4 | "comment-format": [
5 | true,
6 | "check-space"
7 | ],
8 | "indent": [
9 | true,
10 | "spaces"
11 | ],
12 | "no-duplicate-variable": true,
13 | "no-eval": true,
14 | "no-internal-module": true,
15 | "no-trailing-whitespace": true,
16 | "no-var-keyword": true,
17 | "one-line": [
18 | true,
19 | "check-open-brace",
20 | "check-whitespace"
21 | ],
22 | "quotemark": [
23 | false,
24 | "double"
25 | ],
26 | "semicolon": [
27 | true,
28 | "always"
29 | ],
30 | "triple-equals": [
31 | true,
32 | "allow-null-check"
33 | ],
34 | "typedef-whitespace": [
35 | true,
36 | {
37 | "call-signature": "nospace",
38 | "index-signature": "nospace",
39 | "parameter": "nospace",
40 | "property-declaration": "nospace",
41 | "variable-declaration": "nospace"
42 | }
43 | ],
44 | "variable-name": [
45 | true,
46 | "ban-keywords"
47 | ],
48 | "whitespace": [
49 | true,
50 | "check-branch",
51 | "check-decl",
52 | "check-operator",
53 | "check-separator",
54 | "check-type"
55 | ]
56 | }
57 | }
--------------------------------------------------------------------------------