├── .gitattributes ├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ ├── hitesh.xml │ └── profiles_settings.xml ├── dictionaries │ └── Hitesh_Sahu.xml ├── gradle.xml ├── libraries │ ├── MPAndroidChart_v3_0_2.xml │ ├── acra_4_8_5.xml │ ├── animated_vector_drawable_23_4_0.xml │ ├── appcompat_v7_23_4_0.xml │ ├── cardview_v7_23_4_0.xml │ ├── com_google_guava_1_6_0.xml │ ├── design_23_4_0.xml │ ├── glide_3_7_0.xml │ ├── gson_2_4.xml │ ├── kenburnsview_1_0_7.xml │ ├── library_1_0_5.xml │ ├── library_2_4_0.xml │ ├── palette_v7_23_4_0.xml │ ├── picasso_2_5_2.xml │ ├── recyclerview_v7_23_4_0.xml │ ├── support_annotations_23_4_0.xml │ ├── support_v4_23_4_0.xml │ └── support_vector_drawable_23_4_0.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── workspace.xml ├── Art ├── checkout_screen_visble_amount.png ├── collapsable_header_category.png ├── drag_drop_swipe_dismiss.png ├── empty_cart.png ├── home_screen.png ├── nav_drawer.png ├── persistance_storage_onrelaunch.png ├── product_category.png ├── product_detail.png ├── product_detail_from_cart.png ├── product_detail_suggestions.png ├── splash.png ├── visivle_total_amount.png └── visivle_total_amount_from_product_detail.png ├── README.md ├── app ├── build.gradle ├── libs │ └── com.google.guava_1.6.0.jar └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── font │ │ ├── CircleD_Font_by_CrazyForMusic.ttf │ │ └── DS-DIGIT.TTF │ ├── java │ └── com │ │ └── hitesh_sahu │ │ └── retailapp │ │ ├── AppController.java │ │ ├── domain │ │ ├── api │ │ │ ├── ProductCategoryLoaderTask.java │ │ │ └── ProductLoaderTask.java │ │ ├── helper │ │ │ ├── Connectivity.java │ │ │ ├── JSONParser.java │ │ │ └── NetworkConstants.java │ │ ├── mining │ │ │ ├── AprioriFrequentItemsetGenerator.java │ │ │ └── FrequentItemsetData.java │ │ └── mock │ │ │ └── FakeWebServer.java │ │ ├── model │ │ ├── CenterRepository.java │ │ └── entities │ │ │ ├── Money.java │ │ │ ├── Product.java │ │ │ └── ProductCategoryModel.java │ │ ├── util │ │ ├── Animatrix.java │ │ ├── AppConstants.java │ │ ├── ColorGenerator.java │ │ ├── FontText.java │ │ ├── PreferenceHelper.java │ │ ├── TinyDB.java │ │ └── Utils.java │ │ └── view │ │ ├── activities │ │ ├── APrioriResultActivity.java │ │ ├── ECartHomeActivity.java │ │ └── SplashActivity.java │ │ ├── adapter │ │ ├── CategoryListAdapter.java │ │ ├── ItemTouchHelperAdapter.java │ │ ├── ProductListAdapter.java │ │ ├── ProductsInCategoryPagerAdapter.java │ │ ├── ShoppingListAdapter.java │ │ └── SimilarProductsPagerAdapter.java │ │ ├── customview │ │ ├── ClickableViewPager.java │ │ ├── ItemTouchHelperAdapter.java │ │ ├── ItemTouchHelperViewHolder.java │ │ ├── LabelView.java │ │ ├── MathUtils.java │ │ ├── OnStartDragListener.java │ │ ├── ScrollableViewHelper.java │ │ ├── SimpleItemTouchHelperCallback.java │ │ ├── TextDrawable.java │ │ └── ViewDragHelper.java │ │ └── fragment │ │ ├── ContactUsFragment.java │ │ ├── HomeFragment.java │ │ ├── MyCartFragment.java │ │ ├── ProductDetailsFragment.java │ │ ├── ProductListFragment.java │ │ ├── ProductOverviewFragment.java │ │ ├── SearchProductFragment.java │ │ ├── SettingsFragment.java │ │ └── WhatsNewDialog.java │ └── res │ ├── anim │ ├── app_name_animation.xml │ ├── app_name_animation_back.xml │ ├── base_slide_left_out.xml │ ├── base_slide_right_in.xml │ ├── default_out_anim.xml │ ├── donot_move.xml │ ├── fade_in.xml │ ├── fade_out.xml │ ├── from_middle.xml │ ├── grow_color.xml │ ├── logo_animation.xml │ ├── logo_animation_back.xml │ ├── pro_animation.xml │ ├── pro_animation_back.xml │ ├── shrink_color.xml │ ├── simple_grow.xml │ ├── slide_down.xml │ ├── slide_in_left.xml │ ├── slide_in_right.xml │ ├── slide_in_up.xml │ ├── slide_left.xml │ ├── slide_out_left.xml │ ├── slide_out_right.xml │ ├── slide_out_up.xml │ ├── slide_right.xml │ ├── slide_up.xml │ ├── slide_up_left.xml │ ├── slide_up_right.xml │ └── to_middle.xml │ ├── drawable-hdpi │ ├── app_icon.png │ ├── cart.jpg │ ├── header.jpg │ ├── ic_action_search.png │ └── ic_drawer.png │ ├── drawable-mdpi │ ├── app_icon.png │ ├── ic_action_search.png │ └── ic_drawer.png │ ├── drawable-nodpi │ ├── header2.jpg │ ├── header_1.jpg │ └── nav_header_bg.png │ ├── drawable-v21 │ ├── ripple.xml │ └── ripple_accent.xml │ ├── drawable-xhdpi │ ├── app_icon.png │ ├── ic_action_search.png │ └── ic_drawer.png │ ├── drawable-xxhdpi │ ├── app_icon.png │ ├── ic_action_search.png │ └── ic_drawer.png │ ├── drawable-xxxhdpi │ ├── ic_action_search.png │ └── ic_drawer.png │ ├── drawable │ ├── above_shadow.xml │ ├── below_shadow.xml │ ├── btn_feed_action.xml │ ├── checkout_button.xml │ ├── green_g_plus_button.xml │ ├── ic_add_shopping_cart.png │ ├── ico_mic.png │ ├── img_circle_placeholder.xml │ ├── indicator_selected.xml │ ├── indicator_unselected.xml │ ├── no_items_found.jpg │ ├── round_text_add_item.xml │ ├── round_text_cart_item.xml │ ├── round_text_remove_item.xml │ ├── rounder_rectangle_visa_card.xml │ ├── shadow.xml │ ├── simplecircle.xml │ └── slide_down.png │ ├── layout │ ├── activity_apriori_result.xml │ ├── activity_ecart.xml │ ├── activity_splash.xml │ ├── connection_dialog.xml │ ├── drawer_header.xml │ ├── frag_about.xml │ ├── frag_category_details.xml │ ├── frag_my_cart.xml │ ├── frag_product_category.xml │ ├── frag_product_detail.xml │ ├── frag_product_list_fragment.xml │ ├── frag_search_product.xml │ ├── frag_settings.xml │ ├── item_category_list.xml │ ├── item_product_list.xml │ ├── toolbar.xml │ ├── toolbar_spinner.xml │ ├── toolbar_transparent.xml │ ├── toolbar_w_shadow.xml │ ├── view_bottom_anchor.xml │ └── view_show_similar.xml │ ├── menu │ ├── drawer.xml │ ├── menu_apriori.xml │ └── menu_main.xml │ ├── values-land │ └── dimens.xml │ ├── values-sw600dp │ └── dimens.xml │ ├── values-v21 │ └── styles.xml │ ├── values-w820dp │ └── dimens.xml │ ├── values │ ├── attrs.xml │ ├── colors.xml │ ├── dimens.xml │ ├── integers.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ └── changelog.xml ├── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── import-summary.txt └── settings.gradle /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the 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 | # Intellij 36 | *.iml 37 | 38 | # Keystore files 39 | *.jks 40 | 41 | # ========================= 42 | # Operating System Files 43 | # ========================= 44 | 45 | # OSX 46 | # ========================= 47 | 48 | .DS_Store 49 | .AppleDouble 50 | .LSOverride 51 | 52 | # Thumbnails 53 | ._* 54 | 55 | # Files that might appear in the root of a volume 56 | .DocumentRevisions-V100 57 | .fseventsd 58 | .Spotlight-V100 59 | .TemporaryItems 60 | .Trashes 61 | .VolumeIcon.icns 62 | 63 | # Directories potentially created on remote AFP share 64 | .AppleDB 65 | .AppleDesktop 66 | Network Trash Folder 67 | Temporary Items 68 | .apdisk 69 | 70 | # Windows 71 | # ========================= 72 | 73 | # Windows image file caches 74 | Thumbs.db 75 | ehthumbs.db 76 | 77 | # Folder config file 78 | Desktop.ini 79 | 80 | # Recycle Bin used on file shares 81 | $RECYCLE.BIN/ 82 | 83 | # Windows Installer files 84 | *.cab 85 | *.msi 86 | *.msm 87 | *.msp 88 | 89 | # Windows shortcuts 90 | *.lnk 91 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /.idea/copyright/hitesh.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/dictionaries/Hitesh_Sahu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/libraries/MPAndroidChart_v3_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/acra_4_8_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/animated_vector_drawable_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/appcompat_v7_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/cardview_v7_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_google_guava_1_6_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/design_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/glide_3_7_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/gson_2_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/kenburnsview_1_0_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/library_1_0_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/library_2_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/palette_v7_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/picasso_2_5_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/recyclerview_v7_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/support_annotations_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/support_v4_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/libraries/support_vector_drawable_23_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Android 39 | 40 | 41 | Android > Lint > Correctness 42 | 43 | 44 | Java 45 | 46 | 47 | Java language level migration aidsJava 48 | 49 | 50 | 51 | 52 | Android 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 74 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /Art/checkout_screen_visble_amount.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/checkout_screen_visble_amount.png -------------------------------------------------------------------------------- /Art/collapsable_header_category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/collapsable_header_category.png -------------------------------------------------------------------------------- /Art/drag_drop_swipe_dismiss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/drag_drop_swipe_dismiss.png -------------------------------------------------------------------------------- /Art/empty_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/empty_cart.png -------------------------------------------------------------------------------- /Art/home_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/home_screen.png -------------------------------------------------------------------------------- /Art/nav_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/nav_drawer.png -------------------------------------------------------------------------------- /Art/persistance_storage_onrelaunch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/persistance_storage_onrelaunch.png -------------------------------------------------------------------------------- /Art/product_category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/product_category.png -------------------------------------------------------------------------------- /Art/product_detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/product_detail.png -------------------------------------------------------------------------------- /Art/product_detail_from_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/product_detail_from_cart.png -------------------------------------------------------------------------------- /Art/product_detail_suggestions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/product_detail_suggestions.png -------------------------------------------------------------------------------- /Art/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/splash.png -------------------------------------------------------------------------------- /Art/visivle_total_amount.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/visivle_total_amount.png -------------------------------------------------------------------------------- /Art/visivle_total_amount_from_product_detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/Art/visivle_total_amount_from_product_detail.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Shopping App 2 | This is an Open Sourced full stack E-Commerce App. I started this Project out of cusiosity and absoulutely no vision but now it have eveolve to full size Shopping App. This repos hold basic E-commerce App POC which I had created 2 years back. You can download emo App to see what it looks like now. I also have PWA web App for the this project. If you are interested feel free to Ping me. 3 | 4 | # Try the Demo on PlayStore 5 | 6 | # https://play.google.com/store/apps/details?id=com.hitesh_sahu.retailapp&hl=en 7 | 8 | ![Alt text](https://lh3.googleusercontent.com/PjO9tgrzKjF6MfYQasTqPeErOhjAn4O6dFNhPFOCnm0YDaupeMPyG2w9ksPRFTl1FBs=h900-rw) 9 | 10 | ### What this project does :- 11 | 12 | #### View Layer 13 | - Single Activity Model with reusable Fragments. 14 | - Display categories of product (eg Electronic,Furnitures) 15 | - Display products in a given category (TV,Microwave,Vaccum cleaner) 16 | - Show Product Details. 17 | - Add any product to cart and update total item count and amount. 18 | - Swipe to Dismiss along with Drag-Drop in Shopping List Fragments 19 | - Swipe to dismiss in RecyclerView 20 | - Store cart list in DB for persistant storage. 21 | - Whats new dialog on new update 22 | 23 | #### Data and Domain Layer 24 | 25 | - Fetch and store list of Products and Categoreis from Mock Server. The Mock server mimic and return product data from real life Flipkart Server. 26 | - Persistant storage of Shopping List items when User close the App. 27 | - Loading and caching image from actual Flipkart's image URl with help of Glide 28 | - ACRA crash reporting (Planning to Move on Firebase) 29 | - Data Mining with Apriori Algorithm. 30 | 31 | ### What Is Not Included (feel free to Ping me if you want complete solution):- 32 | 33 | - Back End Web Server with Web API 34 | - Admin Panel 35 | - Web SIte. 36 | 37 | ## Got any Issue or Change Request :- 38 | 39 | Log it into Issue Tracker and please don't mail me. I am going to stop to replying to mails and whatsapp messages from June 2017. 40 | 41 | ## Screen shots 42 | 43 | 44 | 45 | 46 | ## Tablet 47 | 48 | 49 | # Legal 50 | 51 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | apply plugin: 'com.android.application' 10 | 11 | android { 12 | compileSdkVersion 23 13 | buildToolsVersion "23.0.3" 14 | 15 | defaultConfig { 16 | applicationId "com.hitesh_sahu.retailshop" 17 | minSdkVersion 14 18 | targetSdkVersion 23 19 | } 20 | 21 | buildTypes { 22 | release { 23 | minifyEnabled false 24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 25 | } 26 | } 27 | } 28 | 29 | dependencies { 30 | //Material design 31 | compile 'com.android.support:design:23.4.0' 32 | compile 'com.android.support:appcompat-v7:23.4.0' 33 | compile 'com.android.support:recyclerview-v7:23.4.0' 34 | compile 'com.android.support:cardview-v7:23.4.0' 35 | compile 'com.android.support:palette-v7:23.4.0' 36 | compile 'com.android.support:support-v4:23.4.0' 37 | 38 | compile 'com.google.code.gson:gson:2.4' 39 | compile 'ch.acra:acra:4.8.5' 40 | compile files('libs/com.google.guava_1.6.0.jar') 41 | compile 'com.github.bumptech.glide:glide:3.7.0' 42 | compile 'com.squareup.picasso:picasso:2.5.2' 43 | compile 'com.flaviofaria:kenburnsview:1.0.7' 44 | 45 | compile 'com.github.PhilJay:MPAndroidChart:v3.0.2' 46 | 47 | //Loading animations 48 | compile 'com.wang.avi:library:1.0.5' 49 | compile 'com.nineoldandroids:library:2.4.0' 50 | 51 | } 52 | -------------------------------------------------------------------------------- /app/libs/com.google.guava_1.6.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/libs/com.google.guava_1.6.0.jar -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 30 | 31 | 35 | 36 | 40 | 41 | 42 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /app/src/main/assets/font/CircleD_Font_by_CrazyForMusic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/assets/font/CircleD_Font_by_CrazyForMusic.ttf -------------------------------------------------------------------------------- /app/src/main/assets/font/DS-DIGIT.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/assets/font/DS-DIGIT.TTF -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/AppController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp; 10 | 11 | import android.app.Application; 12 | 13 | import com.hitesh_sahu.retailapp.util.PreferenceHelper; 14 | 15 | import org.acra.ACRA; 16 | import org.acra.ReportField; 17 | import org.acra.ReportingInteractionMode; 18 | import org.acra.annotation.ReportsCrashes; 19 | 20 | @ReportsCrashes(mailTo = "hiteshkrsahu@gmail.com", customReportContent = { 21 | ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, 22 | ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, 23 | ReportField.CUSTOM_DATA, ReportField.STACK_TRACE, ReportField.LOGCAT}, mode = ReportingInteractionMode.TOAST, resToastText = R.string.crash_toast_text) 24 | public class AppController extends Application { 25 | 26 | public static final String TAG = AppController.class.getSimpleName(); 27 | 28 | private static AppController mInstance; 29 | 30 | public static synchronized AppController getInstance() { 31 | return mInstance; 32 | } 33 | 34 | @Override 35 | public void onCreate() { 36 | super.onCreate(); 37 | mInstance = this; 38 | 39 | // The following line triggers the initialization of ACRA for crash Log Reposrting 40 | if (PreferenceHelper.getPrefernceHelperInstace().getBoolean( 41 | this, PreferenceHelper.SUBMIT_LOGS, true)) { 42 | ACRA.init(this); 43 | } 44 | } 45 | 46 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/domain/api/ProductCategoryLoaderTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.domain.api; 10 | 11 | import android.content.Context; 12 | import android.os.AsyncTask; 13 | import android.support.v7.widget.RecyclerView; 14 | import android.view.View; 15 | 16 | import com.hitesh_sahu.retailapp.R; 17 | import com.hitesh_sahu.retailapp.domain.mock.FakeWebServer; 18 | import com.hitesh_sahu.retailapp.util.AppConstants; 19 | import com.hitesh_sahu.retailapp.util.Utils; 20 | import com.hitesh_sahu.retailapp.util.Utils.AnimationType; 21 | import com.hitesh_sahu.retailapp.view.activities.ECartHomeActivity; 22 | import com.hitesh_sahu.retailapp.view.adapter.CategoryListAdapter; 23 | import com.hitesh_sahu.retailapp.view.adapter.CategoryListAdapter.OnItemClickListener; 24 | import com.hitesh_sahu.retailapp.view.fragment.ProductOverviewFragment; 25 | 26 | /** 27 | * The Class ImageLoaderTask. 28 | */ 29 | public class ProductCategoryLoaderTask extends AsyncTask { 30 | 31 | private static final int NUMBER_OF_COLUMNS = 2; 32 | private Context context; 33 | private RecyclerView recyclerView; 34 | 35 | public ProductCategoryLoaderTask(RecyclerView listView, Context context) { 36 | 37 | this.recyclerView = listView; 38 | this.context = context; 39 | } 40 | 41 | @Override 42 | protected void onPreExecute() { 43 | 44 | super.onPreExecute(); 45 | 46 | if (null != ((ECartHomeActivity) context).getProgressBar()) 47 | ((ECartHomeActivity) context).getProgressBar().setVisibility( 48 | View.VISIBLE); 49 | 50 | } 51 | 52 | @Override 53 | protected void onPostExecute(Void result) { 54 | super.onPostExecute(result); 55 | 56 | if (null != ((ECartHomeActivity) context).getProgressBar()) 57 | ((ECartHomeActivity) context).getProgressBar().setVisibility( 58 | View.GONE); 59 | 60 | if (recyclerView != null) { 61 | CategoryListAdapter simpleRecyclerAdapter = new CategoryListAdapter( 62 | context); 63 | 64 | recyclerView.setAdapter(simpleRecyclerAdapter); 65 | 66 | simpleRecyclerAdapter 67 | .SetOnItemClickListener(new OnItemClickListener() { 68 | 69 | @Override 70 | public void onItemClick(View view, int position) { 71 | 72 | AppConstants.CURRENT_CATEGORY = position; 73 | 74 | Utils.switchFragmentWithAnimation( 75 | R.id.frag_container, 76 | new ProductOverviewFragment(), 77 | ((ECartHomeActivity) context), null, 78 | AnimationType.SLIDE_LEFT); 79 | 80 | } 81 | }); 82 | } 83 | 84 | } 85 | 86 | @Override 87 | protected Void doInBackground(String... params) { 88 | 89 | try { 90 | Thread.sleep(3000); 91 | } catch (InterruptedException e) { 92 | e.printStackTrace(); 93 | } 94 | 95 | FakeWebServer.getFakeWebServer().addCategory(); 96 | 97 | return null; 98 | } 99 | 100 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/domain/helper/NetworkConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.domain.helper; 10 | 11 | 12 | // TODO: Auto-generated Javadoc 13 | 14 | /** 15 | * The Interface NetworkConstants. 16 | */ 17 | public interface NetworkConstants { 18 | public boolean DEBUGABLE = true; 19 | 20 | /** 21 | * The Constant URL_BASE_URI. 22 | */ 23 | // public static final String URL_BASE_URI = 24 | // "http://192.168.2.7:8080/Delivery2Home/"; 25 | 26 | public static final String URL_BASE_URI = "http://delivery2home.com" 27 | + "/Delivery2Home/"; 28 | 29 | /** 30 | * The Constant URL_GET_PRODUCTS_BY_CATEGORY. 31 | */ 32 | public static final String URL_GET_ALL_CATEGORY = URL_BASE_URI 33 | + "categories"; 34 | 35 | /** 36 | * The Constant URL_GET_PRODUCTS_BY_CATEGORY. 37 | */ 38 | public static final String URL_GET_PRODUCTS_MAP = URL_BASE_URI 39 | + "productMap"; 40 | 41 | /** 42 | * The Constant URL_GET_PRODUCTS_BY_CATEGORY. 43 | */ 44 | public static final String URL_PLACE_ORDER = URL_BASE_URI + "insertOrder"; 45 | 46 | public static final String URL_APPLY_COUPAN = URL_BASE_URI 47 | + "validateCoupan"; 48 | 49 | 50 | // ------------------------- 51 | // Products functionality 52 | /** 53 | * The Constant getProductByCategory. 54 | */ 55 | // ------------------------- 56 | public static final int GET_ALL_PRODUCT_BY_CATEGORY = 0; 57 | public static final int GET_ALL_PRODUCT = 1; 58 | public static final int GET_SHOPPING_LIST = 9; 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/domain/mining/FrequentItemsetData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.domain.mining; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | import java.util.Set; 14 | 15 | /** 16 | * This class holds the result information of a data-mining task. 17 | * 18 | * @author Rodion "rodde" Efremov 19 | * @version 1.6 (Sep 14, 2015) 20 | */ 21 | public class FrequentItemsetData { 22 | 23 | private final List> frequentItemsetList; 24 | private final Map, Integer> supportCountMap; 25 | private final double minimumSupport; 26 | private final int numberOfTransactions; 27 | 28 | FrequentItemsetData(List> frequentItemsetList, 29 | Map, Integer> supportCountMap, 30 | double minimumSupport, 31 | int transactionNumber) { 32 | this.frequentItemsetList = frequentItemsetList; 33 | this.supportCountMap = supportCountMap; 34 | this.minimumSupport = minimumSupport; 35 | this.numberOfTransactions = transactionNumber; 36 | } 37 | 38 | public List> getFrequentItemsetList() { 39 | return frequentItemsetList; 40 | } 41 | 42 | public Map, Integer> getSupportCountMap() { 43 | return supportCountMap; 44 | } 45 | 46 | public double getMinimumSupport() { 47 | return minimumSupport; 48 | } 49 | 50 | public int getTransactionNumber() { 51 | return numberOfTransactions; 52 | } 53 | 54 | public double getSupport(Set itemset) { 55 | return 1.0 * supportCountMap.get(itemset) / numberOfTransactions; 56 | } 57 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/model/CenterRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.model; 10 | 11 | import com.hitesh_sahu.retailapp.model.entities.Product; 12 | import com.hitesh_sahu.retailapp.model.entities.ProductCategoryModel; 13 | 14 | import java.util.ArrayList; 15 | import java.util.Collections; 16 | import java.util.HashSet; 17 | import java.util.List; 18 | import java.util.Map; 19 | import java.util.Set; 20 | import java.util.concurrent.ConcurrentHashMap; 21 | 22 | public class CenterRepository { 23 | 24 | private static CenterRepository centerRepository; 25 | 26 | private ArrayList listOfCategory = new ArrayList(); 27 | private ConcurrentHashMap> mapOfProductsInCategory = new ConcurrentHashMap>(); 28 | private List listOfProductsInShoppingList = Collections.synchronizedList(new ArrayList()); 29 | private List> listOfItemSetsForDataMining = new ArrayList<>(); 30 | 31 | public static CenterRepository getCenterRepository() { 32 | 33 | if (null == centerRepository) { 34 | centerRepository = new CenterRepository(); 35 | } 36 | return centerRepository; 37 | } 38 | 39 | 40 | public List getListOfProductsInShoppingList() { 41 | return listOfProductsInShoppingList; 42 | } 43 | 44 | public void setListOfProductsInShoppingList(ArrayList getShoppingList) { 45 | this.listOfProductsInShoppingList = getShoppingList; 46 | } 47 | 48 | public Map> getMapOfProductsInCategory() { 49 | 50 | return mapOfProductsInCategory; 51 | } 52 | 53 | public void setMapOfProductsInCategory(ConcurrentHashMap> mapOfProductsInCategory) { 54 | this.mapOfProductsInCategory = mapOfProductsInCategory; 55 | } 56 | 57 | public ArrayList getListOfCategory() { 58 | 59 | return listOfCategory; 60 | } 61 | 62 | public void setListOfCategory(ArrayList listOfCategory) { 63 | this.listOfCategory = listOfCategory; 64 | } 65 | 66 | public List> getItemSetList() { 67 | 68 | return listOfItemSetsForDataMining; 69 | } 70 | 71 | public void addToItemSetList(HashSet list) { 72 | listOfItemSetsForDataMining.add(list); 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/model/entities/Money.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.model.entities; 10 | 11 | import java.math.BigDecimal; 12 | import java.math.RoundingMode; 13 | import java.util.Currency; 14 | import java.util.Locale; 15 | 16 | public class Money { 17 | 18 | private static final Currency INR = Currency.getInstance(new Locale("en", 19 | "in")); 20 | private static final RoundingMode DEFAULT_ROUNDING = RoundingMode.HALF_EVEN; 21 | 22 | private BigDecimal amount; 23 | private Currency currency; 24 | 25 | Money(BigDecimal amount, Currency currency) { 26 | this(amount, currency, DEFAULT_ROUNDING); 27 | } 28 | 29 | Money(BigDecimal amount, Currency currency, RoundingMode rounding) { 30 | this.amount = amount; 31 | this.currency = currency; 32 | 33 | this.amount = amount.setScale(currency.getDefaultFractionDigits(), 34 | rounding); 35 | } 36 | 37 | public static Money rupees(BigDecimal amount) { 38 | return new Money(amount, INR); 39 | } 40 | 41 | public BigDecimal getAmount() { 42 | return amount; 43 | } 44 | 45 | public Currency getCurrency() { 46 | return currency; 47 | } 48 | 49 | @Override 50 | public String toString() { 51 | return getCurrency().getSymbol() + " " + getAmount(); 52 | } 53 | 54 | public String toString(Locale locale) { 55 | return getCurrency().getSymbol(locale) + " " + getAmount(); 56 | } 57 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/model/entities/Product.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | /** 10 | * 11 | */ 12 | package com.hitesh_sahu.retailapp.model.entities; 13 | 14 | /** 15 | * The Class Product used as model for Products. 16 | * 17 | * @author Hitesh 18 | */ 19 | public class Product { 20 | 21 | 22 | /** 23 | * The item short desc. 24 | */ 25 | private String description = ""; 26 | 27 | /** 28 | * The item detail. 29 | */ 30 | private String longDescription = ""; 31 | 32 | /** 33 | * The mrp. 34 | */ 35 | private String mrp; 36 | 37 | /** 38 | * The discount. 39 | */ 40 | private String discount; 41 | 42 | /** 43 | * The sell mrp. 44 | */ 45 | private String salePrice; 46 | 47 | /** 48 | * The quantity. 49 | */ 50 | private String orderQty; 51 | 52 | /** 53 | * The image url. 54 | */ 55 | private String imageUrl = ""; 56 | 57 | /** 58 | * The item name. 59 | */ 60 | private String productName = ""; 61 | 62 | private String productId = ""; 63 | 64 | /** 65 | * @param itemName 66 | * @param itemShortDesc 67 | * @param itemDetail 68 | * @param MRP 69 | * @param discount 70 | * @param sellMRP 71 | * @param quantity 72 | * @param imageURL 73 | */ 74 | public Product(String itemName, String itemShortDesc, String itemDetail, 75 | String MRP, String discount, String sellMRP, String quantity, 76 | String imageURL, String orderId) { 77 | this.productName = itemName; 78 | this.description = itemShortDesc; 79 | this.longDescription = itemDetail; 80 | this.mrp = MRP; 81 | this.discount = discount; 82 | this.salePrice = sellMRP; 83 | this.orderQty = quantity; 84 | this.imageUrl = imageURL; 85 | this.productId = orderId; 86 | } 87 | 88 | public String getProductId() { 89 | return productId; 90 | } 91 | 92 | public void setProductId(String productId) { 93 | this.productId = productId; 94 | } 95 | 96 | public String getItemName() { 97 | return productName; 98 | } 99 | 100 | public void setItemName(String itemName) { 101 | this.productName = itemName; 102 | } 103 | 104 | public String getItemShortDesc() { 105 | return description; 106 | } 107 | 108 | public void setItemShortDesc(String itemShortDesc) { 109 | this.description = itemShortDesc; 110 | } 111 | 112 | public String getItemDetail() { 113 | return longDescription; 114 | } 115 | 116 | public void setItemDetail(String itemDetail) { 117 | this.longDescription = itemDetail; 118 | } 119 | 120 | public String getMRP() { 121 | return this.mrp; 122 | } 123 | 124 | public void setMRP(String MRP) { 125 | this.mrp = MRP; 126 | } 127 | 128 | public String getDiscount() { 129 | return discount + "%"; 130 | } 131 | 132 | public void setDiscount(String discount) { 133 | this.discount = discount; 134 | } 135 | 136 | public String getDiscountNumeric() { 137 | return discount; 138 | } 139 | 140 | public String getSellMRP() { 141 | return salePrice; 142 | } 143 | 144 | public void setSellMRP(String sellMRP) { 145 | this.salePrice = sellMRP; 146 | } 147 | 148 | public String getQuantity() { 149 | return orderQty; 150 | } 151 | 152 | public void setQuantity(String quantity) { 153 | this.orderQty = quantity; 154 | } 155 | 156 | public String getImageURL() { 157 | return imageUrl; 158 | } 159 | 160 | public void setImageURL(String imageURL) { 161 | this.imageUrl = imageURL; 162 | } 163 | 164 | } 165 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/model/entities/ProductCategoryModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | /** 10 | * 11 | */ 12 | package com.hitesh_sahu.retailapp.model.entities; 13 | 14 | /** 15 | * @author Hitesh 16 | */ 17 | public class ProductCategoryModel { 18 | 19 | private String categoryName; 20 | private String categoryDescription; 21 | private String categoryDiscount; 22 | private String categoryImageUrl; 23 | /** 24 | * @param productCategoryName 25 | * @param productCategoryDescription 26 | * @param productCategoryDiscount 27 | * @param productCategoryUrl 28 | */ 29 | public ProductCategoryModel(String productCategoryName, String productCategoryDescription, 30 | String productCategoryDiscount, String productCategoryUrl) { 31 | super(); 32 | this.categoryName = productCategoryName; 33 | this.categoryDescription = productCategoryDescription; 34 | this.categoryDiscount = productCategoryDiscount; 35 | this.categoryImageUrl = productCategoryUrl; 36 | } 37 | 38 | /** 39 | * @return the idproductcategory 40 | */ 41 | public String getProductCategoryName() { 42 | return categoryName; 43 | } 44 | 45 | /** 46 | * @param idproductcategory the idproductcategory to set 47 | */ 48 | public void setProductCategoryName(String idproductcategory) { 49 | this.categoryName = idproductcategory; 50 | } 51 | 52 | /** 53 | * @return the productDescription 54 | */ 55 | public String getProductCategoryDescription() { 56 | return categoryDescription; 57 | } 58 | 59 | /** 60 | * @param productDescription the productDescription to set 61 | */ 62 | public void setProductCategoryDescription(String productDescription) { 63 | this.categoryDescription = productDescription; 64 | } 65 | 66 | /** 67 | * @return the productDiscount 68 | */ 69 | public String getProductCategoryDiscount() { 70 | return categoryDiscount; 71 | } 72 | 73 | /** 74 | * @param productDiscount the productDiscount to set 75 | */ 76 | public void setProductCategoryDiscount(String productDiscount) { 77 | this.categoryDiscount = productDiscount; 78 | } 79 | 80 | /** 81 | * @return the productUrl 82 | */ 83 | public String getProductCategoryImageUrl() { 84 | return categoryImageUrl; 85 | } 86 | 87 | /** 88 | * @param productUrl the productUrl to set 89 | */ 90 | public void setProductCategoryImageUrl(String productUrl) { 91 | this.categoryImageUrl = productUrl; 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/util/Animatrix.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.util; 10 | 11 | import android.animation.Animator; 12 | import android.animation.AnimatorListenerAdapter; 13 | import android.animation.ObjectAnimator; 14 | import android.os.Build; 15 | import android.view.View; 16 | import android.view.ViewAnimationUtils; 17 | import android.view.animation.AccelerateDecelerateInterpolator; 18 | import android.view.animation.OvershootInterpolator; 19 | import android.widget.SeekBar; 20 | 21 | /** 22 | * Created by Hitesh on 12-10-2016. 23 | */ 24 | public class Animatrix { 25 | 26 | public static void scale(View view, long delay) { 27 | view.setScaleX(0); 28 | view.setScaleY(0); 29 | view.animate() 30 | .scaleX(1) 31 | .scaleY(1) 32 | .setDuration(500) 33 | .setStartDelay(delay) 34 | .setInterpolator(new OvershootInterpolator()) 35 | .start(); 36 | } 37 | 38 | public static void slideUp(View view, long delay) { 39 | view.setTranslationY(0); 40 | view.animate() 41 | .scaleY(1) 42 | .setDuration(500) 43 | .setStartDelay(delay) 44 | .setInterpolator(new OvershootInterpolator()) 45 | .start(); 46 | } 47 | 48 | public static void animateSeekBar(SeekBar seekBar) { 49 | seekBar.setProgress(15); 50 | 51 | ObjectAnimator progressAnimator = ObjectAnimator.ofInt(seekBar, "progress", 15, 0); 52 | progressAnimator.setDuration(300); 53 | progressAnimator.setInterpolator(new AccelerateDecelerateInterpolator()); 54 | progressAnimator.start(); 55 | } 56 | 57 | public static void circularRevealView(View revealLayout) { 58 | 59 | int cx = revealLayout.getWidth() / 2; 60 | int cy = revealLayout.getHeight() / 2; 61 | 62 | float finalRadius = Math.max(revealLayout.getWidth(), revealLayout.getHeight()); 63 | 64 | // create the animator for this view (the start radius is zero) 65 | Animator circularReveal = null; 66 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 67 | circularReveal = ViewAnimationUtils.createCircularReveal(revealLayout, cx, cy, 0, finalRadius); 68 | 69 | circularReveal.setDuration(1000); 70 | 71 | // make the view visible and start the animation 72 | revealLayout.setVisibility(View.VISIBLE); 73 | 74 | circularReveal.start(); 75 | } else { 76 | revealLayout.setVisibility(View.VISIBLE); 77 | } 78 | } 79 | 80 | public static Animator exitReveal(final View myView) { 81 | // previously visible view 82 | 83 | // get the center for the clipping circle 84 | int cx = myView.getMeasuredWidth() / 2; 85 | int cy = myView.getMeasuredHeight() / 2; 86 | 87 | 88 | // get the initial radius for the clipping circle 89 | int initialRadius = myView.getWidth() / 2; 90 | 91 | // create the animation (the final radius is zero) 92 | Animator anim = 93 | null; 94 | 95 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 96 | anim = ViewAnimationUtils.createCircularReveal(myView, cx, cy, initialRadius, 0); 97 | 98 | // make the view invisible when the animation is done 99 | anim.addListener(new AnimatorListenerAdapter() { 100 | @Override 101 | public void onAnimationEnd(Animator animation) { 102 | super.onAnimationEnd(animation); 103 | myView.setVisibility(View.INVISIBLE); 104 | } 105 | }); 106 | } 107 | 108 | // anim.setDuration(800); 109 | 110 | // start the animation 111 | return anim; 112 | } 113 | 114 | 115 | } 116 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/util/AppConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.util; 10 | 11 | 12 | public class AppConstants { 13 | 14 | public static final String FIRST_TIME = "FirstTime"; 15 | public static final String WHATS_NEW_LAST_SHOWN = "whats_new_last_shown"; 16 | // Audio prefernces 17 | public static final String VIEW_PAGER_ANIME = "PagerAnime"; 18 | // Help Preference 19 | public static final String SUBMIT_LOGS = "CrashLogs"; 20 | public static int CURRENT_CATEGORY = 0; 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/util/ColorGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.util; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | import java.util.Random; 14 | 15 | /** 16 | * @author amulya 17 | * @datetime 14 Oct 2014, 5:20 PM 18 | */ 19 | public class ColorGenerator { 20 | 21 | public static ColorGenerator DEFAULT; 22 | 23 | public static ColorGenerator MATERIAL; 24 | 25 | static { 26 | DEFAULT = create(Arrays.asList( 27 | 0xfff16364, 28 | 0xfff58559, 29 | 0xfff9a43e, 30 | 0xffe4c62e, 31 | 0xff67bf74, 32 | 0xff59a2be, 33 | 0xff2093cd, 34 | 0xffad62a7, 35 | 0xff805781 36 | )); 37 | MATERIAL = create(Arrays.asList( 38 | 0xffe57373, 39 | 0xfff06292, 40 | 0xffba68c8, 41 | 0xff9575cd, 42 | 0xff7986cb, 43 | 0xff64b5f6, 44 | 0xff4fc3f7, 45 | 0xff4dd0e1, 46 | 0xff4db6ac, 47 | 0xff81c784, 48 | 0xffaed581, 49 | 0xffff8a65, 50 | 0xffd4e157, 51 | 0xffffd54f, 52 | 0xffffb74d, 53 | 0xffa1887f, 54 | 0xff90a4ae 55 | )); 56 | } 57 | 58 | private final List mColors; 59 | private final Random mRandom; 60 | 61 | private ColorGenerator(List colorList) { 62 | mColors = colorList; 63 | mRandom = new Random(System.currentTimeMillis()); 64 | } 65 | 66 | public static ColorGenerator create(List colorList) { 67 | return new ColorGenerator(colorList); 68 | } 69 | 70 | public int getRandomColor() { 71 | return mColors.get(mRandom.nextInt(mColors.size())); 72 | } 73 | 74 | public int getColor(Object key) { 75 | return mColors.get(Math.abs(key.hashCode()) % mColors.size()); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/util/FontText.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.util; 10 | 11 | import android.content.Context; 12 | import android.graphics.Typeface; 13 | import android.util.AttributeSet; 14 | import android.widget.TextView; 15 | 16 | public class FontText extends TextView { 17 | 18 | String TAG = getClass().getName(); 19 | private Context mContext; 20 | private String ttfName; 21 | 22 | public FontText(Context context) { 23 | super(context); 24 | this.mContext = context; 25 | } 26 | 27 | public FontText(Context context, AttributeSet attrs) { 28 | super(context, attrs); 29 | 30 | this.mContext = context; 31 | 32 | // Typeface.createFromAsset doesn't work in the layout editor. 33 | // Skipping... 34 | if (isInEditMode()) { 35 | return; 36 | } 37 | 38 | for (int i = 0; i < attrs.getAttributeCount(); i++) { 39 | this.ttfName = attrs.getAttributeValue(Utils.ATTRIBUTE_SCHEMA, 40 | Utils.ATTRIBUTE_TTF_KEY); 41 | 42 | if (null != ttfName) 43 | init(); 44 | } 45 | 46 | } 47 | 48 | public FontText(Context context, AttributeSet attrs, int defStyle) { 49 | super(context, attrs, defStyle); 50 | this.mContext = context; 51 | } 52 | 53 | private void init() { 54 | Typeface font = Utils.getFonts(mContext, ttfName); 55 | if (null != font) 56 | setTypeface(font); 57 | } 58 | 59 | @Override 60 | public void setTypeface(Typeface tf) { 61 | 62 | super.setTypeface(tf); 63 | } 64 | 65 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/util/PreferenceHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | /** 10 | * 11 | */ 12 | package com.hitesh_sahu.retailapp.util; 13 | 14 | import android.content.Context; 15 | import android.preference.PreferenceManager; 16 | 17 | /** 18 | * @author Hitesh 19 | */ 20 | public class PreferenceHelper { 21 | 22 | public final static String FIRST_TIME = "FirstTime"; 23 | public final static String WHATS_NEW_LAST_SHOWN = "whats_new_last_shown"; 24 | public final static String SUBMIT_LOGS = "CrashLogs"; 25 | // Handle Local Caching of data for responsiveness 26 | public static final String MY_CART_LIST_LOCAL = "MyCartItems"; 27 | private static final String USER_LOGGED_IN = "isLoggedIn"; 28 | private static PreferenceHelper preferenceHelperInstance = new PreferenceHelper(); 29 | 30 | private PreferenceHelper() { 31 | } 32 | 33 | public static PreferenceHelper getPrefernceHelperInstace() { 34 | 35 | return preferenceHelperInstance; 36 | } 37 | 38 | public void setBoolean(Context appContext, String key, Boolean value) { 39 | 40 | PreferenceManager.getDefaultSharedPreferences(appContext).edit() 41 | .putBoolean(key, value).apply(); 42 | } 43 | 44 | public void setInteger(Context appContext, String key, int value) { 45 | 46 | PreferenceManager.getDefaultSharedPreferences(appContext).edit() 47 | .putInt(key, value).apply(); 48 | } 49 | 50 | public void setFloat(Context appContext, String key, float value) { 51 | 52 | PreferenceManager.getDefaultSharedPreferences(appContext).edit() 53 | .putFloat(key, value).apply(); 54 | } 55 | 56 | public void setString(Context appContext, String key, String value) { 57 | 58 | PreferenceManager.getDefaultSharedPreferences(appContext).edit() 59 | .putString(key, value).apply(); 60 | } 61 | 62 | // To retrieve values from shared preferences: 63 | 64 | public boolean getBoolean(Context appContext, String key, 65 | Boolean defaultValue) { 66 | 67 | return PreferenceManager.getDefaultSharedPreferences(appContext) 68 | .getBoolean(key, defaultValue); 69 | } 70 | 71 | public int getInteger(Context appContext, String key, int defaultValue) { 72 | 73 | return PreferenceManager.getDefaultSharedPreferences(appContext) 74 | .getInt(key, defaultValue); 75 | } 76 | 77 | public float getString(Context appContext, String key, float defaultValue) { 78 | 79 | return PreferenceManager.getDefaultSharedPreferences(appContext) 80 | .getFloat(key, defaultValue); 81 | } 82 | 83 | public String getString(Context appContext, String key, String defaultValue) { 84 | 85 | return PreferenceManager.getDefaultSharedPreferences(appContext) 86 | .getString(key, defaultValue); 87 | } 88 | 89 | public void setUserLoggedIn(boolean UserLoggedIn, Context appContext) { 90 | 91 | setBoolean(appContext, USER_LOGGED_IN, UserLoggedIn); 92 | } 93 | 94 | public boolean isUserLoggedIn(Context appContext) { 95 | 96 | return getBoolean(appContext, USER_LOGGED_IN, false); 97 | } 98 | 99 | } 100 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/view/activities/SplashActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.view.activities; 10 | 11 | import android.content.Intent; 12 | import android.graphics.Typeface; 13 | import android.os.Bundle; 14 | import android.os.Handler; 15 | import android.support.v4.app.FragmentActivity; 16 | import android.view.animation.Animation; 17 | import android.view.animation.Animation.AnimationListener; 18 | import android.view.animation.AnimationUtils; 19 | import android.widget.ImageView; 20 | import android.widget.TextView; 21 | 22 | import com.hitesh_sahu.retailapp.R; 23 | 24 | 25 | public class SplashActivity extends FragmentActivity { 26 | 27 | private Animation animation; 28 | private ImageView logo; 29 | private TextView appTitle; 30 | private TextView appSlogan; 31 | 32 | @Override 33 | protected void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | setContentView(R.layout.activity_splash); 36 | 37 | logo = (ImageView) findViewById(R.id.logo_img); 38 | appTitle = (TextView) findViewById(R.id.track_txt); 39 | appSlogan = (TextView) findViewById(R.id.pro_txt); 40 | 41 | // Font path 42 | String fontPath = "font/CircleD_Font_by_CrazyForMusic.ttf"; 43 | // Loading Font Face 44 | Typeface tf = Typeface.createFromAsset(getAssets(), fontPath); 45 | 46 | // Applying font 47 | appTitle.setTypeface(tf); 48 | appSlogan.setTypeface(tf); 49 | 50 | if (savedInstanceState == null) { 51 | flyIn(); 52 | } 53 | 54 | new Handler().postDelayed(new Runnable() { 55 | 56 | @Override 57 | public void run() { 58 | endSplash(); 59 | } 60 | }, 3000); 61 | } 62 | 63 | private void flyIn() { 64 | animation = AnimationUtils.loadAnimation(this, R.anim.logo_animation); 65 | logo.startAnimation(animation); 66 | 67 | animation = AnimationUtils.loadAnimation(this, 68 | R.anim.app_name_animation); 69 | appTitle.startAnimation(animation); 70 | 71 | animation = AnimationUtils.loadAnimation(this, R.anim.pro_animation); 72 | appSlogan.startAnimation(animation); 73 | } 74 | 75 | private void endSplash() { 76 | animation = AnimationUtils.loadAnimation(this, 77 | R.anim.logo_animation_back); 78 | logo.startAnimation(animation); 79 | 80 | animation = AnimationUtils.loadAnimation(this, 81 | R.anim.app_name_animation_back); 82 | appTitle.startAnimation(animation); 83 | 84 | animation = AnimationUtils.loadAnimation(this, 85 | R.anim.pro_animation_back); 86 | appSlogan.startAnimation(animation); 87 | 88 | animation.setAnimationListener(new AnimationListener() { 89 | @Override 90 | public void onAnimationEnd(Animation arg0) { 91 | 92 | Intent intent = new Intent(getApplicationContext(), 93 | ECartHomeActivity.class); 94 | startActivity(intent); 95 | finish(); 96 | } 97 | 98 | @Override 99 | public void onAnimationRepeat(Animation arg0) { 100 | } 101 | 102 | @Override 103 | public void onAnimationStart(Animation arg0) { 104 | } 105 | }); 106 | 107 | } 108 | 109 | @Override 110 | public void onBackPressed() { 111 | // Do nothing 112 | } 113 | 114 | } 115 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/CategoryListAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.view.adapter; 10 | 11 | import android.content.Context; 12 | import android.support.v7.widget.RecyclerView; 13 | import android.view.LayoutInflater; 14 | import android.view.View; 15 | import android.view.ViewGroup; 16 | import android.widget.ImageView; 17 | import android.widget.TextView; 18 | 19 | import com.bumptech.glide.Glide; 20 | import com.hitesh_sahu.retailapp.R; 21 | import com.hitesh_sahu.retailapp.model.CenterRepository; 22 | import com.hitesh_sahu.retailapp.model.entities.ProductCategoryModel; 23 | import com.hitesh_sahu.retailapp.util.ColorGenerator; 24 | import com.hitesh_sahu.retailapp.view.customview.LabelView; 25 | import com.hitesh_sahu.retailapp.view.customview.TextDrawable; 26 | import com.hitesh_sahu.retailapp.view.customview.TextDrawable.IBuilder; 27 | 28 | import java.util.ArrayList; 29 | import java.util.List; 30 | 31 | /** 32 | * @author Hitesh Sahu (hiteshsahu.com) 33 | */ 34 | public class CategoryListAdapter extends 35 | RecyclerView.Adapter { 36 | 37 | public static List categoryList = new ArrayList(); 38 | OnItemClickListener clickListener; 39 | private ColorGenerator mColorGenerator = ColorGenerator.MATERIAL; 40 | private IBuilder mDrawableBuilder; 41 | private TextDrawable drawable; 42 | private String ImageUrl; 43 | private Context context; 44 | 45 | public CategoryListAdapter(Context context) { 46 | 47 | categoryList = CenterRepository.getCenterRepository().getListOfCategory(); 48 | 49 | this.context = context; 50 | } 51 | 52 | @Override 53 | public VersionViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { 54 | View view = LayoutInflater.from(viewGroup.getContext()).inflate( 55 | R.layout.item_category_list, viewGroup, false); 56 | VersionViewHolder viewHolder = new VersionViewHolder(view); 57 | return viewHolder; 58 | } 59 | 60 | @Override 61 | public void onBindViewHolder(VersionViewHolder versionViewHolder, 62 | int categoryIndex) { 63 | 64 | versionViewHolder.itemName.setText(categoryList.get(categoryIndex) 65 | .getProductCategoryName()); 66 | 67 | versionViewHolder.itemDesc.setText(categoryList.get(categoryIndex) 68 | .getProductCategoryDescription()); 69 | 70 | mDrawableBuilder = TextDrawable.builder().beginConfig().withBorder(4) 71 | .endConfig().roundRect(10); 72 | 73 | drawable = mDrawableBuilder.build(String.valueOf(categoryList 74 | .get(categoryIndex).getProductCategoryName().charAt(0)), 75 | mColorGenerator.getColor(categoryList.get(categoryIndex) 76 | .getProductCategoryName())); 77 | 78 | ImageUrl = categoryList.get(categoryIndex).getProductCategoryImageUrl(); 79 | 80 | Glide.with(context).load(ImageUrl).placeholder(drawable) 81 | .error(drawable).animate(R.anim.base_slide_right_in) 82 | .centerCrop().into(versionViewHolder.imagView); 83 | 84 | LabelView label = new LabelView(context); 85 | label.setText(categoryList.get(categoryIndex) 86 | .getProductCategoryDiscount()); 87 | label.setBackgroundColor(0xffE91E63); 88 | label.setTargetView(versionViewHolder.imagView, 10, 89 | LabelView.Gravity.RIGHT_TOP); 90 | 91 | } 92 | 93 | @Override 94 | public int getItemCount() { 95 | return categoryList == null ? 0 : categoryList.size(); 96 | } 97 | 98 | public void SetOnItemClickListener( 99 | final OnItemClickListener itemClickListener) { 100 | this.clickListener = itemClickListener; 101 | } 102 | 103 | public interface OnItemClickListener { 104 | public void onItemClick(View view, int position); 105 | } 106 | 107 | class VersionViewHolder extends RecyclerView.ViewHolder implements 108 | View.OnClickListener { 109 | TextView itemName, itemDesc, itemCost, availability, quanitity, 110 | addItem, removeItem; 111 | ImageView imagView; 112 | 113 | public VersionViewHolder(View itemView) { 114 | super(itemView); 115 | 116 | itemName = (TextView) itemView.findViewById(R.id.item_name); 117 | 118 | itemDesc = (TextView) itemView.findViewById(R.id.item_short_desc); 119 | 120 | itemName.setSelected(true); 121 | 122 | imagView = ((ImageView) itemView.findViewById(R.id.imageView)); 123 | 124 | itemView.setOnClickListener(this); 125 | 126 | } 127 | 128 | @Override 129 | public void onClick(View v) { 130 | clickListener.onItemClick(v, getPosition()); 131 | } 132 | } 133 | 134 | } 135 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/ItemTouchHelperAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.view.adapter; 10 | 11 | import android.support.v7.widget.RecyclerView; 12 | import android.support.v7.widget.helper.ItemTouchHelper; 13 | 14 | /** 15 | * Interface to listen for a move or dismissal event from a {@link ItemTouchHelper.Callback}. 16 | * 17 | * @author Paul Burke (ipaulpro) 18 | */ 19 | public interface ItemTouchHelperAdapter { 20 | 21 | /** 22 | * Called when an item has been dragged far enough to trigger a move. This is called every time 23 | * an item is shifted, and not at the end of a "drop" event.
24 | *
25 | * Implementations should call {@link RecyclerView.Adapter#notifyItemMoved(int, int)} after 26 | * adjusting the underlying data to reflect this move. 27 | * 28 | * @param fromPosition The start position of the moved item. 29 | * @param toPosition Then resolved position of the moved item. 30 | * @see RecyclerView#getAdapterPositionFor(RecyclerView.ViewHolder) 31 | * @see RecyclerView.ViewHolder#getAdapterPosition() 32 | */ 33 | void onItemMove(int fromPosition, int toPosition); 34 | 35 | 36 | /** 37 | * Called when an item has been dismissed by a swipe.
38 | *
39 | * Implementations should call {@link RecyclerView.Adapter#notifyItemRemoved(int)} after 40 | * adjusting the underlying data to reflect this removal. 41 | * 42 | * @param position The position of the item dismissed. 43 | * @see RecyclerView#getAdapterPositionFor(RecyclerView.ViewHolder) 44 | * @see RecyclerView.ViewHolder#getAdapterPosition() 45 | */ 46 | void onItemDismiss(int position); 47 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/view/adapter/ProductsInCategoryPagerAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.view.adapter; 10 | 11 | import android.support.v4.app.Fragment; 12 | import android.support.v4.app.FragmentManager; 13 | import android.support.v4.app.FragmentStatePagerAdapter; 14 | 15 | import java.util.ArrayList; 16 | import java.util.List; 17 | 18 | public class ProductsInCategoryPagerAdapter extends FragmentStatePagerAdapter { 19 | private final List mFragmentList = new ArrayList<>(); 20 | private final List mFragmentTitleList = new ArrayList<>(); 21 | 22 | public ProductsInCategoryPagerAdapter(FragmentManager manager) { 23 | super(manager); 24 | } 25 | 26 | @Override 27 | public Fragment getItem(int position) { 28 | return mFragmentList.get(position); 29 | } 30 | 31 | @Override 32 | public int getCount() { 33 | return mFragmentList.size(); 34 | } 35 | 36 | public void addFrag(Fragment fragment, String title) { 37 | mFragmentList.add(fragment); 38 | mFragmentTitleList.add(title); 39 | 40 | } 41 | 42 | @Override 43 | public CharSequence getPageTitle(int position) { 44 | return mFragmentTitleList.get(position); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/view/customview/ClickableViewPager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.view.customview; 10 | 11 | import android.content.Context; 12 | import android.support.v4.view.ViewPager; 13 | import android.util.AttributeSet; 14 | import android.view.GestureDetector; 15 | import android.view.MotionEvent; 16 | import android.view.View; 17 | 18 | public class ClickableViewPager extends ViewPager { 19 | 20 | private OnItemClickListener mOnItemClickListener; 21 | 22 | public ClickableViewPager(Context context) { 23 | super(context); 24 | 25 | setup(); 26 | } 27 | 28 | public ClickableViewPager(Context context, AttributeSet attrs) { 29 | super(context, attrs); 30 | 31 | setup(); 32 | } 33 | 34 | private void setup() { 35 | final GestureDetector tapGestureDetector = new GestureDetector(getContext(), new TapGestureListener()); 36 | 37 | setOnTouchListener(new OnTouchListener() { 38 | @Override 39 | public boolean onTouch(View v, MotionEvent event) { 40 | tapGestureDetector.onTouchEvent(event); 41 | 42 | return false; 43 | } 44 | }); 45 | } 46 | 47 | public void setOnItemClickListener(OnItemClickListener onItemClickListener) { 48 | mOnItemClickListener = onItemClickListener; 49 | } 50 | 51 | public interface OnItemClickListener { 52 | void onItemClick(int position); 53 | } 54 | 55 | private class TapGestureListener extends GestureDetector.SimpleOnGestureListener { 56 | 57 | @Override 58 | public boolean onSingleTapConfirmed(MotionEvent e) { 59 | if (mOnItemClickListener != null) { 60 | mOnItemClickListener.onItemClick(getCurrentItem()); 61 | } 62 | 63 | return true; 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/view/customview/ItemTouchHelperAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.view.customview; 10 | 11 | import android.support.v7.widget.RecyclerView; 12 | import android.support.v7.widget.helper.ItemTouchHelper; 13 | 14 | /** 15 | * Interface to listen for a move or dismissal event from a {@link ItemTouchHelper.Callback}. 16 | * 17 | * @author Paul Burke (ipaulpro) 18 | */ 19 | public interface ItemTouchHelperAdapter { 20 | 21 | /** 22 | * Called when an item has been dragged far enough to trigger a move. This is called every time 23 | * an item is shifted, and not at the end of a "drop" event.
24 | *
25 | * Implementations should call {@link RecyclerView.Adapter#notifyItemMoved(int, int)} after 26 | * adjusting the underlying data to reflect this move. 27 | * 28 | * @param fromPosition The start position of the moved item. 29 | * @param toPosition Then resolved position of the moved item. 30 | * @return True if the item was moved to the new adapter position. 31 | * @see RecyclerView#getAdapterPositionFor(RecyclerView.ViewHolder) 32 | * @see RecyclerView.ViewHolder#getAdapterPosition() 33 | */ 34 | boolean onItemMove(int fromPosition, int toPosition); 35 | 36 | 37 | /** 38 | * Called when an item has been dismissed by a swipe.
39 | *
40 | * Implementations should call {@link RecyclerView.Adapter#notifyItemRemoved(int)} after 41 | * adjusting the underlying data to reflect this removal. 42 | * 43 | * @param position The position of the item dismissed. 44 | * @see RecyclerView#getAdapterPositionFor(RecyclerView.ViewHolder) 45 | * @see RecyclerView.ViewHolder#getAdapterPosition() 46 | */ 47 | void onItemDismiss(int position); 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/view/customview/ItemTouchHelperViewHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.view.customview; 10 | 11 | import android.support.v7.widget.helper.ItemTouchHelper; 12 | 13 | /** 14 | * Interface to notify an item ViewHolder of relevant callbacks from {@link 15 | * android.support.v7.widget.helper.ItemTouchHelper.Callback}. 16 | * 17 | * @author Paul Burke (ipaulpro) 18 | */ 19 | public interface ItemTouchHelperViewHolder { 20 | 21 | /** 22 | * Called when the {@link ItemTouchHelper} first registers an item as being moved or swiped. 23 | * Implementations should update the item view to indicate it's active state. 24 | */ 25 | void onItemSelected(); 26 | 27 | 28 | /** 29 | * Called when the {@link ItemTouchHelper} has completed the move or swipe, and the active item 30 | * state should be cleared. 31 | */ 32 | void onItemClear(); 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/view/customview/MathUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | package com.hitesh_sahu.retailapp.view.customview; 9 | 10 | import android.graphics.RectF; 11 | 12 | /** 13 | * Helper class to perform math computations. 14 | */ 15 | public final class MathUtils { 16 | 17 | /** 18 | * Truncates a float number {@code f} to {@code decimalPlaces}. 19 | * 20 | * @param f the number to be truncated. 21 | * @param decimalPlaces the amount of decimals that {@code f} 22 | * will be truncated to. 23 | * @return a truncated representation of {@code f}. 24 | */ 25 | protected static float truncate(float f, int decimalPlaces) { 26 | float decimalShift = (float) Math.pow(10, decimalPlaces); 27 | return Math.round(f * decimalShift) / decimalShift; 28 | } 29 | 30 | 31 | /** 32 | * Checks whether two {@link RectF} have the same aspect ratio. 33 | * 34 | * @param r1 the first rect. 35 | * @param r2 the second rect. 36 | * @return {@code true} if both rectangles have the same aspect ratio, 37 | * {@code false} otherwise. 38 | */ 39 | protected static boolean haveSameAspectRatio(RectF r1, RectF r2) { 40 | // Reduces precision to avoid problems when comparing aspect ratios. 41 | float srcRectRatio = MathUtils.truncate(MathUtils.getRectRatio(r1), 3); 42 | float dstRectRatio = MathUtils.truncate(MathUtils.getRectRatio(r2), 3); 43 | 44 | // Compares aspect ratios that allows for a tolerance range of [0, 0.01] 45 | return (Math.abs(srcRectRatio - dstRectRatio) <= 0.01f); 46 | } 47 | 48 | 49 | /** 50 | * Computes the aspect ratio of a given rect. 51 | * 52 | * @param rect the rect to have its aspect ratio computed. 53 | * @return the rect aspect ratio. 54 | */ 55 | protected static float getRectRatio(RectF rect) { 56 | return rect.width() / rect.height(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/view/customview/OnStartDragListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.view.customview; 10 | 11 | import android.support.v7.widget.RecyclerView; 12 | 13 | /** 14 | * Listener for manual initiation of a drag. 15 | */ 16 | public interface OnStartDragListener { 17 | 18 | /** 19 | * Called when a view is requesting a start of a drag. 20 | * 21 | * @param viewHolder The holder of the view to drag. 22 | */ 23 | void onStartDrag(RecyclerView.ViewHolder viewHolder); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/view/customview/ScrollableViewHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.view.customview; 10 | 11 | import android.support.v7.widget.RecyclerView; 12 | import android.view.View; 13 | import android.widget.ListView; 14 | import android.widget.ScrollView; 15 | 16 | /** 17 | * Helper class for determining the current scroll positions for scrollable views. Currently works 18 | * for ListView, ScrollView & RecyclerView, but the library users can override it to add support 19 | * for other views. 20 | */ 21 | public class ScrollableViewHelper { 22 | /** 23 | * Returns the current scroll position of the scrollable view. If this method returns zero or 24 | * less, it means at the scrollable view is in a position such as the panel should handle 25 | * scrolling. If the method returns anything above zero, then the panel will let the scrollable 26 | * view handle the scrolling 27 | * 28 | * @param scrollableView the scrollable view 29 | * @param isSlidingUp whether or not the panel is sliding up or down 30 | * @return the scroll position 31 | */ 32 | public int getScrollableViewScrollPosition(View scrollableView, boolean isSlidingUp) { 33 | if (scrollableView == null) return 0; 34 | if (scrollableView instanceof ScrollView) { 35 | if (isSlidingUp) { 36 | return scrollableView.getScrollY(); 37 | } else { 38 | ScrollView sv = ((ScrollView) scrollableView); 39 | View child = sv.getChildAt(0); 40 | return (child.getBottom() - (sv.getHeight() + sv.getScrollY())); 41 | } 42 | } else if (scrollableView instanceof ListView && ((ListView) scrollableView).getChildCount() > 0) { 43 | ListView lv = ((ListView) scrollableView); 44 | if (lv.getAdapter() == null) return 0; 45 | if (isSlidingUp) { 46 | View firstChild = lv.getChildAt(0); 47 | // Approximate the scroll position based on the top child and the first visible item 48 | return lv.getFirstVisiblePosition() * firstChild.getHeight() - firstChild.getTop(); 49 | } else { 50 | View lastChild = lv.getChildAt(lv.getChildCount() - 1); 51 | // Approximate the scroll position based on the bottom child and the last visible item 52 | return (lv.getAdapter().getCount() - lv.getLastVisiblePosition() - 1) * lastChild.getHeight() + lastChild.getBottom() - lv.getBottom(); 53 | } 54 | } else if (scrollableView instanceof RecyclerView && ((RecyclerView) scrollableView).getChildCount() > 0) { 55 | RecyclerView rv = ((RecyclerView) scrollableView); 56 | RecyclerView.LayoutManager lm = rv.getLayoutManager(); 57 | if (rv.getAdapter() == null) return 0; 58 | if (isSlidingUp) { 59 | View firstChild = rv.getChildAt(0); 60 | // Approximate the scroll position based on the top child and the first visible item 61 | return rv.getChildLayoutPosition(firstChild) * lm.getDecoratedMeasuredHeight(firstChild) - lm.getDecoratedTop(firstChild); 62 | } else { 63 | View lastChild = rv.getChildAt(rv.getChildCount() - 1); 64 | // Approximate the scroll position based on the bottom child and the last visible item 65 | return (rv.getAdapter().getItemCount() - 1) * lm.getDecoratedMeasuredHeight(lastChild) + lm.getDecoratedBottom(lastChild) - rv.getBottom(); 66 | } 67 | } else { 68 | return 0; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/view/customview/SimpleItemTouchHelperCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.view.customview; 10 | 11 | import android.graphics.Canvas; 12 | import android.support.v7.widget.GridLayoutManager; 13 | import android.support.v7.widget.RecyclerView; 14 | import android.support.v7.widget.helper.ItemTouchHelper; 15 | 16 | /** 17 | * An implementation of {@link ItemTouchHelper.Callback} that enables basic drag & drop and 18 | * swipe-to-dismiss. Drag events are automatically started by an item long-press.
19 | *
20 | * Expects the RecyclerView.Adapter to listen for {@link 21 | * ItemTouchHelperAdapter} callbacks and the RecyclerView.ViewHolder to implement 22 | * {@link ItemTouchHelperViewHolder}. 23 | * 24 | * @author Paul Burke (ipaulpro) 25 | */ 26 | public class SimpleItemTouchHelperCallback extends ItemTouchHelper.Callback { 27 | 28 | public static final float ALPHA_FULL = 1.0f; 29 | 30 | private final ItemTouchHelperAdapter mAdapter; 31 | 32 | public SimpleItemTouchHelperCallback(ItemTouchHelperAdapter adapter) { 33 | mAdapter = adapter; 34 | } 35 | 36 | @Override 37 | public boolean isLongPressDragEnabled() { 38 | return true; 39 | } 40 | 41 | @Override 42 | public boolean isItemViewSwipeEnabled() { 43 | return true; 44 | } 45 | 46 | @Override 47 | public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { 48 | // Set movement flags based on the layout manager 49 | if (recyclerView.getLayoutManager() instanceof GridLayoutManager) { 50 | final int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN | ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT; 51 | final int swipeFlags = 0; 52 | return makeMovementFlags(dragFlags, swipeFlags); 53 | } else { 54 | final int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN; 55 | final int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END; 56 | return makeMovementFlags(dragFlags, swipeFlags); 57 | } 58 | } 59 | 60 | @Override 61 | public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder source, RecyclerView.ViewHolder target) { 62 | if (source.getItemViewType() != target.getItemViewType()) { 63 | return false; 64 | } 65 | 66 | // Notify the adapter of the move 67 | mAdapter.onItemMove(source.getAdapterPosition(), target.getAdapterPosition()); 68 | return true; 69 | } 70 | 71 | @Override 72 | public void onSwiped(RecyclerView.ViewHolder viewHolder, int i) { 73 | // Notify the adapter of the dismissal 74 | mAdapter.onItemDismiss(viewHolder.getAdapterPosition()); 75 | } 76 | 77 | @Override 78 | public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { 79 | if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) { 80 | // Fade out the view as it is swiped out of the parent's bounds 81 | final float alpha = ALPHA_FULL - Math.abs(dX) / (float) viewHolder.itemView.getWidth(); 82 | viewHolder.itemView.setAlpha(alpha); 83 | viewHolder.itemView.setTranslationX(dX); 84 | } else { 85 | super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive); 86 | } 87 | } 88 | 89 | @Override 90 | public void onSelectedChanged(RecyclerView.ViewHolder viewHolder, int actionState) { 91 | // We only want the active item to change 92 | if (actionState != ItemTouchHelper.ACTION_STATE_IDLE) { 93 | if (viewHolder instanceof ItemTouchHelperViewHolder) { 94 | // Let the view holder know that this item is being moved or dragged 95 | ItemTouchHelperViewHolder itemViewHolder = (ItemTouchHelperViewHolder) viewHolder; 96 | itemViewHolder.onItemSelected(); 97 | } 98 | } 99 | 100 | super.onSelectedChanged(viewHolder, actionState); 101 | } 102 | 103 | @Override 104 | public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) { 105 | super.clearView(recyclerView, viewHolder); 106 | 107 | viewHolder.itemView.setAlpha(ALPHA_FULL); 108 | 109 | if (viewHolder instanceof ItemTouchHelperViewHolder) { 110 | // Tell the view holder it's time to restore the idle state 111 | ItemTouchHelperViewHolder itemViewHolder = (ItemTouchHelperViewHolder) viewHolder; 112 | itemViewHolder.onItemClear(); 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /app/src/main/java/com/hitesh_sahu/retailapp/view/fragment/ProductListFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017. http://hiteshsahu.com- All Rights Reserved 3 | * Unauthorized copying of this file, via any medium is strictly prohibited 4 | * If you use or distribute this project then you MUST ADD A COPY OF LICENCE 5 | * along with the project. 6 | * Written by Hitesh Sahu , 2017. 7 | */ 8 | 9 | package com.hitesh_sahu.retailapp.view.fragment; 10 | 11 | import android.os.Bundle; 12 | import android.support.v4.app.Fragment; 13 | import android.support.v7.widget.LinearLayoutManager; 14 | import android.support.v7.widget.RecyclerView; 15 | import android.view.KeyEvent; 16 | import android.view.LayoutInflater; 17 | import android.view.MotionEvent; 18 | import android.view.View; 19 | import android.view.View.OnTouchListener; 20 | import android.view.ViewGroup; 21 | 22 | import com.hitesh_sahu.retailapp.R; 23 | import com.hitesh_sahu.retailapp.util.Utils; 24 | import com.hitesh_sahu.retailapp.util.Utils.AnimationType; 25 | import com.hitesh_sahu.retailapp.view.activities.ECartHomeActivity; 26 | import com.hitesh_sahu.retailapp.view.adapter.ProductListAdapter; 27 | import com.hitesh_sahu.retailapp.view.adapter.ProductListAdapter.OnItemClickListener; 28 | 29 | public class ProductListFragment extends Fragment { 30 | private String subcategoryKey; 31 | private boolean isShoppingList; 32 | 33 | public ProductListFragment() { 34 | isShoppingList = true; 35 | } 36 | 37 | public ProductListFragment(String subcategoryKey) { 38 | 39 | isShoppingList = false; 40 | this.subcategoryKey = subcategoryKey; 41 | } 42 | 43 | @Override 44 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 45 | Bundle savedInstanceState) { 46 | View view = inflater.inflate(R.layout.frag_product_list_fragment, container, 47 | false); 48 | 49 | if (isShoppingList) { 50 | view.findViewById(R.id.slide_down).setVisibility(View.VISIBLE); 51 | view.findViewById(R.id.slide_down).setOnTouchListener( 52 | new OnTouchListener() { 53 | 54 | @Override 55 | public boolean onTouch(View v, MotionEvent event) { 56 | 57 | // Utils.switchContent(R.id.top_container, 58 | // Utils.HOME_FRAGMENT, 59 | // ((ECartHomeActivity) (getContext())), 60 | // AnimationType.SLIDE_DOWN); 61 | 62 | Utils.switchFragmentWithAnimation( 63 | R.id.frag_container, 64 | new HomeFragment(), 65 | ((ECartHomeActivity) (getContext())), Utils.HOME_FRAGMENT, 66 | AnimationType.SLIDE_DOWN); 67 | 68 | 69 | return false; 70 | } 71 | }); 72 | } 73 | 74 | // Fill Recycler View 75 | 76 | RecyclerView recyclerView = (RecyclerView) view 77 | .findViewById(R.id.product_list_recycler_view); 78 | 79 | LinearLayoutManager linearLayoutManager = new LinearLayoutManager( 80 | getActivity().getBaseContext()); 81 | recyclerView.setLayoutManager(linearLayoutManager); 82 | recyclerView.setHasFixedSize(true); 83 | 84 | ProductListAdapter adapter = new ProductListAdapter(subcategoryKey, 85 | getActivity(), isShoppingList); 86 | 87 | recyclerView.setAdapter(adapter); 88 | 89 | adapter.SetOnItemClickListener(new OnItemClickListener() { 90 | 91 | @Override 92 | public void onItemClick(View view, int position) { 93 | 94 | Utils.switchFragmentWithAnimation(R.id.frag_container, 95 | new ProductDetailsFragment(subcategoryKey, position, false), 96 | ((ECartHomeActivity) (getContext())), null, 97 | AnimationType.SLIDE_LEFT); 98 | 99 | } 100 | }); 101 | 102 | // Handle Back press 103 | view.setFocusableInTouchMode(true); 104 | view.requestFocus(); 105 | view.setOnKeyListener(new View.OnKeyListener() { 106 | 107 | @Override 108 | public boolean onKey(View v, int keyCode, KeyEvent event) { 109 | 110 | if (event.getAction() == KeyEvent.ACTION_UP 111 | && keyCode == KeyEvent.KEYCODE_BACK) { 112 | 113 | // Utils.switchContent(R.id.top_container, 114 | // Utils.HOME_FRAGMENT, 115 | // ((ECartHomeActivity) (getContext())), 116 | // AnimationType.SLIDE_UP); 117 | 118 | Utils.switchFragmentWithAnimation( 119 | R.id.frag_container, 120 | new HomeFragment(), 121 | ((ECartHomeActivity) (getContext())), Utils.HOME_FRAGMENT, 122 | AnimationType.SLIDE_UP); 123 | 124 | } 125 | return true; 126 | } 127 | }); 128 | 129 | return view; 130 | } 131 | 132 | } -------------------------------------------------------------------------------- /app/src/main/res/anim/app_name_animation.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/anim/app_name_animation_back.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 20 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/anim/base_slide_left_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/anim/base_slide_right_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/anim/default_out_anim.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 17 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/anim/donot_move.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/anim/from_middle.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/grow_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/anim/logo_animation.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 23 | 24 | 31 | 32 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/anim/logo_animation_back.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 23 | 24 | 31 | 32 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/anim/pro_animation.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 20 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/anim/pro_animation_back.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/anim/shrink_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/anim/simple_grow.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_down.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_up.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_up.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_up.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_up_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 17 | 18 | 22 | 23 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_up_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 17 | 18 | 22 | 23 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/anim/to_middle.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-hdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/cart.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-hdpi/cart.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-hdpi/header.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_action_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-hdpi/ic_action_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-hdpi/ic_drawer.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-mdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_action_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-mdpi/ic_action_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-mdpi/ic_drawer.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/header2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-nodpi/header2.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/header_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-nodpi/header_1.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/nav_header_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-nodpi/nav_header_bg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ripple.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/ripple_accent.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-xhdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_action_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-xhdpi/ic_action_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-xhdpi/ic_drawer.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-xxhdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_action_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-xxhdpi/ic_action_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-xxhdpi/ic_drawer.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_action_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-xxxhdpi/ic_action_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_drawer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable-xxxhdpi/ic_drawer.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/above_shadow.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/below_shadow.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_feed_action.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/checkout_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/green_g_plus_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 27 | 28 | 29 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add_shopping_cart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable/ic_add_shopping_cart.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ico_mic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable/ico_mic.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_circle_placeholder.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/indicator_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/indicator_unselected.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/no_items_found.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable/no_items_found.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/round_text_add_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/round_text_cart_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/round_text_remove_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rounder_rectangle_visa_card.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shadow.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/simplecircle.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/slide_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emonm/ECommerce-App-Android/f318542041117bdd928e1ee7e75d84ecf167a20c/app/src/main/res/drawable/slide_down.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_apriori_result.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 18 | 23 | 24 | 33 | 34 | 44 | 45 | 46 | 50 | 51 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_ecart.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 15 | 16 | 20 | 21 | 26 | 27 | 36 | 37 | 38 | 39 | 40 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 21 | 22 | 29 | 30 | 46 | 47 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/res/layout/connection_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 23 | 24 | 33 | 34 |