diff --git a/.gitignore b/.gitignore index 824865d..cfbbe00 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ # Built application files -*.apk *.ap_ # Files for the ART/Dalvik VM @@ -45,4 +44,4 @@ captures/ .DS_Store # Personal -app/config.properties \ No newline at end of file +app/config.properties diff --git a/README.md b/README.md index c060005..19c5d8a 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,70 @@ ### Preview #### 1. sample_ListView -![sample_list](./art/sample_list.gif) + #### 2. sample_RecyclerView -![sample_recycler](./art/sample_recycler.gif) + #### 3. sample_ScrollView -![sample_recycler](./art/sample_scroll.gif) + + +### Usage +- Add `AlphaLayout` widget in your layout + +```xml + + + + + +``` + +- implements AlphaLayout.OnRefreshListener in your `Activity` + +```java + @Override + public void onRefresh() { + alphaLayout.postDelayed(new Runnable() { + @Override + public void run() { + alphaLayout.setRefreshing(false); + } + }, REFRESH_DELAY); + } + + @Override + public void onScroll(int direction, float percent) { + if (direction == AlphaLayout.DIRECTION_DOWN) { + ViewCompat.setAlpha(alphaLayout.getHeaderLayout(), 1.0f - percent); + } else { + alphaLayout.getHeaderLayout().getBackground().setAlpha((int) (255 * percent)); + mTitleView.getBackground().mutate().setAlpha((int) (255 * (1 - percent))); + } + } +``` + +### Attention +- You should use `AlphaScrollView` which been provided instead of `ScrollView`. +- I also provided `AlphaHeaderLayout` which can make good performance easily. + +**See sample project for detail** + +### Download Sample apk +#### 1. Fir.im + +#### 2.download apk directly +[release_1.0.0_github.apk](./art/alpha_release-1/0/0-github.apk) diff --git a/art/alpha-release-1.0.0-github.apk b/art/alpha-release-1.0.0-github.apk new file mode 100644 index 0000000..7cb103b Binary files /dev/null and b/art/alpha-release-1.0.0-github.apk differ diff --git a/art/fir_1.0.0_release.jpeg b/art/fir_1.0.0_release.jpeg new file mode 100644 index 0000000..a3348c4 Binary files /dev/null and b/art/fir_1.0.0_release.jpeg differ