@hanwha-ss1/plugin 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HanwhaSs1Plugin.podspec +17 -0
- package/README.md +67 -0
- package/android/build.gradle +58 -0
- package/android/src/main/AndroidManifest.xml +14 -0
- package/android/src/main/java/com/plugin/contacts/Contacts.java +41 -0
- package/android/src/main/java/com/plugin/contacts/ContactsPlugin.java +35 -0
- package/android/src/main/java/com/plugin/openbrowser/ChromeClient.java +125 -0
- package/android/src/main/java/com/plugin/openbrowser/OpenBrowser.java +34 -0
- package/android/src/main/java/com/plugin/openbrowser/OpenBrowserPlugin.java +32 -0
- package/android/src/main/java/com/plugin/openbrowser/WebViewActivity.java +71 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_ap.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_avi.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_bmp.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_doc.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_etc.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_etc_fill.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_exe.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_explorer.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_gif.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_gui.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_gul.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_hwp.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_img.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_jpg.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_mp_3.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_pdf.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_png.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_ppt.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_question.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_tif.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_tiff.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_txt.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_user.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_wav.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_xls.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_xml.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_20_file_zip.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_24_ico_close.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_24_ico_down.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_24_ico_down_2.png +0 -0
- package/android/src/main/res/drawable-hdpi/icon_24_ico_view.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_ap.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_avi.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_bmp.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_doc.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_etc.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_etc_fill.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_exe.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_explorer.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_gif.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_gui.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_gul.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_hwp.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_img.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_jpg.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_mp_3.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_pdf.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_png.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_ppt.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_question.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_tif.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_tiff.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_txt.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_user.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_wav.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_xls.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_xml.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_20_file_zip.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_24_ico_close.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_24_ico_down.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_24_ico_down_2.png +0 -0
- package/android/src/main/res/drawable-mdpi/icon_24_ico_view.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_ap.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_avi.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_bmp.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_doc.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_etc.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_etc_fill.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_exe.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_explorer.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_gif.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_gui.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_gul.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_hwp.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_img.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_jpg.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_mp_3.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_pdf.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_png.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_ppt.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_question.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_tif.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_tiff.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_txt.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_user.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_wav.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_xls.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_xml.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_20_file_zip.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_24_ico_close.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_24_ico_down.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_24_ico_down_2.png +0 -0
- package/android/src/main/res/drawable-xhdpi/icon_24_ico_view.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_ap.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_avi.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_bmp.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_doc.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_etc.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_etc_fill.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_exe.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_explorer.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_gif.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_gui.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_gul.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_hwp.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_img.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_jpg.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_mp_3.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_pdf.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_png.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_ppt.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_question.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_tif.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_tiff.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_txt.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_user.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_wav.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_xls.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_xml.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_20_file_zip.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_24_ico_close.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_24_ico_down.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_24_ico_down_2.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/icon_24_ico_view.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_ap.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_avi.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_bmp.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_doc.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_etc.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_etc_fill.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_exe.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_explorer.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_gif.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_gui.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_gul.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_hwp.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_img.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_jpg.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_mp_3.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_pdf.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_png.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_ppt.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_question.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_tif.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_tiff.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_txt.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_user.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_wav.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_xls.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_xml.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_20_file_zip.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_24_ico_close.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_24_ico_down.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_24_ico_down_2.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/icon_24_ico_view.png +0 -0
- package/android/src/main/res/layout/activity_webview.xml +49 -0
- package/android/src/main/res/values/strings.xml +5 -0
- package/android/src/main/res/values-ko-rKR/strings.xml +6 -0
- package/dist/docs.json +65 -0
- package/dist/esm/definitions.d.ts +19 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +5 -0
- package/dist/esm/web.js +8 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +24 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +27 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/Contact.h +10 -0
- package/ios/Plugin/Contact.swift +10 -0
- package/ios/Plugin/ContactPlugin.m +8 -0
- package/ios/Plugin/ContactPlugin.swift +124 -0
- package/ios/Plugin/Info.plist +24 -0
- package/ios/Plugin/Thumbs.db +0 -0
- package/package.json +79 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'HanwhaSs1Plugin'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.license = package['license']
|
|
10
|
+
s.homepage = package['repository']['url']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
|
+
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp,xib,xcassets,png}'
|
|
14
|
+
s.ios.deployment_target = '12.0'
|
|
15
|
+
s.dependency 'Capacitor'
|
|
16
|
+
s.swift_version = '5.1'
|
|
17
|
+
end
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# capacitor-plugin-hanwha-openbrowser
|
|
2
|
+
|
|
3
|
+
OpenBrowser
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install capacitor-plugin-hanwha-openbrowser
|
|
9
|
+
npx cap sync
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```javascript
|
|
15
|
+
import { OpenBrowser } from 'capacitor-plugin-hanwha-openbrowser';
|
|
16
|
+
|
|
17
|
+
await OpenBrowser.open({url: 'https://naver.com', ext: false});
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## API
|
|
21
|
+
|
|
22
|
+
<docgen-index>
|
|
23
|
+
|
|
24
|
+
* [`addListener(string, ...)`](#addlistenerstring)
|
|
25
|
+
* [`removeAllListeners()`](#removealllisteners)
|
|
26
|
+
* [Interfaces](#interfaces)
|
|
27
|
+
|
|
28
|
+
</docgen-index>
|
|
29
|
+
|
|
30
|
+
<docgen-api>
|
|
31
|
+
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
32
|
+
|
|
33
|
+
### addListener(string, ...)
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
addListener(eventName: string, listenerFunc: (...args: any[]) => any) => Promise<PluginListenerHandle>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
| Param | Type |
|
|
40
|
+
| ------------------ | --------------------------------------- |
|
|
41
|
+
| **`eventName`** | <code>string</code> |
|
|
42
|
+
| **`listenerFunc`** | <code>(...args: any[]) => any</code> |
|
|
43
|
+
|
|
44
|
+
**Returns:** <code>Promise<<a href="#pluginlistenerhandle">PluginListenerHandle</a>></code>
|
|
45
|
+
|
|
46
|
+
--------------------
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### removeAllListeners()
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
removeAllListeners() => Promise<void>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
--------------------
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### Interfaces
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
#### PluginListenerHandle
|
|
62
|
+
|
|
63
|
+
| Prop | Type |
|
|
64
|
+
| ------------ | ----------------------------------------- |
|
|
65
|
+
| **`remove`** | <code>() => Promise<void></code> |
|
|
66
|
+
|
|
67
|
+
</docgen-api>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
ext {
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
buildscript {
|
|
9
|
+
repositories {
|
|
10
|
+
google()
|
|
11
|
+
mavenCentral()
|
|
12
|
+
}
|
|
13
|
+
dependencies {
|
|
14
|
+
classpath 'com.android.tools.build:gradle:7.2.1'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
apply plugin: 'com.android.library'
|
|
19
|
+
|
|
20
|
+
android {
|
|
21
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
|
|
22
|
+
defaultConfig {
|
|
23
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
24
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
|
|
25
|
+
versionCode 1
|
|
26
|
+
versionName "1.0"
|
|
27
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
28
|
+
}
|
|
29
|
+
buildTypes {
|
|
30
|
+
release {
|
|
31
|
+
minifyEnabled false
|
|
32
|
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
lintOptions {
|
|
36
|
+
abortOnError false
|
|
37
|
+
}
|
|
38
|
+
compileOptions {
|
|
39
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
40
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
repositories {
|
|
45
|
+
google()
|
|
46
|
+
mavenCentral()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
dependencies {
|
|
51
|
+
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
52
|
+
implementation project(':capacitor-android')
|
|
53
|
+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
54
|
+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
55
|
+
testImplementation "junit:junit:$junitVersion"
|
|
56
|
+
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
57
|
+
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
58
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
package="com.plugin.openbrowser">
|
|
4
|
+
|
|
5
|
+
<uses-permission android:name="android.permission.INTERNET"/>
|
|
6
|
+
|
|
7
|
+
<application>
|
|
8
|
+
<activity
|
|
9
|
+
android:theme="@style/AppTheme.NoActionBar"
|
|
10
|
+
android:name="com.openbrowser.WebViewActivity"
|
|
11
|
+
android:exported="false" />
|
|
12
|
+
</application>
|
|
13
|
+
|
|
14
|
+
</manifest>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
package com.plugin.contacts;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.content.Intent;
|
|
5
|
+
import android.provider.ContactsContract;
|
|
6
|
+
import android.util.Log;
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
public class Contacts {
|
|
10
|
+
|
|
11
|
+
public String echo(String value) {
|
|
12
|
+
Log.i("Echo", value);
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 연락처 저장
|
|
18
|
+
*
|
|
19
|
+
* @param activity
|
|
20
|
+
* @param options name : 성명
|
|
21
|
+
* @param options mobilePhoneNumber : 전화번호
|
|
22
|
+
* @param options email : 이메일
|
|
23
|
+
* @param options departmentName : 소속
|
|
24
|
+
* @param options extensionNumber : 내선번호
|
|
25
|
+
*/
|
|
26
|
+
public void save(Activity activity, String name, String email, String mobilePhoneNumber, String extensionNumber, String departmentName) {
|
|
27
|
+
Intent intentInsertEdit = new Intent(Intent.ACTION_INSERT_OR_EDIT);
|
|
28
|
+
intentInsertEdit.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
|
|
29
|
+
intentInsertEdit
|
|
30
|
+
.putExtra(ContactsContract.Intents.Insert.NAME, name)
|
|
31
|
+
.putExtra(ContactsContract.Intents.Insert.EMAIL, email)
|
|
32
|
+
.putExtra(ContactsContract.Intents.Insert.EMAIL_TYPE, ContactsContract.CommonDataKinds.Email.TYPE_WORK)
|
|
33
|
+
.putExtra(ContactsContract.Intents.Insert.PHONE, mobilePhoneNumber)
|
|
34
|
+
.putExtra(ContactsContract.Intents.Insert.PHONE_TYPE,ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE)
|
|
35
|
+
.putExtra(ContactsContract.Intents.Insert.SECONDARY_PHONE, extensionNumber)
|
|
36
|
+
.putExtra(ContactsContract.Intents.Insert.SECONDARY_PHONE_TYPE,ContactsContract.CommonDataKinds.Phone.TYPE_WORK)
|
|
37
|
+
.putExtra(ContactsContract.Intents.Insert.COMPANY, departmentName);
|
|
38
|
+
activity.startActivity(intentInsertEdit);
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
package com.plugin.contacts;
|
|
2
|
+
|
|
3
|
+
import com.getcapacitor.JSObject;
|
|
4
|
+
import com.getcapacitor.Plugin;
|
|
5
|
+
import com.getcapacitor.PluginCall;
|
|
6
|
+
import com.getcapacitor.PluginMethod;
|
|
7
|
+
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@CapacitorPlugin(name = "Contacts")
|
|
11
|
+
public class ContactsPlugin extends Plugin{
|
|
12
|
+
private Contacts implementation = new Contacts();
|
|
13
|
+
|
|
14
|
+
@PluginMethod
|
|
15
|
+
public void echo(PluginCall call) {
|
|
16
|
+
String value = call.getString("value");
|
|
17
|
+
|
|
18
|
+
JSObject ret = new JSObject();
|
|
19
|
+
ret.put("value", implementation.echo(value));
|
|
20
|
+
call.resolve(ret);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@PluginMethod
|
|
24
|
+
public void addContact(PluginCall call) {
|
|
25
|
+
String name = call.getString("name");
|
|
26
|
+
String mobile = call.getString("phone");
|
|
27
|
+
String phone = call.getString("ext");
|
|
28
|
+
String department = call.getString("dept");
|
|
29
|
+
String email = call.getString("email");
|
|
30
|
+
if(implementation == null) {
|
|
31
|
+
implementation = new Contacts();
|
|
32
|
+
}
|
|
33
|
+
implementation.save(getActivity(), name, email, mobile, phone, department);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
package com.plugin.openbrowser;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.app.AlertDialog;
|
|
5
|
+
import android.content.DialogInterface;
|
|
6
|
+
import android.webkit.JsPromptResult;
|
|
7
|
+
import android.webkit.JsResult;
|
|
8
|
+
import android.webkit.WebChromeClient;
|
|
9
|
+
import android.webkit.WebView;
|
|
10
|
+
|
|
11
|
+
public class ChromeClient extends WebChromeClient {
|
|
12
|
+
protected Activity mActivity;
|
|
13
|
+
|
|
14
|
+
public interface CustomAlertListener {
|
|
15
|
+
void onPositiveClick(DialogInterface var1, String var2);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public interface CustomDialogListener {
|
|
19
|
+
void onPositiveClick(DialogInterface var1, String var2);
|
|
20
|
+
void onNegativeClick(DialogInterface var1, String var2);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public ChromeClient(Activity activity) {
|
|
24
|
+
this.mActivity = activity;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
|
|
28
|
+
showAlert("", message, new CustomAlertListener() {
|
|
29
|
+
public void onPositiveClick(DialogInterface dialog, String data) {
|
|
30
|
+
result.confirm();
|
|
31
|
+
dialog.dismiss();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
|
|
38
|
+
showConfirm("", message, new CustomDialogListener() {
|
|
39
|
+
public void onPositiveClick(DialogInterface dialog, String data) {
|
|
40
|
+
result.confirm();
|
|
41
|
+
dialog.dismiss();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public void onNegativeClick(DialogInterface dialog, String data) {
|
|
45
|
+
result.cancel();
|
|
46
|
+
dialog.dismiss();
|
|
47
|
+
}
|
|
48
|
+
}, true);
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public void showAlert(final String title, final String message, final CustomAlertListener listener) {
|
|
57
|
+
if (this.mActivity != null) {
|
|
58
|
+
this.mActivity.runOnUiThread(new Runnable() {
|
|
59
|
+
public void run() {
|
|
60
|
+
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(mActivity);
|
|
61
|
+
if (title != null && !title.equals("")) {
|
|
62
|
+
alertBuilder.setTitle(title);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (message != null && !message.equals("")) {
|
|
66
|
+
alertBuilder.setMessage(message);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
String confirm = mActivity.getString(R.string.ok);
|
|
70
|
+
alertBuilder.setPositiveButton(confirm, new DialogInterface.OnClickListener() {
|
|
71
|
+
public void onClick(DialogInterface dialog, int which) {
|
|
72
|
+
if (listener != null) {
|
|
73
|
+
listener.onPositiveClick(dialog, "");
|
|
74
|
+
}
|
|
75
|
+
dialog.dismiss();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
alertBuilder.setCancelable(false);
|
|
79
|
+
alertBuilder.show();
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public void showConfirm(final String title, final String message, final CustomDialogListener listener, boolean cancelable) {
|
|
86
|
+
if (this.mActivity != null) {
|
|
87
|
+
this.mActivity.runOnUiThread(new Runnable() {
|
|
88
|
+
public void run() {
|
|
89
|
+
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(mActivity);
|
|
90
|
+
if (title != null && !title.equals("")) {
|
|
91
|
+
alertBuilder.setTitle(title);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (message != null && !message.equals("")) {
|
|
95
|
+
alertBuilder.setMessage(message);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
alertBuilder.setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
|
|
99
|
+
public void onClick(DialogInterface dialog, int which) {
|
|
100
|
+
if (listener != null) {
|
|
101
|
+
listener.onPositiveClick(dialog, "");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
alertBuilder.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
|
106
|
+
public void onCancel(DialogInterface dialog) {
|
|
107
|
+
if (listener != null) {
|
|
108
|
+
listener.onNegativeClick(dialog, "");
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
alertBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
|
|
113
|
+
public void onClick(DialogInterface dialog, int which) {
|
|
114
|
+
if (listener != null) {
|
|
115
|
+
listener.onNegativeClick(dialog, "");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
alertBuilder.setCancelable(false);
|
|
120
|
+
alertBuilder.show();
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
package com.plugin.openbrowser;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.content.Intent;
|
|
5
|
+
import android.net.Uri;
|
|
6
|
+
import android.util.Log;
|
|
7
|
+
|
|
8
|
+
public class OpenBrowser {
|
|
9
|
+
|
|
10
|
+
public String echo(String value) {
|
|
11
|
+
Log.i("Echo", value);
|
|
12
|
+
return value;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 브라우저 실행
|
|
17
|
+
*
|
|
18
|
+
* @param activity
|
|
19
|
+
* @param url
|
|
20
|
+
* @param isExternal
|
|
21
|
+
*/
|
|
22
|
+
public void open(Activity activity, String url, boolean isExternal) {
|
|
23
|
+
if(activity != null && url != null && !url.isEmpty()) {
|
|
24
|
+
Intent intent;
|
|
25
|
+
if(isExternal) {
|
|
26
|
+
intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
|
|
27
|
+
} else {
|
|
28
|
+
intent = new Intent(activity, WebViewActivity.class);
|
|
29
|
+
intent.putExtra("url", url);
|
|
30
|
+
}
|
|
31
|
+
activity.startActivity(intent);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
package com.plugin.openbrowser;
|
|
2
|
+
|
|
3
|
+
import com.getcapacitor.JSObject;
|
|
4
|
+
import com.getcapacitor.Plugin;
|
|
5
|
+
import com.getcapacitor.PluginCall;
|
|
6
|
+
import com.getcapacitor.PluginMethod;
|
|
7
|
+
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
8
|
+
|
|
9
|
+
@CapacitorPlugin(name = "OpenBrowser")
|
|
10
|
+
public class OpenBrowserPlugin extends Plugin {
|
|
11
|
+
|
|
12
|
+
private OpenBrowser implementation = new OpenBrowser();
|
|
13
|
+
|
|
14
|
+
@PluginMethod
|
|
15
|
+
public void echo(PluginCall call) {
|
|
16
|
+
String value = call.getString("value");
|
|
17
|
+
|
|
18
|
+
JSObject ret = new JSObject();
|
|
19
|
+
ret.put("value", implementation.echo(value));
|
|
20
|
+
call.resolve(ret);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@PluginMethod
|
|
24
|
+
public void open(PluginCall call) {
|
|
25
|
+
String url = call.getString("url");
|
|
26
|
+
boolean isExternal = call.getBoolean("ext");
|
|
27
|
+
if(implementation == null) {
|
|
28
|
+
implementation = new OpenBrowser();
|
|
29
|
+
}
|
|
30
|
+
implementation.open(getActivity(), url, isExternal);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
package com.plugin.openbrowser;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.os.Bundle;
|
|
5
|
+
import android.view.View;
|
|
6
|
+
import android.webkit.WebView;
|
|
7
|
+
import android.webkit.WebViewClient;
|
|
8
|
+
import android.widget.ImageView;
|
|
9
|
+
|
|
10
|
+
import androidx.appcompat.app.AppCompatActivity;
|
|
11
|
+
|
|
12
|
+
public class WebViewActivity extends AppCompatActivity {
|
|
13
|
+
|
|
14
|
+
private WebView webView;
|
|
15
|
+
private ImageView ivClose;
|
|
16
|
+
|
|
17
|
+
@Override
|
|
18
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
19
|
+
super.onCreate(savedInstanceState);
|
|
20
|
+
setContentView(R.layout.activity_webview);
|
|
21
|
+
|
|
22
|
+
initLayout();
|
|
23
|
+
|
|
24
|
+
String url = getIntent().getStringExtra("url");
|
|
25
|
+
|
|
26
|
+
openUrl(url);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
private void initLayout() {
|
|
30
|
+
webView = findViewById(R.id.webView);
|
|
31
|
+
ivClose = findViewById(R.id.ivClose);
|
|
32
|
+
|
|
33
|
+
webView.getSettings().setJavaScriptEnabled(true);
|
|
34
|
+
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
|
|
35
|
+
webView.getSettings().setSupportZoom(true);
|
|
36
|
+
webView.getSettings().setBuiltInZoomControls(true);
|
|
37
|
+
webView.getSettings().setDisplayZoomControls(false);
|
|
38
|
+
webView.getSettings().setLoadWithOverviewMode(true);
|
|
39
|
+
webView.getSettings().setUseWideViewPort(true);
|
|
40
|
+
webView.setWebChromeClient(new ChromeClient((Activity)this));
|
|
41
|
+
webView.setWebViewClient(new WebViewClient(){
|
|
42
|
+
@Override
|
|
43
|
+
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
44
|
+
if(url.startsWith("close://")){
|
|
45
|
+
WebViewActivity.this.finish();
|
|
46
|
+
}
|
|
47
|
+
return super.shouldOverrideUrlLoading(view, url);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
ivClose.setOnClickListener(new View.OnClickListener() {
|
|
52
|
+
@Override
|
|
53
|
+
public void onClick(View v) {
|
|
54
|
+
WebViewActivity.this.finish();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
private void openUrl(String url) {
|
|
60
|
+
webView.loadUrl(url);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@Override
|
|
64
|
+
public void onBackPressed() {
|
|
65
|
+
if(webView != null && webView.canGoBack()) {
|
|
66
|
+
webView.goBack();
|
|
67
|
+
} else {
|
|
68
|
+
super.onBackPressed();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|