summaryrefslogtreecommitdiff
path: root/www/lib/ionic-native-transitions/test/config.js
blob: 35aa240b5e0d003ebf2e3e93ff759260ea04dcce (plain)
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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
export default function ($ionicNativeTransitionsProvider, $stateProvider, $urlRouterProvider, $ionicConfigProvider) {
    'ngInject';
    $ionicNativeTransitionsProvider.setDefaultOptions({
        duration: 500,
        // backInOppositeDirection: true
    });

    $ionicNativeTransitionsProvider.setDefaultTransition({
        type: 'flip',
        direction: 'left'
    });

    $ionicNativeTransitionsProvider.setDefaultBackTransition({
        type: 'slide',
        direction: 'right'
    });

    $ionicNativeTransitionsProvider.enable(false);

    $ionicConfigProvider.tabs.position('top');

    $stateProvider
        .state('tabs', {
            url: "/tab",
            abstract: true,
            templateUrl: "templates/tabs.html"
        })
        .state('tabs.home', {
            url: "/home",
            nativeTransitions: null,
            views: {
                'home-tab': {
                    templateUrl: "templates/home.html"
                }
            }
        })
        .state('tabs.about', {
            url: "/about",
            nativeTransitions: {
                type: "fade"
            },
            views: {
                'about-tab': {
                    templateUrl: "templates/about.html"
                }
            }
        })
        .state('tabs.contact', {
            url: "/contact",
            nativeTransitions: {
                type: "slide",
                direction: "left",
                fixedPixelsTop: 93
            },
            views: {
                'contact-tab': {
                    templateUrl: "templates/contact.html"
                }
            }
        })
        .state('one', {
            url: "/one",
            nativeTransitions: {
                "type": "flip",
                "direction": "up"
            },
            nativeTransitionsAndroid: {
                "type": "flip",
                "direction": "right"
            },
            nativeTransitionsBackAndroid: {
                "type": "slide",
                "direction": "down"
            },
            nativeTransitionsIOS: {
                "type": "flip",
                "direction": "left"
            },
            nativeTransitionsWindowsPhone: {
                "type": "flip",
                "direction": "down"
            },
            templateUrl: "templates/one.html"
        })
        .state('two', {
            url: "/two",
            nativeTransitions: {
                type: "fade"
            },
            nativeTransitionsBack: null,
            nativeTransitionsIOS: {
                "type": "flip",
                "direction": "down" // 'left|right|up|down', default 'right' (Android currently only supports left and right)
            },
            templateUrl: "templates/two.html"
        })
        .state('three', {
            url: "/three",
            nativeTransitions: {
                type: "fade"
            },
            nativeTransitionsAndroid: {
                "type": "slide",
                "direction": "up" // 'left|right|up|down', default 'right' (Android currently only supports left and right)
            },
            nativeTransitionsBackAndroid: {
                "type": "slide",
                "direction": "up" // 'left|right|up|down', default 'right' (Android currently only supports left and right)
            },
            templateUrl: "templates/three.html"
        })
        .state('four', {
            url: "/four?testParamUrl",
            params: {
                test: null
            },
            templateUrl: "templates/four.html",
            controller: function ($stateParams) {
                'ngInject';
                console.log('$stateParams', $stateParams);
            }
        })
        .state('five', {
            url: "/five",
            templateUrl: "templates/five.html",
            controller: function ($stateParams) {
                'ngInject';
                console.log('$stateParams', $stateParams);
            },
            resolve: function ($timeout, $q, $ionicPopup) {
                'ngInject';
                var deferred = $q.defer();
                $timeout(function () {
                    $ionicPopup.show({
                        template: '',
                        title: 'A popup',
                        buttons: [
                            { text: 'Cancel' }
                        ]
                    });
                    deferred.reject();
                }, 1000)
                return deferred.promise;
            }
        });


    $urlRouterProvider.otherwise("/tab/home");
}