diff --git a/README.md b/README.md index 521193f..5b17f43 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/build.gradle b/lib/build.gradle index cf7bc0a..d011cfd 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -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" @@ -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' diff --git a/lib/src/main/java/com/androidessence/pinchzoomtextview/PinchZoomTextView.java b/lib/src/main/java/com/androidessence/pinchzoomtextview/PinchZoomTextView.java index 269ba85..74108f9 100644 --- a/lib/src/main/java/com/androidessence/pinchzoomtextview/PinchZoomTextView.java +++ b/lib/src/main/java/com/androidessence/pinchzoomtextview/PinchZoomTextView.java @@ -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; @@ -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(); diff --git a/sample.gif b/sample.gif index e7ff183..d5ccd0a 100644 Binary files a/sample.gif and b/sample.gif differ