├── .editorconfig ├── .gitignore ├── README.md ├── config.xml ├── demo.gif ├── ionic.config.json ├── package-lock.json ├── package.json ├── resources ├── README.md ├── android │ ├── icon │ │ ├── drawable-hdpi-icon.png │ │ ├── drawable-ldpi-icon.png │ │ ├── drawable-mdpi-icon.png │ │ ├── drawable-xhdpi-icon.png │ │ ├── drawable-xxhdpi-icon.png │ │ └── drawable-xxxhdpi-icon.png │ └── splash │ │ ├── drawable-land-hdpi-screen.png │ │ ├── drawable-land-ldpi-screen.png │ │ ├── drawable-land-mdpi-screen.png │ │ ├── drawable-land-xhdpi-screen.png │ │ ├── drawable-land-xxhdpi-screen.png │ │ ├── drawable-land-xxxhdpi-screen.png │ │ ├── drawable-port-hdpi-screen.png │ │ ├── drawable-port-ldpi-screen.png │ │ ├── drawable-port-mdpi-screen.png │ │ ├── drawable-port-xhdpi-screen.png │ │ ├── drawable-port-xxhdpi-screen.png │ │ └── drawable-port-xxxhdpi-screen.png ├── icon.png ├── icon.png.md5 ├── ios │ ├── icon │ │ ├── icon-1024.png │ │ ├── icon-40.png │ │ ├── icon-40@2x.png │ │ ├── icon-40@3x.png │ │ ├── icon-50.png │ │ ├── icon-50@2x.png │ │ ├── icon-60.png │ │ ├── icon-60@2x.png │ │ ├── icon-60@3x.png │ │ ├── icon-72.png │ │ ├── icon-72@2x.png │ │ ├── icon-76.png │ │ ├── icon-76@2x.png │ │ ├── icon-83.5@2x.png │ │ ├── icon-small.png │ │ ├── icon-small@2x.png │ │ ├── icon-small@3x.png │ │ ├── icon.png │ │ └── icon@2x.png │ └── splash │ │ ├── Default-568h@2x~iphone.png │ │ ├── Default-667h.png │ │ ├── Default-736h.png │ │ ├── Default-Landscape-736h.png │ │ ├── Default-Landscape@2x~ipad.png │ │ ├── Default-Landscape@~ipadpro.png │ │ ├── Default-Landscape~ipad.png │ │ ├── Default-Portrait@2x~ipad.png │ │ ├── Default-Portrait@~ipadpro.png │ │ ├── Default-Portrait~ipad.png │ │ ├── Default@2x~iphone.png │ │ ├── Default@2x~universal~anyany.png │ │ └── Default~iphone.png ├── splash.png └── splash.png.md5 ├── src ├── app │ ├── app.component.ts │ ├── app.config.ts │ ├── app.html │ ├── app.module.ts │ ├── app.scss │ └── main.ts ├── assets │ ├── icon │ │ └── favicon.ico │ └── imgs │ │ └── logo.png ├── index.html ├── manifest.json ├── pages │ ├── home │ │ ├── home.html │ │ ├── home.scss │ │ └── home.ts │ ├── list │ │ ├── list.html │ │ ├── list.scss │ │ └── list.ts │ ├── page1 │ │ ├── page1.html │ │ ├── page1.scss │ │ └── page1.ts │ ├── page2 │ │ ├── page2.html │ │ ├── page2.scss │ │ └── page2.ts │ └── page3 │ │ ├── page3.html │ │ ├── page3.scss │ │ └── page3.ts ├── service-worker.js ├── services │ └── backbutton.service.ts └── theme │ └── variables.scss ├── tsconfig.json └── tslint.json /.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 -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ionic Android Back Button 2 | 3 | Comprehensive Android Back Button Demo 4 | 5 | Performing the following checks: 6 | 7 | * Close the side menu if it's open 8 | * Close any pushed page 9 | * Switch between tabs 10 | 11 | ![Demo](demo.gif) 12 | 13 | 14 | ## Getting Started 15 | 16 | ``` 17 | npm install 18 | ionic cordova platform add android 19 | ionic cordova run android 20 | ``` 21 | 22 | ## Built With 23 | 24 | * [Ionic](https://ionicframework.com/) - The Ionic Framework 25 | 26 | ## License 27 | 28 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details 29 | -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | backbutton 4 | Comprehensive Android Back Button Demo 5 | Ionic Framework Team 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/demo.gif -------------------------------------------------------------------------------- /ionic.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backbutton2", 3 | "app_id": "", 4 | "type": "ionic-angular", 5 | "integrations": { 6 | "cordova": {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "backbutton2", 3 | "version": "0.0.1", 4 | "author": "Ari Saif", 5 | "homepage": "https://github.com/ourarash", 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/common": "5.0.3", 16 | "@angular/compiler": "5.0.3", 17 | "@angular/compiler-cli": "5.0.3", 18 | "@angular/core": "5.0.3", 19 | "@angular/forms": "5.0.3", 20 | "@angular/http": "5.0.3", 21 | "@angular/platform-browser": "5.0.3", 22 | "@angular/platform-browser-dynamic": "5.0.3", 23 | "@ionic-native/core": "4.4.0", 24 | "@ionic-native/splash-screen": "4.4.0", 25 | "@ionic-native/status-bar": "4.4.0", 26 | "@ionic/storage": "2.1.3", 27 | "cordova-android": "6.3.0", 28 | "cordova-plugin-device": "^2.0.1", 29 | "cordova-plugin-ionic-keyboard": "^2.0.5", 30 | "cordova-plugin-ionic-webview": "^1.1.16", 31 | "cordova-plugin-splashscreen": "^5.0.2", 32 | "cordova-plugin-whitelist": "^1.3.3", 33 | "ionic-angular": "3.9.2", 34 | "ionicons": "3.0.0", 35 | "rxjs": "5.5.2", 36 | "sw-toolbox": "3.6.0", 37 | "zone.js": "0.8.18" 38 | }, 39 | "devDependencies": { 40 | "@ionic/app-scripts": "3.1.8", 41 | "typescript": "2.4.2" 42 | }, 43 | "description": "An Ionic project", 44 | "cordova": { 45 | "plugins": { 46 | "cordova-plugin-whitelist": {}, 47 | "cordova-plugin-device": {}, 48 | "cordova-plugin-splashscreen": {}, 49 | "cordova-plugin-ionic-webview": {}, 50 | "cordova-plugin-ionic-keyboard": {} 51 | }, 52 | "platforms": [ 53 | "android" 54 | ] 55 | } 56 | } -------------------------------------------------------------------------------- /resources/README.md: -------------------------------------------------------------------------------- 1 | These are Cordova resources. You can replace icon.png and splash.png and run 2 | `ionic cordova resources` to generate custom icons and splash screens for your 3 | app. See `ionic cordova resources --help` for details. 4 | 5 | Cordova reference documentation: 6 | 7 | - Icons: https://cordova.apache.org/docs/en/latest/config_ref/images.html 8 | - Splash Screens: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/ 9 | -------------------------------------------------------------------------------- /resources/android/icon/drawable-hdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/icon/drawable-hdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-ldpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/icon/drawable-ldpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-mdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/icon/drawable-mdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/icon/drawable-xhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/icon/drawable-xxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/icon/drawable-xxxhdpi-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/icon/drawable-xxxhdpi-icon.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/splash/drawable-land-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/splash/drawable-land-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/splash/drawable-land-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/splash/drawable-land-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/splash/drawable-land-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-land-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/splash/drawable-land-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-hdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/splash/drawable-port-hdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-ldpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/splash/drawable-port-ldpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-mdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/splash/drawable-port-mdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/splash/drawable-port-xhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/splash/drawable-port-xxhdpi-screen.png -------------------------------------------------------------------------------- /resources/android/splash/drawable-port-xxxhdpi-screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/android/splash/drawable-port-xxxhdpi-screen.png -------------------------------------------------------------------------------- /resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/icon.png -------------------------------------------------------------------------------- /resources/icon.png.md5: -------------------------------------------------------------------------------- 1 | 3f1bbdf1aefcb5ce7b60770ce907c68f -------------------------------------------------------------------------------- /resources/ios/icon/icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-1024.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-40.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-40@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-40@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-50.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-50@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-60.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-60@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-60@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-72.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-72@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-76.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-76@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-83.5@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-small.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-small@2x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon-small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon-small@3x.png -------------------------------------------------------------------------------- /resources/ios/icon/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon.png -------------------------------------------------------------------------------- /resources/ios/icon/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/icon/icon@2x.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-568h@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default-568h@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-667h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default-667h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape-736h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default-Landscape-736h.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default-Landscape@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape@~ipadpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default-Landscape@~ipadpro.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Landscape~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default-Landscape~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@2x~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default-Portrait@2x~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait@~ipadpro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default-Portrait@~ipadpro.png -------------------------------------------------------------------------------- /resources/ios/splash/Default-Portrait~ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default-Portrait~ipad.png -------------------------------------------------------------------------------- /resources/ios/splash/Default@2x~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default@2x~iphone.png -------------------------------------------------------------------------------- /resources/ios/splash/Default@2x~universal~anyany.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default@2x~universal~anyany.png -------------------------------------------------------------------------------- /resources/ios/splash/Default~iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/ios/splash/Default~iphone.png -------------------------------------------------------------------------------- /resources/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/resources/splash.png -------------------------------------------------------------------------------- /resources/splash.png.md5: -------------------------------------------------------------------------------- 1 | 2412a8324a656ec5993eb50b3b293c69 -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ViewChild } from "@angular/core"; 2 | import { StatusBar } from "@ionic-native/status-bar"; 3 | import { SplashScreen } from "@ionic-native/splash-screen"; 4 | import { Platform, MenuController, AlertController, Nav, Tab, ToastController } from "ionic-angular"; 5 | 6 | import { HomePage } from "../pages/home/home"; 7 | import { ListPage } from "../pages/list/list"; 8 | import { Globals, EN_TAB_PAGES } from "../app/app.config"; 9 | import { BackbuttonService } from "../services/backbutton.service"; 10 | 11 | @Component({ 12 | templateUrl: "app.html" 13 | }) 14 | export class MyApp { 15 | @ViewChild(Nav) nav: Nav; 16 | 17 | rootPage: any = HomePage; 18 | 19 | pages: Array<{ title: string; component: any }>; 20 | alert; 21 | constructor( 22 | public platform: Platform, 23 | public statusBar: StatusBar, 24 | public splashScreen: SplashScreen, 25 | private alertController: AlertController, 26 | public menu: MenuController, 27 | private backbuttonService: BackbuttonService, 28 | private toastController: ToastController 29 | ) { 30 | this.initializeApp(); 31 | 32 | // used for an example of ngFor and navigation 33 | this.pages = [{ title: "List", component: ListPage }]; 34 | this.registerBackButton(); 35 | } 36 | 37 | initializeApp() { 38 | this.platform.ready().then(() => { 39 | // Okay, so the platform is ready and our plugins are available. 40 | // Here you can do any higher level native things you might need. 41 | this.statusBar.styleDefault(); 42 | this.splashScreen.hide(); 43 | }); 44 | } 45 | 46 | openPage(page) { 47 | // Reset the content nav to have just this page 48 | // we wouldn't want the back button to show in this scenario 49 | // this.nav.setRoot(page.component); 50 | this.nav.push(page.component); 51 | } 52 | 53 | registerBackButton() { 54 | this.platform.registerBackButtonAction(() => { 55 | let toast = this.toastController.create({ 56 | message: "Back button pushed!", 57 | 58 | duration: 1000, 59 | 60 | dismissOnPageChange: false, 61 | position: "middle", 62 | cssClass:"my-toast", 63 | }); 64 | 65 | toast.present(); 66 | 67 | if (this.menu.isOpen()) { 68 | console.log("Menu is open!", "loggedInMenu"); 69 | this.menu.close(); 70 | console.log("this.menu.isOpen(): " + JSON.stringify(this.menu.isOpen())); 71 | return; 72 | } 73 | console.log("Checking for other pages"); 74 | 75 | let checkHomePage = true; 76 | let max = Globals.navCtrls.length; 77 | for (let i = 0; i < Globals.navCtrls.length; i++) { 78 | let n = Globals.navCtrls[i]; 79 | if (n) { 80 | if (n.canGoBack()) { 81 | console.log("Breaking the loop i: " + JSON.stringify(i)); 82 | let navParams = n.getActive().getNavParams(); 83 | if (navParams) { 84 | console.log("navParams exists"); 85 | let resolve = navParams.get("resolve"); 86 | if (resolve) { 87 | n.pop().then(() => resolve({})); 88 | } else { 89 | n.pop(); 90 | } 91 | } else { 92 | n.pop(); 93 | } 94 | checkHomePage = false; 95 | return; 96 | } 97 | } else console.log("n was null!"); 98 | } 99 | 100 | if (this.nav.getActive().instance instanceof HomePage && !this.nav.canGoBack()) { 101 | let popPageVal = this.backbuttonService.popPage(); 102 | console.log("popPageVal: " + JSON.stringify(popPageVal)); 103 | if (popPageVal >= 0) { 104 | console.log("Switching the tab to: ", popPageVal); 105 | this.switchTab(popPageVal); 106 | } else { 107 | console.log("Last page is HomePage"); 108 | 109 | if (this.alert) { 110 | this.alert.dismiss(); 111 | this.alert = null; 112 | } else { 113 | this.showAlert(); 114 | } 115 | } 116 | } else { 117 | console.log("Last page is not HomePage"); 118 | if (this.nav.canGoBack()) { 119 | console.log("We can go back!"); 120 | this.nav.pop(); 121 | } 122 | } 123 | }); 124 | } 125 | 126 | showAlert() { 127 | this.alert = this.alertController.create({ 128 | title: "Exit?", 129 | message: "Are you sure you want to exit?", 130 | buttons: [ 131 | { 132 | text: "Cancel", 133 | role: "cancel", 134 | handler: () => { 135 | this.alert = null; 136 | } 137 | }, 138 | { 139 | text: "Exit", 140 | handler: () => { 141 | this.platform.exitApp(); 142 | } 143 | } 144 | ] 145 | }); 146 | this.alert.present(); 147 | } 148 | 149 | switchTab(tabIndex) { 150 | if (Globals.tabs && tabIndex >= 0) { 151 | console.log("Switch condition met"); 152 | Globals.tabIndex = tabIndex; 153 | Globals.tabs.select(tabIndex); 154 | Globals.tabs.selectedIndex = tabIndex; 155 | } 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | export var EN_TAB_PAGES = { 2 | EN_TP_HOME: 0, 3 | EN_TP_PLANET:1, 4 | EN_TP_STAR: 2, 5 | 6 | EN_TP_LENGTH: 3, 7 | } 8 | 9 | export var Globals = { 10 | navCtrls : new Array(EN_TAB_PAGES.EN_TP_LENGTH), 11 | tabIndex:0, 12 | tabs: {}, 13 | } -------------------------------------------------------------------------------- /src/app/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Menu 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { ErrorHandler, NgModule } from '@angular/core'; 3 | import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; 4 | 5 | import { MyApp } from './app.component'; 6 | import { HomePage } from '../pages/home/home'; 7 | import { ListPage } from '../pages/list/list'; 8 | import { Page1Page } from '../pages/page1/page1'; 9 | import { Page2Page } from '../pages/page2/page2'; 10 | import { Page3Page } from '../pages/page3/page3'; 11 | 12 | import { StatusBar } from '@ionic-native/status-bar'; 13 | import { SplashScreen } from '@ionic-native/splash-screen'; 14 | import { BackbuttonService } from "../services/backbutton.service"; 15 | 16 | @NgModule({ 17 | declarations: [ 18 | MyApp, 19 | HomePage, 20 | ListPage, 21 | Page1Page, 22 | Page2Page, 23 | Page3Page, 24 | ], 25 | imports: [ 26 | BrowserModule, 27 | IonicModule.forRoot(MyApp), 28 | ], 29 | bootstrap: [IonicApp], 30 | entryComponents: [ 31 | MyApp, 32 | HomePage, 33 | ListPage, 34 | Page1Page, 35 | Page2Page, 36 | Page3Page, 37 | ], 38 | providers: [ 39 | StatusBar, 40 | SplashScreen, 41 | BackbuttonService, 42 | {provide: ErrorHandler, useClass: IonicErrorHandler} 43 | ] 44 | }) 45 | export class AppModule {} 46 | -------------------------------------------------------------------------------- /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 | .my-toast>.toast-wrapper>.toast-container { 18 | color: gold; 19 | background-color: gold; 20 | // opacity: .5; 21 | 22 | text-align: center; 23 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/assets/icon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/src/assets/icon/favicon.ico -------------------------------------------------------------------------------- /src/assets/imgs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ourarash/ionic3-android-back-button/1a5146c2ae0d6b55b120372c5612245e2f56c40f/src/assets/imgs/logo.png -------------------------------------------------------------------------------- /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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /src/pages/home/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | Home 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/pages/home/home.scss: -------------------------------------------------------------------------------- 1 | page-home { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/home/home.ts: -------------------------------------------------------------------------------- 1 | import { Component, ViewChild } from '@angular/core'; 2 | import { NavController } from 'ionic-angular'; 3 | import { Page1Page } from '../../pages/page1/page1'; 4 | import { Page2Page } from '../../pages/page2/page2'; 5 | import { Page3Page } from '../../pages/page3/page3'; 6 | import { Globals } from "../../app/app.config"; 7 | import { Tabs } from "ionic-angular"; 8 | 9 | @Component({ 10 | selector: 'page-home', 11 | templateUrl: 'home.html' 12 | }) 13 | export class HomePage { 14 | @ViewChild("tabs") tabs: Tabs; 15 | 16 | tab1Root = Page1Page; 17 | tab2Root = Page2Page; 18 | tab3Root = Page3Page; 19 | 20 | constructor(public navCtrl: NavController) { 21 | 22 | } 23 | 24 | ionViewDidEnter() { 25 | Globals.tabs = this.tabs; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/pages/list/list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | List 7 | 8 | 9 | 10 | 11 | 12 | 19 | 20 |
21 | You navigated here from {{selectedItem.title}} 22 |
23 |
24 | -------------------------------------------------------------------------------- /src/pages/list/list.scss: -------------------------------------------------------------------------------- 1 | page-list { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/list/list.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { NavController, NavParams } from 'ionic-angular'; 3 | 4 | @Component({ 5 | selector: 'page-list', 6 | templateUrl: 'list.html' 7 | }) 8 | export class ListPage { 9 | selectedItem: any; 10 | icons: string[]; 11 | items: Array<{title: string, note: string, icon: string}>; 12 | 13 | constructor(public navCtrl: NavController, public navParams: NavParams) { 14 | // If we navigated to this page, we will have an item available as a nav param 15 | this.selectedItem = navParams.get('item'); 16 | 17 | // Let's populate this page with some filler content for funzies 18 | this.icons = ['flask', 'wifi', 'beer', 'football', 'basketball', 'paper-plane', 19 | 'american-football', 'boat', 'bluetooth', 'build']; 20 | 21 | this.items = []; 22 | for (let i = 1; i < 11; i++) { 23 | this.items.push({ 24 | title: 'Item ' + i, 25 | note: 'This is item #' + i, 26 | icon: this.icons[Math.floor(Math.random() * this.icons.length)] 27 | }); 28 | } 29 | } 30 | 31 | itemTapped(event, item) { 32 | // That's right, we're pushing to ourselves! 33 | this.navCtrl.push(ListPage, { 34 | item: item 35 | }); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/pages/page1/page1.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | page1 11 | 12 | 13 | 14 | 15 | 16 | 17 |

Page 1

18 |

Comprehensive Android Back Button Demo

19 |

Back button should check for several things in the following order:

20 | 25 |
26 | -------------------------------------------------------------------------------- /src/pages/page1/page1.scss: -------------------------------------------------------------------------------- 1 | page-page1 { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/page1/page1.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { NavController, NavParams } from 'ionic-angular'; 3 | import { BackbuttonService } from '../../services/backbutton.service'; 4 | import { EN_TAB_PAGES } from "../../app/app.config"; 5 | 6 | /** 7 | * Generated class for the Page1Page page. 8 | * 9 | * See https://ionicframework.com/docs/components/#navigation for more info on 10 | * Ionic pages and navigation. 11 | */ 12 | 13 | @Component({ 14 | selector: 'page-page1', 15 | templateUrl: 'page1.html', 16 | }) 17 | export class Page1Page { 18 | 19 | constructor(public navCtrl: NavController, public navParams: NavParams, 20 | private backbuttonService: BackbuttonService, 21 | ) { 22 | } 23 | 24 | ionViewDidLoad() { 25 | console.log('ionViewDidLoad Page1Page'); 26 | } 27 | 28 | ionViewWillEnter() { 29 | this.backbuttonService.pushPage(EN_TAB_PAGES.EN_TP_HOME, this.navCtrl); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/pages/page2/page2.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | page2 11 | 12 | 13 | 14 | 15 | 16 | 17 |

Page 2

18 |
19 | -------------------------------------------------------------------------------- /src/pages/page2/page2.scss: -------------------------------------------------------------------------------- 1 | page-page2 { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/page2/page2.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { NavController, NavParams } from 'ionic-angular'; 3 | import { BackbuttonService } from '../../services/backbutton.service'; 4 | import { EN_TAB_PAGES } from "../../app/app.config"; 5 | /** 6 | * Generated class for the Page2Page page. 7 | * 8 | * See https://ionicframework.com/docs/components/#navigation for more info on 9 | * Ionic pages and navigation. 10 | */ 11 | 12 | @Component({ 13 | selector: 'page-page2', 14 | templateUrl: 'page2.html', 15 | }) 16 | export class Page2Page { 17 | 18 | constructor(public navCtrl: NavController, public navParams: NavParams, 19 | private backbuttonService: BackbuttonService, 20 | ) { 21 | } 22 | 23 | ionViewDidLoad() { 24 | console.log('ionViewDidLoad Page2Page'); 25 | } 26 | ionViewWillEnter() { 27 | this.backbuttonService.pushPage(EN_TAB_PAGES.EN_TP_PLANET, this.navCtrl); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/pages/page3/page3.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | page3 11 | 12 | 13 | 14 | 15 | 16 | 17 |

Page 3

18 |
19 | -------------------------------------------------------------------------------- /src/pages/page3/page3.scss: -------------------------------------------------------------------------------- 1 | page-page3 { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /src/pages/page3/page3.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { NavController, NavParams } from 'ionic-angular'; 3 | import { BackbuttonService } from '../../services/backbutton.service'; 4 | import { EN_TAB_PAGES } from "../../app/app.config"; 5 | /** 6 | * Generated class for the Page3Page page. 7 | * 8 | * See https://ionicframework.com/docs/components/#navigation for more info on 9 | * Ionic pages and navigation. 10 | */ 11 | 12 | @Component({ 13 | selector: 'page-page3', 14 | templateUrl: 'page3.html', 15 | }) 16 | export class Page3Page { 17 | 18 | constructor(public navCtrl: NavController, public navParams: NavParams, 19 | private backbuttonService: BackbuttonService, 20 | ) { 21 | 22 | } 23 | 24 | ionViewDidLoad() { 25 | console.log('ionViewDidLoad Page3Page'); 26 | } 27 | 28 | ionViewWillEnter() { 29 | this.backbuttonService.pushPage(EN_TAB_PAGES.EN_TP_STAR, this.navCtrl); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/services/backbutton.service.ts: -------------------------------------------------------------------------------- 1 | 2 | import { Injectable } from "@angular/core"; 3 | import { Globals, EN_TAB_PAGES } from "../app/app.config"; 4 | 5 | @Injectable() 6 | export class BackbuttonService { 7 | pageNumberStack = []; 8 | constructor() { 9 | } 10 | 11 | pushPage(pageNumber, navCtrl) { 12 | if (navCtrl) 13 | Globals.navCtrls[pageNumber] = navCtrl; 14 | Globals.tabIndex = pageNumber; 15 | 16 | let indexOfPageNumber = this.pageNumberStack.indexOf(pageNumber); 17 | console.log("pageNumber: " + JSON.stringify(pageNumber)); 18 | console.log("indexOfPageNumber: " + JSON.stringify(indexOfPageNumber)); 19 | if (indexOfPageNumber >= 0) { 20 | this.pageNumberStack.splice(indexOfPageNumber, 1); 21 | } 22 | console.log("Before this.pageNumberStack: " + JSON.stringify(this.pageNumberStack)); 23 | this.pageNumberStack.push(pageNumber); 24 | console.log("After this.pageNumberStack: " + JSON.stringify(this.pageNumberStack)); 25 | } 26 | 27 | popPage() { 28 | if (this.pageNumberStack.length > 0) 29 | this.pageNumberStack.pop(); 30 | 31 | console.log("After pop this.pageNumberStack: " + JSON.stringify(this.pageNumberStack)); 32 | if (this.pageNumberStack.length > 0) 33 | return this.pageNumberStack[this.pageNumberStack.length - 1]; 34 | else { 35 | // Always leave 0 in the stack 36 | this.pageNumberStack.push(0); 37 | return -1; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------