Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/onlynight/LSearchView

Android L design circle wave animation search view
https://github.com/onlynight/LSearchView

Last synced: 1 day ago
JSON representation

Android L design circle wave animation search view

Lists

README

        

LSearchView
===========

This is an Android L design search view. It support reveal animation, let's review.

# Update

- 2016.11.17 update

I develop another library about ripple animation, it's a ripple animation layout you can use if anywhere you want(it is above android 4.0). Later i will develop a file explore use Material Design, and i will add some useful function to the ```LSearchView``` library.You can see the ```RippleEverywhere``` here https://github.com/onlynight/RippleEverywhere.

# Preview

## eg.1 HiQianBei
This is an Chinese local app, so you can't install it from google play.It just use for demo.
If you want to try it, you can download here: http://www.wandoujia.com/apps/com.superlity.hiqianbei

![hiqianbei_demo](./images/hiqianbei_demo.gif)

## eg.2 LSearchView
This is the LSearchView demo, you can see the source code in this the ```demo``` module.

![LSearchView_Demo](./images/lsearchview_demo.gif)

# build.gradle
In your project root path ```build.gradle``` file, add this:

```groovy
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```

And in your module path ```build.gradle``` file, add this:

```groovy
dependencies {
compile 'com.github.onlynight:LSearchView:1.0.0'
}
```

# Sample Code

layout file:

```xml

```

controller java code:

```java
searchView = (LSearchView) findViewById(R.id.searchView);

searchView.getSearchButton().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
searchView.setSearching(true);
searchView.postDelayed(new Runnable() {
@Override
public void run() {
searchView.setSearching(false);
}
}, 1000);
}
});
searchView.getBackButton().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
onBackSearch();
}
});

private void onBackSearch(){
searchView.hideWithAnim();
adapter.clear();
adapter.notifyDataSetChanged();
}
```

# XML property explain

```xml











```

# API explain

```java
/**
* Set the searching state and change search button to progress bar.
* If you mean to use it, first when you start search you should call
* setSearching(true), and when you end your search you should call
* setSearching(false).
* @param searching is the searching state
* @return
*/
public void setSearching(boolean searching);

/**
* You can get the back button use this method.
* @return
*/
public LinearLayout getBackButton();

/**
* You can get the search button use this method.
* @return
*/
public LinearLayout getSearchButton();

/**
* You can get the search edittext view use this method.
* @return
*/
public EditText getSearchEdit();

/**
* Call this method to show the view.
* When initial the LSearchView it's invisible,
* you must call this method to show it.
*/
public void showWithAnim();

/**
* Call this mehod to hide the view with animation.
*/
public void hideWithAnim();
```

# THANKS

[nineoldandroids]

[CircularReveal]

# License

```
Copyright 2016 onlynight

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

[nineoldandroids]: https://github.com/JakeWharton/NineOldAndroids
[CircularReveal]: https://github.com/ozodrukh/CircularReveal