-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from muskan35/main
CircleImageView
- Loading branch information
Showing
31 changed files
with
2,672 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"apiType": 'faMode', | ||
"buildOption": { | ||
}, | ||
"targets": [ | ||
{ | ||
"name": "default", | ||
}, | ||
{ | ||
"name": "ohosTest", | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.