|
1 | | -# Pixel Perfect |
| 1 | +# PixelPerfect |
2 | 2 |
|
3 | | -The tool can be used by developers as well as designers to achieve the highest visual quality of an app and to add more transparency to both sides. |
4 | | -You can control position of the application/pixelperfect switcher, model image opacity and image's movement diraction. |
| 3 | +PixelPerfect is aimed to help you to create pixel perfect UI for Android apps. It lets developers and designers easily compare implementation with reference design and fix visual difference between them. |
5 | 4 |
|
6 | | - |
| 5 | + |
7 | 6 |
|
| 7 | +#### Supported features: |
| 8 | +- Picking overlay image. |
| 9 | +- Adjustment transparency. |
| 10 | +- Moving overlay. |
| 11 | +- Measuring offset. |
| 12 | +- Inverse mode. |
8 | 13 |
|
9 | | -## Getting started |
| 14 | +## Download |
10 | 15 |
|
11 | | -To add the library to your project update `build.gradle`: |
| 16 | +Grab via Gradle: |
12 | 17 |
|
13 | 18 | ```gradle |
14 | | - dependencies { |
15 | | - compile 'is.handsome.pixelperfect:pixelperfect:0.1' |
16 | | - } |
| 19 | +compile 'is.handsome.pixelperfect:pixelperfect:1.0.1' |
| 20 | +``` |
| 21 | + |
| 22 | +or Maven: |
| 23 | + |
| 24 | +```maven |
| 25 | +<dependency> |
| 26 | +<groupId>is.handsome.pixelperfect</groupId> |
| 27 | +<artifactId>pixelperfect</artifactId> |
| 28 | +<version>1.0.1</version> |
| 29 | +<type>pom</type> |
| 30 | +</dependency> |
17 | 31 | ``` |
| 32 | + |
| 33 | +## Getting started |
| 34 | + |
| 35 | +#### Show PixelPerfect |
| 36 | +```java |
| 37 | +PixelPerfect.show(HomeActivity.this); |
| 38 | +``` |
| 39 | + |
| 40 | +In default configuration PixelPerfect will be linked with 'pixelperfect' assets folder. |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | +If you want to use different folder, please read `Configuration` section. |
| 45 | + |
| 46 | +#### Hide PixelPerfect |
| 47 | +```java |
| 48 | +PixelPerfect.hide(); |
| 49 | +``` |
| 50 | + |
| 51 | +## Configuration |
| 52 | + |
| 53 | +`PixelPerfect.Config` provides possibility to configure major attributes of PixelPerfect. This snippet demonstrates usage of custom `overlayImagesAssetsPath` (assets folder for overlay images) and `overlayActiveImageName` (name of active by default overlay image): |
| 54 | + |
| 55 | +```java |
| 56 | +PixelPerfect.Config config = new PixelPerfect.Config.Builder() |
| 57 | +.overlayImagesAssetsPath("my_overlays") |
| 58 | +.overlayActiveImageName("main.png") |
| 59 | +.build(); |
| 60 | +PixelPerfect.show(HomeActivity.this, config); |
| 61 | +``` |
| 62 | + |
| 63 | +## Permissions and Android Marshmallow+ |
| 64 | + |
| 65 | +PixelPerfect requires SYSTEM_ALERT_WINDOW permission to run properly. So, for Marshmallow and later versions you have to handle permissions with `PixelPerfect.hasPermission(context)` and `PixelPerfect.askForPermission(context)` methods. |
| 66 | + |
| 67 | +You can find demonstartion of its usage in Sample app. |
| 68 | + |
0 commit comments