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