Skip to content

Commit

Permalink
[Release] 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaosLeung committed Apr 2, 2018
1 parent a4ab000 commit 38941a2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ repositories {
}
dependencies {
compile 'com.chaos.view:pinview:1.3.0'
compile 'com.chaos.view:pinview:1.3.1'
}
```

## Usage

PinView inherits from EditText, which means you can use all the APIs from EditText.

### Step 1:

Add PinView in your layout.
Expand Down Expand Up @@ -74,6 +76,7 @@ pinView.setCursorVisible(false);
pinView.setCursorColor(
ResourcesCompat.getColor(getResources(), R.color.line_selected, getTheme()));
pinView.setCursorWidth(getResources().getDimensionPixelSize(R.dimen.pv_pin_view_cursor_width));
pinView.addTextChangedListener(new TextWatcher() {...});
```

### Step 2:
Expand Down
2 changes: 1 addition & 1 deletion pinview/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def issueUrl = 'https://github.com/ChaosLeong/PinView/issues'
def gitUrl = '[email protected]:ChaosLeong/PinView.git'

group = "com.chaos.view"
version = "1.3.0"
version = "1.3.1"

install {
repositories.mavenInstaller {
Expand Down
21 changes: 21 additions & 0 deletions simple/src/main/java/com/chaos/view/example/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@
import android.os.Bundle;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import com.chaos.view.PinView;

public class MainActivity extends AppCompatActivity {

private static final String TAG = "MainActivity";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -52,6 +57,22 @@ protected void onCreate(Bundle savedInstanceState) {
pinView.setCursorColor(
ResourcesCompat.getColor(getResources(), R.color.line_selected, getTheme()));
pinView.setCursorWidth(getResources().getDimensionPixelSize(R.dimen.pv_pin_view_cursor_width));
pinView.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {

}

@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
Log.d(TAG, "onTextChanged() called with: s = [" + s + "], start = [" + start + "], before = [" + before + "], count = [" + count + "]");
}

@Override
public void afterTextChanged(Editable s) {

}
});
}

@Override
Expand Down

0 comments on commit 38941a2

Please sign in to comment.