1/* 2 * Copyright (c) 2023 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 16import type { CameraPlatformCapability } from '../../camera/CameraPlatformCapability'; 17import type { CameraId } from '../../setting/settingitem/CameraId'; 18import type { AnyAction } from '../../redux/core/redux'; 19 20interface Data { 21 [prop: string]: any; 22} 23 24export enum UiStateMode { 25 NONE, 26 EXCLUDE_PREVIEW 27} 28 29export interface ActionData extends AnyAction { 30 data: Data 31} 32 33export class Action { 34 35 // Context 36 public static readonly ACTION_INIT_FOOT_BAR_WIDTH = 'ACTION_INIT_FOOT_BAR_WIDTH'; 37 public static readonly ACTION_INIT_FOOT_BAR_HEIGHT = 'ACTION_INIT_FOOT_BAR_HEIGHT'; 38 public static readonly ACTION_SET_PERMISSION_FLAG = 'ACTION_SET_PERMISSION_FLAG'; 39 public static readonly ACTION_INIT_ACTION = 'ACTION_INIT_ACTION'; 40 public static readonly ACTION_KEEP_SCREEN_ON = 'ACTION_KEEP_SCREEN_ON'; 41 public static readonly ACTION_UPDATE_INIT_SHOW_FLAG = 'ACTION_UPDATE_INIT_SHOW_FLAG'; 42 43 // Camera 44 public static readonly ACTION_INIT = 'ACTION_INIT'; 45 public static readonly ACTION_INIT_DONE = 'ACTION_INIT_DONE'; 46 public static readonly ACTION_SWITCH_CAMERA = 'ACTION_SWITCH_CAMERA'; 47 public static readonly ACTION_SET_CAMERA_POSITION = 'ACTION_SET_CAMERA_POSITION'; 48 public static readonly ACTION_UPDATE_CAMERA_POSITION = 'ACTION_UPDATE_CAMERA_POSITION'; 49 public static readonly ACTION_CLOSE_CAMERA = 'ACTION_CLOSE_CAMERA'; 50 public static readonly ACTION_UPDATE_CAMERA_STATUS = 'ACTION_UPDATE_CAMERA_STATUS'; 51 52 // Mode 53 public static readonly ACTION_INIT_MODE = 'ACTION_INIT_MODE'; 54 public static readonly ACTION_CHANGE_MODE = 'ACTION_CHANGE_MODE'; 55 public static readonly ACTION_SET_MODE = 'ACTION_SET_MODE'; 56 public static readonly ACTION_UPDATE_MODE = 'ACTION_UPDATE_MODE'; 57 public static readonly ACTION_ON_MODE_CHANGED = 'ACTION_ON_MODE_CHANGED'; 58 public static readonly ACTION_THIRD_PARTY_CALL = 'ACTION_THIRD_PARTY_CALL'; 59 public static readonly ACTION_FA_CALL = 'ACTION_FA_CALL'; 60 public static readonly ACTION_SWIPE_MODE_DONE = 'ACTION_SWIPE_MODE_DONE'; 61 62 // Preview 63 public static readonly ACTION_PREPARE_SURFACE = 'ACTION_PREPARE_SURFACE'; 64 public static readonly ACTION_START_PREVIEW = 'ACTION_START_PREVIEW'; 65 public static readonly ACTION_RESTART_PREVIEW = 'ACTION_RESTART_PREVIEW'; 66 public static readonly ACTION_UPDATE_SURFACE_ID = 'ACTION_UPDATE_SURFACE_ID'; 67 public static readonly ACTION_CHANGE_X_COMPONENT_SIZE = 'ACTION_CHANGE_X_COMPONENT_SIZE'; 68 public static readonly ACTION_UPDATE_SHOW_PREVIEW_FLAG = 'ACTION_UPDATE_SHOW_PREVIEW_FLAG'; 69 70 // Capture 71 public static readonly ACTION_CAPTURE = 'ACTION_CAPTURE'; 72 public static readonly ACTION_CAPTURE_DONE = 'ACTION_CAPTURE_DONE'; 73 public static readonly ACTION_CAPTURE_ERROR = 'ACTION_CAPTURE_ERROR'; 74 public static readonly ACTION_THUMBNAIL = 'ACTION_THUMBNAIL'; 75 public static readonly ACTION_UPDATE_THUMBNAIL = 'ACTION_UPDATE_THUMBNAIL'; 76 public static readonly ACTION_LOAD_THUMBNAIL = 'ACTION_LOAD_THUMBNAIL'; 77 public static readonly ACTION_RELOAD_THUMBNAIL = 'ACTION_RELOAD_THUMBNAIL'; 78 79 // Record 80 public static readonly ACTION_RECORD_START = 'ACTION_RECORD_START'; 81 public static readonly ACTION_RECORD_PAUSE = 'ACTION_RECORD_PAUSE'; 82 public static readonly ACTION_RECORD_RESUME = 'ACTION_RECORD_RESUME'; 83 public static readonly ACTION_RECORD_STOP = 'ACTION_RECORD_STOP'; 84 public static readonly ACTION_RECORD_DONE = 'ACTION_RECORD_DONE'; 85 public static readonly ACTION_RECORD_ERROR = 'ACTION_RECORD_ERROR'; 86 public static readonly ACTION_START_VIDEO_FLAG = 'ACTION_START_VIDEO_FLAG'; 87 public static readonly ACTION_UPDATE_RECORDING_TIME = 'ACTION_UPDATE_RECORDING_TIME'; 88 public static readonly ACTION_UPDATE_RECORDING_TIME_DISPLAY = 'ACTION_UPDATE_RECORDING_TIME_DISPLAY'; 89 public static readonly ACTION_UPDATE_VIDEO_STATE = 'ACTION_UPDATE_VIDEO_STATE'; 90 public static readonly ACTION_UPDATE_RECORDING_PAUSED = 'ACTION_UPDATE_RECORDING_PAUSED'; 91 public static readonly ACTION_UPDATE_VIDEO_URI = 'ACTION_UPDATE_VIDEO_URI'; 92 93 // Setting 94 public static readonly ACTION_CHANGE_IMAGE_SIZE = 'ACTION_CHANGE_IMAGE_SIZE'; 95 public static readonly ACTION_CHANGE_VIDEO_SIZE = 'ACTION_CHANGE_VIDEO_SIZE'; 96 public static readonly ACTION_CHANGE_ZOOM_RATIO = 'ACTION_CHANGE_ZOOM_RATIO'; 97 public static readonly ACTION_CHANGE_TIME_LAPSE = 'ACTION_CHANGE_TIME_LAPSE'; 98 public static readonly ACTION_ASSISTIVE_GRID_VIEW = 'ACTION_ASSISTIVE_GRID_VIEW'; 99 100 // Device error 101 public static readonly ACTION_DEVICE_ERROR = 'ACTION_DEVICE_ERROR'; 102 103 // Ui 104 public static readonly ACTION_UI_STATE = 'ACTION_UI_STATE'; 105 public static readonly ACTION_INIT_ZOOM_RATIO = 'ACTION_INIT_ZOOM_RATIO'; 106 public static readonly ACTION_RESET_ZOOM_RATIO = 'ACTION_RESET_ZOOM_RATIO'; 107 public static readonly ACTION_UPDATE_ZOOM_PERCENTAGE = 'ACTION_UPDATE_ZOOM_PERCENTAGE'; 108 public static readonly ACTION_UPDATE_SHOW_BIG_TEXT_FLAG = 'ACTION_UPDATE_SHOW_BIG_TEXT_FLAG'; 109 public static readonly ACTION_UPDATE_SHOW_ZOOM_TEXT_FLAG = 'ACTION_UPDATE_SHOW_ZOOM_TEXT_FLAG'; 110 public static readonly ACTION_UPDATE_PHOTO_ZOOM_DETAILS_FLAG = 'ACTION_UPDATE_PHOTO_ZOOM_DETAILS_FLAG'; 111 public static readonly ACTION_UPDATE_BASE_ZOOM = 'ACTION_UPDATE_BASE_ZOOM'; 112 public static readonly ACTION_UPDATE_PINCH_GESTURE_FLAG = 'ACTION_UPDATE_PINCH_GESTURE_FLAG'; 113 public static readonly ACTION_UPDATE_PINCH_GESTURE_TIMER_ID = 'ACTION_UPDATE_PINCH_GESTURE_TIMER_ID'; 114 public static readonly ACTION_UPDATE_MODE_INDEX = 'ACTION_UPDATE_MODE_INDEX'; 115 public static readonly ACTION_UPDATE_SMALL_VIDEO_TIMER_VISIBLE = 'ACTION_UPDATE_SMALL_VIDEO_TIMER_VISIBLE'; 116 public static readonly ACTION_UPDATE_BIG_VIDEO_TIMER_VISIBLE = 'ACTION_UPDATE_BIG_VIDEO_TIMER_VISIBLE'; 117 public static readonly ACTION_UPDATE_RECORDING_SPOT_VISIBLE = 'ACTION_UPDATE_RECORDING_SPOT_VISIBLE'; 118 public static readonly ACTION_UPDATE_OPACITY_VALUE = 'ACTION_UPDATE_OPACITY_VALUE'; 119 public static readonly ACTION_UPDATE_SHOW_PRESS_SCROLL_DETAIL_PHOTO_BUTTON = 'ACTION_UPDATE_SHOW_PRESS_SCROLL_DETAIL_PHOTO_BUTTON'; 120 public static readonly ACTION_UPDATE_SCROLL_DETAILS_BOX = 'ACTION_UPDATE_SCROLL_DETAILS_BOX'; 121 public static readonly ACTION_INIT_PHOTO_DETAILS_OFFSET_X = 'ACTION_INIT_PHOTO_DETAILS_OFFSET_X'; 122 public static readonly ACTION_UPDATE_PHOTO_DETAILS_OFFSET_X = 'ACTION_UPDATE_PHOTO_DETAILS_OFFSET_X'; 123 public static readonly ACTION_UPDATE_CAPTURE_BTN_SCALE = 'ACTION_UPDATE_CAPTURE_BTN_SCALE'; 124 public static readonly ACTION_UPDATE_SHOW_FLASH_BLACK_FLAG = 'ACTION_UPDATE_SHOW_FLASH_BLACK_FLAG'; 125 public static readonly ACTION_UPDATE_SHUTTER_ICON = 'ACTION_UPDATE_SHUTTER_ICON'; 126 public static readonly ACTION_UPDATE_BIG_TEXT_OPACITY = 'ACTION_UPDATE_BIG_TEXT_OPACITY'; 127 public static readonly ACTION_UPDATE_MODE_BAR_ITEM_WIDTH = 'ACTION_UPDATE_MODE_BAR_ITEM_WIDTH'; 128 public static readonly ACTION_UPDATE_SHOW_TAB_BAR_WIDTH = 'ACTION_UPDATE_SHOW_TAB_BAR_WIDTH'; 129 public static readonly ACTION_UPDATE_SHOW_MORE_LIST = 'ACTION_UPDATE_SHOW_MORE_LIST'; 130 public static readonly ACTION_UPDATE_OPACITY_TAB_BAR = 'ACTION_UPDATE_OPACITY_TAB_BAR'; 131 public static readonly ACTION_SWIPE_MODE = 'ACTION_SWIPE_MODE'; 132 public static readonly ACTION_SHOW_ZOOM_LABEL_VALUE = 'ACTION_SHOW_ZOOM_LABEL_VALUE'; 133 public static readonly ACTION_UPDATE_SHOW_PINCH = 'ACTION_UPDATE_SHOW_PINCH'; 134 public static readonly ACTION_CLOSE_DIALOG = 'ACTION_CLOSE_DIALOG'; 135 public static readonly ACTION_SHOW_SETTING_VIEW = 'ACTION_SHOW_SETTING_VIEW'; 136 public static readonly ACTION_CAPTURE_PHOTO_OUTPUT = 'ACTION_CAPTURE_PHOTO_OUTPUT'; 137 138 139 /** CONTEXT METHODS LIST **/ 140 141 public static initFootBarWidth(footBarWidth: number): ActionData { 142 return { 143 type: Action.ACTION_INIT_FOOT_BAR_WIDTH, 144 data: { footBarWidth: footBarWidth } 145 } 146 } 147 148 public static initFootBarHeight(footBarHeight: number): ActionData { 149 return { 150 type: Action.ACTION_INIT_FOOT_BAR_HEIGHT, 151 data: { footBarHeight: footBarHeight } 152 } 153 } 154 155 public static setPermissionFlag(permissionFlag: boolean): ActionData { 156 return { 157 type: Action.ACTION_SET_PERMISSION_FLAG, 158 data: { permissionFlag: permissionFlag } 159 } 160 } 161 162 public static initAction(action: string): ActionData { 163 return { 164 type: Action.ACTION_INIT_ACTION, 165 data: { action: action } 166 } 167 } 168 169 public static updateScreenStatus(isKeepScreenOn: boolean): ActionData { 170 return { 171 type: Action.ACTION_KEEP_SCREEN_ON, 172 data: { isKeepScreenOn: isKeepScreenOn } 173 } 174 } 175 176 public static updateInitShowFlag(initShowFlag: boolean): ActionData { 177 return { 178 type: Action.ACTION_UPDATE_INIT_SHOW_FLAG, 179 data: { initShowFlag: initShowFlag } 180 } 181 } 182 183 184 /** CAMERA METHODS LIST **/ 185 186 public static initCamera(cameraId: CameraId, mode: string): ActionData { 187 return { 188 type: Action.ACTION_INIT, 189 data: { cameraId: cameraId, mode: mode } 190 } 191 } 192 193 public static initCameraDone(platformCapability: CameraPlatformCapability): ActionData { 194 return { 195 type: Action.ACTION_INIT_DONE, 196 data: { platformCapability: platformCapability } 197 } 198 } 199 200 public static switchCamera(cameraId: string, curMode?: string): ActionData { 201 return { 202 type: Action.ACTION_SWITCH_CAMERA, 203 data: { cameraId: cameraId, curMode: curMode } 204 } 205 } 206 207 public static setCameraPosition(cameraPosition: string): ActionData { 208 return { 209 type: Action.ACTION_SET_CAMERA_POSITION, 210 data: { cameraPosition: cameraPosition } 211 } 212 } 213 214 public static updateCameraPosition(cameraPosition: string): ActionData { 215 return { 216 type: Action.ACTION_UPDATE_CAMERA_POSITION, 217 data: { cameraPosition: cameraPosition } 218 } 219 } 220 221 public static updateCameraStatus(): ActionData { 222 return { 223 type: Action.ACTION_UPDATE_CAMERA_STATUS, 224 data: {} 225 } 226 } 227 228 public static close(): ActionData { 229 return { 230 type: Action.ACTION_CLOSE_CAMERA, 231 data: {} 232 } 233 } 234 235 236 /** MODE METHODS LIST**/ 237 238 public static initMode(mode: string): ActionData { 239 return { 240 type: Action.ACTION_INIT_MODE, 241 data: { mode: mode } 242 } 243 } 244 245 public static changeMode(mode: string): ActionData { 246 return { 247 type: Action.ACTION_CHANGE_MODE, 248 data: { mode: mode } 249 } 250 } 251 252 public static setMode(mode: string): ActionData { 253 return { 254 type: Action.ACTION_SET_MODE, 255 data: { mode: mode } 256 } 257 } 258 259 public static updateMode(mode: string): ActionData { 260 return { 261 type: Action.ACTION_UPDATE_MODE, 262 data: { mode: mode } 263 } 264 } 265 266 public static onModeChanged(mode: string): ActionData { 267 return { 268 type: Action.ACTION_ON_MODE_CHANGED, 269 data: { mode: mode } 270 } 271 } 272 273 public static thirdPartyCall(isThirdPartyCall: boolean, action: string): ActionData { 274 return { 275 type: Action.ACTION_THIRD_PARTY_CALL, 276 data: { isThirdPartyCall: isThirdPartyCall, action: action } 277 } 278 } 279 280 public static faCall(isFaCall: boolean): ActionData { 281 return { 282 type: Action.ACTION_FA_CALL, 283 data: { isFaCall: isFaCall} 284 } 285 } 286 287 288 /** PREVIEW METHODS LIST **/ 289 290 public static prepareSurface(surfaceId: number): ActionData { 291 return { 292 type: Action.ACTION_PREPARE_SURFACE, 293 data: { surfaceId: surfaceId } 294 } 295 } 296 297 public static startPreview(zoomRatio?: number): ActionData { 298 return { 299 type: Action.ACTION_START_PREVIEW, 300 data: { zoomRatio: zoomRatio } 301 } 302 } 303 304 public static reStartPreview(zoomRatio?: number): ActionData { 305 return { 306 type: Action.ACTION_RESTART_PREVIEW, 307 data: { zoomRatio: zoomRatio } 308 } 309 } 310 311 public static updateSurfaceId(surfaceId: number): ActionData { 312 return { 313 type: Action.ACTION_UPDATE_SURFACE_ID, 314 data: { surfaceId: surfaceId } 315 } 316 } 317 318 public static changeXComponentSize(xComponentWidth: number, xComponentHeight: number): ActionData { 319 return { 320 type: Action.ACTION_CHANGE_X_COMPONENT_SIZE, 321 data: { xComponentWidth: xComponentWidth, xComponentHeight: xComponentHeight } 322 } 323 } 324 325 public static updateShowPreviewFlag(isShowPreview: boolean): ActionData { 326 return { 327 type: Action.ACTION_UPDATE_SHOW_PREVIEW_FLAG, 328 data: { isShowPreview: isShowPreview } 329 } 330 } 331 332 333 /** CAPTURE METHODS LIST **/ 334 335 public static capture(): ActionData { 336 return { 337 type: Action.ACTION_CAPTURE, 338 data: {} 339 } 340 } 341 342 public static capturePhotoOutput(): ActionData { 343 return { 344 isEvent: true, 345 type: Action.ACTION_CAPTURE_PHOTO_OUTPUT, 346 data: {} 347 } 348 } 349 350 public static captureDone(thumbnail): ActionData { 351 return { 352 type: Action.ACTION_THUMBNAIL, 353 data: { thumbnail: thumbnail } 354 } 355 } 356 357 public static captureError(): ActionData { 358 return { 359 type: Action.ACTION_CAPTURE_ERROR, 360 data: {} 361 } 362 } 363 364 public static thumbnail(thumbnailUri): ActionData { 365 return { 366 type: Action.ACTION_THUMBNAIL, 367 data: { thumbnail: thumbnailUri } 368 } 369 } 370 371 public static updateThumbnail(thumbnailPixelMap, resourceUri): ActionData { 372 return { 373 type: Action.ACTION_UPDATE_THUMBNAIL, 374 data: { thumbnail: thumbnailPixelMap, resourceUri: resourceUri } 375 } 376 } 377 378 public static loadThumbnail(thumbnailPixelMap): ActionData { 379 return { 380 type: Action.ACTION_LOAD_THUMBNAIL, 381 data: { thumbnail: thumbnailPixelMap } 382 } 383 } 384 385 public static reloadThumbnail(): ActionData { 386 return { 387 type: Action.ACTION_RELOAD_THUMBNAIL, 388 data: {} 389 } 390 } 391 392 393 /** RECORD METHODS LIST **/ 394 395 public static startRecording(): ActionData { 396 return { 397 type: Action.ACTION_RECORD_START, 398 data: {} 399 } 400 } 401 402 public static pauseRecording(): ActionData { 403 return { 404 type: Action.ACTION_RECORD_PAUSE, 405 data: {} 406 } 407 } 408 409 public static resumeRecording(): ActionData { 410 return { 411 type: Action.ACTION_RECORD_RESUME, 412 data: {} 413 } 414 } 415 416 public static stopRecording(): ActionData { 417 return { 418 type: Action.ACTION_RECORD_STOP, 419 data: {} 420 } 421 } 422 423 public static recordDone(thumbnail): ActionData { 424 return { 425 type: Action.ACTION_RECORD_STOP, 426 data: { thumbnail: thumbnail } 427 } 428 } 429 430 public static recordError(): ActionData { 431 return { 432 type: Action.ACTION_RECORD_ERROR, 433 data: {} 434 } 435 } 436 437 public static startVideoFlag(isStartVideoFlag: boolean): ActionData { 438 return { 439 type: Action.ACTION_START_VIDEO_FLAG, 440 data: { isStartVideo: isStartVideoFlag } 441 } 442 } 443 444 public static updateRecordingTime(recordingTime: number): ActionData { 445 return { 446 type: Action.ACTION_UPDATE_RECORDING_TIME, 447 data: { recordingTime: recordingTime } 448 } 449 } 450 451 public static updateRecordingTimeDisplay(recordingTimeDisplay: string): ActionData { 452 return { 453 type: Action.ACTION_UPDATE_RECORDING_TIME_DISPLAY, 454 data: { recordingTimeDisplay: recordingTimeDisplay } 455 } 456 } 457 458 public static updateVideoState(videoState: string): ActionData { 459 return { 460 type: Action.ACTION_UPDATE_VIDEO_STATE, 461 data: { videoState: videoState } 462 } 463 } 464 465 public static updateRecordingPaused(isRecordingPaused: boolean): ActionData { 466 return { 467 type: Action.ACTION_UPDATE_RECORDING_PAUSED, 468 data: { isRecordingPaused: isRecordingPaused } 469 } 470 } 471 472 public static updateVideoUri(videoUri: string): ActionData { 473 return { 474 type: Action.ACTION_UPDATE_VIDEO_URI, 475 data: { videoUri: videoUri } 476 } 477 } 478 479 480 /** SETTING METHODS LIST **/ 481 482 public static changeImageSize(imageSize): ActionData { 483 return { 484 type: Action.ACTION_CHANGE_IMAGE_SIZE, 485 data: { imageSize: imageSize } 486 } 487 } 488 489 public static changeVideoSize(videoSize): ActionData { 490 return { 491 type: Action.ACTION_CHANGE_VIDEO_SIZE, 492 data: { videoSize: videoSize } 493 } 494 } 495 496 public static changeZoomRatio(zoomRatio: number): ActionData { 497 return { 498 type: Action.ACTION_CHANGE_ZOOM_RATIO, 499 data: { zoomRatio: zoomRatio } 500 } 501 } 502 503 public static changeTimeLapse(isShowtimeLapse: boolean): ActionData { 504 return { 505 type: Action.ACTION_CHANGE_TIME_LAPSE, 506 data: { isShowtimeLapse: isShowtimeLapse} 507 } 508 } 509 510 public static swipeModeChangeDone(modeChangeDone: boolean): ActionData { 511 return { 512 type: Action.ACTION_SWIPE_MODE_DONE, 513 data: { modeChangeDone: modeChangeDone} 514 } 515 } 516 517 public static assistiveGridView(isAssGridViewShow: number): ActionData { 518 return { 519 type: Action.ACTION_ASSISTIVE_GRID_VIEW, 520 data: { isAssGridViewShow: isAssGridViewShow } 521 } 522 } 523 524 525 /** DEVICE ERROR METHODS LIST **/ 526 527 public static deviceError(info): ActionData { 528 return { 529 type: Action.ACTION_DEVICE_ERROR, 530 data: { info: info } 531 } 532 } 533 534 535 /** UI METHODS LIST **/ 536 537 public static uiState(enable: boolean): ActionData { 538 return { 539 type: Action.ACTION_UI_STATE, 540 data: { enable: enable, uiStateMode: UiStateMode.NONE } 541 } 542 } 543 544 public static uiStateWithMode(enable: boolean, uiStateMode: UiStateMode): ActionData { 545 return { 546 type: Action.ACTION_UI_STATE, 547 data: { enable: enable, uiStateMode: uiStateMode } 548 } 549 } 550 551 public static initZoomRatio(min: number, max: number): ActionData { 552 return { 553 type: Action.ACTION_INIT_ZOOM_RATIO, 554 data: { minZoomRatio: min, maxZoomRatio: max } 555 } 556 } 557 558 public static resetZoomRatio(zoomRatio: number): ActionData { 559 return { 560 type: Action.ACTION_RESET_ZOOM_RATIO, 561 data: { zoomRatio: zoomRatio } 562 } 563 } 564 565 public static updateZoomPercentage(zoomPercentage: number): ActionData { 566 return { 567 type: Action.ACTION_UPDATE_ZOOM_PERCENTAGE, 568 data: { zoomPercentage: zoomPercentage } 569 } 570 } 571 572 public static updateShowBigTextFlag(isShowBigText: boolean): ActionData { 573 return { 574 type: Action.ACTION_UPDATE_SHOW_BIG_TEXT_FLAG, 575 data: { isShowBigText: isShowBigText } 576 } 577 } 578 579 public static updateShowZoomTextFlag(isShowZoomText: boolean): ActionData { 580 return { 581 type: Action.ACTION_UPDATE_SHOW_ZOOM_TEXT_FLAG, 582 data: { isShowZoomText: isShowZoomText } 583 } 584 } 585 586 public static updatePhotoZoomDetailsFlag(isPhotoZoomDetails: boolean): ActionData { 587 return { 588 type: Action.ACTION_UPDATE_PHOTO_ZOOM_DETAILS_FLAG, 589 data: { isPhotoZoomDetails: isPhotoZoomDetails } 590 } 591 } 592 593 public static updateBaseZoom(baseZoom: number): ActionData { 594 return { 595 type: Action.ACTION_UPDATE_BASE_ZOOM, 596 data: { baseZoom: baseZoom } 597 } 598 } 599 600 public static updatePinchGestureFlag(isPinchGesture: boolean): ActionData { 601 return { 602 type: Action.ACTION_UPDATE_PINCH_GESTURE_FLAG, 603 data: { isPinchGesture: isPinchGesture } 604 } 605 } 606 607 public static updatePinchGestureTimerId(pinchGestureTimerId: number): ActionData { 608 return { 609 type: Action.ACTION_UPDATE_PINCH_GESTURE_TIMER_ID, 610 data: { pinchGestureTimerId: pinchGestureTimerId } 611 } 612 } 613 614 public static updateModeIndex(modeIndex: number): ActionData { 615 return { 616 type: Action.ACTION_UPDATE_MODE_INDEX, 617 data: { modeIndex: modeIndex } 618 } 619 } 620 621 public static updateSmallVideoTimerVisible(visible: boolean): ActionData { 622 return { 623 type: Action.ACTION_UPDATE_SMALL_VIDEO_TIMER_VISIBLE, 624 data: { isSmallVideoTimerVisible: visible } 625 } 626 } 627 628 public static updateBigVideoTimerVisible(visible: boolean): ActionData { 629 return { 630 type: Action.ACTION_UPDATE_BIG_VIDEO_TIMER_VISIBLE, 631 data: { isBigVideoTimerVisible: visible } 632 } 633 } 634 635 public static updateRecordingSpotVisible(visible: boolean): ActionData { 636 return { 637 type: Action.ACTION_UPDATE_RECORDING_SPOT_VISIBLE, 638 data: { isRecordingSpotVisible: visible } 639 } 640 } 641 642 public static updateOpacityValue(opacityValue: number): ActionData { 643 return { 644 type: Action.ACTION_UPDATE_OPACITY_VALUE, 645 data: { opacityValue: opacityValue } 646 } 647 } 648 649 public static updateShowPressScrollDetailPhotoButton(isShow: boolean): ActionData { 650 return { 651 type: Action.ACTION_UPDATE_SHOW_PRESS_SCROLL_DETAIL_PHOTO_BUTTON, 652 data: { isShowPressScrollDetailPhotoButton: isShow } 653 } 654 } 655 656 public static updateScrollDetailsBox(value: number): ActionData { 657 return { 658 type: Action.ACTION_UPDATE_SCROLL_DETAILS_BOX, 659 data: { scrollDetailsBox: value } 660 } 661 } 662 663 public static initPhotoDetailsOffsetX(offsetX: number): ActionData { 664 return { 665 type: Action.ACTION_INIT_PHOTO_DETAILS_OFFSET_X, 666 data: { photoDetailsOffsetXInit: offsetX } 667 } 668 } 669 670 public static updatePhotoDetailsOffsetX(offsetX: number): ActionData { 671 return { 672 type: Action.ACTION_UPDATE_PHOTO_DETAILS_OFFSET_X, 673 data: { photoDetailsOffsetX: offsetX } 674 } 675 } 676 677 public static updateCaptureBtnScale(scale: number): ActionData { 678 return { 679 type: Action.ACTION_UPDATE_CAPTURE_BTN_SCALE, 680 data: { captureBtnScale: scale } 681 } 682 } 683 684 public static updateShowFlashBlackFlag(flag: boolean): ActionData { 685 return { 686 type: Action.ACTION_UPDATE_SHOW_FLASH_BLACK_FLAG, 687 data: { isShowFlashBlack: flag } 688 } 689 } 690 691 public static updateShutterIcon(icon: Resource): ActionData { 692 return { 693 type: Action.ACTION_UPDATE_SHUTTER_ICON, 694 data: { shutterIcon: icon } 695 } 696 } 697 698 public static updateBigTextOpacity(opacity: number): ActionData { 699 return { 700 type: Action.ACTION_UPDATE_BIG_TEXT_OPACITY, 701 data: { bigTextOpacity: opacity } 702 } 703 } 704 705 public static updateModeBarItemWidth(width: number): ActionData { 706 return { 707 type: Action.ACTION_UPDATE_MODE_BAR_ITEM_WIDTH, 708 data: { modeBarItemWidth: width } 709 } 710 } 711 712 public static updateShowTabBarWidth(widthTabBar: string): ActionData { 713 return { 714 type: Action.ACTION_UPDATE_SHOW_TAB_BAR_WIDTH, 715 data: { widthTabBar: widthTabBar } 716 } 717 } 718 719 public static updateShowMoreList(isShowMoreList: boolean): ActionData { 720 return { 721 type: Action.ACTION_UPDATE_SHOW_MORE_LIST, 722 data: { isShowMoreList: isShowMoreList } 723 } 724 } 725 726 public static updateOpacityForTabBar(opacity: number): ActionData { 727 return { 728 type: Action.ACTION_UPDATE_OPACITY_TAB_BAR, 729 data: { opacityValueForTabBar: opacity } 730 } 731 } 732 733 public static swipeChangeMode(swipeModeIndex: number): ActionData { 734 return { 735 type: Action.ACTION_SWIPE_MODE, 736 data: { swipeModeIndex: swipeModeIndex } 737 } 738 } 739 740 public static updateShowZoomLabelValue(flag: boolean): ActionData { 741 return { 742 type: Action.ACTION_SHOW_ZOOM_LABEL_VALUE, 743 data: { showZoomLabelValue: flag } 744 } 745 } 746 747 public static updateShowPinch(isShowPinch: boolean): ActionData { 748 return { 749 type: Action.ACTION_UPDATE_SHOW_PINCH, 750 data: { isShowPinch: isShowPinch } 751 } 752 } 753 754 public static closeDialog(isCloseFlag: boolean): ActionData { 755 return { 756 type: Action.ACTION_CLOSE_DIALOG, 757 data: { isCloseFlag: isCloseFlag } 758 } 759 } 760 761 public static showSettingView(isShowSettingView: boolean): ActionData { 762 return { 763 type: Action.ACTION_SHOW_SETTING_VIEW, 764 data: { isShowSettingView: isShowSettingView } 765 } 766 } 767} 768