Neues Initialrelease mit IonicMaterial

This commit is contained in:
Carsten Hilmer
2016-08-22 12:55:52 +02:00
parent 30a5df79aa
commit 45e482b14d
1249 changed files with 305225 additions and 68794 deletions

View File

@@ -0,0 +1,29 @@
<!--View Information-->
<!--View name : Device Flashlight-->
<!--Controller name : flashLightCtrl-->
<!--Controller path : www/templates/hardware-connect/flash-light/js/controllers.js-->
<!--State name : app.flashLight-->
<!--URL : #app/flashLight-->
<ion-view title="Flash Light">
<!--flash light section-->
<!--flash light icon section-->
<ion-content id="flash-light-content" scroll="false">
<div class="row">
<div id="flash-light-icon" class="col">
<i ng-class="{'flash-light-color' : isTurnOn}" class="fa fa-diamond center-screen icon-flash-light"></i>
</div>
</div><!--end flash light icon section-->
<div class="row">
<!--flash light control section-->
<div id="flash-light-control" class="col">
<p>Devise Flash Light</p>
<a ng-class="{'md-warn' : isTurnOn}" class="md-raised md-primary md-button md-default-theme"
ng-click="flashLight()">
Turn {{isTurnOn == true ? 'OFF' : 'On'}}
</a>
</div><!--end flash light control section-->
</div>
</ion-content><!--end flash light section-->
</ion-view>

View File

@@ -0,0 +1,52 @@
// For using flashlight you have to install $cordovaFlashlight by running the following
// command in your cmd.exe for windows or terminal for mac:
// $ cd your_project_path
// $ ionic plugin remove nl.x-services.plugins.flashlight
// $ ionic plugin add https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin.git
//
// Learn more about $cordovaFlashlight :
// http://ngcordova.com/docs/plugins/flashlight/
//
// Controller of Flashlight page.
appControllers.controller('flashLightCtrl', function ($scope, $cordovaFlashlight, $timeout) {
// initialForm is the first activity in the controller.
// It will initial all variable data and let the function works when page load.
$scope.initialForm = function () {
//$scope.isTurnOn is Flashlight status.
$scope.isTurnOn = false;
//$scope.deviceInformation is getting device platform.
$scope.deviceInformation = ionic.Platform.device();
//If you start your application with flash Light feature.
//You have to add timeout for 2 sec before run it.
}; // End initialForm.
// flashLight for turn on and off flashLight.
$scope.flashLight = function () {
// turn on flashLight
if ($scope.isTurnOn == false) {
// turn on flashLight for Android
if ($scope.deviceInformation.platform == "Android") {
$scope.isTurnOn = true;
$timeout(function () {
$cordovaFlashlight.switchOn();
}, 50);
}
// turn on flashLight for IOS
else {
$scope.isTurnOn = true;
$cordovaFlashlight.switchOn();
}
} // End turn on flashLight.
// turn off flashLight.
else {
$scope.isTurnOn = false;
$cordovaFlashlight.switchOff();
}// End turn off flashLight.
};// End flashLight.
$scope.initialForm();
});// End of Flashlight Controller.