Skip to content

Commit

Permalink
Merge branch 'release/v1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelCatalan committed Oct 25, 2015
2 parents 781ceb4 + 5c88a64 commit ca7789a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Cute library to implement SearchView in a Material Design Approach. *Works from
**Add the dependencies to your gradle file:**
```javascript
dependencies {
compile 'com.miguelcatalan:materialsearchview:1.2.0'
compile 'com.miguelcatalan:materialsearchview:1.3.0'
}
```
**Add MaterialSearchView to your layout file along with the Toolbar** *(Add this block at the bottom of your layout, in order to display it over the rest of the view)*:
Expand Down
6 changes: 3 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ android {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.2.0"
versionName "1.3.0"
}
buildTypes {
release {
Expand All @@ -30,14 +30,14 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:appcompat-v7:23.1.0'
}

publish {
userOrg = 'miguelcatalan'
groupId = 'com.miguelcatalan'
artifactId = 'materialsearchview'
publishVersion = '1.2.0'
publishVersion = '1.3.0'
desc = 'Cute library to implement SearchView in a Material Design Approach'
website = 'https://github.com/MiguelCatalan/MaterialSearchView'
}
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,12 @@ private boolean isVoiceAvailable() {
}
}

private void hideKeyboard(View view) {
public void hideKeyboard(View view) {
InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
}

private void showKeyboard(View view) {
public void showKeyboard(View view) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1 && view.hasFocus()) {
view.clearFocus();
}
Expand Down Expand Up @@ -529,7 +529,7 @@ public boolean onAnimationCancel(View view) {

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mSearchLayout.setVisibility(View.VISIBLE);
AnimationUtil.reveal(mSearchTopBar, AnimationUtil.ANIMATION_DURATION_MEDIUM, animationListener);
AnimationUtil.reveal(mSearchTopBar, animationListener);

} else {
AnimationUtil.fadeInView(mSearchLayout, AnimationUtil.ANIMATION_DURATION_MEDIUM, animationListener);
Expand Down Expand Up @@ -600,7 +600,7 @@ public void clearFocus() {
mSearchSrcTextView.clearFocus();
mClearingFocus = false;
}

@Override
public Parcelable onSaveInstanceState() {
//begin boilerplate code that allows parent classes to save state
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package com.miguelcatalan.materialsearchview.utils;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.os.Build;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPropertyAnimatorListener;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewAnimationUtils;
import android.view.animation.DecelerateInterpolator;

/**
* @author Miguel Catalan Bañuls
Expand Down Expand Up @@ -81,21 +82,18 @@ public void onAnimationCancel(View view) {
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public static void reveal(final View view, int animationDuration, final AnimationListener listener) {
View viewRoot = view;
int cx = (viewRoot.getRight());
int cy = (viewRoot.getTop() + viewRoot.getBottom()) / 2;
int finalRadius = Math.max(viewRoot.getWidth(), viewRoot.getHeight());

Animator anim = ViewAnimationUtils.createCircularReveal(viewRoot, cx, cy, 0, finalRadius);
viewRoot.setVisibility(View.VISIBLE);

anim.setDuration(animationDuration);
anim.setInterpolator(new DecelerateInterpolator());
anim.addListener(new Animator.AnimatorListener() {
public static void reveal(final View view, final AnimationListener listener) {
int cx = view.getWidth() - (int) TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, 24, view.getResources().getDisplayMetrics());
int cy = view.getHeight() / 2;
int finalRadius = Math.max(view.getWidth(), view.getHeight());

Animator anim = ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius);
view.setVisibility(View.VISIBLE);
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
listener.onAnimationStart(view);
listener.onAnimationStart(view);
}

@Override
Expand All @@ -105,7 +103,7 @@ public void onAnimationEnd(Animator animation) {

@Override
public void onAnimationCancel(Animator animation) {
listener.onAnimationCancel(view);
listener.onAnimationCancel(view);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/res/layout/search_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:id="@+id/search_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
android:visibility="invisible">

<View
android:id="@+id/transparent_view"
Expand Down
8 changes: 4 additions & 4 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.miguelcatalan.materialsearchview.sample"
minSdkVersion 14
targetSdkVersion 23
versionCode 4
versionName "1.2.0"
versionCode 5
versionName "1.3.0"
}
buildTypes {
release {
Expand All @@ -22,6 +22,6 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':library')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
}

0 comments on commit ca7789a

Please sign in to comment.