Skip to content

Commit

Permalink
Merge pull request #3 from muskan35/main
Browse files Browse the repository at this point in the history
CircleImageView
  • Loading branch information
Gleelakrishna authored May 30, 2022
2 parents ee3b17a + 2f36fc9 commit 8984488
Show file tree
Hide file tree
Showing 31 changed files with 2,672 additions and 0 deletions.
101 changes: 101 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
Circle Image

This library is developed to provide circle image implemented using extended typescript.

Download and Install

npm install @ohos/libcircularimage --save

For more information on OpenHarmony npm environment configuration, please refer to How to install OpenHarmony npm package .

Instructions for Use:

1. Import files and code dependencies

import {CircularImage, CircleImageModel, ClickListener} from '@ohos/libcirclularimage'

2. Initialize Model Data

model: CircleImageModel.Model = new CircleImageModel.Model();

3. Initialize the Circular Image

CircularImage({
model: this.model,
onClick: () => {
prompt.showToast({
message: 'Circular Image is clicked'
})
}
})

4. Call the corresponding function of Model and display the target image

updateModelForFirst() {

this.model.reset()

this.model.setSrcPath(this.imageSource)

this.model.setImageWidth(this.imageWidth)

this.model.setImageHeight(this.imageHeight)

this.model.setImageRadius(50)

this.model.setNeedBorder(true)

this.model.setBorderWidth(5)

this.model.setBorderColor('#0000FF')

}

5.Interface Description

model: CircleImageModel.Model = new CircleImageModel.Model();

Reset: model.reset()

Set Image source path: model.setSrcPath()

Set Image width: model.setImageWidth()

Set Image height: model.setImageHeight()

Set Image radius: model.setImageRadius()

Whether a border is required: model.setNeedBorder()

Set border width: model.setBorderWidth()

Set border color: model.setBorderColor()

Set the click event: model.setClickListener()

Directory Structure

|---- ImageCircle
| |---- libcircularimage #circle image library
| |---- src
| |---- clickListener.ets
| |---- CircleImageModel.ets
| |---- circleImage.ets
| |---- entry #Sample Code Folder
| |---- src
| |---- main
| |---- MainAbility
| |---- pages
| |---- index.ets

Compatibility

Supports OpenHarmony API version 8 and above.

Code Contribution

If you find any problems during usage, you can submit an Issue to us. Of course, we also welcome you to send us PR. Please enjoy and participate in open source freely.

Open Source Protocol

This project is based on Apache License 2.0 , please enjoy and participate in open source freely.
27 changes: 27 additions & 0 deletions build-profile.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"app": {
"signingConfigs": [],
"compileSdkVersion": 8,
"compatibleSdkVersion": 8,
"products": [
{
"name": "default",
"signingConfig": "default",
}
]
},
"modules": [
{
"name": "entry",
"srcPath": "./entry",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
}
]
}
13 changes: 13 additions & 0 deletions entry/build-profile.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"apiType": 'faMode',
"buildOption": {
},
"targets": [
{
"name": "default",
},
{
"name": "ohosTest",
}
]
}
2 changes: 2 additions & 0 deletions entry/hvigorfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
module.exports = require('@ohos/hvigor-ohos-plugin').legacyHapTasks
5 changes: 5 additions & 0 deletions entry/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions entry/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "entry",
"version": "1.0.0",
"ohos": {
"org": "huawei",
"buildTool": "hvigor",
"directoryLevel": "module"
},
"description": "example description",
"repository": {},
"license": "ISC",
"dependencies": {}
}
68 changes: 68 additions & 0 deletions entry/src/main/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"app": {
"vendor": "example",
"bundleName": "com.example.imagecircle",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"mainAbility": ".MainAbility",
"deviceType": [
"phone",
"tablet"
],
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"visible": true,
"srcPath": "MainAbility",
"name": ".MainAbility",
"srcLanguage": "ets",
"icon": "$media:icon",
"description": "$string:MainAbility_desc",
"formsEnabled": false,
"label": "$string:MainAbility_label",
"type": "page",
"launchType": "standard"
}
],
"distro": {
"moduleType": "entry",
"installationFree": false,
"deliveryWithInstall": true,
"moduleName": "entry"
},
"package": "com.example.entry",
"srcPath": "",
"name": ".entry",
"js": [
{
"mode": {
"syntax": "ets",
"type": "pageAbility"
},
"pages": [
"pages/index"
],
"name": ".MainAbility",
"window": {
"designWidth": 720,
"autoDesignWidth": false
}
}
]
}
}
23 changes: 23 additions & 0 deletions entry/src/main/ets/MainAbility/app.ets
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2022 Application Library Engineering Group.
* 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.
*/

export default {
onCreate() {
console.info('Application onCreate')
},
onDestroy() {
console.info('Application onDestroy')
},
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8984488

Please sign in to comment.