• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16export class Constants {
17    // Immersive animation duration
18    static readonly IMMERSE_ANIM_DURATION = 300;
19
20    // click event
21    static readonly TOGGLE_BAR = 'single_photo_toggle_bar';
22
23    // hide bars
24    static readonly HIDE_BARS = 'single_photo_hide_bars';
25
26    // pull down to return start
27    static readonly PULL_DOWN_START = 'single_photo_pull_down_start';
28
29    // pull down to return end
30    static readonly PULL_DOWN_END = 'single_photo_pull_down_end';
31
32    // pull down to return cancel
33    static readonly PULL_DOWN_CANCEL = 'single_photo_pull_down_cancel';
34
35    // pull down to return threshold
36    static readonly PULL_DOWN_THRESHOLD = 200;
37
38    // touch event
39    static readonly TOUCH_EVENT = 'single_photo_touch_event';
40
41    // direction change event
42    static readonly DIRECTION_CHANGE = 'single_photo_direction_change';
43
44    // animation event
45    static readonly ANIMATION_EVENT = 'single_photo_animation_event';
46
47    // data quantity change
48    static readonly DATA_SIZE_CHANGED = 'photo_data_size_changed';
49
50    // current data change
51    static readonly DATA_CONTENT_CHANGED = 'photo_data_content_changed';
52
53    // video play
54    static readonly VIDEO_PLAY = 'single_photo_video_play';
55
56    // video pause
57    static readonly VIDEO_PAUSE = 'single_photo_video_pause';
58
59    // popup show
60    static readonly POP_APPEAR = 'single_photo_popup_appear';
61
62    // popup disappear
63    static readonly POP_DISAPPEAR = 'single_photo_popup_disappear';
64
65    // set favor photo
66    static readonly SET_FAVOR = 'single_photo_set_favor';
67
68    // rename photo
69    static readonly RENAME = 'single_photo_rename';
70
71    // rotate photo
72    static readonly ROTATE = 'single_photo_rotate';
73
74    // delete photo
75    static readonly DELETE = 'single_photo_delete';
76
77    // photo show state
78    static readonly PHOTO_SHOW_STATE = 'single_photo_show_state';
79
80    // set swiper can swipe
81    static readonly SET_DISABLE_SWIPE = 'set_disable_swipe';
82
83    // Scale lower limit
84    static readonly COMPONENT_SCALE_FLOOR = 0.5;
85
86    // scale upper limit
87    static readonly COMPONENT_SCALE_CEIL = 2.0;
88
89    // when the double-click scale is larger than maxScale, the maxScale is adjusted to 1.2 times the double-click scale
90    static readonly MAX_SCALE_EXTRA_FACTOR = 1.2;
91
92    // After reaching max scale, you can also scale an additional 0.2x max scale, and rebound after letting go
93    static readonly OVER_SCALE_EXTRA_FACTOR = 1.5;
94
95    // If the aspect ratio of the picture is the same as the display area,
96    // double-click to adjust the zoom factor to 4 / 3
97    static readonly SAME_RATIO_SCALE_FACTOR = 4 / 3;
98
99    // overScale animation duration
100    static readonly OVER_SCALE_ANIME_DURATION = 500;
101    static readonly SHARE_TRANSITION_DURATION = 200;
102    static readonly PAGE_SHOW_ANIMATION_DURATION = 200;
103    static readonly RESERVED_DIGITS = 6;
104    static readonly CENTER_DEFAULT = 0.5;
105    static readonly NUMBER_2 = 2;
106    static readonly NUMBER_3 = 3;
107    static readonly NUMBER_12 = 12;
108    static readonly NUMBER_13 = 13;
109    static readonly DEFAULT_TRANSITION_ID: string = 'default_id';
110}