Detail-Navigation eingebaut, Sprung auf aktualisierte List nach Bilder download

This commit is contained in:
Carsten Hilmer
2016-09-20 01:44:22 +02:00
parent 93431210f4
commit a8a9b07b3f
5 changed files with 155 additions and 9 deletions

View File

@@ -13,7 +13,7 @@
// http://ngcordova.com/docs/plugins/sqlite/
//
// Controller of Contract List Page.
appControllers.controller('imageDownloadCtrl', function ($scope, $stateParams, $mdBottomSheet, $timeout, $mdDialog, $cordovaFileTransfer, $cordovaFile, $state, pokedexDB) {
appControllers.controller('imageDownloadCtrl', function ($scope, $stateParams, $mdBottomSheet, $timeout, $mdDialog, $cordovaFileTransfer, $ionicViewSwitcher, $ionicHistory, $cordovaFile, $state, pokedexDB, dataShare) {
$scope.progressval = 0;
$scope.currentfile = '';
@@ -100,6 +100,9 @@ appControllers.controller('imageDownloadCtrl', function ($scope, $stateParams, $
$scope.progressprozent = 'Download abgeschlossen! ' + $scope.progressprozent;
$scope.DownloadisVisible=true;
$scope.AbbrechenisVisible=false;
$timeout(function(){
$scope.refreshData();
}, 1000);
}
if ( $scope.startdownloadtimer==false){
@@ -129,6 +132,31 @@ appControllers.controller('imageDownloadCtrl', function ($scope, $stateParams, $
downloadtimer();
};
$scope.refreshData=function(){
var data='refresh';
dataShare.sendData(data);
$scope.navigateTo('app.pokemonlist', {isAnimated:false});
};
// navigateTo is for navigate to other page
// by using targetPage to be the destination state.
// Parameter :
// stateNames = target state to go.
// objectData = Object data will send to destination state.
$scope.navigateTo = function (stateName,objectData) {
if ($ionicHistory.currentStateName() != stateName) {
$ionicHistory.nextViewOptions({
disableAnimate: false,
disableBack: true
});
//Next view animate will display in back direction
$ionicViewSwitcher.nextDirection('back');
$state.go(stateName, {
isAnimated: objectData.isAnimated
});
}
};
$scope.downloadabbrechen = function() {
$scope.DownloadisVisible=true;