# SmileyRating **Repository Path**: HarmonyOS-tpc/SmileyRating ## Basic Information - **Project Name**: SmileyRating - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-09-17 - **Last Updated**: 2023-04-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SmileyRating ## Introduction: SmileyRating is a simple rating bar for openharmony. It displays animated smileys as rating icon, drawn completely using canvas. ## Usage Instructions: ##### Smile Rating with animation: Basic 5 smileys are displayed in landscape orientation and supports smiley selection with animation. ###### xml ###### java mSmileRating = (SmileRating) findComponentById(ResourceTable.Id_ratingView); public void onSmileySelected(@BaseRating.Smiley int smiley, boolean reselected) { switch (smiley) { case SmileRating.BAD: LogUtil.info(TAG, "Bad"); break; case SmileRating.GOOD: LogUtil.info(TAG, "Good"); break; case SmileRating.GREAT: LogUtil.info(TAG, "Great"); break; case SmileRating.OKAY: LogUtil.info(TAG, "Okay"); break; case SmileRating.TERRIBLE: LogUtil.info(TAG, "Terrible"); break; case SmileRating.NONE: LogUtil.info(TAG, "None"); break; } } ##### Smiley Rating with animation: Basic 5 smileys are displayed in landscape orientation with reset option and smiley selection with animation. ###### xml ###### java To set face color for smiley : mSmileyRating.setFaceColor(SmileyRating.Type.GREAT, Color.BLUE.getValue()); mSmileyRating.setFaceBackgroundColor(SmileyRating.Type.GREAT, Color.RED.getValue()) ##### Smiley View with gesture support: Display of one Smiley that occupies the full Screen. By swiping left to Right Smiley should change from one Smiley to another. ###### xml ##### Smiley Rating in recycler list view List: Basic 5 smileys in recycler list view. ###### xml ## Installation instruction Method 1: Generate the .har package through the library and add the .har package to the libs folder. Add the following code to the entry gradle: ``` implementation fileTree (dir: 'libs', include: ['*.jar', '*.har']) ``` Method 2: For using as a library project, add the following code to the entry gradle: ``` implementation project(path: ': smilerating) ``` Method 3: For using SmileyRating from a remote repository in separate application, add the below dependency in entry/build.gradle file. ``` implementation 'io.openharmony.tpc.thirdlib:SmileyRating:1.0.0' ``` ## License Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.