Skip to content

Commit

Permalink
Merge branch 'release/1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamMc331 committed Dec 2, 2016
2 parents 9801d9d + 487cfc8 commit 4b8ab97
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -9,7 +9,7 @@ Usage
To have access to the library, add the dependency to your build.gradle:

```java
compile 'com.androidessence:pinchzoomtextview:1.0.0'
compile 'com.androidessence:pinchzoomtextview:1.0.1'
```

Developer Notes
Expand Down
6 changes: 3 additions & 3 deletions lib/build.gradle
Expand Up @@ -7,8 +7,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.0.1"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand All @@ -32,7 +32,7 @@ dependencies {
ext {
PUBLISH_GROUP_ID = 'com.androidessence'
PUBLISH_ARTIFACT_ID = 'pinchzoomtextview'
PUBLISH_VERSION = '1.0.0'
PUBLISH_VERSION = '1.0.1'
}

apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
@@ -1,6 +1,7 @@
package com.androidessence.pinchzoomtextview;

import android.content.Context;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.TextView;
Expand Down Expand Up @@ -66,6 +67,16 @@ public PinchZoomTextView(Context context, AttributeSet attrs) {
*/
@Override
public boolean onTouchEvent(MotionEvent event) {
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
setPaintFlags(getPaintFlags() | (Paint.LINEAR_TEXT_FLAG | Paint.SUBPIXEL_TEXT_FLAG));
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
setPaintFlags(getPaintFlags() & ~(Paint.LINEAR_TEXT_FLAG | Paint.SUBPIXEL_TEXT_FLAG));
break;
}

// Must have two gestures.
if(zoomEnabled && event.getPointerCount() == 2) {
int action = event.getAction();
Expand Down
Binary file modified sample.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4b8ab97

Please sign in to comment.