├── .gitignore ├── README.md ├── demo ├── .editorconfig ├── .gitignore ├── .gradle │ ├── 4.4 │ │ ├── fileChanges │ │ │ └── last-build.bin │ │ ├── fileHashes │ │ │ └── fileHashes.lock │ │ └── taskHistory │ │ │ └── taskHistory.lock │ └── buildOutputCleanup │ │ ├── buildOutputCleanup.lock │ │ └── cache.properties ├── android │ ├── .gitignore │ ├── app │ │ ├── .npmignore │ │ ├── build.gradle │ │ ├── capacitor.build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── getcapacitor │ │ │ │ └── myapp │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── github │ │ │ │ │ └── triniwiz │ │ │ │ │ └── imagecachedemo │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable-land-hdpi │ │ │ │ └── splash.png │ │ │ │ ├── drawable-land-ldpi │ │ │ │ └── splash.png │ │ │ │ ├── drawable-land-mdpi │ │ │ │ └── splash.png │ │ │ │ ├── drawable-land-xhdpi │ │ │ │ └── splash.png │ │ │ │ ├── drawable-land-xxhdpi │ │ │ │ └── splash.png │ │ │ │ ├── drawable-land-xxxhdpi │ │ │ │ └── splash.png │ │ │ │ ├── drawable-port-hdpi │ │ │ │ └── splash.png │ │ │ │ ├── drawable-port-ldpi │ │ │ │ └── splash.png │ │ │ │ ├── drawable-port-mdpi │ │ │ │ └── splash.png │ │ │ │ ├── drawable-port-xhdpi │ │ │ │ └── splash.png │ │ │ │ ├── drawable-port-xxhdpi │ │ │ │ └── splash.png │ │ │ │ ├── drawable-port-xxxhdpi │ │ │ │ └── splash.png │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ └── launch_splash.xml │ │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── icon.png │ │ │ │ ├── mipmap-ldpi │ │ │ │ └── icon.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── icon.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── icon.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── icon.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── icon.png │ │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ │ └── xml │ │ │ │ ├── config.xml │ │ │ │ └── file_paths.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── getcapacitor │ │ │ └── myapp │ │ │ └── ExampleUnitTest.java │ ├── build.gradle │ ├── capacitor-cordova-android-plugins │ │ ├── build.gradle │ │ ├── cordova.variables.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── .gitkeep │ │ │ └── res │ │ │ └── .gitkeep │ ├── capacitor.settings.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── capacitor.config.json ├── ionic.config.json ├── ios │ ├── .gitignore │ ├── App │ │ ├── App.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ ├── App.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── App │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── AppIcon-20x20@1x.png │ │ │ │ │ ├── AppIcon-20x20@2x-1.png │ │ │ │ │ ├── AppIcon-20x20@2x.png │ │ │ │ │ ├── AppIcon-20x20@3x.png │ │ │ │ │ ├── AppIcon-29x29@1x.png │ │ │ │ │ ├── AppIcon-29x29@2x-1.png │ │ │ │ │ ├── AppIcon-29x29@2x.png │ │ │ │ │ ├── AppIcon-29x29@3x.png │ │ │ │ │ ├── AppIcon-40x40@1x.png │ │ │ │ │ ├── AppIcon-40x40@2x-1.png │ │ │ │ │ ├── AppIcon-40x40@2x.png │ │ │ │ │ ├── AppIcon-40x40@3x.png │ │ │ │ │ ├── AppIcon-512@2x.png │ │ │ │ │ ├── AppIcon-60x60@2x.png │ │ │ │ │ ├── AppIcon-60x60@3x.png │ │ │ │ │ ├── AppIcon-76x76@1x.png │ │ │ │ │ ├── AppIcon-76x76@2x.png │ │ │ │ │ ├── AppIcon-83.5x83.5@2x.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── Contents.json │ │ │ │ └── Splash.imageset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── splash-2732x2732-1.png │ │ │ │ │ ├── splash-2732x2732-2.png │ │ │ │ │ └── splash-2732x2732.png │ │ │ ├── Base.lproj │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ └── Main.storyboard │ │ │ ├── Info.plist │ │ │ ├── capacitor.config.json │ │ │ └── config.xml │ │ ├── Podfile │ │ └── Podfile.lock │ └── capacitor-cordova-ios-plugins │ │ ├── CordovaPlugins.podspec │ │ ├── CordovaPluginsResources.podspec │ │ ├── CordovaPluginsStatic.podspec │ │ ├── resources │ │ └── .gitkeep │ │ └── sources │ │ └── .gitkeep ├── package-lock.json ├── package.json ├── scripts │ └── copy.js ├── src │ ├── app │ │ ├── app.component.ts │ │ ├── app.html │ │ ├── app.module.ts │ │ ├── app.scss │ │ └── main.ts │ ├── assets │ │ ├── icon │ │ │ └── favicon.ico │ │ └── imgs │ │ │ ├── Superman.jpg │ │ │ └── logo.png │ ├── index.html │ ├── manifest.json │ ├── ng-cached-image │ │ ├── cached-image.component.html │ │ ├── cached-image.component.scss │ │ ├── cached-image.component.ts │ │ └── cached-image.module.ts │ ├── pages │ │ └── home │ │ │ ├── data.json │ │ │ ├── home.html │ │ │ ├── home.scss │ │ │ └── home.ts │ ├── service-worker.js │ └── theme │ │ └── variables.scss ├── tsconfig.json └── tslint.json └── src ├── core ├── CapacitorImageCache.podspec ├── android │ ├── .npmignore │ ├── capacitor-image-cache │ │ ├── .npmignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── getcapacitor │ │ │ │ └── android │ │ │ │ └── ExampleInstrumentedTest.java │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── github │ │ │ │ │ └── triniwiz │ │ │ │ │ └── capacitorimagecache │ │ │ │ │ └── ImageCachePlugin.java │ │ │ └── res │ │ │ │ ├── layout │ │ │ │ └── bridge_layout_main.xml │ │ │ │ └── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── getcapacitor │ │ │ └── ExampleUnitTest.java │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── scripts │ │ └── release.sh ├── ios │ └── Plugin │ │ ├── Plugin.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ ├── max.xcuserdatad │ │ │ └── xcschemes │ │ │ │ └── xcschememanagement.plist │ │ │ └── triniwiz.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ ├── Plugin.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── max.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── triniwiz.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ ├── Plugin │ │ ├── Info.plist │ │ ├── Plugin.h │ │ ├── Plugin.m │ │ └── Plugin.swift │ │ ├── PluginTests │ │ ├── Info.plist │ │ └── PluginTests.swift │ │ ├── Podfile │ │ └── Podfile.lock ├── package-lock.json ├── package.json ├── rollup.config.js ├── src │ ├── definitions.ts │ ├── index.ts │ ├── plugin.ts │ ├── web-plugin.ts │ └── web.ts └── tsconfig.json └── view ├── .editorconfig ├── .gitignore ├── LICENSE ├── package-lock.json ├── package.json ├── readme.md ├── src ├── components.d.ts ├── components │ └── stencil-cached-image │ │ ├── cached-image.css │ │ └── cached-image.tsx └── index.html ├── stencil.config.js └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules 3 | .DS_Store 4 | dist 5 | src/core/ios/Plugin/Pods/ 6 | demo/android/app/src/main/assets 7 | src/core/android/capacitor-image-cache/build 8 | demo/android/app/build -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Image Cache Core 2 | 3 | [![npm](https://img.shields.io/npm/v/capacitor-image-cache.svg)](https://www.npmjs.com/package/capacitor-image-cache) 4 | [![npm](https://img.shields.io/npm/dt/capacitor-image-cache.svg?label=npm%20downloads)](https://www.npmjs.com/package/capacitor-image-cache) 5 | [![Build Status](https://travis-ci.org/triniwiz/capacitor-image-cache.svg?branch=master)](https://travis-ci.org/triniwiz/capacitor-image-cache) 6 | 7 | `npm i capacitor-image-cache` 8 | 9 | 10 | ```ts 11 | import { ImageCache } from 'capacitor-image-cache'; 12 | 13 | const cache = new ImageCache(); 14 | 15 | const { value } = await cache.get({src:"someSrc"}) // checks if the image is in cache and returns the image if not download, store then return 16 | 17 | const { value } = await cache.clear() // Clear entire cache returns a boolean 18 | 19 | const { value } = await cache.clearItem({src:"someSrc"}) // Clear item cache returns a boolean 20 | 21 | const { value } = await cache.hasItem({src:"someSrc"}) // check if cache has item returns a boolean 22 | 23 | ``` 24 | 25 | # Cached Image 26 | 27 | [![npm](https://img.shields.io/npm/v/st-cached-image.svg)](https://www.npmjs.com/package/st-cached-image) 28 | [![npm](https://img.shields.io/npm/dt/st-cached-image.svg?label=npm%20downloads)](https://www.npmjs.com/package/st-cached-image) 29 | [![Build Status](https://travis-ci.org/triniwiz/st-cached-image.svg?branch=master)](https://travis-ci.org/triniwiz/st-cached-image) 30 | 31 | # Cached Image 32 | 33 | ## Install 34 | **[Capacitor Image Cache](https://www.npmjs.com/package/capacitor-image-cache)** is require for this package 35 | * `npm i capacitor-image-cache st-cached-image` 36 | 37 | ## Usage 38 | 39 | 40 | 41 | ```html 42 | 43 | ``` 44 | 45 | **If using with ionic** 46 | 47 | ``` 48 | import 'st-cached-image/dist/cached-image'; 49 | ``` 50 | 51 | Update the following file since ionic ignores the file 52 | 53 | `youAppDir/node_modules/@ionic/app-scripts/config/copy.config.js` 54 | 55 | 56 | ```js 57 | copyStCachedImage: { 58 | src: ['{{ROOT}}/node_modules/st-cached-image/dist/cached-image**/*'], 59 | dest: '{{BUILD}}' 60 | } 61 | ``` -------------------------------------------------------------------------------- /demo/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs 2 | # editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | indent_style = space 8 | indent_size = 2 9 | 10 | # We recommend you to keep these unchanged 11 | end_of_line = lf 12 | charset = utf-8 13 | trim_trailing_whitespace = true 14 | insert_final_newline = true 15 | 16 | [*.md] 17 | trim_trailing_whitespace = false -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | # Specifies intentionally untracked files to ignore when using Git 2 | # http://git-scm.com/docs/gitignore 3 | 4 | *~ 5 | *.sw[mnpcod] 6 | *.log 7 | *.tmp 8 | *.tmp.* 9 | log.txt 10 | *.sublime-project 11 | *.sublime-workspace 12 | .vscode/ 13 | npm-debug.log* 14 | 15 | .idea/ 16 | .sourcemaps/ 17 | .sass-cache/ 18 | .tmp/ 19 | .versions/ 20 | coverage/ 21 | dist/ 22 | node_modules/ 23 | tmp/ 24 | temp/ 25 | hooks/ 26 | platforms/ 27 | plugins/ 28 | plugins/android.json 29 | plugins/ios.json 30 | www/ 31 | $RECYCLE.BIN/ 32 | 33 | .DS_Store 34 | Thumbs.db 35 | UserInterfaceState.xcuserstate 36 | -------------------------------------------------------------------------------- /demo/.gradle/4.4/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/.gradle/4.4/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/.gradle/4.4/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /demo/.gradle/4.4/taskHistory/taskHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/.gradle/4.4/taskHistory/taskHistory.lock -------------------------------------------------------------------------------- /demo/.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /demo/.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Tue Jun 19 12:26:40 AST 2018 2 | gradle.version=4.4 3 | -------------------------------------------------------------------------------- /demo/android/.gitignore: -------------------------------------------------------------------------------- 1 | # NPM renames .gitignore to .npmignore 2 | # In order to prevent that, we remove the initial "." 3 | # And the CLI then renames it 4 | 5 | # Using Android gitignore template: https://github.com/github/gitignore/blob/master/Android.gitignore 6 | 7 | # Built application files 8 | *.apk 9 | *.ap_ 10 | 11 | # Files for the ART/Dalvik VM 12 | *.dex 13 | 14 | # Java class files 15 | *.class 16 | 17 | # Generated files 18 | bin/ 19 | gen/ 20 | out/ 21 | 22 | # Gradle files 23 | .gradle/ 24 | build/ 25 | 26 | # Local configuration file (sdk path, etc) 27 | local.properties 28 | 29 | # Proguard folder generated by Eclipse 30 | proguard/ 31 | 32 | # Log Files 33 | *.log 34 | 35 | # Android Studio Navigation editor temp files 36 | .navigation/ 37 | 38 | # Android Studio captures folder 39 | captures/ 40 | 41 | # IntelliJ 42 | *.iml 43 | .idea/workspace.xml 44 | .idea/tasks.xml 45 | .idea/gradle.xml 46 | .idea/dictionaries 47 | .idea/libraries 48 | 49 | # Keystore files 50 | # Uncomment the following line if you do not want to check your keystore files in. 51 | #*.jks 52 | 53 | # External native build folder generated in Android Studio 2.2 and later 54 | .externalNativeBuild 55 | 56 | # Google Services (e.g. APIs or Firebase) 57 | google-services.json 58 | 59 | # Freeline 60 | freeline.py 61 | freeline/ 62 | freeline_project_description.json 63 | 64 | # fastlane 65 | fastlane/report.xml 66 | fastlane/Preview.html 67 | fastlane/screenshots 68 | fastlane/test_output 69 | fastlane/readme.md 70 | -------------------------------------------------------------------------------- /demo/android/app/.npmignore: -------------------------------------------------------------------------------- 1 | /build/* 2 | !/build/.npmkeep 3 | -------------------------------------------------------------------------------- /demo/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | defaultConfig { 6 | applicationId "com.github.triniwiz.imagecachedemo" 7 | minSdkVersion 21 8 | targetSdkVersion 27 9 | versionCode 1 10 | versionName "1.0" 11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | repositories { 22 | maven { 23 | url "https://dl.bintray.com/ionic-team/capacitor" 24 | } 25 | flatDir{ 26 | dirs '../../node_modules/@capacitor/cli/assets/capacitor-android-plugins/src/main/libs', 'libs' 27 | } 28 | } 29 | 30 | dependencies { 31 | implementation fileTree(include: ['*.jar'], dir: 'libs') 32 | implementation 'com.android.support:appcompat-v7:27.1.1' 33 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 34 | implementation project(':capacitor-android') 35 | testImplementation 'junit:junit:4.12' 36 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 37 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 38 | implementation project(':capacitor-android-plugins') 39 | } 40 | 41 | apply from: 'capacitor.build.gradle' -------------------------------------------------------------------------------- /demo/android/app/capacitor.build.gradle: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN 2 | apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle" 3 | dependencies { 4 | implementation project(':capacitor-image-cache') 5 | 6 | } 7 | 8 | 9 | if (hasProperty('postBuildExtras')) { 10 | postBuildExtras() 11 | } 12 | -------------------------------------------------------------------------------- /demo/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /demo/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.getcapacitor.myapp; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.getcapacitor.app", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /demo/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 28 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 53 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /demo/android/app/src/main/java/com/github/triniwiz/imagecachedemo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.github.triniwiz.imagecachedemo; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.getcapacitor.BridgeActivity; 6 | import com.getcapacitor.Plugin; 7 | import com.github.triniwiz.capacitorimagecache.ImageCachePlugin; 8 | 9 | import java.util.ArrayList; 10 | 11 | public class MainActivity extends BridgeActivity { 12 | @Override 13 | public void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | 16 | // Initializes the Bridge 17 | this.init(savedInstanceState, new ArrayList>() {{ 18 | // Additional plugins you've installed go here 19 | add(ImageCachePlugin.class); 20 | }}); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-land-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/drawable-land-hdpi/splash.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-land-ldpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/drawable-land-ldpi/splash.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-land-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/drawable-land-mdpi/splash.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-land-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/drawable-land-xhdpi/splash.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-land-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/drawable-land-xxhdpi/splash.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-land-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/drawable-land-xxxhdpi/splash.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-port-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/drawable-port-hdpi/splash.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-port-ldpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/drawable-port-ldpi/splash.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-port-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/drawable-port-mdpi/splash.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-port-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/drawable-port-xhdpi/splash.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-port-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/drawable-port-xxhdpi/splash.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-port-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/drawable-port-xxxhdpi/splash.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/drawable/launch_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/mipmap-hdpi/icon.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-ldpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/mipmap-ldpi/icon.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/mipmap-mdpi/icon.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/mipmap-xhdpi/icon.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/mipmap-xxhdpi/icon.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/mipmap-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/app/src/main/res/mipmap-xxxhdpi/icon.png -------------------------------------------------------------------------------- /demo/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ImageCacheDemo 4 | ImageCacheDemo 5 | com.github.triniwiz.imagecachedemo 6 | com.github.triniwiz.imagecachedemo.fileprovider 7 | com.github.triniwiz.imagecachedemo 8 | 9 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 17 | 18 | 19 | 22 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/xml/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /demo/android/app/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /demo/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.getcapacitor.myapp; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /demo/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | 5 | repositories { 6 | google() 7 | jcenter() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.1.1' 11 | 12 | 13 | // NOTE: Do not place your application dependencies here; they belong 14 | // in the individual module build.gradle files 15 | } 16 | } 17 | 18 | allprojects { 19 | repositories { 20 | google() 21 | jcenter() 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | -------------------------------------------------------------------------------- /demo/android/capacitor-cordova-android-plugins/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | google() 5 | } 6 | dependencies { 7 | classpath 'com.android.tools.build:gradle:3.1.1' 8 | } 9 | } 10 | 11 | apply plugin: 'com.android.library' 12 | 13 | android { 14 | compileSdkVersion 27 15 | defaultConfig { 16 | minSdkVersion 21 17 | targetSdkVersion 27 18 | versionCode 1 19 | versionName "1.0" 20 | } 21 | lintOptions { 22 | abortOnError false 23 | } 24 | } 25 | 26 | repositories { 27 | google() 28 | jcenter() 29 | mavenCentral() 30 | flatDir{ 31 | dirs 'src/main/libs', 'libs' 32 | } 33 | } 34 | 35 | dependencies { 36 | implementation fileTree(dir: 'src/main/libs', include: ['*.jar']) 37 | implementation 'org.apache.cordova:framework:7.0.0' 38 | // SUB-PROJECT DEPENDENCIES START 39 | 40 | // SUB-PROJECT DEPENDENCIES END 41 | } 42 | 43 | // PLUGIN GRADLE EXTENSIONS START 44 | apply from: "cordova.variables.gradle" 45 | // PLUGIN GRADLE EXTENSIONS END -------------------------------------------------------------------------------- /demo/android/capacitor-cordova-android-plugins/cordova.variables.gradle: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN 2 | ext { 3 | cdvMinSdkVersion = 21 4 | } -------------------------------------------------------------------------------- /demo/android/capacitor-cordova-android-plugins/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /demo/android/capacitor-cordova-android-plugins/src/main/java/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/capacitor-cordova-android-plugins/src/main/java/.gitkeep -------------------------------------------------------------------------------- /demo/android/capacitor-cordova-android-plugins/src/main/res/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /demo/android/capacitor.settings.gradle: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN 2 | include ':capacitor-android' 3 | project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor') 4 | 5 | include ':capacitor-image-cache' 6 | project(':capacitor-image-cache').projectDir = new File('../node_modules/capacitor-image-cache/android/capacitor-image-cache') 7 | -------------------------------------------------------------------------------- /demo/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /demo/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /demo/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jan 30 13:14:22 CST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /demo/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /demo/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /demo/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | include ':capacitor-android' 3 | project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor/') 4 | include ':capacitor-android-plugins' 5 | project(':capacitor-android-plugins').projectDir = new File('../node_modules/@capacitor/cli/assets/capacitor-android-plugins/') 6 | 7 | apply from: 'capacitor.settings.gradle' -------------------------------------------------------------------------------- /demo/capacitor.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "appId": "com.github.triniwiz.imagecachedemo", 3 | "appName": "ImageCacheDemo", 4 | "bundledWebRuntime": false, 5 | "webDir": "www", 6 | "ios": { 7 | "minVersion": "11.0" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /demo/ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo", 3 | "app_id": "", 4 | "type": "ionic-angular", 5 | "integrations": {} 6 | } 7 | -------------------------------------------------------------------------------- /demo/ios/.gitignore: -------------------------------------------------------------------------------- 1 | # NPM renames .gitignore to .npmignore 2 | # In order to prevent that, we remove the initial "." 3 | # And the CLI then renames it 4 | 5 | App/build 6 | App/Pods 7 | App/public 8 | xcuserdata 9 | 10 | -------------------------------------------------------------------------------- /demo/ios/App/App.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2FAD9763203C412B000D30F8 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = 2FAD9762203C412B000D30F8 /* config.xml */; }; 11 | 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */ = {isa = PBXBuildFile; fileRef = 50379B222058CBB4000EE86E /* capacitor.config.json */; }; 12 | 504EC3081FED79650016851F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504EC3071FED79650016851F /* AppDelegate.swift */; }; 13 | 504EC30D1FED79650016851F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30B1FED79650016851F /* Main.storyboard */; }; 14 | 504EC30F1FED79650016851F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30E1FED79650016851F /* Assets.xcassets */; }; 15 | 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; }; 16 | 50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; }; 17 | A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 2FAD9762203C412B000D30F8 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = ""; }; 22 | 50379B222058CBB4000EE86E /* capacitor.config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = capacitor.config.json; sourceTree = ""; }; 23 | 504EC3041FED79650016851F /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 504EC3071FED79650016851F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 25 | 504EC30C1FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 26 | 504EC30E1FED79650016851F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | 504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 28 | 504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | 50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = SOURCE_ROOT; }; 30 | AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.release.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.release.xcconfig"; sourceTree = ""; }; 32 | FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App.debug.xcconfig"; path = "Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig"; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 504EC3011FED79650016851F /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | A084ECDBA7D38E1E42DFC39D /* Pods_App.framework in Frameworks */, 41 | ); 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | /* End PBXFrameworksBuildPhase section */ 45 | 46 | /* Begin PBXGroup section */ 47 | 27E2DDA53C4D2A4D1A88CE4A /* Frameworks */ = { 48 | isa = PBXGroup; 49 | children = ( 50 | AF277DCFFFF123FFC6DF26C7 /* Pods_App.framework */, 51 | ); 52 | name = Frameworks; 53 | sourceTree = ""; 54 | }; 55 | 504EC2FB1FED79650016851F = { 56 | isa = PBXGroup; 57 | children = ( 58 | 504EC3061FED79650016851F /* App */, 59 | 504EC3051FED79650016851F /* Products */, 60 | 7F8756D8B27F46E3366F6CEA /* Pods */, 61 | 27E2DDA53C4D2A4D1A88CE4A /* Frameworks */, 62 | ); 63 | sourceTree = ""; 64 | }; 65 | 504EC3051FED79650016851F /* Products */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | 504EC3041FED79650016851F /* App.app */, 69 | ); 70 | name = Products; 71 | sourceTree = ""; 72 | }; 73 | 504EC3061FED79650016851F /* App */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 50379B222058CBB4000EE86E /* capacitor.config.json */, 77 | 504EC3071FED79650016851F /* AppDelegate.swift */, 78 | 504EC30B1FED79650016851F /* Main.storyboard */, 79 | 504EC30E1FED79650016851F /* Assets.xcassets */, 80 | 504EC3101FED79650016851F /* LaunchScreen.storyboard */, 81 | 504EC3131FED79650016851F /* Info.plist */, 82 | 2FAD9762203C412B000D30F8 /* config.xml */, 83 | 50B271D01FEDC1A000F3C39B /* public */, 84 | ); 85 | path = App; 86 | sourceTree = ""; 87 | }; 88 | 7F8756D8B27F46E3366F6CEA /* Pods */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */, 92 | AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */, 93 | ); 94 | name = Pods; 95 | sourceTree = ""; 96 | }; 97 | /* End PBXGroup section */ 98 | 99 | /* Begin PBXNativeTarget section */ 100 | 504EC3031FED79650016851F /* App */ = { 101 | isa = PBXNativeTarget; 102 | buildConfigurationList = 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */; 103 | buildPhases = ( 104 | 6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */, 105 | 504EC3001FED79650016851F /* Sources */, 106 | 504EC3011FED79650016851F /* Frameworks */, 107 | 504EC3021FED79650016851F /* Resources */, 108 | 9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */, 109 | ); 110 | buildRules = ( 111 | ); 112 | dependencies = ( 113 | ); 114 | name = App; 115 | productName = App; 116 | productReference = 504EC3041FED79650016851F /* App.app */; 117 | productType = "com.apple.product-type.application"; 118 | }; 119 | /* End PBXNativeTarget section */ 120 | 121 | /* Begin PBXProject section */ 122 | 504EC2FC1FED79650016851F /* Project object */ = { 123 | isa = PBXProject; 124 | attributes = { 125 | LastSwiftUpdateCheck = 0920; 126 | LastUpgradeCheck = 0920; 127 | TargetAttributes = { 128 | 504EC3031FED79650016851F = { 129 | CreatedOnToolsVersion = 9.2; 130 | ProvisioningStyle = Automatic; 131 | }; 132 | }; 133 | }; 134 | buildConfigurationList = 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */; 135 | compatibilityVersion = "Xcode 8.0"; 136 | developmentRegion = en; 137 | hasScannedForEncodings = 0; 138 | knownRegions = ( 139 | en, 140 | Base, 141 | ); 142 | mainGroup = 504EC2FB1FED79650016851F; 143 | productRefGroup = 504EC3051FED79650016851F /* Products */; 144 | projectDirPath = ""; 145 | projectRoot = ""; 146 | targets = ( 147 | 504EC3031FED79650016851F /* App */, 148 | ); 149 | }; 150 | /* End PBXProject section */ 151 | 152 | /* Begin PBXResourcesBuildPhase section */ 153 | 504EC3021FED79650016851F /* Resources */ = { 154 | isa = PBXResourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | 504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */, 158 | 50B271D11FEDC1A000F3C39B /* public in Resources */, 159 | 504EC30F1FED79650016851F /* Assets.xcassets in Resources */, 160 | 50379B232058CBB4000EE86E /* capacitor.config.json in Resources */, 161 | 504EC30D1FED79650016851F /* Main.storyboard in Resources */, 162 | 2FAD9763203C412B000D30F8 /* config.xml in Resources */, 163 | ); 164 | runOnlyForDeploymentPostprocessing = 0; 165 | }; 166 | /* End PBXResourcesBuildPhase section */ 167 | 168 | /* Begin PBXShellScriptBuildPhase section */ 169 | 6634F4EFEBD30273BCE97C65 /* [CP] Check Pods Manifest.lock */ = { 170 | isa = PBXShellScriptBuildPhase; 171 | buildActionMask = 2147483647; 172 | files = ( 173 | ); 174 | inputPaths = ( 175 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 176 | "${PODS_ROOT}/Manifest.lock", 177 | ); 178 | name = "[CP] Check Pods Manifest.lock"; 179 | outputPaths = ( 180 | "$(DERIVED_FILE_DIR)/Pods-App-checkManifestLockResult.txt", 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 185 | showEnvVarsInLog = 0; 186 | }; 187 | 9592DBEFFC6D2A0C8D5DEB22 /* [CP] Embed Pods Frameworks */ = { 188 | isa = PBXShellScriptBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | ); 192 | inputPaths = ( 193 | "${SRCROOT}/Pods/Target Support Files/Pods-App/Pods-App-frameworks.sh", 194 | "${BUILT_PRODUCTS_DIR}/Capacitor/Capacitor.framework", 195 | "${BUILT_PRODUCTS_DIR}/CapacitorCordova/Cordova.framework", 196 | "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", 197 | ); 198 | name = "[CP] Embed Pods Frameworks"; 199 | outputPaths = ( 200 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Capacitor.framework", 201 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cordova.framework", 202 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | shellPath = /bin/sh; 206 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-App/Pods-App-frameworks.sh\"\n"; 207 | showEnvVarsInLog = 0; 208 | }; 209 | /* End PBXShellScriptBuildPhase section */ 210 | 211 | /* Begin PBXSourcesBuildPhase section */ 212 | 504EC3001FED79650016851F /* Sources */ = { 213 | isa = PBXSourcesBuildPhase; 214 | buildActionMask = 2147483647; 215 | files = ( 216 | 504EC3081FED79650016851F /* AppDelegate.swift in Sources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXSourcesBuildPhase section */ 221 | 222 | /* Begin PBXVariantGroup section */ 223 | 504EC30B1FED79650016851F /* Main.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 504EC30C1FED79650016851F /* Base */, 227 | ); 228 | name = Main.storyboard; 229 | sourceTree = ""; 230 | }; 231 | 504EC3101FED79650016851F /* LaunchScreen.storyboard */ = { 232 | isa = PBXVariantGroup; 233 | children = ( 234 | 504EC3111FED79650016851F /* Base */, 235 | ); 236 | name = LaunchScreen.storyboard; 237 | sourceTree = ""; 238 | }; 239 | /* End PBXVariantGroup section */ 240 | 241 | /* Begin XCBuildConfiguration section */ 242 | 504EC3141FED79650016851F /* Debug */ = { 243 | isa = XCBuildConfiguration; 244 | buildSettings = { 245 | ALWAYS_SEARCH_USER_PATHS = NO; 246 | CLANG_ANALYZER_NONNULL = YES; 247 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 248 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 249 | CLANG_CXX_LIBRARY = "libc++"; 250 | CLANG_ENABLE_MODULES = YES; 251 | CLANG_ENABLE_OBJC_ARC = YES; 252 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 253 | CLANG_WARN_BOOL_CONVERSION = YES; 254 | CLANG_WARN_COMMA = YES; 255 | CLANG_WARN_CONSTANT_CONVERSION = YES; 256 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 257 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 258 | CLANG_WARN_EMPTY_BODY = YES; 259 | CLANG_WARN_ENUM_CONVERSION = YES; 260 | CLANG_WARN_INFINITE_RECURSION = YES; 261 | CLANG_WARN_INT_CONVERSION = YES; 262 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 263 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 264 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 265 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 266 | CLANG_WARN_STRICT_PROTOTYPES = YES; 267 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 268 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 269 | CLANG_WARN_UNREACHABLE_CODE = YES; 270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 271 | CODE_SIGN_IDENTITY = "iPhone Developer"; 272 | COPY_PHASE_STRIP = NO; 273 | DEBUG_INFORMATION_FORMAT = dwarf; 274 | ENABLE_STRICT_OBJC_MSGSEND = YES; 275 | ENABLE_TESTABILITY = YES; 276 | GCC_C_LANGUAGE_STANDARD = gnu11; 277 | GCC_DYNAMIC_NO_PIC = NO; 278 | GCC_NO_COMMON_BLOCKS = YES; 279 | GCC_OPTIMIZATION_LEVEL = 0; 280 | GCC_PREPROCESSOR_DEFINITIONS = ( 281 | "DEBUG=1", 282 | "$(inherited)", 283 | ); 284 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 285 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 286 | GCC_WARN_UNDECLARED_SELECTOR = YES; 287 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 288 | GCC_WARN_UNUSED_FUNCTION = YES; 289 | GCC_WARN_UNUSED_VARIABLE = YES; 290 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 291 | MTL_ENABLE_DEBUG_INFO = YES; 292 | ONLY_ACTIVE_ARCH = YES; 293 | SDKROOT = iphoneos; 294 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 295 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 296 | }; 297 | name = Debug; 298 | }; 299 | 504EC3151FED79650016851F /* Release */ = { 300 | isa = XCBuildConfiguration; 301 | buildSettings = { 302 | ALWAYS_SEARCH_USER_PATHS = NO; 303 | CLANG_ANALYZER_NONNULL = YES; 304 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 305 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 306 | CLANG_CXX_LIBRARY = "libc++"; 307 | CLANG_ENABLE_MODULES = YES; 308 | CLANG_ENABLE_OBJC_ARC = YES; 309 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 310 | CLANG_WARN_BOOL_CONVERSION = YES; 311 | CLANG_WARN_COMMA = YES; 312 | CLANG_WARN_CONSTANT_CONVERSION = YES; 313 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 314 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 315 | CLANG_WARN_EMPTY_BODY = YES; 316 | CLANG_WARN_ENUM_CONVERSION = YES; 317 | CLANG_WARN_INFINITE_RECURSION = YES; 318 | CLANG_WARN_INT_CONVERSION = YES; 319 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 320 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 321 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 322 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 323 | CLANG_WARN_STRICT_PROTOTYPES = YES; 324 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 325 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 326 | CLANG_WARN_UNREACHABLE_CODE = YES; 327 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 328 | CODE_SIGN_IDENTITY = "iPhone Developer"; 329 | COPY_PHASE_STRIP = NO; 330 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 331 | ENABLE_NS_ASSERTIONS = NO; 332 | ENABLE_STRICT_OBJC_MSGSEND = YES; 333 | GCC_C_LANGUAGE_STANDARD = gnu11; 334 | GCC_NO_COMMON_BLOCKS = YES; 335 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 336 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 337 | GCC_WARN_UNDECLARED_SELECTOR = YES; 338 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 339 | GCC_WARN_UNUSED_FUNCTION = YES; 340 | GCC_WARN_UNUSED_VARIABLE = YES; 341 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 342 | MTL_ENABLE_DEBUG_INFO = NO; 343 | SDKROOT = iphoneos; 344 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 345 | VALIDATE_PRODUCT = YES; 346 | }; 347 | name = Release; 348 | }; 349 | 504EC3171FED79650016851F /* Debug */ = { 350 | isa = XCBuildConfiguration; 351 | baseConfigurationReference = FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */; 352 | buildSettings = { 353 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 354 | CODE_SIGN_STYLE = Automatic; 355 | DEVELOPMENT_TEAM = TG7LSJHB64; 356 | INFOPLIST_FILE = App/Info.plist; 357 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 358 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 359 | OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; 360 | PRODUCT_BUNDLE_IDENTIFIER = com.github.triniwiz.imagecachedemo; 361 | PRODUCT_NAME = "$(TARGET_NAME)"; 362 | SWIFT_VERSION = 4.0; 363 | TARGETED_DEVICE_FAMILY = "1,2"; 364 | }; 365 | name = Debug; 366 | }; 367 | 504EC3181FED79650016851F /* Release */ = { 368 | isa = XCBuildConfiguration; 369 | baseConfigurationReference = AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */; 370 | buildSettings = { 371 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 372 | CODE_SIGN_STYLE = Automatic; 373 | DEVELOPMENT_TEAM = TG7LSJHB64; 374 | INFOPLIST_FILE = App/Info.plist; 375 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 376 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 377 | PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.App; 378 | PRODUCT_NAME = "$(TARGET_NAME)"; 379 | SWIFT_VERSION = 4.0; 380 | TARGETED_DEVICE_FAMILY = "1,2"; 381 | }; 382 | name = Release; 383 | }; 384 | /* End XCBuildConfiguration section */ 385 | 386 | /* Begin XCConfigurationList section */ 387 | 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */ = { 388 | isa = XCConfigurationList; 389 | buildConfigurations = ( 390 | 504EC3141FED79650016851F /* Debug */, 391 | 504EC3151FED79650016851F /* Release */, 392 | ); 393 | defaultConfigurationIsVisible = 0; 394 | defaultConfigurationName = Release; 395 | }; 396 | 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */ = { 397 | isa = XCConfigurationList; 398 | buildConfigurations = ( 399 | 504EC3171FED79650016851F /* Debug */, 400 | 504EC3181FED79650016851F /* Release */, 401 | ); 402 | defaultConfigurationIsVisible = 0; 403 | defaultConfigurationName = Release; 404 | }; 405 | /* End XCConfigurationList section */ 406 | }; 407 | rootObject = 504EC2FC1FED79650016851F /* Project object */; 408 | } 409 | -------------------------------------------------------------------------------- /demo/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/ios/App/App.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /demo/ios/App/App/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Capacitor 3 | 4 | @UIApplicationMain 5 | class AppDelegate: UIResponder, UIApplicationDelegate { 6 | 7 | var window: UIWindow? 8 | 9 | 10 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 11 | // Override point for customization after application launch. 12 | return true 13 | } 14 | 15 | func applicationWillResignActive(_ application: UIApplication) { 16 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 17 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 18 | } 19 | 20 | func applicationDidEnterBackground(_ application: UIApplication) { 21 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 22 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 23 | } 24 | 25 | func applicationWillEnterForeground(_ application: UIApplication) { 26 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 27 | } 28 | 29 | func applicationDidBecomeActive(_ application: UIApplication) { 30 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 31 | } 32 | 33 | func applicationWillTerminate(_ application: UIApplication) { 34 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 35 | } 36 | 37 | func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool { 38 | // Called when the app was launched with a url. Feel free to add additional processing here, 39 | // but if you want the App API to support tracking app url opens, make sure to keep this call 40 | return CAPBridge.handleOpenUrl(url, options) 41 | } 42 | 43 | func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool { 44 | // Called when the app was launched with an activity, including Universal Links. 45 | // Feel free to add additional processing here, but if you want the App API to support 46 | // tracking app url opens, make sure to keep this call 47 | return CAPBridge.handleContinueActivity(userActivity, restorationHandler) 48 | } 49 | 50 | override func touchesBegan(_ touches: Set, with event: UIEvent?) { 51 | super.touchesBegan(touches, with: event) 52 | 53 | let statusBarRect = UIApplication.shared.statusBarFrame 54 | guard let touchPoint = event?.allTouches?.first?.location(in: self.window) else { return } 55 | 56 | if statusBarRect.contains(touchPoint) { 57 | NotificationCenter.default.post(CAPBridge.statusBarTappedNotification) 58 | } 59 | } 60 | 61 | } 62 | 63 | -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x-1.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x-1.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x-1.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "AppIcon-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "AppIcon-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "AppIcon-29x29@2x-1.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "AppIcon-29x29@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "40x40", 29 | "idiom" : "iphone", 30 | "filename" : "AppIcon-40x40@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "AppIcon-40x40@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "AppIcon-60x60@2x.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "AppIcon-60x60@3x.png", 49 | "scale" : "3x" 50 | }, 51 | { 52 | "size" : "20x20", 53 | "idiom" : "ipad", 54 | "filename" : "AppIcon-20x20@1x.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "AppIcon-20x20@2x-1.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "29x29", 65 | "idiom" : "ipad", 66 | "filename" : "AppIcon-29x29@1x.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "AppIcon-29x29@2x.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "40x40", 77 | "idiom" : "ipad", 78 | "filename" : "AppIcon-40x40@1x.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "AppIcon-40x40@2x-1.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "76x76", 89 | "idiom" : "ipad", 90 | "filename" : "AppIcon-76x76@1x.png", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "AppIcon-76x76@2x.png", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "size" : "83.5x83.5", 101 | "idiom" : "ipad", 102 | "filename" : "AppIcon-83.5x83.5@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "1024x1024", 107 | "idiom" : "ios-marketing", 108 | "filename" : "AppIcon-512@2x.png", 109 | "scale" : "1x" 110 | } 111 | ], 112 | "info" : { 113 | "version" : 1, 114 | "author" : "xcode" 115 | } 116 | } -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "splash-2732x2732-2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "splash-2732x2732-1.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "splash-2732x2732.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png -------------------------------------------------------------------------------- /demo/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png -------------------------------------------------------------------------------- /demo/ios/App/App/Base.lproj/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 | -------------------------------------------------------------------------------- /demo/ios/App/App/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /demo/ios/App/App/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ImageCacheDemo 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleURLTypes 22 | 23 | 24 | CFBundleURLName 25 | com.getcapacitor.capacitor 26 | CFBundleURLSchemes 27 | 28 | capacitor 29 | 30 | 31 | 32 | CFBundleVersion 33 | 1 34 | LSRequiresIPhoneOS 35 | 36 | NSAppTransportSecurity 37 | 38 | NSAllowsArbitraryLoads 39 | 40 | 41 | NSCameraUsageDescription 42 | To Take Photos and Video 43 | NSLocationAlwaysUsageDescription 44 | Always allow Geolocation? 45 | NSLocationWhenInUseUsageDescription 46 | Allow Geolocation? 47 | NSMicrophoneUsageDescription 48 | To Record Audio With Video 49 | NSPhotoLibraryAddUsageDescription 50 | Store camera photos to camera 51 | NSPhotoLibraryUsageDescription 52 | To Pick Photos from Library 53 | UILaunchStoryboardName 54 | LaunchScreen 55 | UIMainStoryboardFile 56 | Main 57 | UIRequiredDeviceCapabilities 58 | 59 | armv7 60 | 61 | UISupportedInterfaceOrientations 62 | 63 | UIInterfaceOrientationPortrait 64 | UIInterfaceOrientationLandscapeLeft 65 | UIInterfaceOrientationLandscapeRight 66 | 67 | UISupportedInterfaceOrientations~ipad 68 | 69 | UIInterfaceOrientationPortrait 70 | UIInterfaceOrientationPortraitUpsideDown 71 | UIInterfaceOrientationLandscapeLeft 72 | UIInterfaceOrientationLandscapeRight 73 | 74 | UIViewControllerBasedStatusBarAppearance 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /demo/ios/App/App/capacitor.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "appId": "com.github.triniwiz.imagecachedemo", 3 | "appName": "ImageCacheDemo", 4 | "bundledWebRuntime": false, 5 | "webDir": "www", 6 | "ios": { 7 | "minVersion": "11.0" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /demo/ios/App/App/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /demo/ios/App/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '11.0' 2 | use_frameworks! 3 | 4 | target 'App' do 5 | # Add your Pods here 6 | 7 | # Automatic Capacitor Pod dependencies, do not delete 8 | pod 'Capacitor', :path => '../../node_modules/@capacitor/ios' 9 | pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios' 10 | pod 'CapacitorImageCache', :path => '../../node_modules/capacitor-image-cache' 11 | # Do not delete 12 | end 13 | -------------------------------------------------------------------------------- /demo/ios/App/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Capacitor (1.0.0-beta.12): 3 | - CapacitorCordova (= 1.0.0-beta.12) 4 | - CapacitorCordova (1.0.0-beta.12) 5 | - CapacitorImageCache (0.0.12): 6 | - Capacitor 7 | - SDWebImage (~> 4.0) 8 | - SDWebImage (4.4.3): 9 | - SDWebImage/Core (= 4.4.3) 10 | - SDWebImage/Core (4.4.3) 11 | 12 | DEPENDENCIES: 13 | - "Capacitor (from `../../node_modules/@capacitor/ios`)" 14 | - "CapacitorCordova (from `../../node_modules/@capacitor/ios`)" 15 | - CapacitorImageCache (from `../../node_modules/capacitor-image-cache`) 16 | 17 | SPEC REPOS: 18 | https://github.com/cocoapods/specs.git: 19 | - SDWebImage 20 | 21 | EXTERNAL SOURCES: 22 | Capacitor: 23 | :path: "../../node_modules/@capacitor/ios" 24 | CapacitorCordova: 25 | :path: "../../node_modules/@capacitor/ios" 26 | CapacitorImageCache: 27 | :path: "../../node_modules/capacitor-image-cache" 28 | 29 | SPEC CHECKSUMS: 30 | Capacitor: 95a02969f90a0384263d8dd3a0930548c5eb4d3f 31 | CapacitorCordova: 0ac0f51826feddef37d1ef8a8f6ff8c8b1ed0dd3 32 | CapacitorImageCache: 555a2aaeb22cc137a57446c5e1828b2fe90e0b07 33 | SDWebImage: c5594f1a19c48d526d321e548902b56b479cd508 34 | 35 | PODFILE CHECKSUM: f5e93cbbbf21599541a04a334e70283c0e204719 36 | 37 | COCOAPODS: 1.5.3 38 | -------------------------------------------------------------------------------- /demo/ios/capacitor-cordova-ios-plugins/CordovaPlugins.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | s.name = 'CordovaPlugins' 4 | s.version = '1.0.0-beta.13' 5 | s.summary = 'Autogenerated spec' 6 | s.license = 'Unknown' 7 | s.homepage = 'https://example.com' 8 | s.authors = { 'Capacitor Generator' => 'hi@example.com' } 9 | s.source = { :git => 'https://github.com/ionic-team/does-not-exist.git', :tag => '1.0.0-beta.13' } 10 | s.source_files = 'sources/**/*.{swift,h,m,c,cc,mm,cpp}' 11 | s.ios.deployment_target = '11.0' 12 | s.dependency 'CapacitorCordova' 13 | s.swift_version = '4.0' 14 | 15 | end -------------------------------------------------------------------------------- /demo/ios/capacitor-cordova-ios-plugins/CordovaPluginsResources.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'CordovaPluginsResources' 3 | s.version = '0.0.105' 4 | s.summary = 'Resources for Cordova plugins' 5 | s.social_media_url = 'http://twitter.com/getcapacitor' 6 | s.license = 'MIT' 7 | s.homepage = 'https://capacitor.ionicframework.com/' 8 | s.authors = { 'Ionic Team' => 'hi@ionicframework.com' } 9 | s.source = { :git => 'https://github.com/ionic-team/capacitor.git', :tag => s.version.to_s } 10 | s.resources = ['resources/*'] 11 | end -------------------------------------------------------------------------------- /demo/ios/capacitor-cordova-ios-plugins/CordovaPluginsStatic.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | s.name = 'CordovaPluginsStatic' 4 | s.version = '1.0.0-beta.13' 5 | s.summary = 'Autogenerated spec' 6 | s.license = 'Unknown' 7 | s.homepage = 'https://example.com' 8 | s.authors = { 'Capacitor Generator' => 'hi@example.com' } 9 | s.source = { :git => 'https://github.com/ionic-team/does-not-exist.git', :tag => '1.0.0-beta.13' } 10 | s.source_files = 'sourcesstatic/**/*.{swift,h,m,c,cc,mm,cpp}' 11 | s.ios.deployment_target = '11.0' 12 | s.dependency 'CapacitorCordova' 13 | s.swift_version = '4.0' 14 | s.static_framework = true 15 | end -------------------------------------------------------------------------------- /demo/ios/capacitor-cordova-ios-plugins/resources/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /demo/ios/capacitor-cordova-ios-plugins/sources/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo", 3 | "version": "0.0.1", 4 | "author": "Ionic Framework", 5 | "homepage": "http://ionicframework.com/", 6 | "private": true, 7 | "scripts": { 8 | "clean": "ionic-app-scripts clean", 9 | "build": "ionic-app-scripts build", 10 | "lint": "ionic-app-scripts lint", 11 | "ionic:build": "ionic-app-scripts build", 12 | "ionic:serve": "ionic-app-scripts serve" 13 | }, 14 | "dependencies": { 15 | "@angular/animations": "5.2.11", 16 | "@angular/common": "5.2.11", 17 | "@angular/compiler": "5.2.11", 18 | "@angular/compiler-cli": "5.2.11", 19 | "@angular/core": "5.2.11", 20 | "@angular/forms": "5.2.11", 21 | "@angular/http": "5.2.11", 22 | "@angular/platform-browser": "5.2.11", 23 | "@angular/platform-browser-dynamic": "5.2.11", 24 | "@capacitor/android": "^1.0.0-beta.0", 25 | "@capacitor/cli": "^1.0.0-beta.0", 26 | "@capacitor/core": "^1.0.0-beta.0", 27 | "@capacitor/ios": "^1.0.0-beta.0", 28 | "@ionic-native/core": "4.7.0", 29 | "@ionic-native/splash-screen": "4.7.0", 30 | "@ionic-native/status-bar": "4.7.0", 31 | "@ionic/storage": "2.1.3", 32 | "capacitor-image-cache": "../src/core", 33 | "ionic-angular": "3.9.2", 34 | "ionicons": "3.0.0", 35 | "rxjs": "5.5.11", 36 | "st-cached-image": "0.0.4", 37 | "sw-toolbox": "3.6.0", 38 | "zone.js": "0.8.26" 39 | }, 40 | "devDependencies": { 41 | "@ionic/app-scripts": "3.1.10", 42 | "typescript": "~2.6.2" 43 | }, 44 | "description": "An Ionic project", 45 | "config": { 46 | "ionic_copy": "./scripts/copy.js" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /demo/scripts/copy.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | copyStCachedImage: { 3 | src: ['{{ROOT}}/node_modules/st-cached-image/dist/cached-image**/*'], 4 | dest: '{{BUILD}}' 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /demo/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { Platform } from 'ionic-angular'; 3 | import { StatusBar } from '@ionic-native/status-bar'; 4 | import { SplashScreen } from '@ionic-native/splash-screen'; 5 | 6 | import { HomePage } from '../pages/home/home'; 7 | @Component({ 8 | templateUrl: 'app.html' 9 | }) 10 | export class MyApp { 11 | rootPage:any = HomePage; 12 | 13 | constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) { 14 | platform.ready().then(() => { 15 | // Okay, so the platform is ready and our plugins are available. 16 | // Here you can do any higher level native things you might need. 17 | statusBar.styleDefault(); 18 | splashScreen.hide(); 19 | }); 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /demo/src/app/app.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /demo/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { CUSTOM_ELEMENTS_SCHEMA, ErrorHandler, NgModule } from '@angular/core'; 3 | import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; 4 | import { SplashScreen } from '@ionic-native/splash-screen'; 5 | import { StatusBar } from '@ionic-native/status-bar'; 6 | 7 | import { MyApp } from './app.component'; 8 | import { HomePage } from '../pages/home/home'; 9 | import 'st-cached-image/dist/cached-image'; 10 | import { CachedImageModule } from '../ng-cached-image/cached-image.module'; 11 | @NgModule({ 12 | declarations: [ 13 | MyApp, 14 | HomePage 15 | ], 16 | imports: [ 17 | BrowserModule, 18 | IonicModule.forRoot(MyApp), 19 | CachedImageModule 20 | ], 21 | bootstrap: [IonicApp], 22 | entryComponents: [ 23 | MyApp, 24 | HomePage 25 | ], 26 | providers: [ 27 | StatusBar, 28 | SplashScreen, 29 | {provide: ErrorHandler, useClass: IonicErrorHandler} 30 | ], 31 | schemas: [CUSTOM_ELEMENTS_SCHEMA] 32 | }) 33 | export class AppModule {} 34 | -------------------------------------------------------------------------------- /demo/src/app/app.scss: -------------------------------------------------------------------------------- 1 | // http://ionicframework.com/docs/theming/ 2 | 3 | 4 | // App Global Sass 5 | // -------------------------------------------------- 6 | // Put style rules here that you want to apply globally. These 7 | // styles are for the entire app and not just one component. 8 | // Additionally, this file can be also used as an entry point 9 | // to import other Sass files to be included in the output CSS. 10 | // 11 | // Shared Sass variables, which can be used to adjust Ionic's 12 | // default Sass variables, belong in "theme/variables.scss". 13 | // 14 | // To declare rules for a specific mode, create a child rule 15 | // for the .md, .ios, or .wp mode classes. The mode class is 16 | // automatically applied to the element in the app. 17 | -------------------------------------------------------------------------------- /demo/src/app/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app.module'; 4 | 5 | platformBrowserDynamic().bootstrapModule(AppModule); 6 | -------------------------------------------------------------------------------- /demo/src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /demo/src/assets/imgs/Superman.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/src/assets/imgs/Superman.jpg -------------------------------------------------------------------------------- /demo/src/assets/imgs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/demo/src/assets/imgs/logo.png -------------------------------------------------------------------------------- /demo/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ionic App 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /demo/src/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Ionic", 3 | "short_name": "Ionic", 4 | "start_url": "index.html", 5 | "display": "standalone", 6 | "icons": [{ 7 | "src": "assets/imgs/logo.png", 8 | "sizes": "512x512", 9 | "type": "image/png" 10 | }], 11 | "background_color": "#4e8ef7", 12 | "theme_color": "#4e8ef7" 13 | } -------------------------------------------------------------------------------- /demo/src/ng-cached-image/cached-image.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /demo/src/ng-cached-image/cached-image.component.scss: -------------------------------------------------------------------------------- 1 | div { 2 | width: 100%; 3 | height: 100%; 4 | img { 5 | width: 100px; 6 | height: 100px; 7 | object-fit: cover; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /demo/src/ng-cached-image/cached-image.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; 2 | import { ImageCache } from 'capacitor-image-cache'; 3 | import { Observable } from 'rxjs' 4 | 5 | function uuid() { 6 | return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { 7 | const r = (Math.random() * 16) | 0, 8 | v = c === 'x' ? r : (r & 0x3) | 0x8; 9 | return v.toString(16); 10 | }); 11 | } 12 | 13 | @Component({ 14 | selector: 'cached-image', 15 | template: ` 16 |
17 | 18 |
19 | `, 20 | styles: [` 21 | div { 22 | width: 100%; 23 | height: 100%; 24 | } 25 | 26 | div img { 27 | width: 100%; 28 | height: 100%; 29 | object-fit: fill; 30 | } 31 | `] 32 | }) 33 | export class CachedImageComponent implements OnChanges { 34 | public id: string; 35 | private cache: ImageCache; 36 | public source: Observable; 37 | @Input('src') src: string; 38 | 39 | constructor() { 40 | this.id = uuid(); 41 | this.cache = new ImageCache(); 42 | } 43 | 44 | ngOnChanges(changes: SimpleChanges): void { 45 | const src = changes['src']; 46 | if (src) { 47 | this.source = Observable.fromPromise(this.cache.get({src: src.currentValue})).map(v => v.value) 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /demo/src/ng-cached-image/cached-image.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CachedImageComponent } from './cached-image.component'; 3 | import { BrowserModule } from '@angular/platform-browser'; 4 | 5 | @NgModule({ 6 | imports:[ 7 | BrowserModule, 8 | ], 9 | declarations: [CachedImageComponent], 10 | exports: [CachedImageComponent], 11 | }) 12 | 13 | export class CachedImageModule {} 14 | -------------------------------------------------------------------------------- /demo/src/pages/home/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "items":[ 3 | 4 | { "url": "https://uproxx.files.wordpress.com/2017/07/shazam.jpg" }, 5 | { "url": "assets/imgs/Superman.jpg" }, 6 | { 7 | "url": 8 | "http://i.kinja-img.com/gawker-media/image/upload/arjw8wqvwnihalb6fq3k.png" 9 | }, 10 | { "url": "http://i.imgur.com/gHkiBKr.jpg" }, 11 | { "url": "https://images.alphacoders.com/112/112131.jpg" }, 12 | { 13 | "url": 14 | "http://screenrant.com/wp-content/uploads/flash-movie-director-writer-grahame-smith.jpg" 15 | }, 16 | { 17 | "url": 18 | "http://i.newsarama.com/images/i/000/165/825/i02/Jim_Lee_Superman.jpg?" 19 | }, 20 | { 21 | "url": 22 | "http://www.studiocity-macau.com/uploads/images/SC/Entertainment/Batman/batman_share.jpg" 23 | }, 24 | { 25 | "url": 26 | "http://media.dcentertainment.com/sites/default/files/GalleryChar_1900x900_Shazam_JLWar_52efe00221d5e8.67242484.jpg" 27 | }, 28 | { 29 | "url": 30 | "http://media.dcentertainment.com/sites/default/files/GalleryComics_1920x1080_20150617_WW_Cv41_55775bb30cf485.93762653.jpg" 31 | }, 32 | { 33 | "url": 34 | "http://media.dcentertainment.com/sites/default/files/GalleryComics_1920x1080_20150826_CYB_Cv2_55cceb0d8f1d31.28141728.jpg" 35 | }, 36 | { 37 | "url": 38 | "http://media.dcentertainment.com/sites/default/files/GalleryChar_1900x900_GL_JLWar_05_52efdf431a6f06.20788146.jpg" 39 | }, 40 | { 41 | "url": 42 | "http://media.dcentertainment.com/sites/default/files/GalleryChar_1900x900_aquaman1_04_52ab5de7275bb2.59639997.jpg" 43 | }, 44 | { 45 | "url": 46 | "http://i.newsarama.com/images/i/000/146/771/i02/MM_02_CVR_CMYK.jpg?" 47 | }, 48 | { "url": "http://cdn.hitfix.com/photos/6206789/The-Green-Arrow.jpg" }, 49 | { "url": "http://www.cinemablend.com/images/news/32429/_1447230516.jpg" }, 50 | { "url": "http://gallery.photo.net/photo/7983112-lg.jpg" }, 51 | { "url": "https://images.unsplash.com/photo-1458724338480-79bc7a8352e4" }, 52 | { "url": "https://images.unsplash.com/photo-1456318019777-ccdc4d5b2396" }, 53 | { "url": "https://images.unsplash.com/photo-1455098934982-64c622c5e066" }, 54 | { "url": "https://images.unsplash.com/photo-1454817481404-7e84c1b73b4a" }, 55 | { "url": "https://images.unsplash.com/photo-1454982523318-4b6396f39d3a" }, 56 | { "url": "https://images.unsplash.com/photo-1456428199391-a3b1cb5e93ab" }, 57 | { "url": "https://images.unsplash.com/photo-1423768164017-3f27c066407f" }, 58 | { "url": "https://images.unsplash.com/photo-1433360405326-e50f909805b3" }, 59 | { "url": "https://images.unsplash.com/photo-1421749810611-438cc492b581" }, 60 | { "url": "https://images.unsplash.com/photo-1437652010333-fbf2cd02a4f8" }, 61 | { "url": "https://images.unsplash.com/photo-1458640904116-093b74971de9" }, 62 | { "url": "https://images.unsplash.com/photo-1422393462206-207b0fbd8d6b" }, 63 | { "url": "https://images.unsplash.com/photo-1454047637795-79e3325dfa0e" }, 64 | { "url": "https://images.unsplash.com/photo-1457369804613-52c61a468e7d" }, 65 | { "url": "https://images.unsplash.com/photo-1440227537815-f4476b789291" }, 66 | { "url": "https://images.unsplash.com/photo-1428189923803-e9801d464d76" }, 67 | { 68 | "url": 69 | "https://images.unsplash.com/reserve/eNu5TtyHRnWf9627TvZN_IMG_7791.JPG" 70 | }, 71 | { "url": "https://images.unsplash.com/photo-1453227588063-bb302b62f50b" }, 72 | { "url": "https://images.unsplash.com/photo-1442512595331-e89e73853f31" }, 73 | { "url": "https://images.unsplash.com/photo-1441986380878-c4248f5b8b5b" }, 74 | { "url": "https://images.unsplash.com/photo-1439736637365-748f240b24fb" }, 75 | { "url": "https://images.unsplash.com/photo-1440557653082-e8e186733eeb" }, 76 | { "url": "https://images.unsplash.com/photo-1443926886562-c91054221a5c" }, 77 | { "url": "https://images.unsplash.com/photo-1447958374760-1ce70cf11ee3" }, 78 | { "url": "https://images.unsplash.com/photo-1449452198679-05c7fd30f416" }, 79 | { "url": "https://images.unsplash.com/photo-1452723312111-3a7d0db0e024" }, 80 | { 81 | "url": 82 | "https://images.unsplash.com/uploads/14128434147336bfb286b/e76494ac" 83 | }, 84 | { "url": "https://images.unsplash.com/photo-1421987392252-38a07781c07e" }, 85 | { "url": "https://images.unsplash.com/photo-1422157245273-e08b638b4b00" }, 86 | { "url": "https://images.unsplash.com/photo-1453106037972-08fbfe790762" }, 87 | { "url": "https://images.unsplash.com/photo-1452110040644-6751c0c95836" }, 88 | { "url": "https://images.unsplash.com/photo-1449960238630-7e720e630019" }, 89 | { "url": "https://images.unsplash.com/photo-1433190152045-5a94184895da" }, 90 | { "url": "https://images.unsplash.com/photo-1437382944886-45a9f73d4158" }, 91 | { "url": "https://images.unsplash.com/photo-1433878455169-4698e60005b1" }, 92 | { "url": "https://images.unsplash.com/photo-1453282716202-de94e528067c" }, 93 | { "url": "https://images.unsplash.com/photo-1437382944886-45a9f73d4158" }, 94 | { "url": "https://images.unsplash.com/photo-1453282716202-de94e528067c" }, 95 | { "url": "https://images.unsplash.com/photo-1451188502541-13943edb6acb" }, 96 | { "url": "https://images.unsplash.com/photo-1449024540548-94f5d5a59230" }, 97 | { "url": "https://images.unsplash.com/photo-1447877085163-3cce903855cd" }, 98 | { "url": "https://images.unsplash.com/photo-1445346366695-5bf62de05412" }, 99 | { "url": "https://images.unsplash.com/photo-1442473483905-95eb436675f1" }, 100 | { "url": "https://images.unsplash.com/photo-1434871619871-1f315a50efba" }, 101 | { "url": "https://images.unsplash.com/photo-1433162653888-a571db5ccccf" }, 102 | { "url": "https://images.unsplash.com/photo-1453743327117-664e2bf4e951" }, 103 | { "url": "https://images.unsplash.com/photo-1453170804045-277782641dca" }, 104 | { "url": "https://images.unsplash.com/photo-1452800185063-6db5e12b8e2e" }, 105 | { "url": "https://images.unsplash.com/photo-1452274381522-521513015433" }, 106 | { "url": "https://images.unsplash.com/photo-1451417379553-15d8e8f49cde" }, 107 | { "url": "https://images.unsplash.com/photo-1451337516015-6b6e9a44a8a3" }, 108 | { "url": "https://images.unsplash.com/photo-1449057528837-7ca097b3520c" }, 109 | { "url": "https://images.unsplash.com/photo-1447834353189-91c48abf20e1" }, 110 | { "url": "https://images.unsplash.com/photo-1443890484047-5eaa67d1d630" }, 111 | { "url": "https://images.unsplash.com/photo-1451303688941-9e06d4b1277a" }, 112 | { "url": "https://images.unsplash.com/photo-1451186859696-371d9477be93" }, 113 | { "url": "https://images.unsplash.com/photo-1447069387593-a5de0862481e" }, 114 | { "url": "https://images.unsplash.com/photo-1445299370299-fba06c02df22" }, 115 | { "url": "https://images.unsplash.com/photo-1444044205806-38f3ed106c10" }, 116 | { "url": "https://images.unsplash.com/photo-1442589031151-61d5645469d7" }, 117 | { "url": "https://images.unsplash.com/photo-1439792675105-701e6a4ab6f0" }, 118 | { "url": "https://images.unsplash.com/photo-1439723680580-bfd9d28ef9b6" }, 119 | { "url": "https://images.unsplash.com/photo-1434472007488-8d47f604f644" }, 120 | { 121 | "url": 122 | "http://cdn.pcwallart.com/images/spring-nature-wallpapers-high-resolution-wallpaper-4.jpg" 123 | }, 124 | { "url": "http://gallery.photo.net/photo/11298470-lg.jpg" }, 125 | { "url": "http://gallery.photo.net/photo/5602504-md.jpg" }, 126 | { "url": "http://gallery.photo.net/photo/9734091-md.jpg" }, 127 | { "url": "http://gallery.photo.net/photo/4797337-md.jpg" }, 128 | { "url": "http://gallery.photo.net/photo/7141529-md.jpg" }, 129 | { "url": "http://gallery.photo.net/photo/7232968-md.jpg" }, 130 | { "url": "http://gallery.photo.net/photo/12871773-md.jpg" }, 131 | { "url": "http://gallery.photo.net/photo/12721293-md.jpg" }, 132 | { "url": "http://gallery.photo.net/photo/6892014-md.jpg" }, 133 | { "url": "http://gallery.photo.net/photo/3269153-md.jpg" }, 134 | { "url": "http://gallery.photo.net/photo/8189453-md.jpg" }, 135 | { "url": "http://gallery.photo.net/photo/2693222-lg.jpg" }, 136 | { "url": "http://gallery.photo.net/photo/3606595-md.jpg" }, 137 | { "url": "http://gallery.photo.net/photo/5433159-lg.jpg" }, 138 | { "url": "http://gallery.photo.net/photo/6183491-lg.jpg" }, 139 | { "url": "http://gallery.photo.net/photo/2747674-md.jpg" }, 140 | { "url": "http://gallery.photo.net/photo/8362141-md.jpg" }, 141 | { "url": "http://gallery.photo.net/photo/6456351-lg.jpg" }, 142 | { "url": "http://gallery.photo.net/photo/4087789-md.jpg" }, 143 | { "url": "http://gallery.photo.net/photo/8667486-md.jpg" }, 144 | { "url": "http://gallery.photo.net/photo/11014502-md.jpg" }, 145 | { "url": "http://gallery.photo.net/photo/8829472-lg.jpg" }, 146 | { "url": "http://gallery.photo.net/photo/3536082-md.jpg" }, 147 | { "url": "http://gallery.photo.net/photo/10348290-md.jpg" }, 148 | { "url": "http://gallery.photo.net/photo/6004788-md.jpg" }, 149 | { "url": "http://gallery.photo.net/photo/5724374-lg.jpg" }, 150 | { "url": "http://gallery.photo.net/photo/9703314-md.jpg" }, 151 | { 152 | "url": 153 | "http://cdn.wonderfulengineering.com/wp-content/uploads/2014/03/high-resolution-wallpapers-25.jpg" 154 | }, 155 | { "url": "http://gratisography.com/pictures/259_1.jpg" }, 156 | { "url": "http://gratisography.com/pictures/248_1.jpg" }, 157 | { "url": "http://gratisography.com/pictures/245_1.jpg" }, 158 | { 159 | "url": 160 | "https://www.hdwallpapers.net/previews/lamborghini-centenario-lp770-4-1000.jpg" 161 | }, 162 | { "url": "http://gratisography.com/pictures/235_1.jpg" }, 163 | { "url": "http://gratisography.com/pictures/225_1.jpg" }, 164 | { 165 | "url": 166 | "https://www.hdwallpapers.net/previews/jiraiya-fan-art-naruto-845.jpg" 167 | }, 168 | { 169 | "url": 170 | "http://www.planwallpaper.com/static/images/magic-of-blue-universe-images.jpg" 171 | }, 172 | { 173 | "url": 174 | "http://cdn.theatlantic.com/assets/media/img/photo/2015/11/images-from-the-2016-sony-world-pho/s01_130921474920553591/main_900.jpg" 175 | }, 176 | { 177 | "url": 178 | "http://interrete.org/wp-content/uploads/2014/04/Miniature-World-of-Insects6.png" 179 | }, 180 | { 181 | "url": 182 | "http://www.isharearena.com/wp-content/uploads/2012/12/wallpaper-281049.jpg" 183 | }, 184 | { 185 | "url": "http://excellzone.com/wp-content/uploads/2015/06/anime-front.jpg" 186 | }, 187 | { 188 | "url": 189 | "http://otakukart.com/animeblog/wp-content/uploads/2015/12/Top-10-Anime-Character-That-Really-Started-From-The-Bottom.png" 190 | } 191 | ] 192 | } 193 | -------------------------------------------------------------------------------- /demo/src/pages/home/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Ionic Blank 5 | 6 | 7 | 8 | 9 | 10 | The world is your oyster. 11 |

12 | If you get lost, the docs will be your guide. 13 |

14 | 15 |
16 |
17 |

Url {{item.url}}

18 | 19 |
20 |
21 |
22 | -------------------------------------------------------------------------------- /demo/src/pages/home/home.scss: -------------------------------------------------------------------------------- 1 | page-home { 2 | 3 | } 4 | 5 | .image-list{ 6 | display: grid; 7 | grid-template-columns: repeat(auto-fit,minxmax(100xp,1fr)); 8 | grid-template-rows: repeat(auto-fit,minxmax(100xp,1fr)); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /demo/src/pages/home/home.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { NavController } from 'ionic-angular'; 3 | const data = require('./data.json'); 4 | @Component({ 5 | selector: 'page-home', 6 | templateUrl: 'home.html' 7 | }) 8 | export class HomePage { 9 | 10 | constructor(public navCtrl: NavController) {} 11 | 12 | get items():Array{ 13 | return data['items']; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /demo/src/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Check out https://googlechromelabs.github.io/sw-toolbox/ for 3 | * more info on how to use sw-toolbox to custom configure your service worker. 4 | */ 5 | 6 | 7 | 'use strict'; 8 | importScripts('./build/sw-toolbox.js'); 9 | 10 | self.toolbox.options.cache = { 11 | name: 'ionic-cache' 12 | }; 13 | 14 | // pre-cache our key assets 15 | self.toolbox.precache( 16 | [ 17 | './build/main.js', 18 | './build/vendor.js', 19 | './build/main.css', 20 | './build/polyfills.js', 21 | 'index.html', 22 | 'manifest.json' 23 | ] 24 | ); 25 | 26 | // dynamically cache any other local assets 27 | self.toolbox.router.any('/*', self.toolbox.fastest); 28 | 29 | // for any other requests go to the network, cache, 30 | // and then only use that cached resource if your user goes offline 31 | self.toolbox.router.default = self.toolbox.networkFirst; 32 | -------------------------------------------------------------------------------- /demo/src/theme/variables.scss: -------------------------------------------------------------------------------- 1 | // Ionic Variables and Theming. For more info, please see: 2 | // http://ionicframework.com/docs/theming/ 3 | 4 | // Font path is used to include ionicons, 5 | // roboto, and noto sans fonts 6 | $font-path: "../assets/fonts"; 7 | 8 | 9 | // The app direction is used to include 10 | // rtl styles in your app. For more info, please see: 11 | // http://ionicframework.com/docs/theming/rtl-support/ 12 | $app-direction: ltr; 13 | 14 | 15 | @import "ionic.globals"; 16 | 17 | 18 | // Shared Variables 19 | // -------------------------------------------------- 20 | // To customize the look and feel of this app, you can override 21 | // the Sass variables found in Ionic's source scss files. 22 | // To view all the possible Ionic variables, see: 23 | // http://ionicframework.com/docs/theming/overriding-ionic-variables/ 24 | 25 | 26 | 27 | 28 | // Named Color Variables 29 | // -------------------------------------------------- 30 | // Named colors makes it easy to reuse colors on various components. 31 | // It's highly recommended to change the default colors 32 | // to match your app's branding. Ionic uses a Sass map of 33 | // colors so you can add, rename and remove colors as needed. 34 | // The "primary" color is the only required color in the map. 35 | 36 | $colors: ( 37 | primary: #488aff, 38 | secondary: #32db64, 39 | danger: #f53d3d, 40 | light: #f4f4f4, 41 | dark: #222 42 | ); 43 | 44 | 45 | // App iOS Variables 46 | // -------------------------------------------------- 47 | // iOS only Sass variables can go here 48 | 49 | 50 | 51 | 52 | // App Material Design Variables 53 | // -------------------------------------------------- 54 | // Material Design only Sass variables can go here 55 | 56 | 57 | 58 | 59 | // App Windows Variables 60 | // -------------------------------------------------- 61 | // Windows only Sass variables can go here 62 | 63 | 64 | 65 | 66 | // App Theme 67 | // -------------------------------------------------- 68 | // Ionic apps can have different themes applied, which can 69 | // then be future customized. This import comes last 70 | // so that the above variables are used and Ionic's 71 | // default are overridden. 72 | 73 | @import "ionic.theme.default"; 74 | 75 | 76 | // Ionicons 77 | // -------------------------------------------------- 78 | // The premium icon font for Ionic. For more info, please see: 79 | // http://ionicframework.com/docs/ionicons/ 80 | 81 | @import "ionic.ionicons"; 82 | 83 | 84 | // Fonts 85 | // -------------------------------------------------- 86 | 87 | @import "roboto"; 88 | @import "noto-sans"; 89 | -------------------------------------------------------------------------------- /demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "declaration": false, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": [ 8 | "dom", 9 | "es2015" 10 | ], 11 | "module": "es2015", 12 | "moduleResolution": "node", 13 | "sourceMap": true, 14 | "target": "es5" 15 | }, 16 | "include": [ 17 | "src/**/*.ts" 18 | ], 19 | "exclude": [ 20 | "node_modules", 21 | "src/**/*.spec.ts", 22 | "src/**/__tests__/*.ts" 23 | ], 24 | "compileOnSave": false, 25 | "atom": { 26 | "rewriteTsconfig": false 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /demo/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-duplicate-variable": true, 4 | "no-unused-variable": [ 5 | true 6 | ] 7 | }, 8 | "rulesDirectory": [ 9 | "node_modules/tslint-eslint-rules/dist/rules" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /src/core/CapacitorImageCache.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | s.name = 'CapacitorImageCache' 4 | s.version = '0.0.12' 5 | s.summary = 'Image cache' 6 | s.license = 'MIT' 7 | s.homepage = 'https://github.com/triniwiz/capacitor-image-cache' 8 | s.author = 'Osei Fortune' 9 | s.source = { :git => '', :tag => s.version.to_s } 10 | s.source_files = 'ios/Plugin/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}' 11 | s.ios.deployment_target = '11.0' 12 | s.dependency 'Capacitor' 13 | s.dependency 'SDWebImage', '~> 4.0' 14 | end 15 | -------------------------------------------------------------------------------- /src/core/android/.npmignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /src/core/android/capacitor-image-cache/.npmignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /src/core/android/capacitor-image-cache/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | google() 5 | } 6 | dependencies { 7 | classpath 'com.android.tools.build:gradle:3.1.1' 8 | } 9 | } 10 | 11 | apply plugin: 'com.android.library' 12 | 13 | android { 14 | compileSdkVersion 28 15 | defaultConfig { 16 | minSdkVersion 21 17 | targetSdkVersion 28 18 | versionCode 1 19 | versionName "1.0" 20 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 21 | } 22 | buildTypes { 23 | release { 24 | minifyEnabled false 25 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 26 | } 27 | } 28 | lintOptions { 29 | abortOnError false 30 | } 31 | } 32 | 33 | repositories { 34 | google() 35 | jcenter() 36 | mavenCentral() 37 | maven { 38 | url "https://dl.bintray.com/ionic-team/capacitor" 39 | } 40 | } 41 | 42 | 43 | dependencies { 44 | implementation fileTree(dir: 'libs', include: ['*.jar']) 45 | implementation project(':capacitor-android') 46 | implementation 'com.facebook.fresco:fresco:1.9.0' 47 | testImplementation 'junit:junit:4.12' 48 | androidTestImplementation 'com.android.support.test:runner:1.0.1' 49 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' 50 | } 51 | 52 | -------------------------------------------------------------------------------- /src/core/android/capacitor-image-cache/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /src/core/android/capacitor-image-cache/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.getcapacitor.android; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.getcapacitor.android", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/core/android/capacitor-image-cache/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /src/core/android/capacitor-image-cache/src/main/java/com/github/triniwiz/capacitorimagecache/ImageCachePlugin.java: -------------------------------------------------------------------------------- 1 | package com.github.triniwiz.capacitorimagecache; 2 | 3 | import android.graphics.Bitmap; 4 | import android.net.Uri; 5 | import android.os.Environment; 6 | import android.provider.MediaStore; 7 | import android.content.ContentValues; 8 | import android.Manifest; 9 | import android.util.Log; 10 | import android.content.pm.PackageManager; 11 | 12 | import com.facebook.binaryresource.BinaryResource; 13 | import com.facebook.binaryresource.FileBinaryResource; 14 | import com.facebook.cache.common.CacheKey; 15 | import com.facebook.common.executors.UiThreadImmediateExecutorService; 16 | import com.facebook.common.references.CloseableReference; 17 | import com.facebook.datasource.DataSource; 18 | import com.facebook.datasource.DataSubscriber; 19 | import com.facebook.drawee.backends.pipeline.Fresco; 20 | import com.facebook.imagepipeline.cache.DefaultCacheKeyFactory; 21 | import com.facebook.imagepipeline.core.ImagePipeline; 22 | import com.facebook.imagepipeline.core.ImagePipelineConfig; 23 | import com.facebook.imagepipeline.core.ImagePipelineFactory; 24 | import com.facebook.imagepipeline.image.CloseableBitmap; 25 | import com.facebook.imagepipeline.image.CloseableImage; 26 | import com.facebook.imagepipeline.request.ImageRequest; 27 | import com.facebook.imagepipeline.request.ImageRequestBuilder; 28 | import com.getcapacitor.FileUtils; 29 | import com.getcapacitor.JSObject; 30 | import com.getcapacitor.NativePlugin; 31 | import com.getcapacitor.Plugin; 32 | import com.getcapacitor.PluginCall; 33 | import com.getcapacitor.PluginMethod; 34 | 35 | import java.io.File; 36 | import java.io.FileOutputStream; 37 | import java.text.SimpleDateFormat; 38 | import java.util.Date; 39 | 40 | @NativePlugin( 41 | permissions={ 42 | Manifest.permission.ACCESS_NETWORK_STATE 43 | } 44 | ) 45 | public class ImageCachePlugin extends Plugin { 46 | private final int SAVE_IMAGE_REQUEST = 2102; 47 | 48 | @Override 49 | public void load() { 50 | super.load(); 51 | ImagePipelineConfig config = ImagePipelineConfig.newBuilder(getContext()) 52 | .setDownsampleEnabled(true) 53 | .build(); 54 | Fresco.initialize(getContext(), config); 55 | } 56 | 57 | private static boolean isImageDownloaded(Uri loadUri) { 58 | if (loadUri == null) { 59 | return false; 60 | } 61 | CacheKey cacheKey = DefaultCacheKeyFactory.getInstance().getEncodedCacheKey(ImageRequest.fromUri(loadUri), null); 62 | return ImagePipelineFactory.getInstance().getMainFileCache().hasKey(cacheKey) || ImagePipelineFactory.getInstance().getSmallImageFileCache().hasKey(cacheKey); 63 | } 64 | 65 | 66 | private static File getCachedImageOnDisk(Uri loadUri) { 67 | File localFile = null; 68 | if (loadUri != null) { 69 | CacheKey cacheKey = DefaultCacheKeyFactory.getInstance().getEncodedCacheKey(ImageRequest.fromUri(loadUri), null); 70 | if (ImagePipelineFactory.getInstance().getMainFileCache().hasKey(cacheKey)) { 71 | BinaryResource resource = ImagePipelineFactory.getInstance().getMainFileCache().getResource(cacheKey); 72 | localFile = ((FileBinaryResource) resource).getFile(); 73 | } else if (ImagePipelineFactory.getInstance().getSmallImageFileCache().hasKey(cacheKey)) { 74 | BinaryResource resource = ImagePipelineFactory.getInstance().getSmallImageFileCache().getResource(cacheKey); 75 | localFile = ((FileBinaryResource) resource).getFile(); 76 | } 77 | } 78 | return localFile; 79 | } 80 | 81 | 82 | @PluginMethod() 83 | public void get(final PluginCall call) { 84 | final String src = call.getString("src", ""); 85 | final JSObject obj = new JSObject(); 86 | if (src.contains("http:") || src.contains("https:")) { 87 | 88 | final Uri url = Uri.parse(src); 89 | if (isImageDownloaded(url)) { 90 | obj.put("value", FileUtils.getPortablePath(getContext(), bridge.getLocalUrl(), Uri.fromFile(getCachedImageOnDisk(url)))); 91 | call.resolve(obj); 92 | } else { 93 | 94 | ImageRequest request = ImageRequestBuilder.fromRequest(ImageRequest.fromUri(src)) 95 | .setLowestPermittedRequestLevel(ImageRequest.RequestLevel.FULL_FETCH) 96 | .build(); 97 | 98 | ImagePipeline imagePipeline = Fresco.getImagePipeline(); 99 | DataSource> dataSource = imagePipeline.fetchDecodedImage(request, null); 100 | dataSource.subscribe(new DataSubscriber>() { 101 | @Override 102 | public void onNewResult(DataSource> dataSource) { 103 | if (!dataSource.isFinished()) { 104 | return; 105 | } 106 | if (dataSource.isFinished()) { 107 | if (isImageDownloaded(url)) { 108 | obj.put("value", FileUtils.getPortablePath(getContext(), bridge.getLocalUrl(), Uri.fromFile(getCachedImageOnDisk(url)))); 109 | call.resolve(obj); 110 | } 111 | dataSource.close(); 112 | } 113 | } 114 | 115 | @Override 116 | public void onFailure(DataSource> dataSource) { 117 | Throwable ex = dataSource.getFailureCause(); 118 | call.reject(ex.getLocalizedMessage()); 119 | dataSource.close(); 120 | } 121 | 122 | @Override 123 | public void onCancellation(DataSource> dataSource) { 124 | if (!isImageDownloaded(url)) { 125 | call.reject("cancelled"); 126 | } 127 | dataSource.close(); 128 | } 129 | 130 | @Override 131 | public void onProgressUpdate(DataSource> dataSource) { 132 | 133 | } 134 | }, UiThreadImmediateExecutorService.getInstance()); 135 | 136 | } 137 | 138 | } else { 139 | JSObject _obj = new JSObject(); 140 | _obj.put("value", src); 141 | call.resolve(_obj); 142 | } 143 | } 144 | 145 | @PluginMethod() 146 | public void hasItem(PluginCall call) { 147 | String src = call.getString("src", ""); 148 | Uri url = Uri.parse(src); 149 | ImagePipeline imagePipeline = Fresco.getImagePipeline(); 150 | boolean has = imagePipeline.isInDiskCacheSync(url); 151 | JSObject obj = new JSObject(); 152 | obj.put("value", has); 153 | call.resolve(obj); 154 | } 155 | 156 | @PluginMethod() 157 | public void clearItem(PluginCall call) { 158 | String src = call.getString("src", ""); 159 | Uri url = Uri.parse(src); 160 | JSObject obj = new JSObject(); 161 | try{ 162 | ImagePipeline imagePipeline = Fresco.getImagePipeline(); 163 | imagePipeline.evictFromCache(url); 164 | obj.put("value",true); 165 | call.resolve(); 166 | }catch (Exception e){ 167 | obj.put("value",false); 168 | call.resolve(obj); 169 | } 170 | } 171 | 172 | 173 | @PluginMethod() 174 | public void clear(PluginCall call) { 175 | JSObject obj = new JSObject(); 176 | try{ 177 | ImagePipeline imagePipeline = Fresco.getImagePipeline(); 178 | imagePipeline.clearCaches(); 179 | obj.put("value",true); 180 | call.resolve(); 181 | }catch (Exception e){ 182 | obj.put("value",false); 183 | call.resolve(obj); 184 | } 185 | } 186 | 187 | 188 | @PluginMethod() 189 | public void saveImage(final PluginCall call) { 190 | if (hasPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)) { 191 | Log.d("DEBUG LOG", "HAS PERMISSIONS"); 192 | _saveImage(call); 193 | } else { 194 | Log.d("DEBUG LOG", "NOT ALLOWED"); 195 | saveCall(call); 196 | pluginRequestPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE, SAVE_IMAGE_REQUEST); 197 | } 198 | } 199 | 200 | private void _saveImage(final PluginCall call) { 201 | final String src = call.getString("src", ""); 202 | 203 | if (src.contains("http:") || src.contains("https:")) { 204 | final Uri url = Uri.parse(src); 205 | 206 | if (isImageDownloaded(url)) { 207 | final File imageFile = getCachedImageOnDisk(url); 208 | 209 | ImageRequest request = ImageRequestBuilder.fromRequest(ImageRequest.fromFile(imageFile)) 210 | .setLowestPermittedRequestLevel(ImageRequest.RequestLevel.FULL_FETCH) 211 | .build(); 212 | 213 | ImagePipeline imagePipeline = Fresco.getImagePipeline(); 214 | DataSource> dataSource = 215 | imagePipeline.fetchDecodedImage(request, null); 216 | 217 | dataSource.subscribe(new DataSubscriber>() { 218 | @Override 219 | public void onNewResult(DataSource> dataSource) { 220 | if (!dataSource.isFinished()) { 221 | return; 222 | } else { 223 | try { 224 | CloseableReference imageReference = dataSource.getResult(); 225 | if (imageReference != null) { 226 | try { 227 | CloseableImage image = imageReference.get(); 228 | if (image instanceof CloseableBitmap) { 229 | // do something with the bitmap 230 | Bitmap bitmap = ((CloseableBitmap) image).getUnderlyingBitmap(); 231 | 232 | try { 233 | String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmssSSS").format(new Date()); 234 | File photosDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES); 235 | File newFile = new File(photosDir, "IMG_" + timeStamp + ".jpg"); 236 | 237 | // Copy the bitmap to a new file 238 | FileOutputStream out = new FileOutputStream(newFile); 239 | bitmap.compress(Bitmap.CompressFormat.JPEG, 90, out); 240 | out.flush(); 241 | out.close(); 242 | 243 | // Copy the new file to the gallery 244 | ContentValues values = new ContentValues(); 245 | values.put(MediaStore.Images.Media.DATE_TAKEN, System.currentTimeMillis()); 246 | values.put(MediaStore.Images.Media.MIME_TYPE, "image/jpeg"); 247 | values.put(MediaStore.MediaColumns.DATA, newFile.getPath()); 248 | 249 | getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); 250 | 251 | call.resolve(); 252 | } catch (Exception e) { 253 | call.reject(e.getLocalizedMessage()); 254 | } 255 | } else { 256 | call.reject("Unkown image format"); 257 | } 258 | } finally { 259 | CloseableReference.closeSafely(imageReference); 260 | } 261 | } else { 262 | // cache miss 263 | call.reject("Cache miss"); 264 | } 265 | } finally { 266 | dataSource.close(); 267 | } 268 | } 269 | } 270 | 271 | @Override 272 | public void onFailure(DataSource> dataSource) { 273 | Throwable ex = dataSource.getFailureCause(); 274 | call.reject(ex.getLocalizedMessage()); 275 | dataSource.close(); 276 | } 277 | 278 | @Override 279 | public void onCancellation(DataSource> dataSource) { 280 | call.reject("cancelled"); 281 | dataSource.close(); 282 | } 283 | 284 | @Override 285 | public void onProgressUpdate(DataSource> dataSource) { 286 | 287 | } 288 | }, UiThreadImmediateExecutorService.getInstance()); 289 | } else { 290 | call.reject("Image must exist in cache before saving to gallery"); 291 | } 292 | } else { 293 | call.reject("src must use an http or https scheme"); 294 | } 295 | } 296 | 297 | @Override 298 | protected void handleRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { 299 | super.handleRequestPermissionsResult(requestCode, permissions, grantResults); 300 | 301 | PluginCall savedCall = getSavedCall(); 302 | if (savedCall == null) { 303 | return; 304 | } 305 | 306 | for(int result : grantResults) { 307 | if (result == PackageManager.PERMISSION_DENIED) { 308 | savedCall.error("User denied permission"); 309 | return; 310 | } 311 | } 312 | 313 | if (requestCode == SAVE_IMAGE_REQUEST) { 314 | // We got the permission 315 | _saveImage(savedCall); 316 | } 317 | } 318 | 319 | } 320 | -------------------------------------------------------------------------------- /src/core/android/capacitor-image-cache/src/main/res/layout/bridge_layout_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/core/android/capacitor-image-cache/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/core/android/capacitor-image-cache/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Just a simple string 3 | 4 | -------------------------------------------------------------------------------- /src/core/android/capacitor-image-cache/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/core/android/capacitor-image-cache/src/test/java/com/getcapacitor/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.getcapacitor; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /src/core/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /src/core/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/src/core/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/core/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Dec 01 12:41:00 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /src/core/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /src/core/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /src/core/android/scripts/release.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/src/core/android/scripts/release.sh -------------------------------------------------------------------------------- /src/core/ios/Plugin/Plugin.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 03FC29A292ACC40490383A1F /* Pods_Plugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B2A61DA5A1F2DD4F959604D /* Pods_Plugin.framework */; }; 11 | 20C0B05DCFC8E3958A738AF2 /* Pods_PluginTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6753A823D3815DB436415E3 /* Pods_PluginTests.framework */; }; 12 | 50ADFF92201F53D600D50D53 /* Plugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50ADFF88201F53D600D50D53 /* Plugin.framework */; }; 13 | 50ADFF97201F53D600D50D53 /* PluginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50ADFF96201F53D600D50D53 /* PluginTests.swift */; }; 14 | 50ADFF99201F53D600D50D53 /* Plugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 50ADFF8B201F53D600D50D53 /* Plugin.h */; settings = {ATTRIBUTES = (Public, ); }; }; 15 | 50ADFFA42020D75100D50D53 /* Capacitor.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50ADFFA52020D75100D50D53 /* Capacitor.framework */; }; 16 | 50ADFFA82020EE4F00D50D53 /* Plugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 50ADFFA72020EE4F00D50D53 /* Plugin.m */; }; 17 | 50E1A94820377CB70090CE1A /* Plugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50E1A94720377CB70090CE1A /* Plugin.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 50ADFF93201F53D600D50D53 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 50ADFF7F201F53D600D50D53 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 50ADFF87201F53D600D50D53; 26 | remoteInfo = Plugin; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 3B2A61DA5A1F2DD4F959604D /* Pods_Plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 32 | 50ADFF88201F53D600D50D53 /* Plugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Plugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 50ADFF8B201F53D600D50D53 /* Plugin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Plugin.h; sourceTree = ""; }; 34 | 50ADFF8C201F53D600D50D53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | 50ADFF91201F53D600D50D53 /* PluginTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PluginTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 50ADFF96201F53D600D50D53 /* PluginTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PluginTests.swift; sourceTree = ""; }; 37 | 50ADFF98201F53D600D50D53 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 50ADFFA52020D75100D50D53 /* Capacitor.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Capacitor.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 50ADFFA72020EE4F00D50D53 /* Plugin.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Plugin.m; sourceTree = ""; }; 40 | 50E1A94720377CB70090CE1A /* Plugin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Plugin.swift; sourceTree = ""; }; 41 | 5E23F77F099397094342571A /* Pods-Plugin.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Plugin.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig"; sourceTree = ""; }; 42 | 91781294A431A2A7CC6EB714 /* Pods-Plugin.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Plugin.release.xcconfig"; path = "Pods/Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig"; sourceTree = ""; }; 43 | 96ED1B6440D6672E406C8D19 /* Pods-PluginTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PluginTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.debug.xcconfig"; sourceTree = ""; }; 44 | F65BB2953ECE002E1EF3E424 /* Pods-PluginTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PluginTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.release.xcconfig"; sourceTree = ""; }; 45 | F6753A823D3815DB436415E3 /* Pods_PluginTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PluginTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | /* End PBXFileReference section */ 47 | 48 | /* Begin PBXFrameworksBuildPhase section */ 49 | 50ADFF84201F53D600D50D53 /* Frameworks */ = { 50 | isa = PBXFrameworksBuildPhase; 51 | buildActionMask = 2147483647; 52 | files = ( 53 | 50ADFFA42020D75100D50D53 /* Capacitor.framework in Frameworks */, 54 | 03FC29A292ACC40490383A1F /* Pods_Plugin.framework in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | 50ADFF8E201F53D600D50D53 /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | 50ADFF92201F53D600D50D53 /* Plugin.framework in Frameworks */, 63 | 20C0B05DCFC8E3958A738AF2 /* Pods_PluginTests.framework in Frameworks */, 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | /* End PBXFrameworksBuildPhase section */ 68 | 69 | /* Begin PBXGroup section */ 70 | 50ADFF7E201F53D600D50D53 = { 71 | isa = PBXGroup; 72 | children = ( 73 | 50ADFF8A201F53D600D50D53 /* Plugin */, 74 | 50ADFF95201F53D600D50D53 /* PluginTests */, 75 | 50ADFF89201F53D600D50D53 /* Products */, 76 | 8C8E7744173064A9F6D438E3 /* Pods */, 77 | A797B9EFA3DCEFEA1FBB66A9 /* Frameworks */, 78 | ); 79 | sourceTree = ""; 80 | }; 81 | 50ADFF89201F53D600D50D53 /* Products */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 50ADFF88201F53D600D50D53 /* Plugin.framework */, 85 | 50ADFF91201F53D600D50D53 /* PluginTests.xctest */, 86 | ); 87 | name = Products; 88 | sourceTree = ""; 89 | }; 90 | 50ADFF8A201F53D600D50D53 /* Plugin */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 50E1A94720377CB70090CE1A /* Plugin.swift */, 94 | 50ADFF8B201F53D600D50D53 /* Plugin.h */, 95 | 50ADFFA72020EE4F00D50D53 /* Plugin.m */, 96 | 50ADFF8C201F53D600D50D53 /* Info.plist */, 97 | ); 98 | path = Plugin; 99 | sourceTree = ""; 100 | }; 101 | 50ADFF95201F53D600D50D53 /* PluginTests */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 50ADFF96201F53D600D50D53 /* PluginTests.swift */, 105 | 50ADFF98201F53D600D50D53 /* Info.plist */, 106 | ); 107 | path = PluginTests; 108 | sourceTree = ""; 109 | }; 110 | 8C8E7744173064A9F6D438E3 /* Pods */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 5E23F77F099397094342571A /* Pods-Plugin.debug.xcconfig */, 114 | 91781294A431A2A7CC6EB714 /* Pods-Plugin.release.xcconfig */, 115 | 96ED1B6440D6672E406C8D19 /* Pods-PluginTests.debug.xcconfig */, 116 | F65BB2953ECE002E1EF3E424 /* Pods-PluginTests.release.xcconfig */, 117 | ); 118 | name = Pods; 119 | sourceTree = ""; 120 | }; 121 | A797B9EFA3DCEFEA1FBB66A9 /* Frameworks */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 50ADFFA52020D75100D50D53 /* Capacitor.framework */, 125 | 3B2A61DA5A1F2DD4F959604D /* Pods_Plugin.framework */, 126 | F6753A823D3815DB436415E3 /* Pods_PluginTests.framework */, 127 | ); 128 | name = Frameworks; 129 | sourceTree = ""; 130 | }; 131 | /* End PBXGroup section */ 132 | 133 | /* Begin PBXHeadersBuildPhase section */ 134 | 50ADFF85201F53D600D50D53 /* Headers */ = { 135 | isa = PBXHeadersBuildPhase; 136 | buildActionMask = 2147483647; 137 | files = ( 138 | 50ADFF99201F53D600D50D53 /* Plugin.h in Headers */, 139 | ); 140 | runOnlyForDeploymentPostprocessing = 0; 141 | }; 142 | /* End PBXHeadersBuildPhase section */ 143 | 144 | /* Begin PBXNativeTarget section */ 145 | 50ADFF87201F53D600D50D53 /* Plugin */ = { 146 | isa = PBXNativeTarget; 147 | buildConfigurationList = 50ADFF9C201F53D600D50D53 /* Build configuration list for PBXNativeTarget "Plugin" */; 148 | buildPhases = ( 149 | AB5B3E54B4E897F32C2279DA /* [CP] Check Pods Manifest.lock */, 150 | 50ADFF83201F53D600D50D53 /* Sources */, 151 | 50ADFF84201F53D600D50D53 /* Frameworks */, 152 | 50ADFF85201F53D600D50D53 /* Headers */, 153 | 50ADFF86201F53D600D50D53 /* Resources */, 154 | ); 155 | buildRules = ( 156 | ); 157 | dependencies = ( 158 | ); 159 | name = Plugin; 160 | productName = Plugin; 161 | productReference = 50ADFF88201F53D600D50D53 /* Plugin.framework */; 162 | productType = "com.apple.product-type.framework"; 163 | }; 164 | 50ADFF90201F53D600D50D53 /* PluginTests */ = { 165 | isa = PBXNativeTarget; 166 | buildConfigurationList = 50ADFF9F201F53D600D50D53 /* Build configuration list for PBXNativeTarget "PluginTests" */; 167 | buildPhases = ( 168 | 0596884F929ED6F1DE134961 /* [CP] Check Pods Manifest.lock */, 169 | 50ADFF8D201F53D600D50D53 /* Sources */, 170 | 50ADFF8E201F53D600D50D53 /* Frameworks */, 171 | 50ADFF8F201F53D600D50D53 /* Resources */, 172 | CCA81D3B7E26D0D727D24C84 /* [CP] Embed Pods Frameworks */, 173 | ); 174 | buildRules = ( 175 | ); 176 | dependencies = ( 177 | 50ADFF94201F53D600D50D53 /* PBXTargetDependency */, 178 | ); 179 | name = PluginTests; 180 | productName = PluginTests; 181 | productReference = 50ADFF91201F53D600D50D53 /* PluginTests.xctest */; 182 | productType = "com.apple.product-type.bundle.unit-test"; 183 | }; 184 | /* End PBXNativeTarget section */ 185 | 186 | /* Begin PBXProject section */ 187 | 50ADFF7F201F53D600D50D53 /* Project object */ = { 188 | isa = PBXProject; 189 | attributes = { 190 | LastSwiftUpdateCheck = 0920; 191 | LastUpgradeCheck = 0920; 192 | ORGANIZATIONNAME = "Max Lynch"; 193 | TargetAttributes = { 194 | 50ADFF87201F53D600D50D53 = { 195 | CreatedOnToolsVersion = 9.2; 196 | LastSwiftMigration = 0920; 197 | ProvisioningStyle = Automatic; 198 | }; 199 | 50ADFF90201F53D600D50D53 = { 200 | CreatedOnToolsVersion = 9.2; 201 | ProvisioningStyle = Automatic; 202 | }; 203 | }; 204 | }; 205 | buildConfigurationList = 50ADFF82201F53D600D50D53 /* Build configuration list for PBXProject "Plugin" */; 206 | compatibilityVersion = "Xcode 8.0"; 207 | developmentRegion = en; 208 | hasScannedForEncodings = 0; 209 | knownRegions = ( 210 | en, 211 | ); 212 | mainGroup = 50ADFF7E201F53D600D50D53; 213 | productRefGroup = 50ADFF89201F53D600D50D53 /* Products */; 214 | projectDirPath = ""; 215 | projectRoot = ""; 216 | targets = ( 217 | 50ADFF87201F53D600D50D53 /* Plugin */, 218 | 50ADFF90201F53D600D50D53 /* PluginTests */, 219 | ); 220 | }; 221 | /* End PBXProject section */ 222 | 223 | /* Begin PBXResourcesBuildPhase section */ 224 | 50ADFF86201F53D600D50D53 /* Resources */ = { 225 | isa = PBXResourcesBuildPhase; 226 | buildActionMask = 2147483647; 227 | files = ( 228 | ); 229 | runOnlyForDeploymentPostprocessing = 0; 230 | }; 231 | 50ADFF8F201F53D600D50D53 /* Resources */ = { 232 | isa = PBXResourcesBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXResourcesBuildPhase section */ 239 | 240 | /* Begin PBXShellScriptBuildPhase section */ 241 | 0596884F929ED6F1DE134961 /* [CP] Check Pods Manifest.lock */ = { 242 | isa = PBXShellScriptBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | ); 246 | inputPaths = ( 247 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 248 | "${PODS_ROOT}/Manifest.lock", 249 | ); 250 | name = "[CP] Check Pods Manifest.lock"; 251 | outputPaths = ( 252 | "$(DERIVED_FILE_DIR)/Pods-PluginTests-checkManifestLockResult.txt", 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | shellPath = /bin/sh; 256 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 257 | showEnvVarsInLog = 0; 258 | }; 259 | AB5B3E54B4E897F32C2279DA /* [CP] Check Pods Manifest.lock */ = { 260 | isa = PBXShellScriptBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | ); 264 | inputPaths = ( 265 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 266 | "${PODS_ROOT}/Manifest.lock", 267 | ); 268 | name = "[CP] Check Pods Manifest.lock"; 269 | outputPaths = ( 270 | "$(DERIVED_FILE_DIR)/Pods-Plugin-checkManifestLockResult.txt", 271 | ); 272 | runOnlyForDeploymentPostprocessing = 0; 273 | shellPath = /bin/sh; 274 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 275 | showEnvVarsInLog = 0; 276 | }; 277 | CCA81D3B7E26D0D727D24C84 /* [CP] Embed Pods Frameworks */ = { 278 | isa = PBXShellScriptBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | ); 282 | inputPaths = ( 283 | "${PODS_ROOT}/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh", 284 | "${BUILT_PRODUCTS_DIR}/Capacitor/Capacitor.framework", 285 | "${BUILT_PRODUCTS_DIR}/CapacitorCordova/Cordova.framework", 286 | "${BUILT_PRODUCTS_DIR}/GCDWebServer/GCDWebServer.framework", 287 | "${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework", 288 | ); 289 | name = "[CP] Embed Pods Frameworks"; 290 | outputPaths = ( 291 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Capacitor.framework", 292 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Cordova.framework", 293 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GCDWebServer.framework", 294 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | shellPath = /bin/sh; 298 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh\"\n"; 299 | showEnvVarsInLog = 0; 300 | }; 301 | /* End PBXShellScriptBuildPhase section */ 302 | 303 | /* Begin PBXSourcesBuildPhase section */ 304 | 50ADFF83201F53D600D50D53 /* Sources */ = { 305 | isa = PBXSourcesBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | 50E1A94820377CB70090CE1A /* Plugin.swift in Sources */, 309 | 50ADFFA82020EE4F00D50D53 /* Plugin.m in Sources */, 310 | ); 311 | runOnlyForDeploymentPostprocessing = 0; 312 | }; 313 | 50ADFF8D201F53D600D50D53 /* Sources */ = { 314 | isa = PBXSourcesBuildPhase; 315 | buildActionMask = 2147483647; 316 | files = ( 317 | 50ADFF97201F53D600D50D53 /* PluginTests.swift in Sources */, 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | }; 321 | /* End PBXSourcesBuildPhase section */ 322 | 323 | /* Begin PBXTargetDependency section */ 324 | 50ADFF94201F53D600D50D53 /* PBXTargetDependency */ = { 325 | isa = PBXTargetDependency; 326 | target = 50ADFF87201F53D600D50D53 /* Plugin */; 327 | targetProxy = 50ADFF93201F53D600D50D53 /* PBXContainerItemProxy */; 328 | }; 329 | /* End PBXTargetDependency section */ 330 | 331 | /* Begin XCBuildConfiguration section */ 332 | 50ADFF9A201F53D600D50D53 /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | buildSettings = { 335 | ALWAYS_SEARCH_USER_PATHS = NO; 336 | CLANG_ANALYZER_NONNULL = YES; 337 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_COMMA = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 348 | CLANG_WARN_EMPTY_BODY = YES; 349 | CLANG_WARN_ENUM_CONVERSION = YES; 350 | CLANG_WARN_INFINITE_RECURSION = YES; 351 | CLANG_WARN_INT_CONVERSION = YES; 352 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 355 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 356 | CLANG_WARN_STRICT_PROTOTYPES = YES; 357 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 358 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 359 | CLANG_WARN_UNREACHABLE_CODE = YES; 360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 361 | CODE_SIGN_IDENTITY = "iPhone Developer"; 362 | COPY_PHASE_STRIP = NO; 363 | CURRENT_PROJECT_VERSION = 1; 364 | DEBUG_INFORMATION_FORMAT = dwarf; 365 | ENABLE_STRICT_OBJC_MSGSEND = YES; 366 | ENABLE_TESTABILITY = YES; 367 | GCC_C_LANGUAGE_STANDARD = gnu11; 368 | GCC_DYNAMIC_NO_PIC = NO; 369 | GCC_NO_COMMON_BLOCKS = YES; 370 | GCC_OPTIMIZATION_LEVEL = 0; 371 | GCC_PREPROCESSOR_DEFINITIONS = ( 372 | "DEBUG=1", 373 | "$(inherited)", 374 | ); 375 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 376 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 377 | GCC_WARN_UNDECLARED_SELECTOR = YES; 378 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 379 | GCC_WARN_UNUSED_FUNCTION = YES; 380 | GCC_WARN_UNUSED_VARIABLE = YES; 381 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 382 | MTL_ENABLE_DEBUG_INFO = YES; 383 | ONLY_ACTIVE_ARCH = YES; 384 | SDKROOT = iphoneos; 385 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 386 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 387 | VERSIONING_SYSTEM = "apple-generic"; 388 | VERSION_INFO_PREFIX = ""; 389 | }; 390 | name = Debug; 391 | }; 392 | 50ADFF9B201F53D600D50D53 /* Release */ = { 393 | isa = XCBuildConfiguration; 394 | buildSettings = { 395 | ALWAYS_SEARCH_USER_PATHS = NO; 396 | CLANG_ANALYZER_NONNULL = YES; 397 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 398 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 399 | CLANG_CXX_LIBRARY = "libc++"; 400 | CLANG_ENABLE_MODULES = YES; 401 | CLANG_ENABLE_OBJC_ARC = YES; 402 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 403 | CLANG_WARN_BOOL_CONVERSION = YES; 404 | CLANG_WARN_COMMA = YES; 405 | CLANG_WARN_CONSTANT_CONVERSION = YES; 406 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 407 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 408 | CLANG_WARN_EMPTY_BODY = YES; 409 | CLANG_WARN_ENUM_CONVERSION = YES; 410 | CLANG_WARN_INFINITE_RECURSION = YES; 411 | CLANG_WARN_INT_CONVERSION = YES; 412 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 413 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 414 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 415 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 416 | CLANG_WARN_STRICT_PROTOTYPES = YES; 417 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 418 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 419 | CLANG_WARN_UNREACHABLE_CODE = YES; 420 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 421 | CODE_SIGN_IDENTITY = "iPhone Developer"; 422 | COPY_PHASE_STRIP = NO; 423 | CURRENT_PROJECT_VERSION = 1; 424 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 425 | ENABLE_NS_ASSERTIONS = NO; 426 | ENABLE_STRICT_OBJC_MSGSEND = YES; 427 | GCC_C_LANGUAGE_STANDARD = gnu11; 428 | GCC_NO_COMMON_BLOCKS = YES; 429 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 430 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 431 | GCC_WARN_UNDECLARED_SELECTOR = YES; 432 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 433 | GCC_WARN_UNUSED_FUNCTION = YES; 434 | GCC_WARN_UNUSED_VARIABLE = YES; 435 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 436 | MTL_ENABLE_DEBUG_INFO = NO; 437 | SDKROOT = iphoneos; 438 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 439 | VALIDATE_PRODUCT = YES; 440 | VERSIONING_SYSTEM = "apple-generic"; 441 | VERSION_INFO_PREFIX = ""; 442 | }; 443 | name = Release; 444 | }; 445 | 50ADFF9D201F53D600D50D53 /* Debug */ = { 446 | isa = XCBuildConfiguration; 447 | baseConfigurationReference = 5E23F77F099397094342571A /* Pods-Plugin.debug.xcconfig */; 448 | buildSettings = { 449 | CLANG_ENABLE_MODULES = YES; 450 | CODE_SIGN_IDENTITY = ""; 451 | CODE_SIGN_STYLE = Automatic; 452 | DEFINES_MODULE = YES; 453 | DYLIB_COMPATIBILITY_VERSION = 1; 454 | DYLIB_CURRENT_VERSION = 1; 455 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 456 | INFOPLIST_FILE = Plugin/Info.plist; 457 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 458 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 459 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)\n$(FRAMEWORK_SEARCH_PATHS)\n$(FRAMEWORK_SEARCH_PATHS)"; 460 | ONLY_ACTIVE_ARCH = YES; 461 | PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.Plugin; 462 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 463 | SKIP_INSTALL = YES; 464 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 465 | SWIFT_VERSION = 4.0; 466 | TARGETED_DEVICE_FAMILY = "1,2"; 467 | }; 468 | name = Debug; 469 | }; 470 | 50ADFF9E201F53D600D50D53 /* Release */ = { 471 | isa = XCBuildConfiguration; 472 | baseConfigurationReference = 91781294A431A2A7CC6EB714 /* Pods-Plugin.release.xcconfig */; 473 | buildSettings = { 474 | CLANG_ENABLE_MODULES = YES; 475 | CODE_SIGN_IDENTITY = ""; 476 | CODE_SIGN_STYLE = Automatic; 477 | DEFINES_MODULE = YES; 478 | DYLIB_COMPATIBILITY_VERSION = 1; 479 | DYLIB_CURRENT_VERSION = 1; 480 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 481 | INFOPLIST_FILE = Plugin/Info.plist; 482 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 483 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 484 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks $(FRAMEWORK_SEARCH_PATHS)"; 485 | ONLY_ACTIVE_ARCH = NO; 486 | PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.Plugin; 487 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 488 | SKIP_INSTALL = YES; 489 | SWIFT_VERSION = 4.0; 490 | TARGETED_DEVICE_FAMILY = "1,2"; 491 | }; 492 | name = Release; 493 | }; 494 | 50ADFFA0201F53D600D50D53 /* Debug */ = { 495 | isa = XCBuildConfiguration; 496 | baseConfigurationReference = 96ED1B6440D6672E406C8D19 /* Pods-PluginTests.debug.xcconfig */; 497 | buildSettings = { 498 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 499 | CODE_SIGN_STYLE = Automatic; 500 | INFOPLIST_FILE = PluginTests/Info.plist; 501 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 502 | PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.PluginTests; 503 | PRODUCT_NAME = "$(TARGET_NAME)"; 504 | SWIFT_VERSION = 4.0; 505 | TARGETED_DEVICE_FAMILY = "1,2"; 506 | }; 507 | name = Debug; 508 | }; 509 | 50ADFFA1201F53D600D50D53 /* Release */ = { 510 | isa = XCBuildConfiguration; 511 | baseConfigurationReference = F65BB2953ECE002E1EF3E424 /* Pods-PluginTests.release.xcconfig */; 512 | buildSettings = { 513 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 514 | CODE_SIGN_STYLE = Automatic; 515 | INFOPLIST_FILE = PluginTests/Info.plist; 516 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 517 | PRODUCT_BUNDLE_IDENTIFIER = com.getcapacitor.PluginTests; 518 | PRODUCT_NAME = "$(TARGET_NAME)"; 519 | SWIFT_VERSION = 4.0; 520 | TARGETED_DEVICE_FAMILY = "1,2"; 521 | }; 522 | name = Release; 523 | }; 524 | /* End XCBuildConfiguration section */ 525 | 526 | /* Begin XCConfigurationList section */ 527 | 50ADFF82201F53D600D50D53 /* Build configuration list for PBXProject "Plugin" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | 50ADFF9A201F53D600D50D53 /* Debug */, 531 | 50ADFF9B201F53D600D50D53 /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | 50ADFF9C201F53D600D50D53 /* Build configuration list for PBXNativeTarget "Plugin" */ = { 537 | isa = XCConfigurationList; 538 | buildConfigurations = ( 539 | 50ADFF9D201F53D600D50D53 /* Debug */, 540 | 50ADFF9E201F53D600D50D53 /* Release */, 541 | ); 542 | defaultConfigurationIsVisible = 0; 543 | defaultConfigurationName = Release; 544 | }; 545 | 50ADFF9F201F53D600D50D53 /* Build configuration list for PBXNativeTarget "PluginTests" */ = { 546 | isa = XCConfigurationList; 547 | buildConfigurations = ( 548 | 50ADFFA0201F53D600D50D53 /* Debug */, 549 | 50ADFFA1201F53D600D50D53 /* Release */, 550 | ); 551 | defaultConfigurationIsVisible = 0; 552 | defaultConfigurationName = Release; 553 | }; 554 | /* End XCConfigurationList section */ 555 | }; 556 | rootObject = 50ADFF7F201F53D600D50D53 /* Project object */; 557 | } 558 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/Plugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/Plugin.xcodeproj/xcuserdata/max.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Plugin.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/Plugin.xcodeproj/xcuserdata/triniwiz.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Plugin.xcscheme 8 | 9 | orderHint 10 | 6 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/Plugin.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/Plugin.xcworkspace/xcuserdata/max.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/src/core/ios/Plugin/Plugin.xcworkspace/xcuserdata/max.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /src/core/ios/Plugin/Plugin.xcworkspace/xcuserdata/triniwiz.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/triniwiz/capacitor-image-cache/dd015f71c2b1d960c3eed1a3db68c464a7de9c83/src/core/ios/Plugin/Plugin.xcworkspace/xcuserdata/triniwiz.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /src/core/ios/Plugin/Plugin/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/Plugin/Plugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | //! Project version number for Plugin. 4 | FOUNDATION_EXPORT double PluginVersionNumber; 5 | 6 | //! Project version string for Plugin. 7 | FOUNDATION_EXPORT const unsigned char PluginVersionString[]; 8 | 9 | // In this header, you should import all the public headers of your framework using statements like #import 10 | 11 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/Plugin/Plugin.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | // Define the plugin using the CAP_PLUGIN Macro, and 5 | // each method the plugin supports using the CAP_PLUGIN_METHOD macro. 6 | CAP_PLUGIN(ImageCachePlugin, "ImageCachePlugin", 7 | CAP_PLUGIN_METHOD(get, CAPPluginReturnPromise); 8 | CAP_PLUGIN_METHOD(hasItem, CAPPluginReturnPromise); 9 | CAP_PLUGIN_METHOD(clearItem, CAPPluginReturnPromise); 10 | CAP_PLUGIN_METHOD(clear, CAPPluginReturnPromise); 11 | CAP_PLUGIN_METHOD(saveImage, CAPPluginReturnPromise); 12 | ) 13 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/Plugin/Plugin.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import Capacitor 3 | import SDWebImage 4 | import Photos 5 | let KEY = "_CAP_IMAGE_CACHE_" 6 | typealias JSObject = [String:Any] 7 | @objc(ImageCachePlugin) 8 | public class ImageCachePlugin: CAPPlugin { 9 | private var cache: NSDictionary? 10 | private var manager: SDWebImageManager? 11 | public override func load() { 12 | manager = SDWebImageManager.shared() 13 | manager?.imageDownloader?.shouldDecompressImages = false 14 | } 15 | 16 | @objc func get(_ call: CAPPluginCall) { 17 | let src = call.getString("src") ?? "" 18 | if(src.contains("http:") || src.contains("https:")){ 19 | let url = URL.init(string: src ) 20 | 21 | self.manager?.loadImage(with: url, options: SDWebImageOptions.scaleDownLargeImages, progress: { (receivedSize, expectedSize, path) in 22 | 23 | 24 | }, completed: { (image, data, error, type, finished, completedUrl) in 25 | 26 | if(image == nil && error != nil && data == nil){ 27 | call.reject(error!.localizedDescription) 28 | }else if(finished && completedUrl != nil ){ 29 | if(type == SDImageCacheType.disk){ 30 | DispatchQueue.main.async { 31 | let key = self.manager?.cacheKey(for: completedUrl) 32 | let source = self.manager?.imageCache?.defaultCachePath(forKey: key) 33 | var obj = JSObject() 34 | obj["value"] = CAPFileManager.getPortablePath(host: self.bridge!.getLocalUrl(), uri: URL.init(string: source!)); 35 | call.resolve(obj) 36 | } 37 | }else{ 38 | SDImageCache.shared().store(image, forKey: completedUrl?.absoluteString, completion: { 39 | DispatchQueue.main.async { 40 | let key = self.manager?.cacheKey(for: completedUrl) 41 | let source = self.manager?.imageCache?.defaultCachePath(forKey: key) 42 | var obj = JSObject() 43 | obj["value"] = CAPFileManager.getPortablePath(host: self.bridge!.getLocalUrl(), uri: URL.init(string: source!)); 44 | call.resolve(obj) 45 | } 46 | }) 47 | } 48 | } 49 | 50 | }) 51 | }else{ 52 | var obj = JSObject() 53 | obj["value"] = src; 54 | call.resolve(obj) 55 | } 56 | 57 | } 58 | 59 | @objc func hasItem(_ call: CAPPluginCall) { 60 | let src = call.getString("src") ?? "" 61 | let url = URL.init(string: src) 62 | manager?.cachedImageExists(for: url , completion: { (exists) in 63 | DispatchQueue.main.async { 64 | var obj = JSObject() 65 | obj["value"] = exists 66 | call.resolve(obj) 67 | } 68 | }) 69 | } 70 | 71 | @objc func clearItem(_ call: CAPPluginCall) { 72 | let src = call.getString("src") ?? "" 73 | manager?.imageCache?.removeImage(forKey: src, fromDisk: true, withCompletion: { 74 | DispatchQueue.main.async { 75 | call.resolve() 76 | } 77 | }) 78 | 79 | } 80 | 81 | 82 | @objc func clear(_ call: CAPPluginCall) { 83 | manager?.imageCache?.clearMemory() 84 | } 85 | 86 | @objc func saveImage(_ call: CAPPluginCall) { 87 | let src = call.getString("src") ?? "" 88 | if(src.contains("http:") || src.contains("https:")) { 89 | let url = URL.init(string: src ) 90 | self.manager?.loadImage(with: url, options: SDWebImageOptions.fromCacheOnly, progress: { (receivedSize, expectedSize, path) in 91 | 92 | }, completed: { (image, data, error, type, finished, completedUrl) in 93 | if(image == nil && error != nil && data == nil){ 94 | call.reject(error!.localizedDescription) 95 | }else if(finished && completedUrl != nil ){ 96 | self.checkAuthorization(allowed: { 97 | // Add it to the photo library. 98 | PHPhotoLibrary.shared().performChanges({ 99 | PHAssetChangeRequest.creationRequestForAsset(from: image!) 100 | }, completionHandler: {success, error in 101 | if !success { 102 | call.reject("Unable to save image to camera poll", error) 103 | } else { 104 | call.resolve() 105 | } 106 | }) 107 | }, notAllowed: { 108 | call.reject("Access to photos not allowed by user") 109 | }) 110 | } 111 | }) 112 | } else { 113 | call.reject("src must use an http or https scheme") 114 | } 115 | } 116 | 117 | func checkAuthorization(allowed: @escaping () -> Void, notAllowed: @escaping () -> Void) { 118 | let status = PHPhotoLibrary.authorizationStatus() 119 | if status == PHAuthorizationStatus.authorized { 120 | allowed() 121 | } else { 122 | PHPhotoLibrary.requestAuthorization({ (newStatus) in 123 | if newStatus == PHAuthorizationStatus.authorized { 124 | allowed() 125 | } else { 126 | notAllowed() 127 | } 128 | }) 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/PluginTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/PluginTests/PluginTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import Capacitor 3 | @testable import Plugin 4 | 5 | class PluginTests: XCTestCase { 6 | 7 | override func setUp() { 8 | super.setUp() 9 | // Put setup code here. This method is called before the invocation of each test method in the class. 10 | } 11 | 12 | override func tearDown() { 13 | // Put teardown code here. This method is called after the invocation of each test method in the class. 14 | super.tearDown() 15 | } 16 | 17 | func testEcho() { 18 | // This is an example of a functional test case for a plugin. 19 | // Use XCTAssert and related functions to verify your tests produce the correct results. 20 | 21 | let value = "Hello, World!" 22 | let plugin = MyPlugin() 23 | 24 | let call = CAPPluginCall(callbackId: "test", options: [ 25 | "value": value 26 | ], success: { (result, call) in 27 | let resultValue = result!.data["value"] as? String 28 | XCTAssertEqual(value, resultValue) 29 | }, error: { (err) in 30 | XCTFail("Error shouldn't have been called") 31 | }) 32 | 33 | plugin.echo(call!) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '10.0' 3 | 4 | target 'Plugin' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for IonicRunner 9 | pod 'Capacitor' 10 | 11 | pod 'SDWebImage', '~> 4.0' 12 | end 13 | 14 | target 'PluginTests' do 15 | use_frameworks! 16 | 17 | pod 'Capacitor' 18 | 19 | pod 'SDWebImage', '~> 4.0' 20 | end 21 | -------------------------------------------------------------------------------- /src/core/ios/Plugin/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Capacitor (0.0.113): 3 | - CapacitorCordova (= 0.0.113) 4 | - GCDWebServer (~> 3.0) 5 | - CapacitorCordova (0.0.113) 6 | - GCDWebServer (3.4.2): 7 | - GCDWebServer/Core (= 3.4.2) 8 | - GCDWebServer/Core (3.4.2) 9 | - SDWebImage (4.4.0): 10 | - SDWebImage/Core (= 4.4.0) 11 | - SDWebImage/Core (4.4.0) 12 | 13 | DEPENDENCIES: 14 | - Capacitor 15 | - SDWebImage (~> 4.0) 16 | 17 | SPEC REPOS: 18 | https://github.com/CocoaPods/Specs.git: 19 | - Capacitor 20 | - CapacitorCordova 21 | - GCDWebServer 22 | - SDWebImage 23 | 24 | SPEC CHECKSUMS: 25 | Capacitor: b37060b0b2685257bedbc69e49a54a74ef30fb9a 26 | CapacitorCordova: a923a32bc7ad5f1f3d69664ca86ff69580343ed3 27 | GCDWebServer: 8d67ee9f634b4bb91eb4b8aee440318a5fc6debd 28 | SDWebImage: b534502786e43dde36dfcaee89356fe6df30e203 29 | 30 | PODFILE CHECKSUM: 90294a6e9a81f834598df837d887565e326ff8ff 31 | 32 | COCOAPODS: 1.8.4 33 | -------------------------------------------------------------------------------- /src/core/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "capacitor-image-cache", 3 | "version": "0.0.13", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@capacitor/core": { 8 | "version": "1.3.0", 9 | "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-1.3.0.tgz", 10 | "integrity": "sha512-cVllg+OaYAPCsWOOOuMDqIk0tqjTH1QEBNgTKhAwLJraYy0w5CziUW5gtcmKXTRqD3dzUlHjx1emCKXrg0DACg==", 11 | "requires": { 12 | "tslib": "^1.9.0" 13 | } 14 | }, 15 | "tslib": { 16 | "version": "1.10.0", 17 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", 18 | "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" 19 | }, 20 | "typescript": { 21 | "version": "2.9.2", 22 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz", 23 | "integrity": "sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==", 24 | "dev": true 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "capacitor-image-cache", 3 | "version": "0.0.13", 4 | "description": "", 5 | "main": "dist/esm/index.js", 6 | "types": "dist/esm/index.d.ts", 7 | "scripts": { 8 | "build": "npm run clean && tsc", 9 | "clean": "rm -rf ./dist", 10 | "watch": "tsc --watch", 11 | "prepublishOnly": "npm run build" 12 | }, 13 | "author": "Osei Fortune", 14 | "license": "MIT", 15 | "dependencies": { 16 | "@capacitor/core": "latest" 17 | }, 18 | "devDependencies": { 19 | "typescript": "^2.9.2" 20 | }, 21 | "files": [ 22 | "dist/", 23 | "ios/", 24 | "android/", 25 | "CapacitorImageCache.podspec" 26 | ], 27 | "keywords": [ 28 | "capacitor", 29 | "plugin", 30 | "native" 31 | ], 32 | "capacitor": { 33 | "ios": { 34 | "src": "ios" 35 | }, 36 | "android": { 37 | "src": "android" 38 | } 39 | }, 40 | "repository": { 41 | "type": "git", 42 | "url": "" 43 | }, 44 | "bugs": { 45 | "url": "/issues" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/core/rollup.config.js: -------------------------------------------------------------------------------- 1 | import nodeResolve from 'rollup-plugin-node-resolve'; 2 | 3 | export default { 4 | input: 'dist/esm/index.js', 5 | output: { 6 | file: 'dist/plugin.js', 7 | format: 'iife', 8 | name: 'capacitorPlugin', 9 | sourcemap: true 10 | }, 11 | plugins: [ 12 | nodeResolve() 13 | ] 14 | }; -------------------------------------------------------------------------------- /src/core/src/definitions.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface PluginRegistry { 3 | ImageCachePlugin?: IImageCache; 4 | } 5 | } 6 | 7 | export interface IImageCache { 8 | get(options: { src: string , overwrite?: boolean}): Promise<{value: string}>; 9 | hasItem(options: { src: string }):Promise<{value: boolean}>; 10 | clearItem(options: { src: string }):Promise<{value: boolean}>; 11 | clear():Promise<{value: boolean}>; 12 | saveImage(options: { src: string }):Promise; 13 | } 14 | -------------------------------------------------------------------------------- /src/core/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './definitions'; 2 | export * from './web-plugin'; 3 | export * from './plugin'; 4 | -------------------------------------------------------------------------------- /src/core/src/plugin.ts: -------------------------------------------------------------------------------- 1 | import { Plugins } from '@capacitor/core'; 2 | import { IImageCache } from './definitions'; 3 | 4 | const { ImageCachePlugin } = Plugins; 5 | 6 | export class ImageCache implements IImageCache { 7 | clear(): Promise<{ value: boolean }> { 8 | return ImageCachePlugin.clear(); 9 | } 10 | 11 | clearItem(options: { src: string }): Promise<{ value: boolean }> { 12 | return ImageCachePlugin.clearItem(options); 13 | } 14 | 15 | hasItem(options: { src: string }): Promise<{ value: boolean }> { 16 | return ImageCachePlugin.hasItem(options); 17 | } 18 | 19 | get(options: { src: string, overwrite?: boolean }): Promise<{ value: string }> { 20 | return ImageCachePlugin.get(options); 21 | } 22 | 23 | saveImage(options: { src: string }): Promise { 24 | return ImageCachePlugin.saveImage(options); 25 | } 26 | } -------------------------------------------------------------------------------- /src/core/src/web-plugin.ts: -------------------------------------------------------------------------------- 1 | import { registerWebPlugin } from '@capacitor/core'; 2 | 3 | export * from './web'; 4 | 5 | import { ImageCachePlugin } from './web'; 6 | registerWebPlugin(ImageCachePlugin) -------------------------------------------------------------------------------- /src/core/src/web.ts: -------------------------------------------------------------------------------- 1 | import { WebPlugin } from '@capacitor/core'; 2 | import { IImageCache } from './definitions'; 3 | 4 | export class ImageCachePluginWeb extends WebPlugin implements IImageCache { 5 | 6 | constructor() { 7 | super({ 8 | name: 'ImageCachePlugin', 9 | platforms: ['web'] 10 | }); 11 | } 12 | 13 | clear(): Promise<{ value: boolean }> { 14 | return new Promise(() => { }); 15 | } 16 | 17 | clearItem(options: { src: string }): Promise<{ value: boolean }> { 18 | return new Promise(() => { 19 | console.log(options); 20 | }); 21 | } 22 | 23 | hasItem(options: { src: string }): Promise<{ value: boolean }> { 24 | return new Promise(() => { 25 | console.log(options); 26 | }); 27 | } 28 | 29 | get(options: { src: string, overwrite?: boolean }): Promise<{ value: string }> { 30 | return new Promise((resolve) => { 31 | // return default src for now 32 | resolve({ value: options.src }); 33 | }); 34 | } 35 | 36 | saveImage(options: { src: string }): Promise { 37 | return new Promise((resolve) => { 38 | console.log(options); 39 | resolve(); 40 | }); 41 | } 42 | } 43 | 44 | const ImageCachePlugin = new ImageCachePluginWeb(); 45 | 46 | export { ImageCachePlugin }; 47 | 48 | -------------------------------------------------------------------------------- /src/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "declaration": true, 5 | "experimentalDecorators": true, 6 | "lib": [ 7 | "dom", 8 | "es2015" 9 | ], 10 | "module": "es2015", 11 | "moduleResolution": "node", 12 | "noImplicitAny": true, 13 | "noUnusedLocals": true, 14 | "noUnusedParameters": true, 15 | "outDir": "dist/esm", 16 | "sourceMap": true, 17 | "target": "es2015" 18 | }, 19 | "files": [ 20 | "src/index.ts" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /src/view/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | indent_style = space 8 | indent_size = 2 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | 13 | [*.md] 14 | insert_final_newline = false 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /src/view/.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | www/ 3 | 4 | *~ 5 | *.sw[mnpcod] 6 | *.log 7 | *.lock 8 | *.tmp 9 | *.tmp.* 10 | log.txt 11 | *.sublime-project 12 | *.sublime-workspace 13 | 14 | .idea/ 15 | .vscode/ 16 | .sass-cache/ 17 | .versions/ 18 | node_modules/ 19 | $RECYCLE.BIN/ 20 | 21 | .DS_Store 22 | Thumbs.db 23 | UserInterfaceState.xcuserstate 24 | .env 25 | -------------------------------------------------------------------------------- /src/view/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Ionic 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 | -------------------------------------------------------------------------------- /src/view/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "st-cached-image", 3 | "version": "0.0.6", 4 | "description": "Image Cache View", 5 | "module": "dist/esm/index.js", 6 | "main": "dist/index.js", 7 | "types": "dist/types/components.d.ts", 8 | "collection": "dist/collection/collection-manifest.json", 9 | "files": [ 10 | "dist/" 11 | ], 12 | "scripts": { 13 | "build": "stencil build", 14 | "dev": "sd concurrent \"stencil build --dev --watch\" \"stencil-dev-server\" ", 15 | "serve": "stencil-dev-server", 16 | "start": "npm run dev", 17 | "test": "jest", 18 | "test.watch": "jest --watch", 19 | "prepublishOnly": "npm run build --prod" 20 | }, 21 | "peerDependencies": { 22 | "capacitor-image-cache": "latest" 23 | }, 24 | "devDependencies": { 25 | "@stencil/core": "^0.9.1", 26 | "@stencil/dev-server": "latest", 27 | "@stencil/sass": "0.0.5", 28 | "@stencil/utils": "latest", 29 | "@types/jest": "^21.1.1", 30 | "jest": "^21.2.1" 31 | }, 32 | "repository": { 33 | "type": "git", 34 | "url": "git+https://github.com/ionic-team/stencil-component-starter.git" 35 | }, 36 | "author": "Ionic Team", 37 | "license": "MIT", 38 | "bugs": { 39 | "url": "https://github.com/ionic-team/stencil" 40 | }, 41 | "homepage": "https://github.com/ionic-team/stencil", 42 | "jest": { 43 | "transform": { 44 | "^.+\\.(ts|tsx)$": "/node_modules/@stencil/core/testing/jest.preprocessor.js" 45 | }, 46 | "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$", 47 | "moduleFileExtensions": [ 48 | "ts", 49 | "tsx", 50 | "js", 51 | "json", 52 | "jsx" 53 | ] 54 | }, 55 | "dependencies": { 56 | "capacitor-image-cache": "0.0.8" 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/view/readme.md: -------------------------------------------------------------------------------- 1 | [![npm](https://img.shields.io/npm/v/st-cached-image.svg)](https://www.npmjs.com/package/st-cached-image) 2 | [![npm](https://img.shields.io/npm/dt/st-cached-image.svg?label=npm%20downloads)](https://www.npmjs.com/package/st-cached-image) 3 | [![Build Status](https://travis-ci.org/triniwiz/st-cached-image.svg?branch=master)](https://travis-ci.org/triniwiz/st-cached-image) 4 | 5 | # Cached Image 6 | 7 | ## Install 8 | **[Capacitor Image Cache](https://www.npmjs.com/package/capacitor-image-cache)** is require for this package 9 | * `npm i capacitor-image-cache st-cached-image` 10 | 11 | ## Usage 12 | 13 | 14 | 15 | ```html 16 | 17 | ``` 18 | 19 | **If using with ionic** 20 | 21 | ``` 22 | import 'st-cached-image/dist/cached-image'; 23 | ``` 24 | 25 | Update the following file since ionic ignores the file 26 | 27 | `youAppDir/node_modules/@ionic/app-scripts/config/copy.config.js` 28 | 29 | 30 | ```js 31 | copyStCachedImage: { 32 | src: ['{{ROOT}}/node_modules/st-cached-image/dist/cached-image**/*'], 33 | dest: '{{BUILD}}' 34 | } 35 | ``` -------------------------------------------------------------------------------- /src/view/src/components.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This is an autogenerated file created by the Stencil compiler. 3 | * It contains typing information for all components that exist in this project. 4 | */ 5 | 6 | import '@stencil/core'; 7 | 8 | declare global { 9 | namespace JSX { 10 | interface Element {} 11 | export interface IntrinsicElements {} 12 | } 13 | namespace JSXElements {} 14 | 15 | interface HTMLElement { 16 | componentOnReady?: () => Promise; 17 | } 18 | 19 | interface HTMLStencilElement extends HTMLElement { 20 | componentOnReady(): Promise; 21 | 22 | forceUpdate(): void; 23 | } 24 | 25 | interface HTMLAttributes {} 26 | } 27 | 28 | 29 | declare global { 30 | 31 | namespace StencilComponents { 32 | interface StCachedImage { 33 | 'errorHolder': string; 34 | 'placeHolder': string; 35 | 'src': string; 36 | } 37 | } 38 | 39 | interface HTMLStCachedImageElement extends StencilComponents.StCachedImage, HTMLStencilElement {} 40 | 41 | var HTMLStCachedImageElement: { 42 | prototype: HTMLStCachedImageElement; 43 | new (): HTMLStCachedImageElement; 44 | }; 45 | interface HTMLElementTagNameMap { 46 | 'st-cached-image': HTMLStCachedImageElement; 47 | } 48 | interface ElementTagNameMap { 49 | 'st-cached-image': HTMLStCachedImageElement; 50 | } 51 | namespace JSX { 52 | interface IntrinsicElements { 53 | 'st-cached-image': JSXElements.StCachedImageAttributes; 54 | } 55 | } 56 | namespace JSXElements { 57 | export interface StCachedImageAttributes extends HTMLAttributes { 58 | 'errorHolder'?: string; 59 | 'placeHolder'?: string; 60 | 'src'?: string; 61 | } 62 | } 63 | } 64 | 65 | declare global { namespace JSX { interface StencilJSX {} } } 66 | 67 | export declare function defineCustomElements(window: any): void; -------------------------------------------------------------------------------- /src/view/src/components/stencil-cached-image/cached-image.css: -------------------------------------------------------------------------------- 1 | 2 | img { 3 | object-fit: cover; 4 | width:100%; 5 | height:100%; 6 | } 7 | 8 | div { 9 | width:100%; 10 | height:100%; 11 | } 12 | -------------------------------------------------------------------------------- /src/view/src/components/stencil-cached-image/cached-image.tsx: -------------------------------------------------------------------------------- 1 | import { Component, Prop, Watch, Element, State } from '@stencil/core'; 2 | import { ImageCache } from 'capacitor-image-cache'; 3 | 4 | 5 | function uuid() { 6 | return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { 7 | const r = (Math.random() * 16) | 0, 8 | v = c === 'x' ? r : (r & 0x3) | 0x8; 9 | return v.toString(16); 10 | }); 11 | } 12 | 13 | @Component({ 14 | tag: 'st-cached-image', 15 | styleUrl: 'cached-image.css', 16 | shadow: true 17 | }) 18 | 19 | export class CachedImage { 20 | private cache: ImageCache; 21 | @State() private readonly id: string; 22 | constructor() { 23 | this.cache = new ImageCache(); 24 | this.id = uuid(); 25 | } 26 | 27 | @Prop() src: string; 28 | 29 | @Prop() placeHolder: string; 30 | 31 | @Prop() errorHolder: string; 32 | 33 | @Element() element :HTMLElement; 34 | 35 | 36 | @Watch('src') 37 | srcChanged() { 38 | this.loadImage(); 39 | } 40 | 41 | render() { 42 | return ( 43 |
44 | 45 |
46 | ); 47 | } 48 | 49 | private async loadImage(){ 50 | try { 51 | const { value } = await this.cache.get({src: this.src}); 52 | this.element.shadowRoot.querySelector(`img`).setAttribute('src',value); 53 | }catch (e) { 54 | console.log(e) 55 | } 56 | } 57 | 58 | 59 | componentWillUpdate() { 60 | this.loadImage() 61 | } 62 | 63 | componentDidLoad() { 64 | this.loadImage(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/view/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Stencil Component Starter 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/view/stencil.config.js: -------------------------------------------------------------------------------- 1 | const sass = require('@stencil/sass'); 2 | exports.config = { 3 | namespace: 'cached-image', 4 | outputTargets:[ 5 | { 6 | type: 'dist' 7 | }, 8 | { 9 | type: 'www', 10 | serviceWorker: false 11 | } 12 | ], 13 | plugins: [ 14 | sass() 15 | ] 16 | }; 17 | 18 | exports.devServer = { 19 | root: 'www', 20 | watchGlob: '**/**' 21 | } 22 | -------------------------------------------------------------------------------- /src/view/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "allowUnreachableCode": false, 5 | "declaration": false, 6 | "experimentalDecorators": true, 7 | "lib": [ 8 | "dom", 9 | "es2015" 10 | ], 11 | "moduleResolution": "node", 12 | "module": "es2015", 13 | "target": "es2015", 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "jsx": "react", 17 | "jsxFactory": "h" 18 | 19 | }, 20 | "include": [ 21 | "src", 22 | "types/jsx.d.ts" 23 | ], 24 | "exclude": [ 25 | "node_modules" 26 | ] 27 | } 28 | --------------------------------------------------------------------------------