Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
sumimakito authored Aug 25, 2017
2 parents cef3844 + 4ed2531 commit 58bbcd9
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 100 deletions.
97 changes: 45 additions & 52 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
# AwesomeQRCode
<img alt="Special, thus awesome." src="art/banner.png" style="max-width: 600px;">

[![](https://jitpack.io/v/SumiMakito/AwesomeQRCode.svg)](https://jitpack.io/#SumiMakito/AwesomeQRCode)
[![license](https://img.shields.io/github/license/SumiMakito/AwesomeQRCode.svg)](https://github.com/SumiMakito/AwesomeQRCode/blob/master/LICENSE)
[![release](https://img.shields.io/github/release/SumiMakito/AwesomeQRCode.svg)](https://github.com/SumiMakito/AwesomeQRCode/releases/latest)
[![license](https://img.shields.io/github/license/SumiMakito/AwesomeQRCode.svg)](https://github.com/SumiMakito/AwesomeQRCode/blob/master/LICENSE)
![](https://img.shields.io/badge/made%20with-%3C3-orange.svg)

一个优雅的<del>(不起眼的)</del> QR 二维码生成器

[Kotlin 编写的 AwesomeQRCode](https://github.com/SumiMakito/AwesomeQRCode-Kotlin)

[Swithc to English Version?](README.md)
AwesomeQRCode - 一个优雅的<del>(不起眼的)</del> QR 二维码生成器

<img alt="Special, thus awesome." src="art/banner.png" style="max-width: 600px;">
> [Swithc to English Version?](README.md)
### 好耶! 演示应用!
## 好耶 演示应用

<a href="https://play.google.com/store/apps/details?id=com.github.sumimakito.awesomeqrsample" target="_blank"><img src="art/play_store_badge.png" alt="Google Play Store" width="200"></a>

### 样例
## 样例

> 拿起你的手机扫描下面的二维码试试吧!
> 拿起你的手机扫描下面的二维码试试吧
样例 1 | 样例 2 | 样例 3
------------ | ------------- | -------------
<img src="art/awesome-qr-1.png" width="400"> | <img src="art/awesome-qr-2.png" width="400"> | <img src="art/awesome-qr-3.png" width="400">


使用圆点做数据点 | 二值化处理 | 带有 Logo
------------ | ------------- | -------------
<img src="art/awesome-qr-4.png" width="400"> | <img src="art/awesome-qr-5.png" width="400"> | <img src="art/awesome-qr-6.png" width="400">

### 添加依赖项
## 引用

> <del>万事开头难, 补全就好啦!</del>
在项目根目录下的 build.gradle 中补充以下内容:
在项目根目录下的 build.gradle 中补充以下内容,以添加依赖项:

```
allprojects {
repositories {
Expand All @@ -42,21 +40,21 @@ allprojects {
}
```

在应用模块层级下的 build.gradle 中补充以下内容:
在应用模块层级下的 build.gradle 中补充以下内容:

```
dependencies {
compile 'com.github.SumiMakito:AwesomeQRCode:1.0.5'
}
```

### 快速上手
## 快速上手

#### "人家只想要 Bitmap 嘛":
### 1. "人家只想要 Bitmap 嘛"

> <del>原来乃只想要 Bitmap 撒... 满足你!!</del>

> 这种情况下,二维码将同步(synchronously)生成,这有可能阻塞 UI 线程,引起应用无响应(ANR)问题。因此建议在非 UI 线程中使用。
这种情况下,二维码将同步(synchronously)生成,这有可能阻塞 UI 线程,引起应用无响应(ANR)问题。因此建议在非 UI 线程中使用。

```java
new Thread() {
Expand All @@ -70,7 +68,7 @@ new Thread() {
}.start();
```

#### 异步生成二维码并在 ImageView 中显示:
### 2. 异步生成二维码并在 ImageView 中显示

```java
new AwesomeQRCode.Renderer()
Expand All @@ -95,7 +93,7 @@ new AwesomeQRCode.Renderer()
});
```

### 参数说明
## 参数说明

参数名 | 类型 | 说明 | 默认值 | 备注
:----:|:------:|----|:--:|:-----:
Expand All @@ -116,64 +114,59 @@ logoMargin | int-px | Logo 周围的空白边框, 设为 0 以禁用 | 10 |
logoCornerRadius | int-px | Logo 及其边框的圆角半径, 设为 0 以禁用 | 8 |
logoScale | float | 用于计算 Logo 大小, 过大将覆盖过多数据点而导致解码失败 | 0.2f | (0, 1.0f)

## 更新日志

### 1.0.5 版本

### 更新日志

#### 1.0.5 版本
- 使用 AwesomeQRCode 的方式变的更优雅

#### 1.0.4 版本
### 1.0.4 版本

- 可以在二维码中选择嵌入 Logo
- 演示应用更新

#### 1.0.3 版本
### 1.0.3 版本

- 在二维码中的 Hints 中加入 CHARACTER_SET => UTF-8
- 修复 [#7](https://github.com/SumiMakito/AwesomeQRCode/issues/7) 中提到的编码问题

#### 1.0.2 版本
### 1.0.2 版本

- 加入使用圆点绘制二维码数据点的选项

#### 1.0.1 版本
### 1.0.1 版本

- 加入背景二值化的支持

#### 1.0.0 版本
### 1.0.0 版本

- 初次发布

### 相关项目
## 相关项目

#### Swift 下的 EFQRCode
### Swift 下的 EFQRCode

AwesomeQRCode 受 [由 EyreFree 创造的 EFQRCode](https://github.com/EyreFree/EFQRCode) 所启发而生,它是一个轻量级的、用来生成和识别二维码的纯 Swift 库,可根据输入的水印图和图标产生艺术二维码,基于 CoreImage 进行开发。受 qrcode 启发。EFQRCode 为你提供了一种更好的在你的 App 中操作二维码的方式。


#### 可在网页使用的 JavaScript 版: Awesome-qr.js
### 可在网页使用的 JavaScript 版: Awesome-qr.js

详情请至 [Awesome-qr.js](https://github.com/SumiMakito/Awesome-qr.js)

### 可以请我喝一杯卡布奇诺吗?
PayPal | 支付宝
----|----
[PayPal](https://www.paypal.me/makito) | [支付宝](https://qr.alipay.com/a6x02021re1jk4ftcymlw79)
### 强大的 Kotlin <del>(复刻)</del> 版: AwesomeQRCode-Kotlin

### 版权信息与授权协议
详情请至 [AwesomeQRCode-Kotlin](https://github.com/SumiMakito/AwesomeQRCode-Kotlin)

Copyright &copy; 2017 Sumi Makito
## 捐赠

Licensed under Apache License 2.0 License.
可以请我喝一杯卡布奇诺吗?

```
Copyright 2017 Sumi Makito
PayPal | 支付宝
----|----
[PayPal](https://www.paypal.me/makito) | [支付宝](https://qr.alipay.com/a6x02021re1jk4ftcymlw79)

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
<img alt="Apache-2.0 license" src="https://lucene.apache.org/images/mantle-power.png" width="128">

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.
```
AwesomeQRCode is available under the Apache-2.0 license. See the LICENSE file for more info.
Copyright &copy; 2017 Sumi Makito.
90 changes: 42 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
# AwesomeQRCode
<img alt="Special, thus awesome." src="art/banner.png" style="max-width: 600px;">

[![](https://jitpack.io/v/SumiMakito/AwesomeQRCode.svg)](https://jitpack.io/#SumiMakito/AwesomeQRCode)
[![license](https://img.shields.io/github/license/SumiMakito/AwesomeQRCode.svg)](https://github.com/SumiMakito/AwesomeQRCode/blob/master/LICENSE)
[![release](https://img.shields.io/github/release/SumiMakito/AwesomeQRCode.svg)](https://github.com/SumiMakito/AwesomeQRCode/releases/latest)
[![license](https://img.shields.io/github/license/SumiMakito/AwesomeQRCode.svg)](https://github.com/SumiMakito/AwesomeQRCode/blob/master/LICENSE)
![](https://img.shields.io/badge/made%20with-%3C3-orange.svg)

An awesome<del>(simple)</del> QR code generator for Android.

[AwesomeQRCode in Kotlin](https://github.com/SumiMakito/AwesomeQRCode-Kotlin)

[切换至中文(简体)版本?](README-zh_CN.md)
AwesomeQRCode - An awesome<del>(simple)</del> QR code generator for Android.

<img alt="Special, thus awesome." src="art/banner.png" style="max-width: 600px;">
> [切换至中文(简体)版本?](README-zh_CN.md)
### Yay! Demo Available!
## Yay! Demo Available!

<a href="https://play.google.com/store/apps/details?id=com.github.sumimakito.awesomeqrsample" target="_blank"><img src="art/play_store_badge.png" alt="Google Play Store" width="200"></a>

### Examples
## Examples

> Try to scan these QR codes below with your smart phone.
Example 1|Example 2|Example 3
------------ | ------------- | -------------
<img src="art/awesome-qr-1.png" width="400"> | <img src="art/awesome-qr-2.png" width="400"> | <img src="art/awesome-qr-3.png" width="400">


Solid dots instead of blocks|Binarized|With logo at the center
------------ | ------------- | -------------
<img src="art/awesome-qr-4.png" width="400"> | <img src="art/awesome-qr-5.png" width="400"> | <img src="art/awesome-qr-6.png" width="400">

### Add dependency into your project
## Installation

To add dependency into your project, Add below lines in build.gradle of your project:

Add below lines in build.gradle of your project:
```
allprojects {
repositories {
Expand All @@ -41,18 +39,18 @@ allprojects {
```

Then, add below lines in build.gradle of your app module:

```
dependencies {
compile 'com.github.SumiMakito:AwesomeQRCode:latest'
}
```

### Quick start
## Quick Start

### 1. "I just wanna get a Bitmap"

#### "I just wanna get a Bitmap":

> In this case, QR code will be generated synchronously. Thus it means you may take a risk blocking the UI thread, which would lead to Application Not Responding (ANR). I strongly recommend you to use it in a non-UI thread.
In this case, QR code will be generated synchronously. Thus it means you may take a risk blocking the UI thread, which would lead to Application Not Responding (ANR). I strongly recommend you to use it in a non-UI thread.

```java
new Thread() {
Expand All @@ -66,7 +64,7 @@ new Thread() {
}.start();
```

#### Generate a QR code asynchronously and show the QR code in an ImageView:
### 2. Generate a QR code asynchronously and show the QR code in an ImageView

```java
new AwesomeQRCode.Renderer()
Expand All @@ -91,7 +89,7 @@ new AwesomeQRCode.Renderer()
});
```

### Parameters
## Parameters

Parameter | Type | Explanation | Default Value | Misc.
:----:|:------:|----|:--:|:--:
Expand All @@ -112,69 +110,65 @@ logoMargin | int-px | White margin that appears around the logo image. Leave 0 t
logoCornerRadius | int-px | Radius of the logo's corners. Leave 0 to disable. | 8 |
logoScale | float | Value used to scale the logo image. Larger value may result in decode failure. | 0.2f | (0, 1.0f)


### Changelog
## Changelog

#### Version 1.0.6
- Fixed a "divide by zero" error mentioned in [#20](https://github.com/SumiMakito/AwesomeQRCode/issues/20).

#### Version 1.0.5
- The way to use AwesomeQRCode is more elegant.

#### Version 1.0.4
### Version 1.0.4

- New feature: Embedding a logo image in the QR code.
- Sample/Demo application updated.

#### Version 1.0.3
### Version 1.0.3

- Added CHARACTER_SET => UTF-8 to QR code's hints before encoding.
- Fixed an encoding issue mentioned in [#7](https://github.com/SumiMakito/AwesomeQRCode/issues/7).

#### Version 1.0.2
### Version 1.0.2

- Added an optional parameter which enables the data dots to appear as filled circles.

#### Version 1.0.1
### Version 1.0.1

- Now background images can be binarized as you like.

#### Version 1.0.0
### Version 1.0.0

- Initial release.

### Alternatives
## Alternatives

#### EFQRCode written in Swift
### EFQRCode written in Swift

EFQRCode is a tool to generate QRCode image or recognize QRCode from image, in Swift.

AwesomeQRCode is inspired by [EFQRCode by EyreFree](https://github.com/EyreFree/EFQRCode).

If your application is in need of generating pretty QR codes in Swift, take a look at EFQRCode. It should help.

#### Awesome-qr.js written in JavaScript
### Awesome-qr.js written in JavaScript

Redirect to [Awesome-qr.js](https://github.com/SumiMakito/Awesome-qr.js)

### Would you like to buy me a cup of cappuccino?
PayPal | Alipay
----|----
[PayPal](https://www.paypal.me/makito) | [Alipay](https://qr.alipay.com/a6x02021re1jk4ftcymlw79)
### AwesomeQRCode-Kotlin written in Kotlin

### Copyright &amp; License
Redirect to [AwesomeQRCode-Kotlin](https://github.com/SumiMakito/AwesomeQRCode-Kotlin)

Copyright &copy; 2017 Sumi Makito
## Donation

Licensed under Apache License 2.0 License.
Would you like to buy me a cup of cappuccino?

```
Copyright 2017 Sumi Makito
PayPal | Alipay
----|----
[PayPal](https://www.paypal.me/makito) | [Alipay](https://qr.alipay.com/a6x02021re1jk4ftcymlw79)

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
## Copyright &amp; License

http://www.apache.org/licenses/LICENSE-2.0
<img alt="Apache-2.0 license" src="https://lucene.apache.org/images/mantle-power.png" width="128">

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.
```
AwesomeQRCode is available under the Apache-2.0 license. See the LICENSE file for more info.
Copyright &copy; 2017 Sumi Makito.

0 comments on commit 58bbcd9

Please sign in to comment.