Skip to content

Commit 55589f5

Browse files
authored
Merge pull request #4 from ChaosLeong/develop
1.2.0 Release
2 parents 4c8adfc + 57aa0ae commit 55589f5

File tree

15 files changed

+329
-225
lines changed

15 files changed

+329
-225
lines changed

README.md

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repositories {
1515
}
1616
1717
dependencies {
18-
compile 'com.chaos.view:pinview:1.1.0'
18+
compile 'com.chaos.view:pinview:1.2.0'
1919
}
2020
```
2121

@@ -30,20 +30,22 @@ Add PinView in your layout.
3030
``` xml
3131
<com.chaos.view.PinView
3232
android:id="@+id/pinView"
33+
style="@style/PinWidget.PinView"
3334
android:layout_width="wrap_content"
3435
android:layout_height="wrap_content"
35-
android:inputType="number"
36-
android:padding="5dp"
37-
android:text="12345"
36+
android:hint="Hint."
37+
android:inputType="text"
38+
android:padding="@dimen/common_padding"
3839
android:textColor="@color/text_colors"
3940
android:textSize="18sp"
40-
app:borderColor="@color/border_colors"
41-
app:borderWidth="2dp"
4241
app:itemCount="5"
43-
app:itemSize="48dp"
44-
app:itemSpacing="4dp"
42+
app:itemHeight="48dp"
4543
app:itemRadius="4dp"
46-
style="@style/PinWidget.PinView" />
44+
app:itemSpacing="0dp"
45+
app:itemWidth="36dp"
46+
app:lineColor="@color/line_colors"
47+
app:lineWidth="2dp"
48+
app:viewType="rectangle" />
4749
```
4850

4951
#### Java
@@ -53,16 +55,17 @@ PinView pinView = (PinView) findViewById(R.id.secondPinView);
5355
pinView.setTextColor(
5456
ResourcesCompat.getColor(getResources(), R.color.colorAccent, getTheme()));
5557
pinView.setTextColor(
56-
ResourcesCompat.getColorStateList(getResources(), R.color.text_colors, getTheme()));
57-
pinView.setBorderColor(
58+
ResourcesCompat.getColorStateList(getResources(), R.color.line_colors, getTheme()));
59+
pinView.setLineColor(
5860
ResourcesCompat.getColor(getResources(), R.color.colorPrimary, getTheme()));
59-
pinView.setBorderColor(
60-
ResourcesCompat.getColorStateList(getResources(), R.color.border_colors, getTheme()));
61-
pinView.setItemCount(5);
62-
pinView.setItemSize(getResources().getDimensionPixelSize(R.dimen.pv_pin_view_box_height));
63-
pinView.setItemRadius(getResources().getDimensionPixelSize(R.dimen.pv_pin_view_box_radius));
64-
pinView.setItemSpacing(getResources().getDimensionPixelSize(R.dimen.pv_pin_view_box_margin));
65-
pinView.setBorderWidth(getResources().getDimensionPixelSize(R.dimen.pv_pin_view_box_border_width));
61+
pinView.setLineColor(
62+
ResourcesCompat.getColorStateList(getResources(), R.color.text_colors, getTheme()));
63+
pinView.setItemCount(4);
64+
pinView.setItemHeight(getResources().getDimensionPixelSize(R.dimen.pv_pin_view_item_size));
65+
pinView.setItemWidth(getResources().getDimensionPixelSize(R.dimen.pv_pin_view_item_size));
66+
pinView.setItemRadius(getResources().getDimensionPixelSize(R.dimen.pv_pin_view_item_radius));
67+
pinView.setItemSpacing(getResources().getDimensionPixelSize(R.dimen.pv_pin_view_item_spacing));
68+
pinView.setLineWidth(getResources().getDimensionPixelSize(R.dimen.pv_pin_view_item_line_width));
6669
pinView.setAnimationEnable(true);// start animation when adding text
6770
```
6871

@@ -77,7 +80,7 @@ Specifies `pinViewStyle` in your theme,
7780
</style>
7881
```
7982

80-
or implement `PinWidget.PinView` style.
83+
or use the `PinWidget.PinView` style.
8184

8285
``` xml
8386
<com.chaos.view.PinView
@@ -87,6 +90,19 @@ or implement `PinWidget.PinView` style.
8790
style="@style/PinWidget.PinView" />
8891
```
8992

93+
## Attributes
94+
95+
* **itemSize**, @deprecated use itemWidth or itemHeight instead.
96+
* **borderWidth**, @deprecated use lineWidth instead.
97+
* **borderColor**, @deprecated use lineColor instead.
98+
* **itemCount**, the length of your pin code.
99+
* **itemWidth**, the width of each item.
100+
* **itemHeight**, the height of each item.
101+
* **itemSpacing**, the spacing between two items.
102+
* **lineWidth**, the line(border) width.
103+
* **lineColor**, the line(border) colors.
104+
* **viewType**, the view type of PinView, currently this will be one of `rectangle` or `line`.
105+
90106
## Thanks
91107

92108
* Inspired by [PasswordInput](https://github.com/EthanCo/PasswordInput) in [EthanCo](https://github.com/EthanCo)

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ buildscript {
1616
allprojects {
1717
repositories {
1818
jcenter()
19+
maven {
20+
url 'https://maven.google.com'
21+
}
1922
}
2023
}
2124

pinview/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
apply plugin: 'com.android.library'
1818

1919
android {
20-
compileSdkVersion 25
21-
buildToolsVersion "25.0.2"
20+
compileSdkVersion 26
21+
buildToolsVersion "26.0.1"
2222

2323
defaultConfig {
24-
minSdkVersion 11
25-
targetSdkVersion 25
24+
minSdkVersion 14
25+
targetSdkVersion 26
2626
versionCode 0
2727
versionName ""
2828

@@ -42,7 +42,7 @@ dependencies {
4242
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
4343
exclude group: 'com.android.support', module: 'support-annotations'
4444
})
45-
compile 'com.android.support:appcompat-v7:25.3.0'
45+
compile 'com.android.support:appcompat-v7:26.0.0'
4646
testCompile 'junit:junit:4.12'
4747
}
4848

pinview/publish.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def issueUrl = 'https://github.com/ChaosLeong/PinView/issues'
66
def gitUrl = '[email protected]:ChaosLeong/PinView.git'
77

88
group = "com.chaos.view"
9-
version = "1.1.0"
9+
version = "1.2.0"
1010

1111
install {
1212
repositories.mavenInstaller {

0 commit comments

Comments
 (0)