├── .gitignore ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── allattentionhere │ │ └── fabulousfiltersample │ │ ├── ExampleFragment.java │ │ ├── FragmentExampleActivity.java │ │ ├── MainActivity.java │ │ ├── MainSampleActivity.java │ │ ├── MenuActivity.java │ │ ├── MovieData.java │ │ ├── MoviesAdapter.java │ │ ├── MyFabFragment.java │ │ ├── MySampleFabFragment.java │ │ ├── SingleMovie.java │ │ └── Util.java │ └── res │ ├── drawable │ ├── chip_selected.xml │ ├── chip_unselected.xml │ ├── done.xml │ ├── ic_filter.xml │ ├── refresh.xml │ └── states_fab_button.xml │ ├── layout │ ├── activity_fragment_example.xml │ ├── activity_main.xml │ ├── activity_main_sample.xml │ ├── activity_menu.xml │ ├── filter_sample_view.xml │ ├── filter_view.xml │ ├── fragment_example.xml │ ├── single_chip.xml │ ├── single_movie.xml │ └── view_filters_sorters.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 │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── concept.gif ├── fabulousfilter ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── allattentionhere │ │ └── fabulousfilter │ │ ├── AAH_ArcTranslateAnimation.java │ │ ├── AAH_FabulousFragment.java │ │ ├── AAH_FilterView.java │ │ └── viewpagerbottomsheet │ │ ├── BottomSheetUtils.java │ │ ├── ViewPagerBottomSheetBehavior.java │ │ ├── ViewPagerBottomSheetDialog.java │ │ └── ViewPagerBottomSheetDialogFragment.java │ └── res │ ├── anim │ ├── bottomsheet_enter.xml │ └── bottomsheet_exit.xml │ ├── layout │ └── design_view_pager_bottom_sheet_dialog.xml │ └── values │ ├── strings.xml │ └── styles.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── newDemo1.gif ├── newDemo2.gif ├── scripts ├── publish-module.gradle └── publish-root.gradle └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | 36 | # keys 37 | app/src/main/res/values/keys.xml 38 | 39 | .idea/ 40 | app/app.iml 41 | app/.DS_Store 42 | .DS_Store 43 | 44 | # Intellij 45 | *.iml 46 | .idea/workspace.xml 47 | .idea/tasks.xml 48 | .idea/gradle.xml 49 | .idea/dictionaries 50 | .idea/libraries 51 | 52 | # Keystore files 53 | *.jks 54 | 55 | # External native build folder generated in Android Studio 2.2 and later 56 | .externalNativeBuild 57 | 58 | # Google Services (e.g. APIs or Firebase) 59 | google-services.json 60 | 61 | # Freeline 62 | freeline.py 63 | freeline/ 64 | freeline_project_description.json 65 | -------------------------------------------------------------------------------- /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 | # FabulousFilter 2 | [![API](https://img.shields.io/badge/API-15%2B-brightgreen.svg)](https://android-arsenal.com/api?level=15) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FabulousFilter-2CB3E5.svg)]( https://android-arsenal.com/details/1/5943) [![Material Up](https://img.shields.io/badge/MaterialUp-FabulousFilter-2856b6.svg)](https://material.uplabs.com/posts/fabulousfilter-library) 3 | 4 | ### Show some :heart: and star the repo to support the project 5 | [![GitHub stars](https://img.shields.io/github/stars/Krupen/FabulousFilter.svg?style=social)](https://github.com/Krupen/FabulousFilter/stargazers) [![GitHub forks](https://img.shields.io/github/forks/Krupen/FabulousFilter.svg?style=social)](https://github.com/Krupen/FabulousFilter/network) [![GitHub watchers](https://img.shields.io/github/watchers/Krupen/FabulousFilter.svg?style=social)](https://github.com/Krupen/FabulousFilter/watchers) [![GitHub followers](https://img.shields.io/github/followers/Krupen.svg?style=social)](https://github.com/Krupen/followers) 6 | [![Twitter Follow](https://img.shields.io/twitter/follow/KrupenGhetiya.svg?style=social&label=Follow)](https://twitter.com/krupenghetiya) 7 | 8 | 9 | This library is the implementation of filter-concept posted on MaterialUp.com. 10 | 11 | It makes animation of FloatingActionButton to BottomSheetDialog easy to implement. 12 | 13 | # Concept 14 | ![fabulousfilter concept](https://raw.githubusercontent.com/Krupen/FabulousFilter/master/concept.gif) 15 | 16 | # Demo 17 | ![fabulousfilter demo 1](https://raw.githubusercontent.com/Krupen/FabulousFilter/master/newDemo1.gif) ![fabulousfilter demo 1](https://raw.githubusercontent.com/Krupen/FabulousFilter/master/newDemo2.gif) 18 | 19 | # Download 20 | **Gradle** 21 | 22 | Add the dependency to your app-level build.gradle file: 23 | 24 | ``` groovy 25 | dependencies { 26 | implementation 'io.github.krupen:fabulousfilter:0.0.6' 27 | } 28 | ``` 29 | 30 | # Usage 31 | 32 | Create a Fragment that extends `AAH_FabulousFragment`: 33 | ``` 34 | public class MySampleFabFragment extends AAH_FabulousFragment { 35 | 36 | public static MySampleFabFragment newInstance() { 37 | MySampleFabFragment f = new MySampleFabFragment(); 38 | return f; 39 | } 40 | 41 | @Override 42 | 43 | public void setupDialog(Dialog dialog, int style) { 44 | View contentView = View.inflate(getContext(), R.layout.filter_sample_view, null); 45 | RelativeLayout rl_content = (RelativeLayout) contentView.findViewById(R.id.rl_content); 46 | LinearLayout ll_buttons = (LinearLayout) contentView.findViewById(R.id.ll_buttons); 47 | contentView.findViewById(R.id.btn_close).setOnClickListener(new View.OnClickListener() { 48 | @Override 49 | public void onClick(View v) { 50 | closeFilter("closed"); 51 | } 52 | }); 53 | 54 | //params to set 55 | setAnimationDuration(600); //optional; default 500ms 56 | setInterpolator(new AccelerateDecelerateInterpolator()); // optional 57 | setPeekHeight(300); // optional; default 400dp 58 | setCallbacks((Callbacks) getActivity()); //optional; to get back result 59 | setAnimationListener((AnimationListener) getActivity()); //optional; to get animation callbacks 60 | setViewgroupStatic(ll_buttons); // optional; layout to stick at bottom on slide 61 | setViewPager(vp_types); //optional; if you use viewpager that has scrollview 62 | setViewMain(rl_content); //necessary; main bottomsheet view 63 | setMainContentView(contentView); // necessary; call at end before super 64 | super.setupDialog(dialog, style); //call super at last 65 | } 66 | 67 | } 68 | ``` 69 | Create view for the fragment which has parent element `AAH_FilterView`: 70 | ``` 71 | 77 | 78 | 87 | 88 | 96 | 97 | 98 | 99 | 100 | 101 | ``` 102 | 103 | Start the fragment on click of FloatingActionButton as below: 104 | ``` 105 | fab.setOnClickListener(new View.OnClickListener() { 106 | @Override 107 | public void onClick(View v) { 108 | MySampleFabFragment dialogFrag = MySampleFabFragment.newInstance(); 109 | dialogFrag.setParentFab(fab); 110 | dialogFrag.show(getSupportFragmentManager(), dialogFrag.getTag()); 111 | } 112 | }); 113 | ``` 114 | 115 | # Parameters 116 | 117 | * ### Main View (Required) 118 | This parameter specifies the ViewGroup of the bottom sheet to be shown after animation ends. It can be any ViewGroup(LinearLayout/FrameLayout etc): 119 | ``` 120 | setViewMain(relativelayout_content); 121 | ``` 122 | 123 | * ### Inflated Dialog View (Required) 124 | This parameter specifies the inflated view for the dialog: 125 | ``` 126 | setMainContentView(contentDialogView); 127 | ``` 128 | 129 | * ### Animation duration (Optional) 130 | This parameter sets animation duration of translate and scale animation in `milliseconds`: 131 | ``` 132 | setAnimationDuration(600); // default 500ms 133 | ``` 134 | 135 | * ### Interpolator (Optional) 136 | This parameter is used to set interpolator for fab animation: 137 | ``` 138 | setInterpolator(new AccelerateDecelerateInterpolator()); 139 | ``` 140 | 141 | * ### Peek Height (Optional) 142 | This parameter sets the peek height of the bottom sheet in `dp`: 143 | ``` 144 | setPeekHeight(300); // default 400dp 145 | ``` 146 | 147 | * ### Callback (Optional) 148 | This parameter is used to get callback from `AAH_FabulousFragment` to the component that called it: 149 | ``` 150 | setCallbacks((Callbacks) getActivity()); 151 | ``` 152 | To use it, implement the callback in the calling component(Activity/Fragment etc), example: 153 | ``` 154 | public class MainSampleActivity extends AppCompatActivity implements AAH_FabulousFragment.Callbacks { 155 | @Override 156 | protected void onCreate(Bundle savedInstanceState) { 157 | super.onCreate(savedInstanceState); 158 | setContentView(R.layout.activity_main_sample); 159 | } 160 | 161 | @Override 162 | public void onResult(Object result) { 163 | if (result.toString().equalsIgnoreCase("swiped_down")) { 164 | //do something or nothing 165 | } else { 166 | //handle result 167 | } 168 | } 169 | } 170 | 171 | ``` 172 | 173 | * ### Animation Listener (Optional) 174 | This parameter is used to get animation callbacks. 175 | ``` 176 | setAnimationListener((AnimationListener) getActivity()); 177 | ``` 178 | To use it, implement the AnimationListener in the calling component(Activity/Fragment etc), example: 179 | ``` 180 | public class MainSampleActivity extends AppCompatActivity implements AAH_FabulousFragment.AnimationListener { 181 | @Override 182 | protected void onCreate(Bundle savedInstanceState) { 183 | super.onCreate(savedInstanceState); 184 | setContentView(R.layout.activity_main_sample); 185 | } 186 | 187 | @Override 188 | public void onOpenAnimationStart() { 189 | //do something on open animation start 190 | } 191 | 192 | @Override 193 | public void onOpenAnimationEnd() { 194 | //do something on open animation end 195 | } 196 | 197 | @Override 198 | public void onCloseAnimationStart() { 199 | //do something on close animation start 200 | } 201 | 202 | @Override 203 | public void onCloseAnimationEnd() { 204 | //do something on close animation start 205 | } 206 | } 207 | 208 | ``` 209 | 210 | * ### Static View (Optional) 211 | This parameter is used to make view in Bottom Sheet static when user slides it. It can be any ViewGroup(LinearLayout/FrameLayout etc): 212 | ``` 213 | setViewgroupStatic(linearlayout_buttons); 214 | ``` 215 | 216 | * ### ViewPager (Optional) 217 | This parameter is used to support scrolling in ViewPager as BottomSheetDialog does not support multiple views with scroll: 218 | ``` 219 | setViewPager(viewPager); 220 | ``` 221 | # Libraries by developer 222 | * AutoplayVideos 223 | 224 | # Apps by developer 225 | [![Price Stalker](https://github.com/Krupen/AutoplayVideos/blob/master/pricestalker.png?raw=true)](https://play.google.com/store/apps/details?id=com.allattentionhere.pricestalker) [![Show Card Game](https://github.com/Krupen/AutoplayVideos/blob/master/show.png?raw=true)](https://play.google.com/store/apps/details?id=com.allattentionhere.show) [![Safio chat](https://github.com/Krupen/AutoplayVideos/blob/master/safiochat.png?raw=true)](https://play.google.com/store/apps/details?id=com.allattentionhere.safio) [![Dota Picker Pro](https://github.com/Krupen/AutoplayVideos/blob/master/dotapicker.png?raw=true)](https://play.google.com/store/apps/details?id=com.allattentionhere.heropickerpro) 226 | 227 | # License 228 | Copyright 2017 Krupen Ghetiya 229 | 230 | Licensed under the Apache License, Version 2.0 (the "License"); 231 | you may not use this file except in compliance with the License. 232 | You may obtain a copy of the License at 233 | 234 | http://www.apache.org/licenses/LICENSE-2.0 235 | 236 | Unless required by applicable law or agreed to in writing, software 237 | distributed under the License is distributed on an "AS IS" BASIS, 238 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 239 | See the License for the specific language governing permissions and 240 | limitations under the License. 241 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 33 5 | 6 | defaultConfig { 7 | applicationId "com.allattentionhere.fabulousfiltersample" 8 | minSdkVersion 15 9 | targetSdkVersion 33 10 | versionCode 1 11 | versionName "0.0.1" 12 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | implementation fileTree(include: ['*.jar'], dir: 'libs') 24 | androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { 25 | exclude group: 'com.android.support', module: 'support-annotations' 26 | }) 27 | implementation 'androidx.appcompat:appcompat:1.4.2' 28 | implementation 'com.squareup.picasso:picasso:2.5.2' 29 | implementation 'androidx.cardview:cardview:1.0.0' 30 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' 31 | implementation 'com.google.android.material:material:1.6.1' 32 | implementation 'com.google.android.flexbox:flexbox:3.0.0' 33 | testImplementation 'junit:junit:4.12' 34 | implementation project(':fabulousfilter') 35 | } 36 | -------------------------------------------------------------------------------- /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 /Users/krupenghetiya/Library/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/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 12 | 15 | 18 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/allattentionhere/fabulousfiltersample/ExampleFragment.java: -------------------------------------------------------------------------------- 1 | package com.allattentionhere.fabulousfiltersample; 2 | 3 | import android.content.res.Configuration; 4 | import android.os.Bundle; 5 | import com.google.android.material.floatingactionbutton.FloatingActionButton; 6 | import androidx.annotation.NonNull; 7 | import androidx.fragment.app.Fragment; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | 12 | import com.allattentionhere.fabulousfilter.AAH_FabulousFragment; 13 | 14 | public class ExampleFragment extends Fragment implements AAH_FabulousFragment.Callbacks { 15 | MySampleFabFragment dialogFragment; 16 | 17 | public static ExampleFragment newInstance() { 18 | return new ExampleFragment(); 19 | } 20 | 21 | public ExampleFragment() { 22 | // Required empty public constructor 23 | } 24 | 25 | @Override 26 | public View onCreateView( 27 | LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 28 | View rootView = inflater.inflate(R.layout.fragment_example, container, false); 29 | final FloatingActionButton fab = rootView.findViewById(R.id.fab); 30 | dialogFragment = MySampleFabFragment.newInstance(); 31 | dialogFragment.setParentFab(fab); 32 | fab.setOnClickListener( 33 | v -> { 34 | dialogFragment.setCallbacks(ExampleFragment.this); 35 | if (getActivity() != null && !getActivity().isFinishing()) { 36 | dialogFragment.show(getActivity().getSupportFragmentManager(), dialogFragment.getTag()); 37 | } 38 | }); 39 | return rootView; 40 | } 41 | 42 | @Override 43 | public void onResult(Object result) { 44 | if (result.toString().equalsIgnoreCase("swiped_down")) { 45 | // do something or nothing 46 | } else { 47 | // handle result 48 | } 49 | } 50 | 51 | @Override 52 | public void onConfigurationChanged(@NonNull Configuration newConfig) { 53 | super.onConfigurationChanged(newConfig); 54 | if (dialogFragment.isAdded()) { 55 | dialogFragment.dismiss(); 56 | if (getActivity() != null && !getActivity().isFinishing()) { 57 | dialogFragment.show(getActivity().getSupportFragmentManager(), dialogFragment.getTag()); 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/com/allattentionhere/fabulousfiltersample/FragmentExampleActivity.java: -------------------------------------------------------------------------------- 1 | package com.allattentionhere.fabulousfiltersample; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.fragment.app.FragmentTransaction; 6 | import androidx.appcompat.app.AppCompatActivity; 7 | import android.widget.FrameLayout; 8 | 9 | import com.allattentionhere.fabulousfilter.AAH_FabulousFragment; 10 | 11 | public class FragmentExampleActivity extends AppCompatActivity 12 | implements AAH_FabulousFragment.Callbacks { 13 | 14 | FrameLayout frameLayout; 15 | 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.activity_fragment_example); 20 | frameLayout = findViewById(R.id.fl); 21 | 22 | ExampleFragment exampleFragment = ExampleFragment.newInstance(); 23 | FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); 24 | transaction.replace(R.id.fl, exampleFragment, "tag"); 25 | transaction.commitAllowingStateLoss(); 26 | } 27 | 28 | @Override 29 | public void onResult(Object result) { 30 | if (result.toString().equalsIgnoreCase("swiped_down")) { 31 | // do something or nothing 32 | } else { 33 | // handle result 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/allattentionhere/fabulousfiltersample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.allattentionhere.fabulousfiltersample; 2 | 3 | import android.content.res.Configuration; 4 | import com.google.android.material.floatingactionbutton.FloatingActionButton; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.collection.ArrayMap; 8 | import androidx.appcompat.app.AppCompatActivity; 9 | import android.os.Bundle; 10 | import androidx.recyclerview.widget.DefaultItemAnimator; 11 | import androidx.recyclerview.widget.LinearLayoutManager; 12 | import androidx.recyclerview.widget.RecyclerView; 13 | import android.util.Log; 14 | import android.view.View; 15 | import android.widget.LinearLayout; 16 | 17 | import com.allattentionhere.fabulousfilter.AAH_FabulousFragment; 18 | import com.squareup.picasso.Picasso; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | import java.util.Map; 23 | 24 | public class MainActivity extends AppCompatActivity 25 | implements AAH_FabulousFragment.Callbacks, AAH_FabulousFragment.AnimationListener { 26 | 27 | FloatingActionButton fab, fab2; 28 | RecyclerView recyclerView; 29 | MovieData movieData; 30 | MoviesAdapter moviesAdapter; 31 | Picasso picasso; 32 | LinearLayout linearLayout; 33 | List singleMovieList = new ArrayList<>(); 34 | private final ArrayMap> appliedFilters = new ArrayMap<>(); 35 | MyFabFragment dialogFragment, dialogFragment1; 36 | 37 | @Override 38 | protected void onCreate(Bundle savedInstanceState) { 39 | super.onCreate(savedInstanceState); 40 | setContentView(R.layout.activity_main); 41 | fab = findViewById(R.id.fab); 42 | fab2 = findViewById(R.id.fab2); 43 | recyclerView = findViewById(R.id.recyclerView); 44 | linearLayout = findViewById(R.id.ll); 45 | 46 | movieData = Util.getMovies(); 47 | picasso = Picasso.with(this); 48 | singleMovieList.addAll(movieData.getAllMovies()); 49 | moviesAdapter = new MoviesAdapter(singleMovieList, picasso, MainActivity.this); 50 | LinearLayoutManager layoutManager = new LinearLayoutManager(this); 51 | recyclerView.setLayoutManager(layoutManager); 52 | recyclerView.setItemAnimator(new DefaultItemAnimator()); 53 | recyclerView.setAdapter(moviesAdapter); 54 | 55 | if (getIntent().getIntExtra("fab", 1) == 2) { 56 | fab2.setVisibility(View.VISIBLE); 57 | fab.setVisibility(View.GONE); 58 | linearLayout.setVisibility(View.VISIBLE); 59 | } else { 60 | fab2.setVisibility(View.GONE); 61 | fab.setVisibility(View.VISIBLE); 62 | linearLayout.setVisibility(View.GONE); 63 | } 64 | 65 | dialogFragment1 = MyFabFragment.newInstance(); 66 | dialogFragment1.setParentFab(fab); 67 | fab.setOnClickListener( 68 | v -> dialogFragment1.show(getSupportFragmentManager(), dialogFragment1.getTag())); 69 | 70 | dialogFragment = MyFabFragment.newInstance(); 71 | dialogFragment.setParentFab(fab2); 72 | fab2.setOnClickListener( 73 | v -> dialogFragment.show(getSupportFragmentManager(), dialogFragment.getTag())); 74 | } 75 | 76 | @Override 77 | public void onResult(Object result) { 78 | if (result.toString().equalsIgnoreCase("swiped_down")) { 79 | // do something or nothing 80 | } else { 81 | if (result != null) { 82 | ArrayMap> applied_filters = (ArrayMap>) result; 83 | if (applied_filters.size() != 0) { 84 | List filteredList = movieData.getAllMovies(); 85 | // iterate over arraymap 86 | for (Map.Entry> entry : applied_filters.entrySet()) { 87 | switch (entry.getKey()) { 88 | case "genre": 89 | filteredList = movieData.getGenreFilteredMovies(entry.getValue(), filteredList); 90 | break; 91 | case "rating": 92 | filteredList = movieData.getRatingFilteredMovies(entry.getValue(), filteredList); 93 | break; 94 | case "year": 95 | filteredList = movieData.getYearFilteredMovies(entry.getValue(), filteredList); 96 | break; 97 | case "quality": 98 | filteredList = movieData.getQualityFilteredMovies(entry.getValue(), filteredList); 99 | break; 100 | } 101 | } 102 | singleMovieList.clear(); 103 | singleMovieList.addAll(filteredList); 104 | moviesAdapter.notifyDataSetChanged(); 105 | 106 | } else { 107 | singleMovieList.addAll(movieData.getAllMovies()); 108 | moviesAdapter.notifyDataSetChanged(); 109 | } 110 | } 111 | // handle result 112 | } 113 | } 114 | 115 | public ArrayMap> getAppliedFilters() { 116 | return appliedFilters; 117 | } 118 | 119 | public MovieData getMovieData() { 120 | return movieData; 121 | } 122 | 123 | @Override 124 | public void onConfigurationChanged(@NonNull Configuration newConfig) { 125 | super.onConfigurationChanged(newConfig); 126 | if (dialogFragment.isAdded()) { 127 | dialogFragment.dismiss(); 128 | dialogFragment.show(getSupportFragmentManager(), dialogFragment.getTag()); 129 | } 130 | if (dialogFragment1.isAdded()) { 131 | dialogFragment1.dismiss(); 132 | dialogFragment1.show(getSupportFragmentManager(), dialogFragment1.getTag()); 133 | } 134 | } 135 | 136 | @Override 137 | public void onOpenAnimationStart() { 138 | Log.d("aah_animation", "onOpenAnimationStart: "); 139 | } 140 | 141 | @Override 142 | public void onOpenAnimationEnd() { 143 | Log.d("aah_animation", "onOpenAnimationEnd: "); 144 | } 145 | 146 | @Override 147 | public void onCloseAnimationStart() { 148 | Log.d("aah_animation", "onCloseAnimationStart: "); 149 | } 150 | 151 | @Override 152 | public void onCloseAnimationEnd() { 153 | Log.d("aah_animation", "onCloseAnimationEnd: "); 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /app/src/main/java/com/allattentionhere/fabulousfiltersample/MainSampleActivity.java: -------------------------------------------------------------------------------- 1 | package com.allattentionhere.fabulousfiltersample; 2 | 3 | import android.content.res.Configuration; 4 | import android.os.Bundle; 5 | import com.google.android.material.floatingactionbutton.FloatingActionButton; 6 | import androidx.annotation.NonNull; 7 | import androidx.appcompat.app.AppCompatActivity; 8 | import android.widget.RelativeLayout; 9 | import com.allattentionhere.fabulousfilter.AAH_FabulousFragment; 10 | 11 | public class MainSampleActivity extends AppCompatActivity 12 | implements AAH_FabulousFragment.Callbacks { 13 | 14 | FloatingActionButton fab; 15 | MySampleFabFragment dialogFragment; 16 | RelativeLayout root; 17 | 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_main_sample); 22 | fab = findViewById(R.id.fab); 23 | root = findViewById(R.id.root); 24 | dialogFragment = MySampleFabFragment.newInstance(); 25 | dialogFragment.setParentFab(fab); 26 | fab.setOnClickListener( 27 | v -> dialogFragment.show(getSupportFragmentManager(), dialogFragment.getTag())); 28 | } 29 | 30 | @Override 31 | public void onResult(Object result) { 32 | if (result.toString().equalsIgnoreCase("swiped_down")) { 33 | // do something or nothing 34 | } else { 35 | // handle result 36 | } 37 | } 38 | 39 | @Override 40 | public void onConfigurationChanged(@NonNull Configuration newConfig) { 41 | super.onConfigurationChanged(newConfig); 42 | if (dialogFragment.isAdded()) { 43 | dialogFragment.dismiss(); 44 | dialogFragment.show(getSupportFragmentManager(), dialogFragment.getTag()); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/allattentionhere/fabulousfiltersample/MenuActivity.java: -------------------------------------------------------------------------------- 1 | package com.allattentionhere.fabulousfiltersample; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import androidx.appcompat.app.AppCompatActivity; 6 | 7 | public class MenuActivity extends AppCompatActivity { 8 | 9 | @Override 10 | protected void onCreate(Bundle savedInstanceState) { 11 | super.onCreate(savedInstanceState); 12 | setContentView(R.layout.activity_menu); 13 | 14 | findViewById(R.id.btn_bottom) 15 | .setOnClickListener( 16 | v -> { 17 | Intent i = new Intent(MenuActivity.this, MainActivity.class); 18 | i.putExtra("fab", 1); 19 | startActivity(i); 20 | }); 21 | 22 | findViewById(R.id.btn_top) 23 | .setOnClickListener( 24 | v -> { 25 | Intent i = new Intent(MenuActivity.this, MainActivity.class); 26 | i.putExtra("fab", 2); 27 | startActivity(i); 28 | }); 29 | 30 | findViewById(R.id.btn_understanding) 31 | .setOnClickListener( 32 | v -> { 33 | Intent i = new Intent(MenuActivity.this, MainSampleActivity.class); 34 | startActivity(i); 35 | }); 36 | 37 | findViewById(R.id.btn_fragment) 38 | .setOnClickListener( 39 | v -> { 40 | Intent i = new Intent(MenuActivity.this, FragmentExampleActivity.class); 41 | startActivity(i); 42 | }); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/allattentionhere/fabulousfiltersample/MovieData.java: -------------------------------------------------------------------------------- 1 | package com.allattentionhere.fabulousfiltersample; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collections; 5 | import java.util.List; 6 | 7 | /** Created by krupenghetiya on 28/06/17. */ 8 | public class MovieData { 9 | private List singleMovieList; 10 | 11 | public MovieData(List singleMovieList) { 12 | this.singleMovieList = singleMovieList; 13 | } 14 | 15 | public List getAllMovies() { 16 | return singleMovieList; 17 | } 18 | 19 | public List getGenreFilteredMovies(List genre, List mList) { 20 | List tempList = new ArrayList<>(); 21 | for (SingleMovie movie : mList) { 22 | for (String g : genre) { 23 | if (movie.getGenre().equalsIgnoreCase(g)) { 24 | tempList.add(movie); 25 | } 26 | } 27 | } 28 | return tempList; 29 | } 30 | 31 | public List getYearFilteredMovies(List yearstr, List mList) { 32 | List tempList = new ArrayList<>(); 33 | for (SingleMovie movie : mList) { 34 | for (String y : yearstr) { 35 | if (movie.getYear() == Integer.parseInt(y)) { 36 | tempList.add(movie); 37 | } 38 | } 39 | } 40 | return tempList; 41 | } 42 | 43 | public List getQualityFilteredMovies(List quality, List mList) { 44 | List tempList = new ArrayList<>(); 45 | for (SingleMovie movie : mList) { 46 | for (String q : quality) { 47 | if (movie.getQuality().equalsIgnoreCase(q)) { 48 | tempList.add(movie); 49 | } 50 | } 51 | } 52 | return tempList; 53 | } 54 | 55 | public List getRatingFilteredMovies(List rating, List mList) { 56 | List tempList = new ArrayList<>(); 57 | for (SingleMovie movie : mList) { 58 | for (String r : rating) { 59 | if (movie.getRating() >= Float.parseFloat(r.replace(">", ""))) { 60 | tempList.add(movie); 61 | } 62 | } 63 | } 64 | return tempList; 65 | } 66 | 67 | public List getUniqueGenreKeys() { 68 | List genres = new ArrayList<>(); 69 | for (SingleMovie movie : singleMovieList) { 70 | if (!genres.contains(movie.getGenre())) { 71 | genres.add(movie.getGenre()); 72 | } 73 | } 74 | Collections.sort(genres); 75 | return genres; 76 | } 77 | 78 | public List getUniqueYearKeys() { 79 | List years = new ArrayList<>(); 80 | for (SingleMovie movie : singleMovieList) { 81 | if (!years.contains(movie.getYear() + "")) { 82 | years.add(movie.getYear() + ""); 83 | } 84 | } 85 | Collections.sort(years); 86 | return years; 87 | } 88 | 89 | public List getUniqueQualityKeys() { 90 | List qualities = new ArrayList<>(); 91 | for (SingleMovie movie : singleMovieList) { 92 | if (!qualities.contains(movie.getQuality())) { 93 | qualities.add(movie.getQuality()); 94 | } 95 | } 96 | Collections.sort(qualities); 97 | return qualities; 98 | } 99 | 100 | public List getUniqueRatingKeys() { 101 | List ratings = new ArrayList<>(); 102 | for (SingleMovie movie : singleMovieList) { 103 | int rating = (int) Math.floor(movie.getRating()); 104 | String rate = "> " + rating; 105 | if (!ratings.contains(rate)) { 106 | ratings.add(rate); 107 | } 108 | } 109 | Collections.sort(ratings); 110 | return ratings; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /app/src/main/java/com/allattentionhere/fabulousfiltersample/MoviesAdapter.java: -------------------------------------------------------------------------------- 1 | package com.allattentionhere.fabulousfiltersample; 2 | 3 | import android.app.Activity; 4 | import android.graphics.Bitmap; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.cardview.widget.CardView; 8 | import androidx.recyclerview.widget.RecyclerView; 9 | 10 | import android.view.LayoutInflater; 11 | import android.view.View; 12 | import android.view.ViewGroup; 13 | import android.widget.ImageView; 14 | import android.widget.LinearLayout; 15 | import android.widget.TextView; 16 | import android.widget.Toast; 17 | 18 | import com.squareup.picasso.Picasso; 19 | 20 | import java.util.List; 21 | 22 | /** Created by krupenghetiya on 27/06/17. */ 23 | public class MoviesAdapter extends RecyclerView.Adapter { 24 | 25 | List singleMovieList; 26 | Picasso picasso; 27 | Activity _activity; 28 | 29 | public MoviesAdapter(List list_urls, Picasso p, Activity a) { 30 | this.singleMovieList = list_urls; 31 | this.picasso = p; 32 | this._activity = a; 33 | } 34 | 35 | @NonNull 36 | @Override 37 | public MovieViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 38 | View itemView = 39 | LayoutInflater.from(parent.getContext()).inflate(R.layout.single_movie, parent, false); 40 | return new MovieViewHolder(itemView); 41 | } 42 | 43 | @Override 44 | public void onBindViewHolder(@NonNull MovieViewHolder holder, int position) { 45 | LinearLayout.LayoutParams layoutParams = 46 | new LinearLayout.LayoutParams( 47 | ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); 48 | if (position == 0) { 49 | layoutParams.setMargins( 50 | (int) _activity.getResources().getDimension(R.dimen.card_margin), 51 | (int) _activity.getResources().getDimension(R.dimen.card_margin), 52 | (int) _activity.getResources().getDimension(R.dimen.card_margin), 53 | (int) _activity.getResources().getDimension(R.dimen.card_margin)); 54 | } else { 55 | layoutParams.setMargins( 56 | (int) _activity.getResources().getDimension(R.dimen.card_margin), 57 | 0, 58 | (int) _activity.getResources().getDimension(R.dimen.card_margin), 59 | (int) _activity.getResources().getDimension(R.dimen.card_margin)); 60 | } 61 | holder.cardView.setLayoutParams(layoutParams); 62 | 63 | picasso 64 | .load(singleMovieList.get(position).getMedium_cover_image()) 65 | .placeholder(android.R.color.darker_gray) 66 | .config(Bitmap.Config.RGB_565) 67 | .into(holder.cover); 68 | holder.title.setText(singleMovieList.get(position).getTitle()); 69 | holder.genre.setText("Genre: " + singleMovieList.get(position).getGenre()); 70 | holder.rating.setText("Rating: " + singleMovieList.get(position).getRating()); 71 | holder.year.setText("Year: " + singleMovieList.get(position).getYear()); 72 | holder.quality.setText("Quality: " + singleMovieList.get(position).getQuality()); 73 | holder.cardView.setOnClickListener( 74 | v -> 75 | Toast.makeText( 76 | v.getContext(), 77 | "Clicked: " + singleMovieList.get(position).getTitle(), 78 | Toast.LENGTH_SHORT) 79 | .show()); 80 | } 81 | 82 | @Override 83 | public int getItemCount() { 84 | return singleMovieList.size(); 85 | } 86 | 87 | public static class MovieViewHolder extends RecyclerView.ViewHolder { 88 | private final ImageView cover; 89 | private final TextView title; 90 | private final TextView genre; 91 | private final TextView rating; 92 | private final TextView year; 93 | private final TextView quality; 94 | private final CardView cardView; 95 | 96 | public MovieViewHolder(View x) { 97 | super(x); 98 | cover = x.findViewById(R.id.iv_cover); 99 | title = x.findViewById(R.id.tv_title); 100 | genre = x.findViewById(R.id.tv_genre); 101 | rating = x.findViewById(R.id.tv_rating); 102 | year = x.findViewById(R.id.tv_year); 103 | quality = x.findViewById(R.id.tv_quality); 104 | cardView = x.findViewById(R.id.card_view); 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /app/src/main/java/com/allattentionhere/fabulousfiltersample/MyFabFragment.java: -------------------------------------------------------------------------------- 1 | package com.allattentionhere.fabulousfiltersample; 2 | 3 | import android.app.Dialog; 4 | import android.os.Bundle; 5 | import androidx.annotation.NonNull; 6 | import androidx.annotation.Nullable; 7 | import com.google.android.material.tabs.TabLayout; 8 | import androidx.core.content.ContextCompat; 9 | import androidx.collection.ArrayMap; 10 | import androidx.viewpager.widget.PagerAdapter; 11 | import androidx.viewpager.widget.ViewPager; 12 | import android.view.LayoutInflater; 13 | import android.view.View; 14 | import android.view.ViewGroup; 15 | import android.view.animation.AccelerateDecelerateInterpolator; 16 | import android.widget.ImageButton; 17 | import android.widget.LinearLayout; 18 | import android.widget.RelativeLayout; 19 | import android.widget.TextView; 20 | import com.allattentionhere.fabulousfilter.AAH_FabulousFragment; 21 | import com.google.android.flexbox.FlexboxLayout; 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | /** Created by krupenghetiya on 23/06/17. */ 26 | public class MyFabFragment extends AAH_FabulousFragment { 27 | 28 | ArrayMap> appliedFilters = new ArrayMap<>(); 29 | List textViews = new ArrayList<>(); 30 | 31 | TabLayout tabsTypes; 32 | 33 | ImageButton refreshButton, applyButton; 34 | SectionsPagerAdapter sectionsPagerAdapter; 35 | 36 | public static MyFabFragment newInstance() { 37 | return new MyFabFragment(); 38 | } 39 | 40 | @Override 41 | public void onCreate(@Nullable Bundle savedInstanceState) { 42 | super.onCreate(savedInstanceState); 43 | appliedFilters = ((MainActivity) getActivity()).getAppliedFilters(); 44 | } 45 | 46 | @Override 47 | public void setupDialog(@NonNull Dialog dialog, int style) { 48 | View contentView = View.inflate(getContext(), R.layout.filter_view, null); 49 | 50 | RelativeLayout contentContainer = contentView.findViewById(R.id.rl_content); 51 | LinearLayout buttonsContainer = contentView.findViewById(R.id.ll_buttons); 52 | refreshButton = contentView.findViewById(R.id.imgbtn_refresh); 53 | applyButton = contentView.findViewById(R.id.imgbtn_apply); 54 | ViewPager typesViewPager = contentView.findViewById(R.id.vp_types); 55 | tabsTypes = contentView.findViewById(R.id.tabs_types); 56 | 57 | applyButton.setOnClickListener(v -> closeFilter(appliedFilters)); 58 | refreshButton.setOnClickListener( 59 | v -> { 60 | for (TextView tv : textViews) { 61 | tv.setTag("unselected"); 62 | tv.setBackgroundResource(R.drawable.chip_unselected); 63 | tv.setTextColor(ContextCompat.getColor(getContext(), R.color.filters_chips)); 64 | } 65 | appliedFilters.clear(); 66 | }); 67 | 68 | sectionsPagerAdapter = new SectionsPagerAdapter(); 69 | typesViewPager.setOffscreenPageLimit(4); 70 | typesViewPager.setAdapter(sectionsPagerAdapter); 71 | sectionsPagerAdapter.notifyDataSetChanged(); 72 | tabsTypes.setupWithViewPager(typesViewPager); 73 | 74 | // params to set 75 | setAnimationDuration(600); // optional; default 500ms 76 | setInterpolator(new AccelerateDecelerateInterpolator()); // optional; 77 | setPeekHeight(300); // optional; default 400dp 78 | setCallbacks((Callbacks) getActivity()); // optional; to get back result 79 | setAnimationListener((AnimationListener) getActivity()); // optional; to get animation callbacks 80 | setViewgroupStatic(buttonsContainer); // optional; layout to stick at bottom on slide 81 | setViewPager(typesViewPager); // optional; if you use viewpager that has scrollview 82 | setViewMain(contentContainer); // necessary; main bottomsheet view 83 | setMainContentView(contentView); // necessary; call at end before super 84 | super.setupDialog(dialog, style); // call super at last 85 | } 86 | 87 | public class SectionsPagerAdapter extends PagerAdapter { 88 | 89 | @NonNull 90 | @Override 91 | public Object instantiateItem(@NonNull ViewGroup collection, int position) { 92 | LayoutInflater inflater = LayoutInflater.from(getContext()); 93 | ViewGroup layout = 94 | (ViewGroup) inflater.inflate(R.layout.view_filters_sorters, collection, false); 95 | FlexboxLayout flexboxLayout = layout.findViewById(R.id.fbl); 96 | switch (position) { 97 | case 0: 98 | inflateLayoutWithFilters("genre", flexboxLayout); 99 | break; 100 | case 1: 101 | inflateLayoutWithFilters("rating", flexboxLayout); 102 | break; 103 | case 2: 104 | inflateLayoutWithFilters("year", flexboxLayout); 105 | break; 106 | case 3: 107 | inflateLayoutWithFilters("quality", flexboxLayout); 108 | break; 109 | } 110 | collection.addView(layout); 111 | return layout; 112 | } 113 | 114 | @Override 115 | public void destroyItem(ViewGroup collection, int position, @NonNull Object view) { 116 | collection.removeView((View) view); 117 | } 118 | 119 | @Override 120 | public int getCount() { 121 | return 4; 122 | } 123 | 124 | @Override 125 | public CharSequence getPageTitle(int position) { 126 | switch (position) { 127 | case 0: 128 | return "GENRE"; 129 | case 1: 130 | return "RATING"; 131 | case 2: 132 | return "YEAR"; 133 | case 3: 134 | return "QUALITY"; 135 | } 136 | return ""; 137 | } 138 | 139 | @Override 140 | public boolean isViewFromObject(@NonNull View view, @NonNull Object object) { 141 | return view == object; 142 | } 143 | } 144 | 145 | private void inflateLayoutWithFilters(final String filter_category, FlexboxLayout fbl) { 146 | if (getContext() == null || getActivity() == null || getActivity().isFinishing()) { 147 | return; 148 | } 149 | List keys = new ArrayList<>(); 150 | switch (filter_category) { 151 | case "genre": 152 | keys = ((MainActivity) getActivity()).getMovieData().getUniqueGenreKeys(); 153 | break; 154 | case "rating": 155 | keys = ((MainActivity) getActivity()).getMovieData().getUniqueRatingKeys(); 156 | break; 157 | case "year": 158 | keys = ((MainActivity) getActivity()).getMovieData().getUniqueYearKeys(); 159 | break; 160 | case "quality": 161 | keys = ((MainActivity) getActivity()).getMovieData().getUniqueQualityKeys(); 162 | break; 163 | } 164 | 165 | for (int i = 0; i < keys.size(); i++) { 166 | View subChild = getActivity().getLayoutInflater().inflate(R.layout.single_chip, null); 167 | final TextView title = subChild.findViewById(R.id.txt_title); 168 | title.setText(keys.get(i)); 169 | final int finalI = i; 170 | final List finalKeys = keys; 171 | title.setOnClickListener( 172 | v -> { 173 | if (title.getTag() != null && title.getTag().equals("selected")) { 174 | title.setTag("unselected"); 175 | title.setBackgroundResource(R.drawable.chip_unselected); 176 | title.setTextColor(ContextCompat.getColor(getContext(), R.color.filters_chips)); 177 | removeFromSelectedMap(filter_category, finalKeys.get(finalI)); 178 | } else { 179 | title.setTag("selected"); 180 | title.setBackgroundResource(R.drawable.chip_selected); 181 | title.setTextColor(ContextCompat.getColor(getContext(), R.color.filters_header)); 182 | addToSelectedMap(filter_category, finalKeys.get(finalI)); 183 | } 184 | }); 185 | if (appliedFilters != null 186 | && appliedFilters.get(filter_category) != null 187 | && appliedFilters.get(filter_category).contains(keys.get(finalI))) { 188 | title.setTag("selected"); 189 | title.setBackgroundResource(R.drawable.chip_selected); 190 | title.setTextColor(ContextCompat.getColor(getContext(), R.color.filters_header)); 191 | } else { 192 | title.setBackgroundResource(R.drawable.chip_unselected); 193 | title.setTextColor(ContextCompat.getColor(getContext(), R.color.filters_chips)); 194 | } 195 | textViews.add(title); 196 | 197 | fbl.addView(subChild); 198 | } 199 | } 200 | 201 | private void addToSelectedMap(String key, String value) { 202 | if (appliedFilters.get(key) != null 203 | && appliedFilters.get(key) != null 204 | && !appliedFilters.get(key).contains(value)) { 205 | appliedFilters.get(key).add(value); 206 | } else { 207 | List temp = new ArrayList<>(); 208 | temp.add(value); 209 | appliedFilters.put(key, temp); 210 | } 211 | } 212 | 213 | private void removeFromSelectedMap(String key, String value) { 214 | if (appliedFilters.get(key) == null) { 215 | return; 216 | } 217 | if (appliedFilters.get(key).size() == 1) { 218 | appliedFilters.remove(key); 219 | } else { 220 | appliedFilters.get(key).remove(value); 221 | } 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /app/src/main/java/com/allattentionhere/fabulousfiltersample/MySampleFabFragment.java: -------------------------------------------------------------------------------- 1 | package com.allattentionhere.fabulousfiltersample; 2 | 3 | import android.app.Dialog; 4 | 5 | import androidx.annotation.NonNull; 6 | import android.view.View; 7 | import android.view.animation.DecelerateInterpolator; 8 | import android.widget.LinearLayout; 9 | import android.widget.RelativeLayout; 10 | import com.allattentionhere.fabulousfilter.AAH_FabulousFragment; 11 | 12 | /** Created by krupenghetiya on 23/06/17. */ 13 | public class MySampleFabFragment extends AAH_FabulousFragment { 14 | 15 | public static MySampleFabFragment newInstance() { 16 | return new MySampleFabFragment(); 17 | } 18 | 19 | @Override 20 | public void setupDialog(@NonNull Dialog dialog, int style) { 21 | View contentView = View.inflate(getContext(), R.layout.filter_sample_view, null); 22 | 23 | RelativeLayout contentContainer = contentView.findViewById(R.id.rl_content); 24 | LinearLayout buttonsContainer = contentView.findViewById(R.id.ll_buttons); 25 | contentView.findViewById(R.id.btn_close).setOnClickListener(v -> closeFilter("closed")); 26 | 27 | // params to set 28 | setAnimationDuration(600); // optional; default 500ms 29 | setInterpolator(new DecelerateInterpolator()); // optional; 30 | setPeekHeight(300); // optional; default 400dp 31 | setCallbacks((Callbacks) getActivity()); // optional; to get back result 32 | setViewgroupStatic(buttonsContainer); // optional; layout to stick at bottom on slide 33 | // setViewPager(vp_types); //optional; if you use viewpager that has scrollview 34 | setViewMain(contentContainer); // necessary; main bottomsheet view 35 | setMainContentView(contentView); // necessary; call at end before super 36 | super.setupDialog(dialog, style); // call super at last 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/allattentionhere/fabulousfiltersample/SingleMovie.java: -------------------------------------------------------------------------------- 1 | package com.allattentionhere.fabulousfiltersample; 2 | 3 | /** Created by krupenghetiya on 27/06/17. */ 4 | public class SingleMovie { 5 | private final String title; 6 | private final String url; 7 | private final String medium_cover_image; 8 | private final String genre; 9 | private final String quality; 10 | private final int year; 11 | private final float rating; 12 | 13 | public SingleMovie( 14 | String title, 15 | String url, 16 | String medium_cover_image, 17 | String genre, 18 | String quality, 19 | int year, 20 | float rating) { 21 | this.title = title; 22 | this.url = url; 23 | this.medium_cover_image = medium_cover_image; 24 | this.genre = genre; 25 | this.quality = quality; 26 | this.year = year; 27 | this.rating = rating; 28 | } 29 | 30 | public String getTitle() { 31 | return title; 32 | } 33 | 34 | public String getUrl() { 35 | return url; 36 | } 37 | 38 | public String getMedium_cover_image() { 39 | return medium_cover_image; 40 | } 41 | 42 | public String getGenre() { 43 | return genre; 44 | } 45 | 46 | public String getQuality() { 47 | return quality; 48 | } 49 | 50 | public int getYear() { 51 | return year; 52 | } 53 | 54 | public float getRating() { 55 | return rating; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/allattentionhere/fabulousfiltersample/Util.java: -------------------------------------------------------------------------------- 1 | package com.allattentionhere.fabulousfiltersample; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** Created by krupenghetiya on 27/06/17. */ 7 | public class Util { 8 | 9 | public static MovieData getMovies() { 10 | 11 | List singleMovieList = new ArrayList<>(); 12 | singleMovieList.add( 13 | new SingleMovie( 14 | "Smurfs: The Lost Village", 15 | "https://yts.ag/movie/smurfs-the-lost-village-2017", 16 | "https://yts.ag/assets/images/movies/smurfs_the_lost_village_2017/medium-cover.jpg", 17 | "Adventure", 18 | "720p", 19 | 2017, 20 | 5.8f)); 21 | singleMovieList.add( 22 | new SingleMovie( 23 | "House of Strangers", 24 | "https://yts.ag/movie/house-of-strangers-1949", 25 | "https://yts.ag/assets/images/movies/house_of_strangers_1949/medium-cover.jpg", 26 | "Crime", 27 | "1080p", 28 | 1949, 29 | 7.4f)); 30 | singleMovieList.add( 31 | new SingleMovie( 32 | "Bonjour Tristesse", 33 | "https://yts.ag/movie/bonjour-tristesse-1958", 34 | "https://yts.ag/assets/images/movies/bonjour_tristesse_1958/medium-cover.jpg", 35 | "Drama", 36 | "3D", 37 | 1958, 38 | 7.0f)); 39 | singleMovieList.add( 40 | new SingleMovie( 41 | "Dragonwyck", 42 | "https://yts.ag/movie/dragonwyck-1946", 43 | "https://yts.ag/assets/images/movies/dragonwyck_1946/medium-cover.jpg", 44 | "Drama", 45 | "720p", 46 | 1946, 47 | 7.0f)); 48 | singleMovieList.add( 49 | new SingleMovie( 50 | "Barabbas", 51 | "https://yts.ag/movie/barabbas-1961", 52 | "https://yts.ag/assets/images/movies/barabbas_1961/medium-cover.jpg", 53 | "Adventure", 54 | "1080p", 55 | 1961, 56 | 7.0f)); 57 | singleMovieList.add( 58 | new SingleMovie( 59 | "Ghost in the Shell Arise: Border 4 - Ghost Stands Alone", 60 | "https://yts.ag/movie/ghost-in-the-shell-arise-border-4-ghost-stands-alone-2014", 61 | "https://yts.ag/assets/images/movies/ghost_in_the_shell_arise_border_4_ghost_stands_alone_2014/medium-cover.jpg", 62 | "Action", 63 | "3D", 64 | 2014, 65 | 7.4f)); 66 | singleMovieList.add( 67 | new SingleMovie( 68 | "Ghost in the Shell Arise: Border 3 - Ghost Tears", 69 | "https://yts.ag/movie/ghost-in-the-shell-arise-border-3-ghost-tears-2014", 70 | "https://yts.ag/assets/images/movies/ghost_in_the_shell_arise_border_3_ghost_tears_2014/medium-cover.jpg", 71 | "Action", 72 | "720p", 73 | 2014, 74 | 7.3f)); 75 | singleMovieList.add( 76 | new SingleMovie( 77 | "Extortion", 78 | "https://yts.ag/movie/extortion-2017", 79 | "https://yts.ag/assets/images/movies/extortion_2017/medium-cover.jpg", 80 | "Action", 81 | "1080p", 82 | 2017, 83 | 6.2f)); 84 | singleMovieList.add( 85 | new SingleMovie( 86 | "Is Genesis History?", 87 | "https://yts.ag/movie/is-genesis-history-2017", 88 | "https://yts.ag/assets/images/movies/is_genesis_history_2017/medium-cover.jpg", 89 | "Documentary", 90 | "3D", 91 | 2017, 92 | 4.6f)); 93 | singleMovieList.add( 94 | new SingleMovie( 95 | "Whoever Slew Auntie Roo?", 96 | "https://yts.ag/movie/whoever-slew-auntie-roo-1972", 97 | "https://yts.ag/assets/images/movies/whoever_slew_auntie_roo_1972/medium-cover.jpg", 98 | "Horror", 99 | "720p", 100 | 1972, 101 | 6.2f)); 102 | singleMovieList.add( 103 | new SingleMovie( 104 | "Moontrap: Target Earth", 105 | "https://yts.ag/movie/moontrap-target-earth-2017", 106 | "https://yts.ag/assets/images/movies/moontrap_target_earth_2017/medium-cover.jpg", 107 | "Action", 108 | "1080p", 109 | 2017, 110 | 2.8f)); 111 | singleMovieList.add( 112 | new SingleMovie( 113 | "Kong: Skull Island", 114 | "https://yts.ag/movie/kong-skull-island-2017", 115 | "https://yts.ag/assets/images/movies/kong_skull_island_2017/medium-cover.jpg", 116 | "Action", 117 | "3D", 118 | 2017, 119 | 6.9f)); 120 | singleMovieList.add( 121 | new SingleMovie( 122 | "Trail of the Pink Panther", 123 | "https://yts.ag/movie/trail-of-the-pink-panther-1982", 124 | "https://yts.ag/assets/images/movies/trail_of_the_pink_panther_1982/medium-cover.jpg", 125 | "Comedy", 126 | "720p", 127 | 1982, 128 | 4.9f)); 129 | singleMovieList.add( 130 | new SingleMovie( 131 | "The Babymoon", 132 | "https://yts.ag/movie/the-babymoon-2017", 133 | "https://yts.ag/assets/images/movies/the_babymoon_2017/medium-cover.jpg", 134 | "Action", 135 | "1080p", 136 | 2017, 137 | 4.9f)); 138 | singleMovieList.add( 139 | new SingleMovie( 140 | "Rabbit Hole", 141 | "https://yts.ag/movie/rabbit-hole-2010", 142 | "https://yts.ag/assets/images/movies/rabbit_hole_2010/medium-cover.jpg", 143 | "Drama", 144 | "3D", 145 | 2010, 146 | 7.0f)); 147 | singleMovieList.add( 148 | new SingleMovie( 149 | "Who'll Stop the Rain", 150 | "https://yts.ag/movie/wholl-stop-the-rain-1978", 151 | "https://yts.ag/assets/images/movies/wholl_stop_the_rain_1978/medium-cover.jpg", 152 | "Action", 153 | "720p", 154 | 1978, 155 | 6.8f)); 156 | singleMovieList.add( 157 | new SingleMovie( 158 | "Revenge of the Pink Panther", 159 | "https://yts.ag/movie/revenge-of-the-pink-panther-1978", 160 | "https://yts.ag/assets/images/movies/revenge_of_the_pink_panther_1978/medium-cover.jpg", 161 | "Comedy", 162 | "1080p", 163 | 1978, 164 | 6.7f)); 165 | singleMovieList.add( 166 | new SingleMovie( 167 | "Apprentice", 168 | "https://yts.ag/movie/apprentice-2016", 169 | "https://yts.ag/assets/images/movies/apprentice_2016/medium-cover.jpg", 170 | "Drama", 171 | "3D", 172 | 2016, 173 | 6.7f)); 174 | singleMovieList.add( 175 | new SingleMovie( 176 | "The Food Guide to Love", 177 | "https://yts.ag/movie/the-food-guide-to-love-2013", 178 | "https://yts.ag/assets/images/movies/the_food_guide_to_love_2013/medium-cover.jpg", 179 | "Comedy", 180 | "720p", 181 | 2013, 182 | 5.8f)); 183 | singleMovieList.add( 184 | new SingleMovie( 185 | "Youth in Revolt", 186 | "https://yts.ag/movie/youth-in-revolt-2009", 187 | "https://yts.ag/assets/images/movies/youth_in_revolt_2009/medium-cover.jpg", 188 | "Comedy", 189 | "1080p", 190 | 2009, 191 | 6.5f)); 192 | singleMovieList.add( 193 | new SingleMovie( 194 | "Gods and Generals", 195 | "https://yts.ag/movie/gods-and-generals-2003", 196 | "https://yts.ag/assets/images/movies/gods_and_generals_2003/medium-cover.jpg", 197 | "Drama", 198 | "3D", 199 | 2003, 200 | 6.3f)); 201 | singleMovieList.add( 202 | new SingleMovie( 203 | "D3: The Mighty Ducks", 204 | "https://yts.ag/movie/d3-the-mighty-ducks-1996", 205 | "https://yts.ag/assets/images/movies/d3_the_mighty_ducks_1996/medium-cover.jpg", 206 | "Action", 207 | "720p", 208 | 1996, 209 | 5.3f)); 210 | singleMovieList.add( 211 | new SingleMovie( 212 | "Airport", 213 | "https://yts.ag/movie/airport-1970", 214 | "https://yts.ag/assets/images/movies/airport_1970/medium-cover.jpg", 215 | "Action", 216 | "1080p", 217 | 1970, 218 | 6.6f)); 219 | singleMovieList.add( 220 | new SingleMovie( 221 | "The Zookeeper's Wife", 222 | "https://yts.ag/movie/the-zookeepers-wife-2017", 223 | "https://yts.ag/assets/images/movies/the_zookeepers_wife_2017/medium-cover.jpg", 224 | "Biography", 225 | "3D", 226 | 2017, 227 | 7.0f)); 228 | singleMovieList.add( 229 | new SingleMovie( 230 | "Evil Ed", 231 | "https://yts.ag/movie/evil-ed-1995", 232 | "https://yts.ag/assets/images/movies/evil_ed_1995/medium-cover.jpg", 233 | "Comedy", 234 | "720p", 235 | 1995, 236 | 5.5f)); 237 | singleMovieList.add( 238 | new SingleMovie( 239 | "Needful Things", 240 | "https://yts.ag/movie/needful-things-1993", 241 | "https://yts.ag/assets/images/movies/needful_things_1993/medium-cover.jpg", 242 | "Crime", 243 | "1080p", 244 | 1993, 245 | 6.2f)); 246 | singleMovieList.add( 247 | new SingleMovie( 248 | "Red Dog: True Blue", 249 | "https://yts.ag/movie/red-dog-true-blue-2016", 250 | "https://yts.ag/assets/images/movies/red_dog_true_blue_2016/medium-cover.jpg", 251 | "Comedy", 252 | "3D", 253 | 2016, 254 | 6.6f)); 255 | singleMovieList.add( 256 | new SingleMovie( 257 | "Jawbreaker", 258 | "https://yts.ag/movie/jawbreaker-1999", 259 | "https://yts.ag/assets/images/movies/jawbreaker_1999/medium-cover.jpg", 260 | "Action", 261 | "720p", 262 | 1999, 263 | 5.5f)); 264 | singleMovieList.add( 265 | new SingleMovie( 266 | "Alone in Berlin", 267 | "https://yts.ag/movie/alone-in-berlin-2016", 268 | "https://yts.ag/assets/images/movies/alone_in_berlin_2016/medium-cover.jpg", 269 | "Action", 270 | "1080p", 271 | 2016, 272 | 0.0f)); 273 | singleMovieList.add( 274 | new SingleMovie( 275 | "Song to Song", 276 | "https://yts.ag/movie/song-to-song-2017", 277 | "https://yts.ag/assets/images/movies/song_to_song_2017/medium-cover.jpg", 278 | "Drama", 279 | "3D", 280 | 2017, 281 | 6.2f)); 282 | singleMovieList.add( 283 | new SingleMovie( 284 | "Power Rangers", 285 | "https://yts.ag/movie/power-rangers-2017", 286 | "https://yts.ag/assets/images/movies/power_rangers_2017/medium-cover.jpg", 287 | "Action", 288 | "720p", 289 | 2017, 290 | 0.0f)); 291 | singleMovieList.add( 292 | new SingleMovie( 293 | "Immortal Beloved", 294 | "https://yts.ag/movie/immortal-beloved-1994", 295 | "https://yts.ag/assets/images/movies/immortal_beloved_1994/medium-cover.jpg", 296 | "Biography", 297 | "1080p", 298 | 1994, 299 | 7.5f)); 300 | singleMovieList.add( 301 | new SingleMovie( 302 | "The Eagle Huntress", 303 | "https://yts.ag/movie/the-eagle-huntress-2016", 304 | "https://yts.ag/assets/images/movies/the_eagle_huntress_2016/medium-cover.jpg", 305 | "Adventure", 306 | "3D", 307 | 2016, 308 | 7.5f)); 309 | singleMovieList.add( 310 | new SingleMovie( 311 | "CHIPS", 312 | "https://yts.ag/movie/chips-2017", 313 | "https://yts.ag/assets/images/movies/chips_2017/medium-cover.jpg", 314 | "Action", 315 | "720p", 316 | 2017, 317 | 5.8f)); 318 | singleMovieList.add( 319 | new SingleMovie( 320 | "Jawbone", 321 | "https://yts.ag/movie/jawbone-2017", 322 | "https://yts.ag/assets/images/movies/jawbone_2017/medium-cover.jpg", 323 | "Action", 324 | "1080p", 325 | 2017, 326 | 6.5f)); 327 | singleMovieList.add( 328 | new SingleMovie( 329 | "Dragonheart: Battle for the Heartfire", 330 | "https://yts.ag/movie/dragonheart-battle-for-the-heartfire-2017", 331 | "https://yts.ag/assets/images/movies/dragonheart_battle_for_the_heartfire_2017/medium-cover.jpg", 332 | "Fantasy", 333 | "3D", 334 | 2017, 335 | 5.2f)); 336 | singleMovieList.add( 337 | new SingleMovie( 338 | "Das Boot", 339 | "https://yts.ag/movie/das-boot-1981", 340 | "https://yts.ag/assets/images/movies/das_boot_1981/medium-cover.jpg", 341 | "Adventure", 342 | "720p", 343 | 1981, 344 | 8.4f)); 345 | singleMovieList.add( 346 | new SingleMovie( 347 | "The Belko Experiment", 348 | "https://yts.ag/movie/the-belko-experiment-2016", 349 | "https://yts.ag/assets/images/movies/the_belko_experiment_2016/medium-cover.jpg", 350 | "Action", 351 | "1080p", 352 | 2016, 353 | 6.1f)); 354 | singleMovieList.add( 355 | new SingleMovie( 356 | "Life", 357 | "https://yts.ag/movie/life-2017", 358 | "https://yts.ag/assets/images/movies/life_2017/medium-cover.jpg", 359 | "Horror", 360 | "3D", 361 | 2017, 362 | 6.7f)); 363 | singleMovieList.add( 364 | new SingleMovie( 365 | "The Carer", 366 | "https://yts.ag/movie/the-carer-2016", 367 | "https://yts.ag/assets/images/movies/the_carer_2016/medium-cover.jpg", 368 | "Comedy", 369 | "720p", 370 | 2016, 371 | 6.5f)); 372 | singleMovieList.add( 373 | new SingleMovie( 374 | "Altitude", 375 | "https://yts.ag/movie/altitude-2017", 376 | "https://yts.ag/assets/images/movies/altitude_2017/medium-cover.jpg", 377 | "Action", 378 | "1080p", 379 | 2017, 380 | 5.0f)); 381 | singleMovieList.add( 382 | new SingleMovie( 383 | "Wilson", 384 | "https://yts.ag/movie/wilson-2017", 385 | "https://yts.ag/assets/images/movies/wilson_2017/medium-cover.jpg", 386 | "Comedy", 387 | "3D", 388 | 2017, 389 | 5.8f)); 390 | singleMovieList.add( 391 | new SingleMovie( 392 | "On the Double", 393 | "https://yts.ag/movie/on-the-double-1961", 394 | "https://yts.ag/assets/images/movies/on_the_double_1961/medium-cover.jpg", 395 | "Adventure", 396 | "720p", 397 | 1961, 398 | 6.5f)); 399 | singleMovieList.add( 400 | new SingleMovie( 401 | "A Date with Miss Fortune", 402 | "https://yts.ag/movie/a-date-with-miss-fortune-2015", 403 | "https://yts.ag/assets/images/movies/a_date_with_miss_fortune_2015/medium-cover.jpg", 404 | "Comedy", 405 | "1080p", 406 | 2015, 407 | 5.5f)); 408 | singleMovieList.add( 409 | new SingleMovie( 410 | "Prevenge", 411 | "https://yts.ag/movie/prevenge-2016", 412 | "https://yts.ag/assets/images/movies/prevenge_2016/medium-cover.jpg", 413 | "Comedy", 414 | "3D", 415 | 2016, 416 | 6.0f)); 417 | singleMovieList.add( 418 | new SingleMovie( 419 | "We Go On", 420 | "https://yts.ag/movie/we-go-on-2016", 421 | "https://yts.ag/assets/images/movies/we_go_on_2016/medium-cover.jpg", 422 | "Action", 423 | "720p", 424 | 2016, 425 | 0.0f)); 426 | singleMovieList.add( 427 | new SingleMovie( 428 | "The Legend of Ben Hall", 429 | "https://yts.ag/movie/the-legend-of-ben-hall-2016", 430 | "https://yts.ag/assets/images/movies/the_legend_of_ben_hall_2016/medium-cover.jpg", 431 | "Action", 432 | "1080p", 433 | 2016, 434 | 6.0f)); 435 | singleMovieList.add( 436 | new SingleMovie( 437 | "Sniper", 438 | "https://yts.ag/movie/sniper-1993", 439 | "https://yts.ag/assets/images/movies/sniper_1993/medium-cover.jpg", 440 | "Action", 441 | "3D", 442 | 1993, 443 | 0.0f)); 444 | singleMovieList.add( 445 | new SingleMovie( 446 | "The Last Flight of Noah's Ark", 447 | "https://yts.ag/movie/the-last-flight-of-noahs-ark-1980", 448 | "https://yts.ag/assets/images/movies/the_last_flight_of_noahs_ark_1980/medium-cover.jpg", 449 | "Adventure", 450 | "720p", 451 | 1980, 452 | 5.8f)); 453 | singleMovieList.add( 454 | new SingleMovie( 455 | "I Tawt I Taw a Puddy Tat", 456 | "https://yts.ag/movie/i-tawt-i-taw-a-puddy-tat-2011", 457 | "https://yts.ag/assets/images/movies/i_tawt_i_taw_a_puddy_tat_2011/medium-cover.jpg", 458 | "na", 459 | "1080p", 460 | 2011, 461 | 6.5f)); 462 | singleMovieList.add( 463 | new SingleMovie( 464 | "I Tawt I Taw a Puddy Tat", 465 | "https://yts.ag/movie/i-tawt-i-taw-a-puddy-tat-2011", 466 | "https://yts.ag/assets/images/movies/i_tawt_i_taw_a_puddy_tat_2011/medium-cover.jpg", 467 | "Action", 468 | "1080p", 469 | 2011, 470 | 6.5f)); 471 | 472 | singleMovieList.add( 473 | new SingleMovie( 474 | "Tell Me How I Die", 475 | "https://yts.ag/movie/tell-me-how-i-die-2016", 476 | "https://yts.ag/assets/images/movies/tell_me_how_i_die_2016/medium-cover.jpg", 477 | "na", 478 | "720p", 479 | 2016, 480 | 5.0f)); 481 | singleMovieList.add( 482 | new SingleMovie( 483 | "12 Rounds", 484 | "https://yts.ag/movie/12-rounds-2009", 485 | "https://yts.ag/assets/images/movies/12_rounds_2009/medium-cover.jpg", 486 | "na", 487 | "1080p", 488 | 2009, 489 | 5.6f)); 490 | singleMovieList.add( 491 | new SingleMovie( 492 | "I Am Heath Ledger", 493 | "https://yts.ag/movie/i-am-heath-ledger-2017", 494 | "https://yts.ag/assets/images/movies/i_am_heath_ledger_2017/medium-cover.jpg", 495 | "na", 496 | "3D", 497 | 2017, 498 | 7.4f)); 499 | singleMovieList.add( 500 | new SingleMovie( 501 | "Table 19", 502 | "https://yts.ag/movie/table-19-2017", 503 | "https://yts.ag/assets/images/movies/table_19_2017/medium-cover.jpg", 504 | "na", 505 | "720p", 506 | 2017, 507 | 5.8f)); 508 | singleMovieList.add( 509 | new SingleMovie( 510 | "The LEGO Batman Movie", 511 | "https://yts.ag/movie/the-lego-batman-movie-2017", 512 | "https://yts.ag/assets/images/movies/the_lego_batman_movie_2017/medium-cover.jpg", 513 | "na", 514 | "1080p", 515 | 2017, 516 | 7.4f)); 517 | singleMovieList.add( 518 | new SingleMovie( 519 | "John Wick: Chapter 2", 520 | "https://yts.ag/movie/john-wick-chapter-2-2017", 521 | "https://yts.ag/assets/images/movies/john_wick_chapter_2_2017/medium-cover.jpg", 522 | "na", 523 | "3D", 524 | 2017, 525 | 7.8f)); 526 | singleMovieList.add( 527 | new SingleMovie( 528 | "The Sea Shall Not Have Them", 529 | "https://yts.ag/movie/the-sea-shall-not-have-them-1954", 530 | "https://yts.ag/assets/images/movies/the_sea_shall_not_have_them_1954/medium-cover.jpg", 531 | "na", 532 | "720p", 533 | 1954, 534 | 6.5f)); 535 | singleMovieList.add( 536 | new SingleMovie( 537 | "How to Murder Your Wife", 538 | "https://yts.ag/movie/how-to-murder-your-wife-1965", 539 | "https://yts.ag/assets/images/movies/how_to_murder_your_wife_1965/medium-cover.jpg", 540 | "na", 541 | "1080p", 542 | 1965, 543 | 0.0f)); 544 | singleMovieList.add( 545 | new SingleMovie( 546 | "Alvarez Kelly", 547 | "https://yts.ag/movie/alvarez-kelly-1966", 548 | "https://yts.ag/assets/images/movies/alvarez_kelly_1966/medium-cover.jpg", 549 | "na", 550 | "3D", 551 | 1966, 552 | 6.4f)); 553 | singleMovieList.add( 554 | new SingleMovie( 555 | "The Vagrant", 556 | "https://yts.ag/movie/the-vagrant-1992", 557 | "https://yts.ag/assets/images/movies/the_vagrant_1992/medium-cover.jpg", 558 | "na", 559 | "720p", 560 | 1992, 561 | 5.8f)); 562 | singleMovieList.add( 563 | new SingleMovie( 564 | "Queen Rock Montreal & Live Aid", 565 | "https://yts.ag/movie/queen-rock-montreal-live-aid-2007", 566 | "https://yts.ag/assets/images/movies/queen_rock_montreal_live_aid_2007/medium-cover.jpg", 567 | "na", 568 | "1080p", 569 | 2007, 570 | 0.0f)); 571 | singleMovieList.add( 572 | new SingleMovie( 573 | "Overboard", 574 | "https://yts.ag/movie/overboard-1987", 575 | "https://yts.ag/assets/images/movies/overboard_1987/medium-cover.jpg", 576 | "na", 577 | "3D", 578 | 1987, 579 | 6.8f)); 580 | singleMovieList.add( 581 | new SingleMovie( 582 | "Peaceful Warrior", 583 | "https://yts.ag/movie/peaceful-warrior-2006", 584 | "https://yts.ag/assets/images/movies/peaceful_warrior_2006/medium-cover.jpg", 585 | "na", 586 | "720p", 587 | 2006, 588 | 7.3f)); 589 | singleMovieList.add( 590 | new SingleMovie( 591 | "The Axe Murders of Villisca", 592 | "https://yts.ag/movie/the-axe-murders-of-villisca-2016", 593 | "https://yts.ag/assets/images/movies/the_axe_murders_of_villisca_2016/medium-cover.jpg", 594 | "na", 595 | "1080p", 596 | 2016, 597 | 4.3f)); 598 | singleMovieList.add( 599 | new SingleMovie( 600 | "Viking Legacy", 601 | "https://yts.ag/movie/viking-legacy-2016", 602 | "https://yts.ag/assets/images/movies/viking_legacy_2016/medium-cover.jpg", 603 | "na", 604 | "3D", 605 | 2016, 606 | 2.6f)); 607 | singleMovieList.add( 608 | new SingleMovie( 609 | "Child of Satan", 610 | "https://yts.ag/movie/child-of-satan-2017", 611 | "https://yts.ag/assets/images/movies/child_of_satan_2017/medium-cover.jpg", 612 | "na", 613 | "720p", 614 | 2017, 615 | 2.1f)); 616 | singleMovieList.add( 617 | new SingleMovie( 618 | "Voice from the Stone", 619 | "https://yts.ag/movie/voice-from-the-stone-2017", 620 | "https://yts.ag/assets/images/movies/voice_from_the_stone_2017/medium-cover.jpg", 621 | "na", 622 | "1080p", 623 | 2017, 624 | 5.3f)); 625 | singleMovieList.add( 626 | new SingleMovie( 627 | "The Last Word", 628 | "https://yts.ag/movie/the-last-word-2017", 629 | "https://yts.ag/assets/images/movies/the_last_word_2017/medium-cover.jpg", 630 | "na", 631 | "3D", 632 | 2017, 633 | 6.5f)); 634 | singleMovieList.add( 635 | new SingleMovie( 636 | "Swallows and Amazons", 637 | "https://yts.ag/movie/swallows-and-amazons-2016", 638 | "https://yts.ag/assets/images/movies/swallows_and_amazons_2016/medium-cover.jpg", 639 | "na", 640 | "720p", 641 | 2016, 642 | 6.2f)); 643 | singleMovieList.add( 644 | new SingleMovie( 645 | "A Cure for Wellness", 646 | "https://yts.ag/movie/a-cure-for-wellness-2016", 647 | "https://yts.ag/assets/images/movies/a_cure_for_wellness_2016/medium-cover.jpg", 648 | "na", 649 | "1080p", 650 | 2016, 651 | 6.5f)); 652 | singleMovieList.add( 653 | new SingleMovie( 654 | "McLaren", 655 | "https://yts.ag/movie/mclaren-2017", 656 | "https://yts.ag/assets/images/movies/mclaren_2016/medium-cover.jpg", 657 | "na", 658 | "3D", 659 | 2017, 660 | 0.0f)); 661 | singleMovieList.add( 662 | new SingleMovie( 663 | "The Ticket", 664 | "https://yts.ag/movie/the-ticket-2016", 665 | "https://yts.ag/assets/images/movies/the_ticket_2016/medium-cover.jpg", 666 | "na", 667 | "720p", 668 | 2016, 669 | 5.3f)); 670 | singleMovieList.add( 671 | new SingleMovie( 672 | "Limelight", 673 | "https://yts.ag/movie/limelight-1952", 674 | "https://yts.ag/assets/images/movies/limelight_1952/medium-cover.jpg", 675 | "na", 676 | "1080p", 677 | 1952, 678 | 8.1f)); 679 | singleMovieList.add( 680 | new SingleMovie( 681 | "Bonded by Blood 2", 682 | "https://yts.ag/movie/bonded-by-blood-2-2017", 683 | "https://yts.ag/assets/images/movies/bonded_by_blood_2_2017/medium-cover.jpg", 684 | "na", 685 | "3D", 686 | 2017, 687 | 7.4f)); 688 | singleMovieList.add( 689 | new SingleMovie( 690 | "T2 Trainspotting", 691 | "https://yts.ag/movie/t2-trainspotting-2017", 692 | "https://yts.ag/assets/images/movies/t2_trainspotting_2017/medium-cover.jpg", 693 | "na", 694 | "720p", 695 | 2017, 696 | 7.4f)); 697 | singleMovieList.add( 698 | new SingleMovie( 699 | "The Last Face", 700 | "https://yts.ag/movie/the-last-face-2016", 701 | "https://yts.ag/assets/images/movies/the_last_face_2016/medium-cover.jpg", 702 | "na", 703 | "1080p", 704 | 2016, 705 | 3.9f)); 706 | singleMovieList.add( 707 | new SingleMovie( 708 | "The Assignment", 709 | "https://yts.ag/movie/the-assignment-2016", 710 | "https://yts.ag/assets/images/movies/the_assignment_2016/medium-cover.jpg", 711 | "na", 712 | "3D", 713 | 2016, 714 | 4.5f)); 715 | singleMovieList.add( 716 | new SingleMovie( 717 | "Aftermath", 718 | "https://yts.ag/movie/aftermath-2017", 719 | "https://yts.ag/assets/images/movies/aftermath_2017/medium-cover.jpg", 720 | "na", 721 | "720p", 722 | 2017, 723 | 5.7f)); 724 | singleMovieList.add( 725 | new SingleMovie( 726 | "Night of Something Strange", 727 | "https://yts.ag/movie/night-of-something-strange-2016", 728 | "https://yts.ag/assets/images/movies/night_of_something_strange_2016/medium-cover.jpg", 729 | "na", 730 | "1080p", 731 | 2016, 732 | 4.8f)); 733 | singleMovieList.add( 734 | new SingleMovie( 735 | "Molot", 736 | "https://yts.ag/movie/molot-2016", 737 | "https://yts.ag/assets/images/movies/molot_2016/medium-cover.jpg", 738 | "na", 739 | "3D", 740 | 2016, 741 | 4.7f)); 742 | singleMovieList.add( 743 | new SingleMovie( 744 | "The Devil's Candy", 745 | "https://yts.ag/movie/the-devils-candy-2015", 746 | "https://yts.ag/assets/images/movies/the_devils_candy_2015/medium-cover.jpg", 747 | "na", 748 | "720p", 749 | 2015, 750 | 6.5f)); 751 | singleMovieList.add( 752 | new SingleMovie( 753 | "Teen Witch", 754 | "https://yts.ag/movie/teen-witch-1989", 755 | "https://yts.ag/assets/images/movies/teen_witch_1989/medium-cover.jpg", 756 | "na", 757 | "1080p", 758 | 1989, 759 | 6.2f)); 760 | singleMovieList.add( 761 | new SingleMovie( 762 | "Off Piste", 763 | "https://yts.ag/movie/off-piste-2016", 764 | "https://yts.ag/assets/images/movies/off_piste_2016/medium-cover.jpg", 765 | "na", 766 | "3D", 767 | 2016, 768 | 4.4f)); 769 | singleMovieList.add( 770 | new SingleMovie( 771 | "Ana-ta-han", 772 | "https://yts.ag/movie/ana-ta-han-1953", 773 | "https://yts.ag/assets/images/movies/ana_ta_han_1953/medium-cover.jpg", 774 | "na", 775 | "720p", 776 | 1953, 777 | 7.5f)); 778 | singleMovieList.add( 779 | new SingleMovie( 780 | "Bang Bang Baby", 781 | "https://yts.ag/movie/bang-bang-baby-2014", 782 | "https://yts.ag/assets/images/movies/bang_bang_baby_2014/medium-cover.jpg", 783 | "na", 784 | "1080p", 785 | 2014, 786 | 5.0f)); 787 | singleMovieList.add( 788 | new SingleMovie( 789 | "Logan", 790 | "https://yts.ag/movie/logan-2017", 791 | "https://yts.ag/assets/images/movies/logan_2017/medium-cover.jpg", 792 | "na", 793 | "3D", 794 | 2017, 795 | 8.3f)); 796 | singleMovieList.add( 797 | new SingleMovie( 798 | "Rita, Sue and Bob Too", 799 | "https://yts.ag/movie/rita-sue-and-bob-too-1987", 800 | "https://yts.ag/assets/images/movies/rita_sue_and_bob_too_1987/medium-cover.jpg", 801 | "na", 802 | "720p", 803 | 1987, 804 | 6.5f)); 805 | singleMovieList.add( 806 | new SingleMovie( 807 | "MacArthur", 808 | "https://yts.ag/movie/macarthur-1977", 809 | "https://yts.ag/assets/images/movies/macarthur_1977/medium-cover.jpg", 810 | "na", 811 | "1080p", 812 | 1977, 813 | 6.6f)); 814 | singleMovieList.add( 815 | new SingleMovie( 816 | "King Arthur and the Knights of the Round Table", 817 | "https://yts.ag/movie/king-arthur-and-the-knights-of-the-round-table-2017", 818 | "https://yts.ag/assets/images/movies/king_arthur_and_the_knights_of_the_round_table_2017/medium-cover.jpg", 819 | "na", 820 | "3D", 821 | 2017, 822 | 2.5f)); 823 | singleMovieList.add( 824 | new SingleMovie( 825 | "Albion: The Enchanted Stallion", 826 | "https://yts.ag/movie/albion-the-enchanted-stallion-2016", 827 | "https://yts.ag/assets/images/movies/albion_the_enchanted_stallion_2016/medium-cover.jpg", 828 | "na", 829 | "720p", 830 | 2016, 831 | 4.8f)); 832 | singleMovieList.add( 833 | new SingleMovie( 834 | "The Comedian", 835 | "https://yts.ag/movie/the-comedian-2016", 836 | "https://yts.ag/assets/images/movies/the_comedian_2016/medium-cover.jpg", 837 | "na", 838 | "1080p", 839 | 2016, 840 | 0.0f)); 841 | singleMovieList.add( 842 | new SingleMovie( 843 | "Kill'em All", 844 | "https://yts.ag/movie/killem-all-2017", 845 | "https://yts.ag/assets/images/movies/killem_all_2017/medium-cover.jpg", 846 | "na", 847 | "3D", 848 | 2017, 849 | 4.2f)); 850 | singleMovieList.add( 851 | new SingleMovie( 852 | "M.S. Dhoni: The Untold Story", 853 | "https://yts.ag/movie/m-s-dhoni-the-untold-story-2016", 854 | "https://yts.ag/assets/images/movies/m_s_dhoni_the_untold_story_2016/medium-cover.jpg", 855 | "na", 856 | "720p", 857 | 2016, 858 | 7.8f)); 859 | singleMovieList.add( 860 | new SingleMovie( 861 | "Knucklebones", 862 | "https://yts.ag/movie/knucklebones-2016", 863 | "https://yts.ag/assets/images/movies/knucklebones_2016/medium-cover.jpg", 864 | "na", 865 | "1080p", 866 | 2016, 867 | 3.8f)); 868 | singleMovieList.add( 869 | new SingleMovie( 870 | "Beauty and the Beast", 871 | "https://yts.ag/movie/beauty-and-the-beast-2017", 872 | "https://yts.ag/assets/images/movies/beauty_and_the_beast_2017/medium-cover.jpg", 873 | "na", 874 | "3D", 875 | 2017, 876 | 7.5f)); 877 | singleMovieList.add( 878 | new SingleMovie( 879 | "The Mephisto Waltz", 880 | "https://yts.ag/movie/the-mephisto-waltz-1971", 881 | "https://yts.ag/assets/images/movies/the_mephisto_waltz_1971/medium-cover.jpg", 882 | "na", 883 | "720p", 884 | 1971, 885 | 6.0f)); 886 | singleMovieList.add( 887 | new SingleMovie( 888 | "The Goose Steps Out", 889 | "https://yts.ag/movie/the-goose-steps-out-1942", 890 | "https://yts.ag/assets/images/movies/the_goose_steps_out_1942/medium-cover.jpg", 891 | "na", 892 | "1080p", 893 | 1942, 894 | 7.0f)); 895 | singleMovieList.add( 896 | new SingleMovie( 897 | "The California Kid", 898 | "https://yts.ag/movie/the-california-kid-1974", 899 | "https://yts.ag/assets/images/movies/the_california_kid_1974/medium-cover.jpg", 900 | "na", 901 | "3D", 902 | 1974, 903 | 6.6f)); 904 | singleMovieList.add( 905 | new SingleMovie( 906 | "My Cousin Vinny", 907 | "https://yts.ag/movie/my-cousin-vinny-1992", 908 | "https://yts.ag/assets/images/movies/my_cousin_vinny_1992/medium-cover.jpg", 909 | "na", 910 | "720p", 911 | 1992, 912 | 7.5f)); 913 | singleMovieList.add( 914 | new SingleMovie( 915 | "Mean Dreams", 916 | "https://yts.ag/movie/mean-dreams-2016", 917 | "https://yts.ag/assets/images/movies/mean_dreams_2016/medium-cover.jpg", 918 | "na", 919 | "1080p", 920 | 2016, 921 | 6.3f)); 922 | 923 | return new MovieData(singleMovieList); 924 | } 925 | } 926 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/chip_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/chip_unselected.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/done.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_filter.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/refresh.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/states_fab_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_fragment_example.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 21 | 22 | 23 | 24 | 29 | 41 | 42 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main_sample.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 19 | 20 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 |