# droidicon
**Repository Path**: to-you-too/droidicon
## Basic Information
- **Project Name**: droidicon
- **Description**: 本项目基于开源项目drodicon进行移植和开发,可以通过github地址: https://github.com/theDazzler/droidicon
查看安卓版项目
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 1
- **Created**: 2021-06-04
- **Last Updated**: 2021-06-04
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# drodicon
#### 介绍
本项目基于开源项目drodicon进行移植和开发,可以通过github地址:https://github.com/theDazzler/droidicon 查看。
#### 项目介绍
- 项目名称:drodicon
- 所属系列:第三方组件适配移植
- 功能:图标徽章处理工具
- 项目移植状态:完成
- 调用差异:有差异,详见demo
- 开发版本:sdk5,DevEco Studio2.1 beta3
- 原项目Doc地址:https://github.com/theDazzler/droidicon
#### 项目介绍
- 编程语言:Java
- drodicon是一款处理纯色图标的工具,同时也提供了一些常用图标。
 
#### 安装教程
##### 方式一:
- 1.下载har包[droidicon-1.0.2.har ](https://repo.maven.apache.org/maven2/com/gitee/archermind-ti/droidicon/1.0.2/)。
- 2.启动 DevEco Studio,将下载的har包,导入工程目录“entry->libs”下。
- 3.在moudle级别下的build.gradle文件中添加依赖,在dependences标签中增加对libs目录下jar包的引用。
```
dependencies {
implementation fileTree(dir: 'libs', include: ['.jar', '.har'])
...
}
```
##### 方式二:
在project的build.gradle中添加mavenCentral()的引用
```
repositories {
...
mavenCentral()
...
}
```
在entry的build.gradle中添加依赖
```
dependencies {
...
implementation 'com.gitee.archermind-ti:droidicon:1.0.2'
...
}
```
在sdk4,DevEco Studio2.1 beta3下项目可直接运行
如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件,
并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下
#### 使用说明
使用已有图标时,可直接在布局文件中使用:
```xml
```
使用通用图标时,有两种使用方式:
方式一:
xml中直接配置使用:
```xml
```
方式二:
自行配置图标及背景时,可通过xml文件结合java代码使用:
xml:
```xml
```
java:
```java
DroidiconBadge bug = (DroidiconBadge)findComponentById(ResourceTable.Id_bug);
bug.setResId(ResourceTable.Media_fa_bug)//图片资源设置
.setIconColor(0x7EFFFFFF)//图标颜色设置
.setBackgroundColor(0xFF2ecc71)//背景颜色设置
.setIconPadding(90)//图标离边的距离设置
.showCircularBadge(true)//是否圆形显示
.invalidate();//组件刷新
```
#### 版本迭代
- v1.0.2 库包名修改,部分类名修改
- v1.0.1 组件xml属性添加
- v1.0.0 初始版本
#### 版权和许可信息
- Apache Licence
```
Copyright (C) 2017
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
```