├── .gitignore ├── LICENSE ├── README.md ├── README_CN.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── ryane │ │ └── com │ │ └── gallery │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── ryane │ │ │ └── com │ │ │ └── gallery │ │ │ ├── BlurBitmapUtil.java │ │ │ ├── MainActivity.java │ │ │ └── RecyclerAdapter.java │ └── res │ │ ├── drawable-xxhdpi │ │ ├── beauty1.jpg │ │ ├── beauty10.jpg │ │ ├── beauty11.jpg │ │ ├── beauty12.jpg │ │ ├── beauty13.jpg │ │ ├── beauty2.jpg │ │ ├── beauty3.jpg │ │ ├── beauty4.jpg │ │ ├── beauty5.jpg │ │ ├── beauty6.jpg │ │ ├── beauty7.jpg │ │ ├── beauty8.jpg │ │ ├── beauty9.jpg │ │ ├── ic_change.png │ │ ├── photo_nba1.jpg │ │ ├── photo_nba2.jpg │ │ ├── photo_nba3.jpg │ │ ├── photo_nba4.jpg │ │ ├── photo_nba5.jpg │ │ ├── photo_nba6.jpg │ │ ├── photo_nba7.jpg │ │ ├── photo_nba8.jpg │ │ └── photo_nba9.jpg │ │ ├── layout │ │ ├── activity_main.xml │ │ └── item_gallery.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values-v19 │ │ └── styles.xml │ │ ├── values-v21 │ │ └── styles.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── ryane │ └── com │ └── gallery │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── rv-gallery ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── ryan │ │ └── rv_gallery │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── ryan │ │ │ └── rv_gallery │ │ │ ├── AnimManager.java │ │ │ ├── GalleryItemDecoration.java │ │ │ ├── GalleryRecyclerView.java │ │ │ ├── ScrollManager.java │ │ │ └── util │ │ │ ├── DLog.java │ │ │ └── OsUtil.java │ └── res │ │ └── values │ │ ├── strings.xml │ │ └── value.xml │ └── test │ └── java │ └── com │ └── ryan │ └── rv_gallery │ └── ExampleUnitTest.java ├── settings.gradle └── 用RecyclerView做一个小清新的Gallery效果.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | .idea 4 | /local.properties 5 | /.idea/workspace.xml 6 | /.idea/libraries 7 | .DS_Store 8 | /build 9 | /captures 10 | .externalNativeBuild 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # README # 2 | 3 | [![Download](https://img.shields.io/badge/Download-V1.1.2-blue.svg)](https://bintray.com/ryanlijianchang/maven/RecyclerView-Gallery) 4 | [![License](https://img.shields.io/badge/license-Apache2.0-green.svg)](https://github.com/ryanlijianchang/Recyclerview-Gallery) 5 | [![Build](https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser.svg)](https://github.com/ryanlijianchang/Recyclerview-Gallery) 6 | 7 | [中文版文档](https://github.com/ryanlijianchang/Recyclerview-Gallery/blob/master/README_CN.md) 8 | 9 | This library shows you a gallery using RecyclerView. 10 | 11 | ![小清新的Gallery水平滑动效果](https://user-gold-cdn.xitu.io/2017/12/13/1604f61b7219464a?w=201&h=358&f=gif&s=3031397) 12 | 13 | ![小清新的Gallery垂直滑动效果](https://user-gold-cdn.xitu.io/2017/12/13/1604f61b781841cc?w=206&h=366&f=gif&s=2045166) 14 | 15 | 16 | # Usage # 17 | 18 | First step, add dependence in your `build.gradle`. 19 | 20 | compile 'com.ryan.rv_gallery:rv-gallery:1.1.2' 21 | 22 | Second step, using `GalleryRecyclerView` in your layout file. 23 | 24 | 33 | 34 | 35 | 36 | 41 | 42 | 43 | 44 | Third step, init your GalleryRecyclerView in your java code just like using the normal RecyclerView. Note that you must use the LinearLayoutManager as your LayoutManager. At the same time, you must set the orientation like `HORIZONTAL` or `VERTICAL`, to make your `GalleryRecyclerView` scroll horizontally or vertically. 45 | 46 | 47 | GalleryRecyclerView mRecyclerView = findViewById(R.id.rv_list); 48 | RecyclerAdapter adapter = new RecyclerAdapter(getApplicationContext(), getDatas()); 49 | mRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false)); 50 | mRecyclerView.setAdapter(adapter); 51 | 52 | Finally, set some params of `GalleryRecyclerView` if your need, and you must use the `setUp()` method to make the `GalleryRecyclerView` to work. 53 | 54 | mRecyclerView 55 | // set scroll speed(pixel/s) 56 | .initFlingSpeed(9000) 57 | // set page distance and visible distance of the nearby. 58 | .initPageParams(0, 40) 59 | // set the animation factor 60 | .setAnimFactor(0.1f) 61 | // set animation type. you can choose AnimManager.ANIM_BOTTOM_TO_TOP or AnimManager.ANIM_TOP_TO_BOTTOM 62 | .setAnimType(AnimManager.ANIM_BOTTOM_TO_TOP) 63 | // set click listener 64 | .setOnItemClickListener(this) 65 | // set whether auto play 66 | .autoPlay(false) 67 | // set auto play intervel 68 | .intervalTime(2000) 69 | // set default position 70 | .initPosition(1) 71 | // finally call method 72 | .setUp(); 73 | 74 | You also can release `GalleryRecyclerView` if you need 75 | 76 | 77 | @Override 78 | protected void onDestroy() { 79 | super.onDestroy(); 80 | if (mRecyclerView != null) { 81 | // release 82 | mRecyclerView.release(); 83 | } 84 | } 85 | 86 | # API # 87 | 88 | **Java API** 89 | 90 | 1. `initFlingSpeed(int speed)`:set scroll speed(pixel/s) 91 | 2. `setAnimFactor(float factor)`:set the animation factor 92 | 3. `setAnimType(int type)`:set animation type. you can choose `AnimManager.ANIM_BOTTOM_TO_TOP` or `AnimManager.ANIM_TOP_TO_BOTTOM` 93 | 4. `setOnItemClickListener(OnItemClickListener mListener)`:set click listener 94 | 5. `initPageParams(int pageMargin, int leftPageVisibleWidth)`:set page distance and visible distance of the nearby. 95 | 6. `getScrolledPosition()`: get current position 96 | 7. `getLinearLayoutManager()`:get LayoutManager 97 | 8. `getOrientation()`:get current scroll orientation(HORIZONTAL:0 VERTICAL:1) 98 | 9. `autoPlay(boolean)`:set can it auto play 99 | 10. `intervalTime(int interval)`:set auto play intervel 100 | 11. `initPosition(int position)`: set default position 101 | 102 | **XML API** 103 | 104 | 1. `app:helper="PagerSnapHelper/LinearSnapHelper"`:PagerSnapHelper can move just one page when scroll,LinearSnapHelper can move serveral page when scroll. 105 | 106 | # Version feature # 107 | 108 | see more in [Releases](https://github.com/ryanlijianchang/Recyclerview-Gallery/releases)。 109 | 110 | 111 | # License # 112 | 113 | 114 | Copyright 2017 ryanlijianchang 115 | 116 | Licensed under the Apache License, Version 2.0 (the "License"); 117 | you may not use this file except in compliance with the License. 118 | You may obtain a copy of the License at 119 | 120 | http://www.apache.org/licenses/LICENSE-2.0 121 | 122 | Unless required by applicable law or agreed to in writing, software 123 | distributed under the License is distributed on an "AS IS" BASIS, 124 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 125 | See the License for the specific language governing permissions and 126 | limitations under the License. -------------------------------------------------------------------------------- /README_CN.md: -------------------------------------------------------------------------------- 1 | # README # 2 | 3 | [![Download](https://img.shields.io/badge/Download-V1.1.2-blue.svg)](https://bintray.com/ryanlijianchang/maven/RecyclerView-Gallery) 4 | [![License](https://img.shields.io/badge/license-Apache2.0-green.svg)](https://github.com/ryanlijianchang/Recyclerview-Gallery) 5 | [![Build](https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser.svg)](https://github.com/ryanlijianchang/Recyclerview-Gallery) 6 | 7 | 使用RecyclerView实现Gallery效果。实现效果如下: 8 | 9 | ![小清新的Gallery水平滑动效果](https://user-gold-cdn.xitu.io/2017/12/13/1604f61b7219464a?w=201&h=358&f=gif&s=3031397) 10 | 11 | ![小清新的Gallery垂直滑动效果](https://user-gold-cdn.xitu.io/2017/12/13/1604f61b781841cc?w=206&h=366&f=gif&s=2045166) 12 | 13 | 14 | # 用法 # 15 | 16 | 首先,在你的`build.gradle`中添加依赖。 17 | 18 | compile 'com.ryan.rv_gallery:rv-gallery:1.1.2' 19 | 20 | 第二,在你的layout文件中使用`GalleryRecyclerView`。 21 | 22 | 31 | 32 | 33 | 34 | 39 | 40 | 41 | 42 | 第三,在代码中像使用普通的RecyclerView一样,初始化你的GalleryRecyclerView。LayoutManager必须使用LinearLayoutManager,同时在创建LinearLayoutManager需要指定你的方向为`HORIZONTAL`或者`VERTICAL`,让`GalleryRecyclerView`水平或者垂直方向滑动。 43 | 44 | GalleryRecyclerView mRecyclerView = findViewById(R.id.rv_list); 45 | RecyclerAdapter adapter = new RecyclerAdapter(getApplicationContext(), getDatas()); 46 | mRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false)); 47 | mRecyclerView.setAdapter(adapter); 48 | 49 | 最后,指定`GalleryRecyclerView`的参数(非必须,不指定的话会使用默认值),最后必须调用setUp()方法才生效。 50 | 51 | mRecyclerView 52 | // 设置滑动速度(像素/s) 53 | .initFlingSpeed(9000) 54 | // 设置页边距和左右图片的可见宽度,单位dp 55 | .initPageParams(0, 40) 56 | // 设置切换动画的参数因子 57 | .setAnimFactor(0.1f) 58 | // 设置切换动画类型,目前有AnimManager.ANIM_BOTTOM_TO_TOP和目前有AnimManager.ANIM_TOP_TO_BOTTOM 59 | .setAnimType(AnimManager.ANIM_BOTTOM_TO_TOP) 60 | // 设置点击事件 61 | .setOnItemClickListener(this) 62 | // 设置自动播放 63 | .autoPlay(false) 64 | // 设置自动播放间隔时间 ms 65 | .intervalTime(2000) 66 | // 设置初始化的位置 67 | .initPosition(1) 68 | // 在设置完成之后,必须调用setUp()方法 69 | .setUp(); 70 | 71 | 在你需要释放资源的地方调用release()方法,释放资源: 72 | 73 | 74 | @Override 75 | protected void onDestroy() { 76 | super.onDestroy(); 77 | if (mRecyclerView != null) { 78 | // 释放资源 79 | mRecyclerView.release(); 80 | } 81 | } 82 | 83 | # API # 84 | 85 | **Java API** 86 | 87 | 1. `initFlingSpeed(int speed)`:修改滑动速度(像素/s) 88 | 2. `setAnimFactor(float factor)`:修改切换动画的参数因子 89 | 3. `setAnimType(int type)`:配置动画类型 //ANIM_BOTTOM_TO_TOP、ANIM_TOP_TO_BOTTOM 90 | 4. `setOnItemClickListener(OnItemClickListener mListener)`:设置点击事件 91 | 5. `initPageParams(int pageMargin, int leftPageVisibleWidth)`:动态配置页边距和左右页可视宽度/高度 92 | 6. `getScrolledPosition()`:获取当前位置 93 | 7. `getLinearLayoutManager()`:获取LayoutManager 94 | 8. `getOrientation()`:获取当前的滑动方向 HORIZONTAL:0 VERTICAL:1 95 | 9. `autoPlay(boolean)`:是否自动播放 96 | 10. `intervalTime(int interval)`:自动播放间隔时间,单位ms 97 | 11. `initPosition(int position)`:开始处于的位置 98 | 99 | **XML API** 100 | 101 | 1. `app:helper="PagerSnapHelper/LinearSnapHelper"`:PagerSnapHelper一次只能滑动一页,LinearSnapHelper一次滑动多页。 102 | 103 | # 实现 # 104 | 105 | 具体实现过程已在掘金上发布了,如果你感兴趣,可以跳转到[这里](https://juejin.im/post/5a30fe5a6fb9a045132ab1bf)。如果你觉得可以帮助到你,不妨点个Star。 106 | 107 | # 版本特性 # 108 | 109 | 查看更多,请转移至[Releases](https://github.com/ryanlijianchang/Recyclerview-Gallery/releases)。 110 | 111 | **V1.1.2** 112 | 1. BUG FIX。Fix By @[tingshuonitiao](https://github.com/tingshuonitiao)修复第一次进入时第0张图片leftPageVisibleWidth不展示的bug 113 | 114 | **V1.1.1** 115 | 116 | 1. BUG FIX。修复第一次初始化时设置默认位置不对的问题。提供接口initPosition(int pos)设置初始位置,初始后可以直接调用smoothScrollToPosition(int pos)移动到需要的位置。 117 | 2. 更换设置ScrollListener时机。 118 | 119 | **V1.1.0** 120 | 121 | 1. BUG FIX。修复在Fragment上使用出现的异常问题。 122 | 2. 增加自动播放接口。 123 | 124 | **V1.0.9** 125 | 126 | 1. BUG FIX。修复滑动动画不顺畅问题。 127 | 128 | **V1.0.8** 129 | 130 | 1. BUG FIX。修复从其他图片切换到第一张图片时抖动的问题。 131 | 132 | **V1.0.7** 133 | 134 | 1. BUG FIX。修复横竖屏切换时UI异常问题。 135 | 136 | **V1.0.6** 137 | 138 | 1. BUG FIX By @[jefshi](https://github.com/jefshi)。去除单例,修复前后台切换后,位置不对的问题。 139 | 2. BUG FIX By @[jefshi](https://github.com/jefshi)。修复接受到微信、QQ等消息通知后,图片高度不对问题。 140 | 3. Gradle升级V4.4。 141 | 142 | **V1.0.5** 143 | 144 | 1. BUG FIX。修复了GalleryRecyclerView从前台切换到后台时闪退,位置错乱等问题。 145 | 146 | **V1.0.4** 147 | 148 | 1. 增加helper属性,包括LinearySnapHelper和PagerSnapHelper。 149 | 150 | **V1.0.3** 151 | 152 | 1. 修复了移动一页理论消耗距离应该是图片宽度加上2倍页边距。 153 | 2. 修复了修改页边距和可视宽度之后,没有生效。 154 | 155 | **V1.0.2** 156 | 157 | 1. BUG FIX。修复LayoutManager使用非LinearyLayoutManager时不抛出异常。 158 | 159 | **V1.0.1** 160 | 161 | 1. BUG FIX。首次打开,获得焦点后滑动至第0项,避免第0项的margin不对。 162 | 163 | **V1.0.0** 164 | 165 | 1. GalleryRecyclerview支持实现Gallery效果。 166 | 2. 支持动态修改滑动速度(像素/s)。 167 | 3. 支持动态修改切换动画的参数因子。 168 | 4. 支持配置动画类型。 169 | 5. 支持点击事件。 170 | 6. 支持动态配置页边距和左右页可视宽度/高度。 171 | 172 | 173 | 174 | # License # 175 | 176 | 177 | Copyright 2017 ryanlijianchang 178 | 179 | Licensed under the Apache License, Version 2.0 (the "License"); 180 | you may not use this file except in compliance with the License. 181 | You may obtain a copy of the License at 182 | 183 | http://www.apache.org/licenses/LICENSE-2.0 184 | 185 | Unless required by applicable law or agreed to in writing, software 186 | distributed under the License is distributed on an "AS IS" BASIS, 187 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 188 | See the License for the specific language governing permissions and 189 | limitations under the License. -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | buildToolsVersion '27.0.3' 6 | defaultConfig { 7 | applicationId "ryane.com.gallery" 8 | minSdkVersion 15 9 | targetSdkVersion 27 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | 14 | renderscriptTargetApi 19 15 | renderscriptSupportModeEnabled true 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | } 24 | 25 | dependencies { 26 | implementation 'com.ryan.base-lib:base-lib:0.0.6' 27 | implementation project(':rv-gallery') 28 | } 29 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Administrator\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/androidTest/java/ryane/com/gallery/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package ryane.com.gallery; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("ryane.com.testaidl", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/ryane/com/gallery/BlurBitmapUtil.java: -------------------------------------------------------------------------------- 1 | package ryane.com.gallery; 2 | 3 | import android.content.Context; 4 | import android.graphics.Bitmap; 5 | import android.support.v8.renderscript.Allocation; 6 | import android.support.v8.renderscript.Element; 7 | import android.support.v8.renderscript.RenderScript; 8 | import android.support.v8.renderscript.ScriptIntrinsicBlur; 9 | 10 | /** 11 | * @author Qiushui 12 | * @description 模糊图片工具类 13 | * @revision Xiarui 16.09.05 14 | */ 15 | public class BlurBitmapUtil { 16 | //图片缩放比例 17 | private static final float BITMAP_SCALE = 0.4f; 18 | 19 | /** 20 | * 模糊图片的具体方法 21 | * 22 | * @param context 上下文对象 23 | * @param image 需要模糊的图片 24 | * @return 模糊处理后的图片 25 | */ 26 | public static Bitmap blurBitmap(Context context, Bitmap image, float blurRadius) { 27 | // 计算图片缩小后的长宽 28 | int width = Math.round(image.getWidth() * BITMAP_SCALE); 29 | int height = Math.round(image.getHeight() * BITMAP_SCALE); 30 | 31 | // 将缩小后的图片做为预渲染的图片 32 | Bitmap inputBitmap = Bitmap.createScaledBitmap(image, width, height, false); 33 | // 创建一张渲染后的输出图片 34 | Bitmap outputBitmap = Bitmap.createBitmap(inputBitmap); 35 | 36 | // 创建RenderScript内核对象 37 | RenderScript rs = RenderScript.create(context); 38 | // 创建一个模糊效果的RenderScript的工具对象 39 | ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); 40 | 41 | // 由于RenderScript并没有使用VM来分配内存,所以需要使用Allocation类来创建和分配内存空间 42 | // 创建Allocation对象的时候其实内存是空的,需要使用copyTo()将数据填充进去 43 | Allocation tmpIn = Allocation.createFromBitmap(rs, inputBitmap); 44 | Allocation tmpOut = Allocation.createFromBitmap(rs, outputBitmap); 45 | 46 | // 设置渲染的模糊程度, 25f是最大模糊度 47 | blurScript.setRadius(blurRadius); 48 | // 设置blurScript对象的输入内存 49 | blurScript.setInput(tmpIn); 50 | // 将输出数据保存到输出内存中 51 | blurScript.forEach(tmpOut); 52 | 53 | // 将数据填充到Allocation中 54 | tmpOut.copyTo(outputBitmap); 55 | 56 | return outputBitmap; 57 | } 58 | } -------------------------------------------------------------------------------- /app/src/main/java/ryane/com/gallery/MainActivity.java: -------------------------------------------------------------------------------- 1 | package ryane.com.gallery; 2 | 3 | import android.content.res.TypedArray; 4 | import android.graphics.Bitmap; 5 | import android.graphics.BitmapFactory; 6 | import android.graphics.drawable.BitmapDrawable; 7 | import android.graphics.drawable.Drawable; 8 | import android.graphics.drawable.TransitionDrawable; 9 | import android.os.Bundle; 10 | import android.support.v7.app.AppCompatActivity; 11 | import android.support.v7.widget.LinearLayoutManager; 12 | import android.support.v7.widget.RecyclerView; 13 | import android.view.View; 14 | import android.widget.RelativeLayout; 15 | import android.widget.SeekBar; 16 | import android.widget.Toast; 17 | 18 | import com.ryan.rv_gallery.AnimManager; 19 | import com.ryan.rv_gallery.GalleryRecyclerView; 20 | import com.ryan.rv_gallery.util.DLog; 21 | 22 | import java.util.ArrayList; 23 | import java.util.HashMap; 24 | import java.util.List; 25 | import java.util.Map; 26 | 27 | /** 28 | * @author RyanLee 29 | */ 30 | public class MainActivity extends AppCompatActivity implements GalleryRecyclerView.OnItemClickListener, RecyclerAdapter.OnItemPhotoChangedListener { 31 | public static final String TAG = "MainActivity_TAG"; 32 | 33 | private GalleryRecyclerView mRecyclerView; 34 | private RelativeLayout mContainer; 35 | private SeekBar mSeekbar; 36 | 37 | private Map mTSDraCacheMap = new HashMap<>(); 38 | private static final String KEY_PRE_DRAW = "key_pre_draw"; 39 | 40 | /** 41 | * 获取虚化背景的位置 42 | */ 43 | private int mLastDraPosition = -1; 44 | 45 | 46 | @Override 47 | protected void onCreate(Bundle savedInstanceState) { 48 | super.onCreate(savedInstanceState); 49 | setContentView(R.layout.activity_main); 50 | 51 | DLog.setDebug(true); 52 | 53 | DLog.d(TAG, "MainActivity onCreate()"); 54 | 55 | mRecyclerView = findViewById(R.id.rv_list); 56 | mContainer = findViewById(R.id.rl_container); 57 | mSeekbar = findViewById(R.id.seekBar); 58 | 59 | 60 | final RecyclerAdapter adapter = new RecyclerAdapter(MainActivity.this, getDatas()); 61 | adapter.setOnItemPhotoChangedListener(this); 62 | 63 | mRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false)); 64 | mRecyclerView.setAdapter(adapter); 65 | mRecyclerView 66 | // 设置滑动速度(像素/s) 67 | .initFlingSpeed(9000) 68 | // 设置页边距和左右图片的可见宽度,单位dp 69 | .initPageParams(0, 40) 70 | // 设置切换动画的参数因子 71 | .setAnimFactor(0.1f) 72 | // 设置切换动画类型,目前有AnimManager.ANIM_BOTTOM_TO_TOP和目前有AnimManager.ANIM_TOP_TO_BOTTOM 73 | .setAnimType(AnimManager.ANIM_BOTTOM_TO_TOP) 74 | // 设置点击事件 75 | .setOnItemClickListener(this) 76 | // 设置自动播放 77 | .autoPlay(false) 78 | // 设置自动播放间隔时间 ms 79 | .intervalTime(2000) 80 | // 设置初始化的位置 81 | .initPosition(1) 82 | // 在设置完成之后,必须调用setUp()方法 83 | .setUp(); 84 | 85 | 86 | // 背景高斯模糊 & 淡入淡出 87 | mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { 88 | @Override 89 | public void onScrollStateChanged(RecyclerView recyclerView, int newState) { 90 | super.onScrollStateChanged(recyclerView, newState); 91 | 92 | if (newState == RecyclerView.SCROLL_STATE_IDLE) { 93 | setBlurImage(false); 94 | 95 | mSeekbar.setProgress(mRecyclerView.getScrolledPosition()); 96 | } 97 | } 98 | }); 99 | setBlurImage(false); 100 | 101 | mSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { 102 | @Override 103 | public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { 104 | mRecyclerView.smoothScrollToPosition(progress); 105 | } 106 | 107 | @Override 108 | public void onStartTrackingTouch(SeekBar seekBar) { 109 | 110 | } 111 | 112 | @Override 113 | public void onStopTrackingTouch(SeekBar seekBar) { 114 | 115 | } 116 | }); 117 | } 118 | 119 | /** 120 | * 设置背景高斯模糊 121 | */ 122 | public void setBlurImage(boolean forceUpdate) { 123 | RecyclerAdapter adapter = (RecyclerAdapter) mRecyclerView.getAdapter(); 124 | final int mCurViewPosition = mRecyclerView.getScrolledPosition(); 125 | 126 | boolean isSamePosAndNotUpdate = (mCurViewPosition == mLastDraPosition) && !forceUpdate; 127 | 128 | if (adapter == null || mRecyclerView == null || isSamePosAndNotUpdate) { 129 | return; 130 | } 131 | mRecyclerView.post(new Runnable() { 132 | @Override 133 | public void run() { 134 | //如果是Fragment的话,需要判断Fragment是否Attach当前Activity,否则getResource会报错 135 | /*if (!isAdded()) { 136 | // fix fragment not attached to Activity 137 | return; 138 | }*/ 139 | // 获取当前位置的图片资源ID 140 | int resourceId = ((RecyclerAdapter) mRecyclerView.getAdapter()).getResId(mCurViewPosition); 141 | // 将该资源图片转为Bitmap 142 | Bitmap resBmp = BitmapFactory.decodeResource(getResources(), resourceId); 143 | // 将该Bitmap高斯模糊后返回到resBlurBmp 144 | Bitmap resBlurBmp = BlurBitmapUtil.blurBitmap(mRecyclerView.getContext(), resBmp, 15f); 145 | // 再将resBlurBmp转为Drawable 146 | Drawable resBlurDrawable = new BitmapDrawable(resBlurBmp); 147 | // 获取前一页的Drawable 148 | Drawable preBlurDrawable = mTSDraCacheMap.get(KEY_PRE_DRAW) == null ? resBlurDrawable : mTSDraCacheMap.get(KEY_PRE_DRAW); 149 | 150 | /* 以下为淡入淡出效果 */ 151 | Drawable[] drawableArr = {preBlurDrawable, resBlurDrawable}; 152 | TransitionDrawable transitionDrawable = new TransitionDrawable(drawableArr); 153 | mContainer.setBackgroundDrawable(transitionDrawable); 154 | transitionDrawable.startTransition(500); 155 | 156 | // 存入到cache中 157 | mTSDraCacheMap.put(KEY_PRE_DRAW, resBlurDrawable); 158 | // 记录上一次高斯模糊的位置 159 | mLastDraPosition = mCurViewPosition; 160 | } 161 | }); 162 | } 163 | 164 | 165 | /*** 166 | * 测试数据 167 | * @return List 168 | */ 169 | public List getDatas() { 170 | TypedArray ar = getResources().obtainTypedArray(R.array.test_arr); 171 | final int[] resIds = new int[ar.length()]; 172 | for (int i = 0; i < ar.length(); i++) { 173 | resIds[i] = ar.getResourceId(i, 0); 174 | } 175 | ar.recycle(); 176 | List tDatas = new ArrayList<>(); 177 | for (int resId : resIds) { 178 | tDatas.add(resId); 179 | } 180 | return tDatas; 181 | } 182 | 183 | @Override 184 | protected void onResume() { 185 | super.onResume(); 186 | 187 | DLog.d(TAG, "MainActivity onResume()"); 188 | } 189 | 190 | @Override 191 | protected void onStart() { 192 | super.onStart(); 193 | 194 | DLog.d(TAG, "MainActivity onStart()"); 195 | } 196 | 197 | @Override 198 | protected void onPause() { 199 | super.onPause(); 200 | 201 | DLog.d(TAG, "MainActivity onPause()"); 202 | } 203 | 204 | @Override 205 | protected void onStop() { 206 | super.onStop(); 207 | 208 | DLog.d(TAG, "MainActivity onStop()"); 209 | } 210 | 211 | @Override 212 | protected void onDestroy() { 213 | super.onDestroy(); 214 | DLog.d(TAG, "MainActivity onDestroy()"); 215 | 216 | if (mRecyclerView != null) { 217 | // 释放资源 218 | mRecyclerView.release(); 219 | } 220 | } 221 | 222 | @Override 223 | public void onItemClick(View view, int position) { 224 | Toast.makeText(getApplicationContext(), "position=" + position, Toast.LENGTH_SHORT).show(); 225 | } 226 | 227 | @Override 228 | public void onItemPhotoChanged() { 229 | setBlurImage(true); 230 | } 231 | } 232 | -------------------------------------------------------------------------------- /app/src/main/java/ryane/com/gallery/RecyclerAdapter.java: -------------------------------------------------------------------------------- 1 | package ryane.com.gallery; 2 | 3 | import android.content.Context; 4 | import android.support.design.widget.FloatingActionButton; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | 11 | import com.ryan.rv_gallery.util.DLog; 12 | 13 | import java.util.List; 14 | import java.util.Random; 15 | 16 | /** 17 | * @author RyanLee 18 | * @date 2017/12/7 19 | */ 20 | 21 | public class RecyclerAdapter extends RecyclerView.Adapter { 22 | private Context mContext; 23 | private List mDatas; 24 | 25 | private OnItemPhotoChangedListener mOnItemPhotoChangedListener; 26 | 27 | 28 | RecyclerAdapter(Context mContext, List mDatas) { 29 | this.mContext = mContext; 30 | this.mDatas = mDatas; 31 | } 32 | 33 | @Override 34 | public void onAttachedToRecyclerView(RecyclerView recyclerView) { 35 | DLog.d(MainActivity.TAG, "RecyclerAdapter onAttachedToRecyclerView"); 36 | super.onAttachedToRecyclerView(recyclerView); 37 | } 38 | 39 | @Override 40 | public MyHolder onCreateViewHolder(ViewGroup parent, int viewType) { 41 | DLog.d(MainActivity.TAG, "RecyclerAdapter onCreateViewHolder" + " width = " + parent.getWidth()); 42 | View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_gallery, parent, false); 43 | return new MyHolder(itemView); 44 | } 45 | 46 | @Override 47 | public void onBindViewHolder(final MyHolder holder, final int position) { 48 | DLog.d(MainActivity.TAG, "RecyclerAdapter onBindViewHolder" + "--> position = " + position); 49 | holder.mView.setImageResource(mDatas.get(holder.getAdapterPosition())); 50 | holder.mChange.setOnClickListener(new View.OnClickListener() { 51 | @Override 52 | public void onClick(View view) { 53 | int randomNum = new Random().nextInt(9); 54 | int[] res = {R.drawable.photo_nba1, R.drawable.photo_nba2, R.drawable.photo_nba3, R.drawable.photo_nba4, 55 | R.drawable.photo_nba5, R.drawable.photo_nba6, R.drawable.photo_nba7, R.drawable.photo_nba8, R.drawable.photo_nba9}; 56 | mDatas.set(holder.getAdapterPosition(), res[randomNum]); 57 | notifyItemChanged(holder.getAdapterPosition(), this.getClass().getName()); 58 | if (mOnItemPhotoChangedListener != null) { 59 | mOnItemPhotoChangedListener.onItemPhotoChanged(); 60 | } 61 | } 62 | }); 63 | } 64 | 65 | @Override 66 | public int getItemCount() { 67 | return mDatas.size(); 68 | } 69 | 70 | static class MyHolder extends RecyclerView.ViewHolder { 71 | final ImageView mView; 72 | FloatingActionButton mChange; 73 | 74 | MyHolder(View itemView) { 75 | super(itemView); 76 | mView = itemView.findViewById(R.id.iv_photo); 77 | mChange = itemView.findViewById(R.id.fab_change); 78 | } 79 | } 80 | 81 | /** 82 | * 获取position位置的resId 83 | * 84 | * @param position int 85 | * @return int 86 | */ 87 | public int getResId(int position) { 88 | return mDatas == null ? 0 : mDatas.get(position); 89 | } 90 | 91 | public void setOnItemPhotoChangedListener(OnItemPhotoChangedListener mOnItemPhotoChangedListener) { 92 | this.mOnItemPhotoChangedListener = mOnItemPhotoChangedListener; 93 | } 94 | 95 | public interface OnItemPhotoChangedListener { 96 | /** 97 | * 局部更新后需要替换背景图片 98 | */ 99 | void onItemPhotoChanged(); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty1.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty10.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty11.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty12.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty13.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty2.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty3.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty4.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty5.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty6.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty7.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty8.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/beauty9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/beauty9.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_change.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/ic_change.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/photo_nba1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/photo_nba1.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/photo_nba2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/photo_nba2.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/photo_nba3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/photo_nba3.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/photo_nba4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/photo_nba4.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/photo_nba5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/photo_nba5.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/photo_nba6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/photo_nba6.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/photo_nba7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/photo_nba7.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/photo_nba8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/photo_nba8.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/photo_nba9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/drawable-xxhdpi/photo_nba9.jpg -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 17 | 18 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_gallery.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 17 | 18 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryanlijianchang/Recyclerview-Gallery/f1611b8fc4692fcf51aac556998ed69c7f43e89c/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values-v19/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #9E9E9E 4 | #6A1B9A 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RecyclerView-Gallery 3 | 4 | 5 | @drawable/beauty1 6 | @drawable/beauty2 7 | @drawable/beauty3 8 | @drawable/beauty4 9 | @drawable/beauty5 10 | @drawable/beauty6 11 | @drawable/beauty7 12 | @drawable/beauty8 13 | @drawable/beauty9 14 | @drawable/beauty10 15 | @drawable/beauty11 16 | @drawable/beauty12 17 | @drawable/beauty13 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |