Posting an Image Comment

Overview

This sample shows how to post a comment on an image by starting the system camera.

Preview

360vp 600vp 840vp

How to Use

  1. Open the app. Touch the text box, and then touch the camera button to start the system camera.

  2. Take a photo, return the app page, and touch the button to post it.

Library Directory

├──entry/src/main/ets
│  ├──commmon/constants
│  │  └──CommonConstants.ets       // Common constants 
│  ├──pages                                  
│  │  └──ImageCommentComponent.ets // Home page                            
│  ├──model
│  │  ├──CommentModel.ets          // Comment class
│  │  └──MockCommentData.ets       // Comment data
│  ├──utils
│  │  ├──BreakpointUtils.ets       // Break point utils        
│  │  ├──CameraUtils.ets           // Start the camera  
│  │  ├──Logger.ets                // Log utils                       
│  │  └──WindowUtil.ets            // Window utils
│  ├──view
│  │  ├──CommentInputDialog.ets    // Post comment dialog box
│  │  ├──CommentItemView.ets       // Dialog box components
│  │  ├──CommentItemView.ets       // Comment components
│  │  └──ImageListView.ets         // Comment image list
│  └──ImageCommentController.ets   // Export utils
└──entry/src/main/resources        // Static resources

Required Permissions

N/A

Constraints

  1. The sample app is supported only on Huawei phones, tablets, and PC/2in1 devices running the standard system.

  2. The HarmonyOS version must be HarmonyOS 5.0.0 Release or later.

  3. The DevEco Studio version must be DevEco Studio 5.0.0 Release or later.

  4. The HarmonyOS SDK version must be HarmonyOS 5.0.0 Release or later.