├── core ├── common │ ├── .gitignore │ ├── consumer-rules.pro │ ├── src │ │ └── main │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle.kts ├── logger │ ├── .gitignore │ ├── consumer-rules.pro │ ├── src │ │ └── main │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle.kts ├── worker │ ├── .gitignore │ ├── consumer-rules.pro │ ├── src │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── iceteaviet │ │ │ └── fastfoodfinder │ │ │ └── core │ │ │ └── worker │ │ │ ├── IOWorker.kt │ │ │ ├── ComputationWorker.kt │ │ │ └── SerialWorker.kt │ ├── proguard-rules.pro │ └── build.gradle.kts ├── analytics │ ├── .gitignore │ ├── consumer-rules.pro │ ├── src │ │ └── main │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle.kts ├── location │ ├── .gitignore │ ├── consumer-rules.pro │ ├── src │ │ └── main │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle.kts ├── network │ ├── .gitignore │ ├── consumer-rules.pro │ ├── src │ │ └── main │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle.kts └── notifications │ ├── .gitignore │ ├── consumer-rules.pro │ ├── src │ └── main │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle.kts ├── data ├── model │ ├── .gitignore │ ├── consumer-rules.pro │ ├── src │ │ └── main │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle.kts ├── stores │ ├── .gitignore │ ├── consumer-rules.pro │ ├── src │ │ └── main │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle.kts ├── database │ ├── .gitignore │ ├── consumer-rules.pro │ ├── src │ │ └── main │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle.kts └── datastore │ ├── .gitignore │ ├── consumer-rules.pro │ ├── src │ └── main │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle.kts ├── release ├── ic_launcher.png ├── store_cover.png ├── Screenshot_20180927-011108.png ├── Screenshot_20180927-011121.png └── Screenshot_20180927-011130.png ├── stores_logo ├── logo_bsmart_50.png ├── logo_circlek_50.png ├── logo_shopngo_50.png ├── logo_ministop_50.png └── logo_familymart_50.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── app └── src │ ├── main │ ├── assets │ │ └── fonts │ │ │ ├── Roboto-Bold.ttf │ │ │ ├── Roboto-Thin.ttf │ │ │ ├── Roboto-Italic.ttf │ │ │ ├── Roboto-Regular.ttf │ │ │ ├── RobotoSlab-Bold.ttf │ │ │ ├── RobotoSlab-Thin.ttf │ │ │ ├── Roboto-BoldItalic.ttf │ │ │ ├── Roboto-ThinItalic.ttf │ │ │ └── RobotoSlab-Regular.ttf │ ├── res │ │ ├── drawable-hdpi │ │ │ ├── bg_city.png │ │ │ ├── logo_bsmart_50.png │ │ │ ├── logo_circlek_50.png │ │ │ ├── logo_ministop_50.png │ │ │ ├── logo_shopngo_50.png │ │ │ └── logo_familymart_50.png │ │ ├── drawable │ │ │ ├── ic_map_marker.png │ │ │ ├── ic_map_bluedot.png │ │ │ ├── ic_profile_saved.png │ │ │ ├── logo_bsmart_red.jpg │ │ │ ├── logo_circlek_red.png │ │ │ ├── logo_shopngo_red.png │ │ │ ├── ic_profile_addlist.jpg │ │ │ ├── ic_profile_list_1.png │ │ │ ├── ic_profile_list_10.png │ │ │ ├── ic_profile_list_11.png │ │ │ ├── ic_profile_list_2.png │ │ │ ├── ic_profile_list_3.png │ │ │ ├── ic_profile_list_4.png │ │ │ ├── ic_profile_list_5.png │ │ │ ├── ic_profile_list_6.png │ │ │ ├── ic_profile_list_7.jpg │ │ │ ├── ic_profile_list_8.png │ │ │ ├── ic_profile_list_9.png │ │ │ ├── logo_ministop_red.png │ │ │ ├── ic_main_star_yellow.png │ │ │ ├── ic_profile_favourite.png │ │ │ ├── logo_familymart_red.png │ │ │ ├── bg_rounded_corner_avatar.xml │ │ │ ├── splash_window_background.xml │ │ │ ├── state_tag_color.xml │ │ │ ├── rect_error.xml │ │ │ ├── rect_pressed.xml │ │ │ ├── rect_progress.xml │ │ │ ├── rect_complete.xml │ │ │ ├── state_tag_ic.xml │ │ │ ├── state_tag_bg.xml │ │ │ ├── detail_shape_gradient.xml │ │ │ ├── state_rate_click.xml │ │ │ ├── ic_routing_next.xml │ │ │ ├── ic_routing_previous.xml │ │ │ ├── ic_main_hamburger.xml │ │ │ ├── ic_routing_left.xml │ │ │ ├── ic_routing_right.xml │ │ │ ├── ic_routing_up.xml │ │ │ ├── setting_shape_roundedsolid.xml │ │ │ ├── bg_rounded_corner_medium_disabled.xml │ │ │ ├── ic_main_swap.xml │ │ │ ├── ic_setting_check.xml │ │ │ ├── ic_main_goto.xml │ │ │ ├── ic_main_swap_selected.xml │ │ │ ├── all_noavatar.xml │ │ │ ├── ic_all_about.xml │ │ │ ├── ic_all_close.xml │ │ │ ├── ic_all_store.xml │ │ │ ├── ic_arrow_right.xml │ │ │ ├── ic_routing_merge.xml │ │ │ ├── ic_search_loadmore.xml │ │ │ ├── ic_search_navigation.xml │ │ │ ├── setting_shape_roundedline.xml │ │ │ ├── detail_shape_border.xml │ │ │ ├── ic_setting_profile.xml │ │ │ ├── ic_all_store24h.xml │ │ │ ├── ic_all_store24h_red.xml │ │ │ ├── ic_search_trendingup.xml │ │ │ ├── ic_setting_security.xml │ │ │ ├── bg_rounded_corner_medium_normal.xml │ │ │ ├── bg_rounded_corner_medium_pressed.xml │ │ │ ├── ic_logout.xml │ │ │ ├── ic_cloud_update_done.xml │ │ │ ├── ic_detail_bookmark_selected.xml │ │ │ ├── ic_main_star_red.xml │ │ │ ├── ic_main_clock_red.xml │ │ │ ├── ic_dialog_compass.xml │ │ │ ├── ic_main_map.xml │ │ │ ├── ic_clock_outline_grey.xml │ │ │ ├── bg_navigation_menuitem.xml │ │ │ ├── ic_setting_update.xml │ │ │ ├── ic_default_avatar_menu.xml │ │ │ ├── ic_menu_search.xml │ │ │ ├── ic_setting_termofuse.xml │ │ │ ├── ic_marker_outline_grey.xml │ │ │ ├── ic_all_call.xml │ │ │ ├── bg_post_comment_button.xml │ │ │ ├── rect_normal.xml │ │ │ ├── bg_rounded_corner_medium.xml │ │ │ ├── ic_all_camera.xml │ │ │ ├── ic_search_trophy.xml │ │ │ ├── ic_setting_translate.xml │ │ │ ├── ic_setting_add.xml │ │ │ ├── ic_cloud_update.xml │ │ │ ├── ic_all_share.xml │ │ │ ├── ic_detail_bookmark.xml │ │ │ ├── ic_detail_bookmark_disable.xml │ │ │ ├── ic_detail_pencil.xml │ │ │ ├── ic_detail_pencil_disable.xml │ │ │ ├── ic_detail_love.xml │ │ │ ├── ic_detail_love_disable.xml │ │ │ ├── ic_detail_love_selected.xml │ │ │ └── ic_setting_metric.xml │ │ ├── drawable-xxhdpi │ │ │ ├── bg_city.png │ │ │ ├── logo_bsmart_50.png │ │ │ ├── logo_circlek_50.png │ │ │ ├── logo_ministop_50.png │ │ │ ├── logo_shopngo_50.png │ │ │ └── logo_familymart_50.png │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ ├── logo_bsmart_50.png │ │ │ ├── logo_circlek_50.png │ │ │ ├── logo_ministop_50.png │ │ │ ├── logo_shopngo_50.png │ │ │ └── logo_familymart_50.png │ │ ├── drawable-nodpi │ │ │ ├── all_placeholder.jpg │ │ │ ├── all_sample_avatar.jpg │ │ │ ├── all_sample_cover.jpg │ │ │ ├── detail_sample_food_1.jpg │ │ │ ├── detail_sample_food_2.jpg │ │ │ ├── detail_sample_food_3.jpg │ │ │ ├── detail_sample_food_4.jpg │ │ │ ├── profile_cover_placeholder.jpg │ │ │ ├── profile_sample_background.jpg │ │ │ ├── detail_sample_circlekcover.jpg │ │ │ ├── profile_sample_background_3.jpg │ │ │ ├── profile_sample_background_4.jpg │ │ │ ├── profile_sample_background_5.jpg │ │ │ └── profile_sample_background_6.jpg │ │ ├── drawable-xhdpi │ │ │ ├── logo_bsmart_50.png │ │ │ ├── logo_circlek_50.png │ │ │ ├── logo_shopngo_50.png │ │ │ ├── logo_ministop_50.png │ │ │ └── logo_familymart_50.png │ │ ├── drawable-xxxhdpi │ │ │ ├── logo_bsmart_50.png │ │ │ ├── logo_circlek_50.png │ │ │ ├── logo_shopngo_50.png │ │ │ ├── logo_familymart_50.png │ │ │ └── logo_ministop_50.png │ │ ├── anim │ │ │ ├── layout_top_to_bottom_slide.xml │ │ │ ├── slide_down.xml │ │ │ ├── slide_up.xml │ │ │ ├── scale_out.xml │ │ │ └── scale_in.xml │ │ ├── values │ │ │ ├── attrs.xml │ │ │ └── dimens.xml │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ ├── drawable-v23 │ │ │ └── splash_window_background.xml │ │ ├── menu │ │ │ └── menu_main.xml │ │ ├── layout │ │ │ ├── activity_store_list.xml │ │ │ ├── item_store_title.xml │ │ │ ├── view_new_list.xml │ │ │ ├── fragment_main_recently.xml │ │ │ ├── view_store_tag.xml │ │ │ ├── activity_ar_camera.xml │ │ │ ├── fragment_main_favourited.xml │ │ │ └── activity_splash.xml │ │ ├── animator │ │ │ └── zoom_in_out.xml │ │ ├── values-v21 │ │ │ └── styles.xml │ │ └── layout-v21 │ │ │ └── activity_splash.xml │ └── java │ │ └── com │ │ └── iceteaviet │ │ └── fastfoodfinder │ │ ├── data │ │ ├── remote │ │ │ ├── ChunkItem.kt │ │ │ ├── ApiEndPoint.kt │ │ │ ├── routing │ │ │ │ ├── MapsRoutingApi.kt │ │ │ │ ├── MapsRoutingApiHelper.kt │ │ │ │ └── model │ │ │ │ │ ├── MapsDirection.kt │ │ │ │ │ └── MapCoordination.kt │ │ │ ├── user │ │ │ │ ├── model │ │ │ │ │ └── UserStoreEvent.kt │ │ │ │ └── UserApiHelper.kt │ │ │ └── store │ │ │ │ └── StoreApiHelper.kt │ │ ├── auth │ │ │ ├── provider │ │ │ │ ├── AuthRequestListener.kt │ │ │ │ ├── AuthHelper.kt │ │ │ │ └── AbsAuthHelper.kt │ │ │ └── ClientAuth.kt │ │ ├── local │ │ │ ├── prefs │ │ │ │ ├── PreferencesHelper.kt │ │ │ │ └── PreferencesWrapper.kt │ │ │ └── db │ │ │ │ ├── user │ │ │ │ ├── UserDataSource.kt │ │ │ │ └── model │ │ │ │ │ ├── UserStoreListEntity.kt │ │ │ │ │ └── UserEntity.kt │ │ │ │ └── store │ │ │ │ ├── StoreDataSource.kt │ │ │ │ └── model │ │ │ │ └── StoreEntity.kt │ │ ├── domain │ │ │ ├── routing │ │ │ │ ├── MapsRoutingRepository.kt │ │ │ │ └── AppMapsRoutingRepository.kt │ │ │ ├── prefs │ │ │ │ └── PreferencesRepository.kt │ │ │ ├── user │ │ │ │ └── UserRepository.kt │ │ │ └── store │ │ │ │ └── StoreRepository.kt │ │ └── DataManager.kt │ │ ├── service │ │ ├── eventbus │ │ │ └── core │ │ │ │ ├── Event.kt │ │ │ │ ├── IBus.kt │ │ │ │ └── RobotBus.kt │ │ └── SyncService.kt │ │ ├── ui │ │ ├── base │ │ │ ├── BaseView.kt │ │ │ ├── Presenter.kt │ │ │ ├── BaseActivity.kt │ │ │ └── BasePresenter.kt │ │ ├── custom │ │ │ ├── snaphelper │ │ │ │ └── OnSnapPositionChangeListener.kt │ │ │ └── itemtouchhelper │ │ │ │ ├── ItemTouchHelperViewHolder.kt │ │ │ │ ├── ItemTouchHelperAdapter.kt │ │ │ │ └── OnStartDragListener.kt │ │ ├── main │ │ │ ├── search │ │ │ │ ├── model │ │ │ │ │ └── SearchStoreItem.kt │ │ │ │ ├── SearchContract.kt │ │ │ │ └── SuggestStoreSearchAdapter.kt │ │ │ ├── map │ │ │ │ ├── model │ │ │ │ │ ├── MapCameraPosition.kt │ │ │ │ │ └── NearByStore.kt │ │ │ │ └── storeinfo │ │ │ │ │ └── StoreInfoContract.kt │ │ │ ├── recently │ │ │ │ ├── MainRecentlyContract.kt │ │ │ │ └── MainRecentlyPresenter.kt │ │ │ ├── favourite │ │ │ │ └── MainFavContract.kt │ │ │ └── MainContract.kt │ │ ├── storelist │ │ │ ├── StoreListContract.kt │ │ │ ├── ListDetailContract.kt │ │ │ └── StoreListPresenter.kt │ │ ├── splash │ │ │ └── SplashContract.kt │ │ ├── settings │ │ │ ├── discountnotify │ │ │ │ ├── DiscountNotifyContract.kt │ │ │ │ └── DiscountNotifyPresenter.kt │ │ │ └── SettingContract.kt │ │ ├── profile │ │ │ ├── createlist │ │ │ │ └── CreateListContract.kt │ │ │ ├── cover │ │ │ │ ├── UpdateCoverContract.kt │ │ │ │ └── UpdateCoverPresenter.kt │ │ │ └── ProfileContract.kt │ │ ├── login │ │ │ ├── emaillogin │ │ │ │ └── EmailLoginContract.kt │ │ │ ├── emailregister │ │ │ │ └── EmailRegisterContract.kt │ │ │ └── LoginContract.kt │ │ ├── store │ │ │ └── comment │ │ │ │ └── CommentContract.kt │ │ └── ar │ │ │ ├── model │ │ │ └── AugmentedPOI.kt │ │ │ └── LiveSightContract.kt │ │ ├── utils │ │ ├── exception │ │ │ ├── NotFoundException.kt │ │ │ ├── UnknownException.kt │ │ │ ├── EmptyParamsException.kt │ │ │ ├── NotSupportedException.kt │ │ │ └── EmptyDataException.kt │ │ ├── BuildVersionUtils.kt │ │ ├── ui │ │ │ └── NotiManager.kt │ │ ├── rx │ │ │ ├── SchedulerProvider.kt │ │ │ ├── TrampolineSchedulerProvider.kt │ │ │ └── AppSchedulerProvider.kt │ │ ├── StoreType.kt │ │ ├── shell │ │ │ └── AppShell.kt │ │ ├── RealmUtils.kt │ │ ├── extension │ │ │ ├── SnapHelperExt.kt │ │ │ └── RecyclerViewExt.kt │ │ ├── ReflectionHelper.kt │ │ ├── Constant.kt │ │ ├── FileUtils.kt │ │ └── NetworkUtils.kt │ │ └── location │ │ ├── base │ │ └── ILocationManager.kt │ │ ├── LocationListener.kt │ │ ├── SystemLocationListener.kt │ │ ├── LatLngAlt.kt │ │ └── FailType.kt │ ├── test │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── iceteaviet │ │ └── fastfoodfinder │ │ ├── utils │ │ ├── rx │ │ │ └── TestSchedulerProvider.kt │ │ ├── RealmUtilsTest.kt │ │ └── RetrofitUtilsTest.kt │ │ └── data │ │ ├── local │ │ └── db │ │ │ ├── user │ │ │ └── UserDAOTest.kt │ │ │ └── store │ │ │ └── StoreDAOTest.kt │ │ └── remote │ │ ├── routing │ │ └── GoogleMapsRoutingApiHelperTest.kt │ │ ├── user │ │ └── FirebaseUserApiHelperTest.kt │ │ └── store │ │ └── FirebaseStoreApiHelperTest.kt │ └── mock │ ├── res │ └── values │ │ └── secret.xml │ ├── java │ └── com │ │ └── iceteaviet │ │ └── fastfoodfinder │ │ └── data │ │ └── remote │ │ ├── routing │ │ └── FakeGoogleMapsRoutingApiHelper.kt │ │ └── store │ │ └── FakeFirebaseStoreApiHelper.kt │ └── google-services.json ├── settings.gradle.kts ├── .travis.yml └── gradle.properties /core/common/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /core/logger/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /core/worker/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /data/model/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /data/stores/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /core/analytics/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /core/analytics/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core/common/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core/location/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /core/location/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core/logger/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core/network/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /core/network/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core/worker/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/database/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /data/database/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/datastore/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /data/datastore/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/model/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/stores/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /core/notifications/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /core/notifications/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /release/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/release/ic_launcher.png -------------------------------------------------------------------------------- /release/store_cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/release/store_cover.png -------------------------------------------------------------------------------- /stores_logo/logo_bsmart_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/stores_logo/logo_bsmart_50.png -------------------------------------------------------------------------------- /stores_logo/logo_circlek_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/stores_logo/logo_circlek_50.png -------------------------------------------------------------------------------- /stores_logo/logo_shopngo_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/stores_logo/logo_shopngo_50.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /stores_logo/logo_ministop_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/stores_logo/logo_ministop_50.png -------------------------------------------------------------------------------- /stores_logo/logo_familymart_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/stores_logo/logo_familymart_50.png -------------------------------------------------------------------------------- /release/Screenshot_20180927-011108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/release/Screenshot_20180927-011108.png -------------------------------------------------------------------------------- /release/Screenshot_20180927-011121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/release/Screenshot_20180927-011121.png -------------------------------------------------------------------------------- /release/Screenshot_20180927-011130.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/release/Screenshot_20180927-011130.png -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/assets/fonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/assets/fonts/Roboto-Thin.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Roboto-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/assets/fonts/Roboto-Italic.ttf -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/bg_city.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-hdpi/bg_city.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_map_marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_map_marker.png -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/assets/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/RobotoSlab-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/assets/fonts/RobotoSlab-Bold.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/RobotoSlab-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/assets/fonts/RobotoSlab-Thin.ttf -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/bg_city.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xxhdpi/bg_city.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_map_bluedot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_map_bluedot.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_saved.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_saved.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo_bsmart_red.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/logo_bsmart_red.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo_circlek_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/logo_circlek_red.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo_shopngo_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/logo_shopngo_red.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Roboto-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/assets/fonts/Roboto-BoldItalic.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/Roboto-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/assets/fonts/Roboto-ThinItalic.ttf -------------------------------------------------------------------------------- /app/src/main/assets/fonts/RobotoSlab-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/assets/fonts/RobotoSlab-Regular.ttf -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_addlist.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_addlist.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_list_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_list_1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_list_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_list_10.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_list_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_list_11.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_list_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_list_2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_list_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_list_3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_list_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_list_4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_list_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_list_5.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_list_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_list_6.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_list_7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_list_7.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_list_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_list_8.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_list_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_list_9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo_ministop_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/logo_ministop_red.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/logo_bsmart_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-hdpi/logo_bsmart_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/logo_circlek_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-hdpi/logo_circlek_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/logo_ministop_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-hdpi/logo_ministop_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/logo_shopngo_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-hdpi/logo_shopngo_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/logo_bsmart_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-mdpi/logo_bsmart_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/logo_circlek_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-mdpi/logo_circlek_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/logo_ministop_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-mdpi/logo_ministop_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/logo_shopngo_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-mdpi/logo_shopngo_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/all_placeholder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/all_placeholder.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/logo_bsmart_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xhdpi/logo_bsmart_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/logo_circlek_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xhdpi/logo_circlek_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/logo_shopngo_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xhdpi/logo_shopngo_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/logo_bsmart_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xxhdpi/logo_bsmart_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_main_star_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_main_star_yellow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_profile_favourite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/ic_profile_favourite.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/logo_familymart_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable/logo_familymart_red.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/logo_familymart_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-hdpi/logo_familymart_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/logo_familymart_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-mdpi/logo_familymart_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/all_sample_avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/all_sample_avatar.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/all_sample_cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/all_sample_cover.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/logo_ministop_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xhdpi/logo_ministop_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/logo_circlek_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xxhdpi/logo_circlek_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/logo_ministop_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xxhdpi/logo_ministop_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/logo_shopngo_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xxhdpi/logo_shopngo_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/logo_bsmart_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xxxhdpi/logo_bsmart_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/logo_circlek_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xxxhdpi/logo_circlek_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/logo_shopngo_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xxxhdpi/logo_shopngo_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/detail_sample_food_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/detail_sample_food_1.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/detail_sample_food_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/detail_sample_food_2.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/detail_sample_food_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/detail_sample_food_3.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/detail_sample_food_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/detail_sample_food_4.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/logo_familymart_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xhdpi/logo_familymart_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/logo_familymart_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xxhdpi/logo_familymart_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/logo_familymart_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xxxhdpi/logo_familymart_50.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/logo_ministop_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-xxxhdpi/logo_ministop_50.png -------------------------------------------------------------------------------- /core/common/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /core/logger/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /core/worker/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /data/model/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /data/stores/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /core/analytics/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /core/location/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /core/network/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /data/database/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /data/datastore/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/profile_cover_placeholder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/profile_cover_placeholder.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/profile_sample_background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/profile_sample_background.jpg -------------------------------------------------------------------------------- /core/notifications/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/detail_sample_circlekcover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/detail_sample_circlekcover.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/profile_sample_background_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/profile_sample_background_3.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/profile_sample_background_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/profile_sample_background_4.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/profile_sample_background_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/profile_sample_background_5.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-nodpi/profile_sample_background_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nhoxbypass/FastFoodFinder/HEAD/app/src/main/res/drawable-nodpi/profile_sample_background_6.jpg -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/remote/ChunkItem.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote 2 | 3 | /** 4 | * Created by tom on 2019-01-07. 5 | */ 6 | 7 | abstract class ChunkItem -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/service/eventbus/core/Event.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.service.eventbus.core 2 | 3 | /** 4 | * Created by tom on 2019-06-23. 5 | */ 6 | interface Event -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/base/BaseView.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.base 2 | 3 | /** 4 | * Created by tom on 2019-04-16. 5 | */ 6 | 7 | interface BaseView { 8 | var presenter: T 9 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/exception/NotFoundException.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.exception 2 | 3 | /** 4 | * Created by tom on 8/15/18. 5 | */ 6 | 7 | class NotFoundException : Exception("Not found") -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/exception/UnknownException.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.exception 2 | 3 | /** 4 | * Created by tom on 8/15/18. 5 | */ 6 | 7 | class UnknownException : Exception("Not supported") -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/exception/EmptyParamsException.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.exception 2 | 3 | /** 4 | * Created by tom on 7/31/18. 5 | */ 6 | class EmptyParamsException : Exception("Params is empty") 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/exception/NotSupportedException.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.exception 2 | 3 | /** 4 | * Created by tom on 8/15/18. 5 | */ 6 | 7 | class NotSupportedException : Exception("Not supported") -------------------------------------------------------------------------------- /app/src/main/res/anim/layout_top_to_bottom_slide.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_rounded_corner_avatar.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/exception/EmptyDataException.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.exception 2 | 3 | /** 4 | * Created by tom on 8/15/18. 5 | */ 6 | 7 | class EmptyDataException : Exception("Returned data is empty") -------------------------------------------------------------------------------- /app/src/main/res/drawable/splash_window_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/base/Presenter.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.base 2 | 3 | /** 4 | * Created by tom on 2019-04-16. 5 | */ 6 | 7 | interface Presenter { 8 | fun subscribe() 9 | 10 | fun unsubscribe() 11 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/remote/ApiEndPoint.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote 2 | 3 | /** 4 | * Created by tom on 7/18/18. 5 | */ 6 | object ApiEndPoint { 7 | var GOOGLE_MAP_BASE_URL = "https://maps.googleapis.com/maps/api/directions/" 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/state_tag_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rect_error.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/custom/snaphelper/OnSnapPositionChangeListener.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.custom.snaphelper 2 | 3 | /** 4 | * Created by tom on 2019-07-06. 5 | */ 6 | interface OnSnapPositionChangeListener { 7 | fun onSnapPositionChange(position: Int) 8 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/rect_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/BuildVersionUtils.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("BuildVersionUtils") 2 | 3 | package com.iceteaviet.fastfoodfinder.utils 4 | 5 | /** 6 | * Created by Genius Doan on 21/03/2019. 7 | */ 8 | 9 | fun isLolipopOrHigher(): Boolean { 10 | return true 11 | } 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rect_progress.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rect_complete.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/state_tag_ic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/auth/provider/AuthRequestListener.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.auth.provider 2 | 3 | /** 4 | * Created by tom on 2019-05-02. 5 | */ 6 | interface AuthRequestListener { 7 | fun onSuccess(authCredential: AC, fromLastSignIn: Boolean) 8 | fun onFailed() 9 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/service/eventbus/core/IBus.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.service.eventbus.core 2 | 3 | /** 4 | * Created by tom on 2019-06-23. 5 | */ 6 | interface IBus { 7 | fun post(event: Event) 8 | fun register(subscriber: Any) 9 | fun unregister(subscriber: Any) 10 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/state_tag_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_down.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_up.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/detail_shape_gradient.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/custom/itemtouchhelper/ItemTouchHelperViewHolder.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.custom.itemtouchhelper 2 | 3 | /** 4 | * Created by MyPC on 11/17/2016. 5 | */ 6 | interface ItemTouchHelperViewHolder { 7 | 8 | fun onItemSelected() 9 | 10 | fun onItemClear() 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/main/search/model/SearchStoreItem.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.main.search.model 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 4 | 5 | /** 6 | * Created by tom on 2019-06-15. 7 | */ 8 | data class SearchStoreItem(var store: Store?, var searchQuery: String) -------------------------------------------------------------------------------- /app/src/main/res/drawable/state_rate_click.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/ui/NotiManager.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.ui 2 | 3 | /** 4 | * Created by tom on 2019-07-07. 5 | */ 6 | interface NotiManager { 7 | fun showStoreSyncStatusNotification(message: String, title: String) 8 | fun showStoreSyncProgressStatusNotification(message: String, title: String) 9 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/rx/SchedulerProvider.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.rx 2 | 3 | import io.reactivex.Scheduler 4 | 5 | /** 6 | * Created by tom on 2019-06-02. 7 | */ 8 | interface SchedulerProvider { 9 | fun ui(): Scheduler 10 | 11 | fun computation(): Scheduler 12 | 13 | fun io(): Scheduler 14 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/StoreType.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils 2 | 3 | /** 4 | * Created by tom on 12/25/18. 5 | */ 6 | object StoreType { 7 | const val TYPE_CIRCLE_K = 0 8 | const val TYPE_MINI_STOP = 1 9 | const val TYPE_FAMILY_MART = 2 10 | const val TYPE_BSMART = 3 11 | const val TYPE_SHOP_N_GO = 4 12 | } -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/custom/itemtouchhelper/ItemTouchHelperAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.custom.itemtouchhelper 2 | 3 | /** 4 | * Created by MyPC on 11/17/2016. 5 | */ 6 | interface ItemTouchHelperAdapter { 7 | fun onItemMove(fromPosition: Int, toPosition: Int): Boolean 8 | 9 | fun onItemDismiss(position: Int) 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/custom/itemtouchhelper/OnStartDragListener.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.custom.itemtouchhelper 2 | 3 | import androidx.recyclerview.widget.RecyclerView 4 | 5 | /** 6 | * Created by MyPC on 11/17/2016. 7 | */ 8 | interface OnStartDragListener { 9 | fun onStartDrag(viewHolder: RecyclerView.ViewHolder) 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/main/map/model/MapCameraPosition.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.main.map.model 2 | 3 | import com.google.android.gms.maps.model.LatLng 4 | import com.google.android.gms.maps.model.LatLngBounds 5 | 6 | /** 7 | * Created by tom on 2019-04-29. 8 | */ 9 | data class MapCameraPosition(var cameraPosition: LatLng, var cameraBounds: LatLngBounds) -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_routing_next.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_routing_previous.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/test/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_main_hamburger.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_routing_left.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_routing_right.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_routing_up.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/setting_shape_roundedsolid.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_rounded_corner_medium_disabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_main_swap.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_setting_check.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_main_goto.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_main_swap_selected.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/shell/AppShell.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.shell 2 | 3 | /** 4 | * Wrapper class of {@link Runtime} to exec shell command 5 | * 6 | * Wrap to support mock testing. May need to convert to non-static to remove PowerMock 7 | */ 8 | object AppShell { 9 | fun exec(command: String): Process { 10 | return Runtime.getRuntime().exec(command) 11 | } 12 | } -------------------------------------------------------------------------------- /app/src/mock/res/values/secret.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | fake_api_key 4 | fake_browser_key 5 | fake_app_id 6 | fbAPP_ID 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/all_noavatar.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_all_about.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_all_close.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_all_store.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_arrow_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_routing_merge.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search_loadmore.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search_navigation.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/auth/provider/AuthHelper.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.auth.provider 2 | 3 | import android.content.Intent 4 | 5 | /** 6 | * Created by tom on 2019-05-02. 7 | */ 8 | interface AuthHelper { 9 | fun setAuthRequestListener(listener: AuthRequestListener) 10 | fun startRequestAuthCredential() 11 | fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent) 12 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/setting_shape_roundedline.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/RealmUtils.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("RealmUtils") 2 | 3 | package com.iceteaviet.fastfoodfinder.utils 4 | 5 | import io.realm.RealmList 6 | 7 | /** 8 | * Created by binhlt on 23/11/2016. 9 | */ 10 | 11 | fun realmListToList(realmList: RealmList): MutableList { 12 | 13 | val list = ArrayList() 14 | 15 | for (e in realmList) { 16 | list.add(e) 17 | } 18 | 19 | return list 20 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/detail_shape_border.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_setting_profile.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_all_store24h.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_all_store24h_red.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search_trendingup.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v23/splash_window_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_setting_security.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_rounded_corner_medium_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_rounded_corner_medium_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/anim/scale_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_logout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/location/base/ILocationManager.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.location.base 2 | 3 | import com.iceteaviet.fastfoodfinder.location.LatLngAlt 4 | 5 | /** 6 | * Created by tom on 2019-05-01. 7 | */ 8 | interface ILocationManager { 9 | fun getCurrentLocation(): LatLngAlt? 10 | fun isConnected(): Boolean 11 | fun requestLocationUpdates() 12 | fun subscribeLocationUpdate(listener: L) 13 | fun unsubscribeLocationUpdate(listener: L) 14 | fun terminate() 15 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/auth/provider/AbsAuthHelper.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.auth.provider 2 | 3 | /** 4 | * Created by tom on 2019-05-03. 5 | */ 6 | abstract class AbsAuthHelper protected constructor() : AuthHelper { 7 | 8 | protected var listener: AuthRequestListener? = null 9 | 10 | protected abstract fun setupAuthProvider() 11 | 12 | override fun setAuthRequestListener(listener: AuthRequestListener) { 13 | this.listener = listener 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/remote/routing/MapsRoutingApi.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote.routing 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.routing.model.MapsDirection 4 | 5 | import retrofit2.Call 6 | import retrofit2.http.GET 7 | import retrofit2.http.QueryMap 8 | 9 | /** 10 | * Created by Genius Doan on 11/11/2016. 11 | */ 12 | interface MapsRoutingApi { 13 | @GET("json") 14 | fun getDirection(@QueryMap options: Map): Call 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_cloud_update_done.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_detail_bookmark_selected.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_main_star_red.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/storelist/StoreListContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.storelist 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 4 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 5 | 6 | /** 7 | * Created by tom on 2019-04-18. 8 | */ 9 | interface StoreListContract { 10 | interface View : BaseView { 11 | fun setStores(stores: List) 12 | } 13 | 14 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter 15 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_main_clock_red.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_dialog_compass.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/remote/user/model/UserStoreEvent.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote.user.model 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 4 | 5 | /** 6 | * Created by tom on 7/17/18. 7 | */ 8 | class UserStoreEvent(val store: Store, val eventActionCode: Int) { 9 | companion object { 10 | const val ACTION_ADDED = 0 11 | const val ACTION_CHANGED = 1 12 | const val ACTION_REMOVED = 2 13 | const val ACTION_MOVED = 3 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_store_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_main_map.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_clock_outline_grey.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/local/prefs/PreferencesHelper.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.local.prefs 2 | 3 | /** 4 | * Created by tom on 7/24/18. 5 | */ 6 | interface PreferencesHelper { 7 | fun getAppLaunchFirstTime(): Boolean 8 | 9 | fun setAppLaunchFirstTime(isFirstTime: Boolean) 10 | 11 | fun getSearchHistories(): MutableSet 12 | 13 | fun setSearchHistories(set: MutableSet) 14 | 15 | fun getIfLanguageIsVietnamese(): Boolean 16 | 17 | fun setIfLanguageIsVietnamese(isVietnamese: Boolean) 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_navigation_menuitem.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_setting_update.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/domain/routing/MapsRoutingRepository.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.domain.routing 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.routing.model.MapsDirection 4 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 5 | 6 | import io.reactivex.Single 7 | 8 | /** 9 | * Created by tom on 7/18/18. 10 | * 11 | * Main entry point for accessing routing data. 12 | */ 13 | interface MapsRoutingRepository { 14 | fun getMapsDirection(queries: Map, store: Store): Single 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/extension/SnapHelperExt.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.extension 2 | 3 | import androidx.recyclerview.widget.RecyclerView 4 | import androidx.recyclerview.widget.SnapHelper 5 | 6 | /** 7 | * Created by tom on 2019-07-06. 8 | */ 9 | fun SnapHelper.getSnapPosition(recyclerView: RecyclerView): Int { 10 | val layoutManager = recyclerView.layoutManager ?: return RecyclerView.NO_POSITION 11 | val snapView = findSnapView(layoutManager) ?: return RecyclerView.NO_POSITION 12 | return layoutManager.getPosition(snapView) 13 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/service/eventbus/core/RobotBus.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.service.eventbus.core 2 | 3 | import org.greenrobot.eventbus.EventBus 4 | 5 | /** 6 | * Created by tom on 2019-06-23. 7 | */ 8 | class RobotBus(private val bus: EventBus) : IBus { 9 | 10 | override fun post(event: Event) { 11 | bus.post(event) 12 | } 13 | 14 | override fun register(subscriber: Any) { 15 | bus.register(subscriber) 16 | } 17 | 18 | override fun unregister(subscriber: Any) { 19 | bus.unregister(subscriber) 20 | } 21 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_default_avatar_menu.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_search.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_setting_termofuse.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_marker_outline_grey.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_store_title.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_new_list.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/ReflectionHelper.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils 2 | 3 | import java.lang.reflect.Field 4 | import java.lang.reflect.Modifier 5 | 6 | 7 | /** 8 | * Created by tom on 2019-06-09. 9 | */ 10 | 11 | @Throws(Exception::class) 12 | fun setFinalStatic(field: Field, newValue: Any) { 13 | field.isAccessible = true 14 | 15 | val modifiersField = Field::class.java.getDeclaredField("modifiers") 16 | modifiersField.isAccessible = true 17 | modifiersField.setInt(field, field.modifiers and Modifier.FINAL.inv()) 18 | 19 | field.set(null, newValue) 20 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_all_call.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/rx/TrampolineSchedulerProvider.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.rx 2 | 3 | import io.reactivex.Scheduler 4 | import io.reactivex.schedulers.Schedulers 5 | 6 | 7 | /** 8 | * Created by tom on 2019-06-02. 9 | */ 10 | class TrampolineSchedulerProvider : SchedulerProvider { 11 | override fun computation(): Scheduler { 12 | return Schedulers.trampoline() 13 | } 14 | 15 | override fun io(): Scheduler { 16 | return Schedulers.trampoline() 17 | } 18 | 19 | override fun ui(): Scheduler { 20 | return Schedulers.trampoline() 21 | } 22 | } -------------------------------------------------------------------------------- /app/src/test/java/com/iceteaviet/fastfoodfinder/utils/rx/TestSchedulerProvider.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.rx 2 | 3 | import io.reactivex.Scheduler 4 | import io.reactivex.schedulers.TestScheduler 5 | 6 | 7 | /** 8 | * Created by tom on 2019-06-02. 9 | */ 10 | class TestSchedulerProvider(private val testScheduler: TestScheduler) : SchedulerProvider { 11 | override fun ui(): Scheduler { 12 | return testScheduler 13 | } 14 | 15 | override fun computation(): Scheduler { 16 | return testScheduler 17 | } 18 | 19 | override fun io(): Scheduler { 20 | return testScheduler 21 | } 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/base/BaseActivity.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.base 2 | 3 | import android.os.Bundle 4 | import androidx.annotation.LayoutRes 5 | import androidx.appcompat.app.AppCompatActivity 6 | 7 | /** 8 | * Created by tom on 7/10/18. 9 | */ 10 | abstract class BaseActivity : AppCompatActivity() { 11 | 12 | /** 13 | * @return layout resource id 14 | */ 15 | @get:LayoutRes 16 | abstract val layoutId: Int 17 | 18 | override fun onCreate(savedInstanceState: Bundle?) { 19 | super.onCreate(savedInstanceState) 20 | setContentView(layoutId) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 256dp 6 | 70dp 7 | 14sp 8 | 18sp 9 | 24sp 10 | 16dp 11 | 12 | 2dp 13 | 3dp 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_post_comment_button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/remote/routing/MapsRoutingApiHelper.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote.routing 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.routing.model.MapsDirection 4 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 5 | 6 | /** 7 | * Created by tom on 7/18/18. 8 | */ 9 | interface MapsRoutingApiHelper { 10 | interface RoutingLoadCallback { 11 | fun onSuccess(data: T) 12 | 13 | fun onError(throwable: Throwable) 14 | } 15 | 16 | fun getMapsDirection(queries: Map, store: Store, callback: RoutingLoadCallback) 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rect_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/main/recently/MainRecentlyContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.main.recently 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 4 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 5 | 6 | /** 7 | * Created by tom on 2019-04-18. 8 | */ 9 | interface MainRecentlyContract { 10 | interface View : BaseView { 11 | fun setStores(stores: ArrayList) 12 | fun showStoreDetailView(store: Store) 13 | } 14 | 15 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 16 | fun onStoreItemClick(store: Store) 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_rounded_corner_medium.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_all_camera.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search_trophy.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_setting_translate.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_main_recently.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_setting_add.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/location/LocationListener.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.location 2 | 3 | 4 | /** 5 | * Created by tom on 2019-05-01. 6 | */ 7 | interface LocationListener { 8 | /** 9 | * This method will be invoked whenever new location update received 10 | */ 11 | fun onLocationChanged(location: LatLngAlt) 12 | 13 | /** 14 | * When it is not possible to receive location, such as no active provider or no permission etc. 15 | * It will pass an integer value from [FailType] 16 | * which will help you to determine how did it fail to receive location 17 | */ 18 | fun onLocationFailed(@FailType type: Int) 19 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/rx/AppSchedulerProvider.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.rx 2 | 3 | import io.reactivex.Scheduler 4 | import io.reactivex.android.schedulers.AndroidSchedulers 5 | import io.reactivex.schedulers.Schedulers 6 | 7 | 8 | /** 9 | * Created by tom on 2019-06-02. 10 | */ 11 | class AppSchedulerProvider : SchedulerProvider { 12 | 13 | override fun computation(): Scheduler { 14 | return Schedulers.computation() 15 | } 16 | 17 | override fun io(): Scheduler { 18 | return Schedulers.io() 19 | } 20 | 21 | override fun ui(): Scheduler { 22 | return AndroidSchedulers.mainThread() 23 | } 24 | } -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.gradle.enterprise") version "3.16.2" 3 | id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" 4 | } 5 | 6 | gradleEnterprise { 7 | buildScan { 8 | termsOfServiceUrl = "https://gradle.com/terms-of-service" 9 | termsOfServiceAgree = "yes" 10 | } 11 | } 12 | 13 | include(":app") 14 | include(":core:network") 15 | include(":core:worker") 16 | include(":core:analytics") 17 | include(":core:logger") 18 | include(":core:common") 19 | include(":core:location") 20 | include(":core:notifications") 21 | include(":data:model") 22 | include(":data:database") 23 | include(":data:datastore") 24 | include(":data:stores") -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/splash/SplashContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.splash 2 | 3 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 4 | 5 | /** 6 | * Created by tom on 2019-04-18. 7 | */ 8 | interface SplashContract { 9 | interface View : BaseView { 10 | fun openLoginScreen() 11 | fun openMainScreenWithDelay(delayTime: Long) 12 | fun restartSplashScreen() 13 | fun showGeneralErrorMessage() 14 | fun exit() 15 | fun showRetryDialog() 16 | } 17 | 18 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 19 | fun loadStoresFromServer() 20 | } 21 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_cloud_update.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/settings/discountnotify/DiscountNotifyContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.settings.discountnotify 2 | 3 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 4 | 5 | interface DiscountNotifyContract { 6 | interface View : BaseView { 7 | fun cancelDialog() 8 | fun doneDialog() 9 | fun setupTagContainer(storeList: Array) 10 | } 11 | 12 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 13 | fun onCancelButtonClick() 14 | fun onDoneButtonClick() 15 | fun onSetupTagContainer() 16 | fun getStoreName(key: String): String 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/domain/prefs/PreferencesRepository.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.domain.prefs 2 | 3 | /** 4 | * Created by tom on 7/24/18. 5 | * 6 | * Main entry point for accessing preferences data. 7 | */ 8 | interface PreferencesRepository { 9 | fun getAppLaunchFirstTime(): Boolean 10 | 11 | fun setAppLaunchFirstTime(isFirstTime: Boolean) 12 | 13 | fun getSearchHistories(): MutableSet 14 | 15 | fun setSearchHistories(set: MutableSet) 16 | 17 | fun addSearchHistories(searchContent: String) 18 | 19 | fun getIfLanguageIsVietnamese(): Boolean 20 | 21 | fun setIfLanguageIsVietnamese(isVietnamese: Boolean) 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/base/BasePresenter.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.base 2 | 3 | import com.iceteaviet.fastfoodfinder.data.DataManager 4 | import com.iceteaviet.fastfoodfinder.utils.rx.SchedulerProvider 5 | import io.reactivex.disposables.CompositeDisposable 6 | 7 | /** 8 | * Created by tom on 2019-04-18. 9 | */ 10 | abstract class BasePresenter(protected val dataManager: DataManager, 11 | protected var schedulerProvider: SchedulerProvider) : Presenter { 12 | 13 | protected val compositeDisposable: CompositeDisposable = CompositeDisposable() 14 | 15 | override fun unsubscribe() { 16 | compositeDisposable.clear() 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/local/db/user/UserDataSource.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.local.db.user 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.User 4 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.UserStoreList 5 | 6 | /** 7 | * Created by tom on 7/15/18. 8 | */ 9 | interface UserDataSource { 10 | fun insertOrUpdate(name: String, email: String, photoUrl: String, uid: String, storeLists: List) 11 | 12 | fun insertOrUpdate(user: User) 13 | 14 | fun updateStoreListForUser(uid: String, storeLists: List) 15 | 16 | fun getUser(uid: String): User 17 | 18 | fun isUserExists(uid: String): Boolean 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/auth/ClientAuth.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.auth 2 | 3 | import com.google.firebase.auth.AuthCredential 4 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.User 5 | import io.reactivex.Single 6 | 7 | /** 8 | * Created by tom on 7/17/18. 9 | */ 10 | interface ClientAuth { 11 | fun getCurrentUserUid(): String 12 | 13 | fun signUpWithEmailAndPassword(email: String, password: String): Single 14 | 15 | fun isSignedIn(): Boolean 16 | 17 | fun signOut() 18 | 19 | fun signInWithEmailAndPassword(email: String, password: String): Single 20 | 21 | fun signInWithCredential(authCredential: AuthCredential): Single 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/remote/store/StoreApiHelper.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote.store 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Comment 4 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 5 | 6 | /** 7 | * Created by tom on 7/15/18. 8 | */ 9 | interface StoreApiHelper { 10 | interface StoreLoadCallback { 11 | fun onSuccess(data: T) 12 | 13 | fun onError(exception: Exception) 14 | } 15 | 16 | fun getAllStores(callback: StoreLoadCallback>) 17 | 18 | fun getComments(storeId: String, callback: StoreLoadCallback>) 19 | 20 | fun insertOrUpdateComment(storeId: String, comment: Comment) 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/main/map/model/NearByStore.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.main.map.model 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 4 | 5 | /** 6 | * Created by tom on 2019-04-29. 7 | */ 8 | class NearByStore(var store: Store, var distance: Double) { 9 | override fun equals(other: Any?): Boolean { 10 | return if (other is NearByStore) { 11 | store.equals(other.store) && distance.equals(other.distance) 12 | } else { 13 | false 14 | } 15 | } 16 | 17 | override fun hashCode(): Int { 18 | var result = store.hashCode() 19 | result = 31 * result + distance.hashCode() 20 | return result 21 | } 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/local/prefs/PreferencesWrapper.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.local.prefs 2 | 3 | /** 4 | * Created by tom on 7/24/18. 5 | */ 6 | interface PreferencesWrapper { 7 | fun putString(key: String, value: String) 8 | 9 | fun getString(key: String, defaultValue: String): String 10 | 11 | fun putBoolean(key: String, value: Boolean) 12 | 13 | fun getBoolean(key: String, defaultValue: Boolean): Boolean 14 | 15 | fun putInt(key: String, value: Int) 16 | 17 | fun getInt(key: String, defaultValue: Int): Int 18 | 19 | fun setStringSet(key: String, set: MutableSet) 20 | 21 | fun getStringSet(key: String, defaultValue: MutableSet): MutableSet 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_all_share.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_detail_bookmark.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/profile/createlist/CreateListContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.profile.createlist 2 | 3 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 4 | 5 | /** 6 | * Created by tom on 2019-04-18. 7 | */ 8 | interface CreateListContract { 9 | interface View : BaseView { 10 | fun notifyWithResult(storeName: String, iconId: Int) 11 | fun cancel() 12 | fun showEmptyNameWarning() 13 | fun updateSelectedIconUI(iconId: Int) 14 | } 15 | 16 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 17 | fun onDoneButtonClick(name: String) 18 | fun onCancelButtonClick() 19 | fun onListIconSelect(iconId: Int) 20 | } 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/Constant.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils 2 | 3 | import com.google.android.gms.maps.model.LatLng 4 | 5 | /** 6 | * Use class instead of interface for constant class to avoid Constant Interface Antipattern 7 | * 8 | * @see https://stackoverflow.com/questions/2659593/what-is-the-use-of-interface-constants 9 | * 10 | * 11 | * Created by Genius Doan on 11/11/2016. 12 | */ 13 | 14 | object Constant { 15 | const val DEFAULT_ZOOM_LEVEL = 16f 16 | const val DETAILED_ZOOM_LEVEL = 18f 17 | 18 | val DEFAULT_MAP_TARGET = LatLng(10.773996, 106.6898035) 19 | 20 | const val SEARCH_STORE_PREFIX = "search-store-id_" 21 | const val SEARCH_STORE_PREFIX_LEN = SEARCH_STORE_PREFIX.length 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_detail_bookmark_disable.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/profile/cover/UpdateCoverContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.profile.cover 2 | 3 | import android.graphics.drawable.Drawable 4 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 5 | 6 | /** 7 | * Created by tom on 2019-04-18. 8 | */ 9 | interface UpdateCoverContract { 10 | interface View : BaseView { 11 | fun openImageFilePicker() 12 | fun setSelectedImage(selectedImage: Drawable) 13 | fun dismissWithResult(selectedImage: Drawable?) 14 | fun cancel() 15 | } 16 | 17 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 18 | fun onImageBrowserButtonClick() 19 | fun onCoverImageSelect(selectedImage: Drawable) 20 | fun onDoneButtonClick() 21 | } 22 | } -------------------------------------------------------------------------------- /app/src/main/res/anim/scale_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 22 | -------------------------------------------------------------------------------- /core/common/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /core/location/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /core/logger/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /core/network/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /core/worker/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /data/database/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /data/model/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /data/stores/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /core/analytics/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /core/notifications/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /data/datastore/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/login/emaillogin/EmailLoginContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.login.emaillogin 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.User 4 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 5 | 6 | /** 7 | * Created by tom on 2019-04-18. 8 | */ 9 | interface EmailLoginContract { 10 | interface View : BaseView { 11 | fun setLoginButtonProgress(progress: Int) 12 | fun setInputEnabled(enabled: Boolean) 13 | fun showInvalidPasswordError() 14 | fun showInvalidEmailError() 15 | fun notifyLoginSuccess(user: User) 16 | fun notifyLoginError(e: Throwable) 17 | } 18 | 19 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 20 | fun onSignInButtonClicked(email: String, password: String) 21 | } 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/main/favourite/MainFavContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.main.favourite 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 4 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 5 | 6 | /** 7 | * Created by tom on 2019-04-18. 8 | */ 9 | interface MainFavContract { 10 | interface View : BaseView { 11 | fun setStores(storeList: List) 12 | fun addStore(store: Store) 13 | fun updateStore(store: Store) 14 | fun removeStore(store: Store) 15 | fun showWarningMessage(message: String?) 16 | fun showStoreDetailView(store: Store) 17 | fun showGeneralErrorMessage() 18 | } 19 | 20 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 21 | fun onStoreItemClick(store: Store) 22 | } 23 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | 3 | jdk: 4 | - oraclejdk8 5 | 6 | android: 7 | components: 8 | - tools 9 | - platform-tools 10 | 11 | # The BuildTools version used by your project 12 | - build-tools-29.0.3 13 | 14 | # The SDK version used to compile your project 15 | - android-29 16 | 17 | # Support library 18 | - extra-android-support 19 | - extra-android-m2repository 20 | 21 | # Specify at least one system image, 22 | # if you need to run emulator(s) during your tests 23 | - sys-img-armeabi-v7a-android-28 24 | 25 | before_install: 26 | - yes | sdkmanager "platforms;android-28" 27 | - chmod +x gradlew 28 | 29 | script: 30 | - ./gradlew build jacocoTestReport test -Pbuild=devCI --daemon --scan 31 | 32 | after_success: 33 | - bash <(curl -s https://codecov.io/bash) 34 | - echo "Build Passed - Branch($TRAVIS_BRANCH) Pull Request($TRAVIS_PULL_REQUEST) Tag($TRAVIS_TAG)" 35 | -------------------------------------------------------------------------------- /app/src/main/res/animator/zoom_in_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 13 | 14 | 15 | 19 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/storelist/ListDetailContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.storelist 2 | 3 | import androidx.annotation.DrawableRes 4 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 5 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.UserStoreList 6 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 7 | 8 | /** 9 | * Created by tom on 2019-04-18. 10 | */ 11 | interface ListDetailContract { 12 | interface View : BaseView { 13 | fun setStores(storeList: List) 14 | fun exit() 15 | fun setListNameText(listName: String) 16 | fun loadStoreIcon(@DrawableRes storeIcon: Int) 17 | fun showGeneralErrorMessage() 18 | } 19 | 20 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 21 | fun handleExtras(userStoreList: UserStoreList?, photoUrl: String?) 22 | } 23 | } -------------------------------------------------------------------------------- /app/src/test/java/com/iceteaviet/fastfoodfinder/data/local/db/user/UserDAOTest.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.local.db.user 2 | 3 | import org.junit.After 4 | import org.junit.Before 5 | import org.mockito.MockitoAnnotations 6 | 7 | /** 8 | * Created by tom on 2019-05-29. 9 | */ 10 | class UserDAOTest { 11 | private lateinit var mockAnnotations: AutoCloseable 12 | 13 | private var userDAO: UserDAO? = null 14 | 15 | @Before 16 | fun setupPreferencesHelper() { 17 | // Mockito has a very convenient way to inject mocks by using the @Mock annotation. To 18 | // inject the mocks in the test the initMocks method needs to be called. 19 | mockAnnotations = MockitoAnnotations.openMocks(this) 20 | 21 | // Get a reference to the class under test 22 | userDAO = UserDAO() 23 | } 24 | 25 | @After 26 | fun tearDown() { 27 | mockAnnotations.close() 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/storelist/StoreListPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.storelist 2 | 3 | import com.iceteaviet.fastfoodfinder.data.DataManager 4 | import com.iceteaviet.fastfoodfinder.ui.base.BasePresenter 5 | import com.iceteaviet.fastfoodfinder.utils.getFakeStoreList 6 | import com.iceteaviet.fastfoodfinder.utils.rx.SchedulerProvider 7 | 8 | /** 9 | * Created by tom on 2019-04-18. 10 | */ 11 | class StoreListPresenter : BasePresenter, StoreListContract.Presenter { 12 | 13 | private val storeListView: StoreListContract.View 14 | 15 | constructor(dataManager: DataManager, schedulerProvider: SchedulerProvider, storeListView: StoreListContract.View) : super(dataManager, schedulerProvider) { 16 | this.storeListView = storeListView 17 | } 18 | 19 | override fun subscribe() { 20 | storeListView.setStores(getFakeStoreList()) 21 | } 22 | } -------------------------------------------------------------------------------- /app/src/test/java/com/iceteaviet/fastfoodfinder/data/local/db/store/StoreDAOTest.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.local.db.store 2 | 3 | import org.junit.After 4 | import org.junit.Before 5 | import org.mockito.MockitoAnnotations 6 | 7 | /** 8 | * Created by tom on 2019-05-29. 9 | */ 10 | class StoreDAOTest { 11 | private lateinit var mockAnnotations: AutoCloseable 12 | 13 | private var storeDAO: StoreDAO? = null 14 | 15 | @Before 16 | fun setupPreferencesHelper() { 17 | // Mockito has a very convenient way to inject mocks by using the @Mock annotation. To 18 | // inject the mocks in the test the initMocks method needs to be called. 19 | mockAnnotations = MockitoAnnotations.openMocks(this) 20 | 21 | // Get a reference to the class under test 22 | storeDAO = StoreDAO() 23 | } 24 | 25 | @After 26 | fun tearDown() { 27 | mockAnnotations.close() 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/login/emailregister/EmailRegisterContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.login.emailregister 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.User 4 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 5 | 6 | /** 7 | * Created by tom on 2019-04-18. 8 | */ 9 | interface EmailRegisterContract { 10 | interface View : BaseView { 11 | fun setRegisterButtonProgress(progress: Int) 12 | fun setInputEnabled(enabled: Boolean) 13 | fun showInvalidPasswordError() 14 | fun showInvalidRePasswordError() 15 | fun showInvalidEmailError() 16 | fun notifyRegisterSuccess(user: User) 17 | fun notifyLoginError(e: Throwable) 18 | } 19 | 20 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 21 | fun onSignUpButtonClicked(email: String, password: String, rePassword: String) 22 | } 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/extension/RecyclerViewExt.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils.extension 2 | 3 | import androidx.recyclerview.widget.RecyclerView 4 | import androidx.recyclerview.widget.SnapHelper 5 | import com.iceteaviet.fastfoodfinder.ui.custom.snaphelper.OnSnapListener 6 | import com.iceteaviet.fastfoodfinder.ui.custom.snaphelper.OnSnapPositionChangeListener 7 | 8 | /** 9 | * Created by tom on 2019-07-06. 10 | */ 11 | fun RecyclerView.attachSnapHelperToListener(snapHelper: SnapHelper, 12 | onSnapPositionChangeListener: OnSnapPositionChangeListener, 13 | behavior: OnSnapListener.Behavior = OnSnapListener.Behavior.NOTIFY_ON_SCROLL) { 14 | snapHelper.attachToRecyclerView(this) 15 | val snapOnScrollListener = OnSnapListener(snapHelper, onSnapPositionChangeListener, behavior) 16 | addOnScrollListener(snapOnScrollListener) 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/login/LoginContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.login 2 | 3 | import com.google.firebase.auth.AuthCredential 4 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.User 5 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 6 | 7 | /** 8 | * Created by tom on 2019-04-18. 9 | */ 10 | interface LoginContract { 11 | interface View : BaseView { 12 | fun exit() 13 | fun showMainView() 14 | fun showSignInFailMessage() 15 | fun showGeneralErrorMessage() 16 | } 17 | 18 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 19 | fun onSkipButtonClick() 20 | fun onRegisterSuccess(user: User) 21 | fun onLoginSuccess(baseUser: User) 22 | fun onRequestGoogleAccountSuccess(authCredential: AuthCredential, fromLastSignIn: Boolean) 23 | fun onRequestFacebookAccountSuccess(authCredential: AuthCredential) 24 | } 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/service/SyncService.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.service 2 | 3 | import android.app.Service 4 | import android.content.Context 5 | import android.content.Intent 6 | import android.os.IBinder 7 | 8 | /** 9 | * Created by tom on 8/7/18. 10 | */ 11 | class SyncService : Service() { 12 | override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int { 13 | return START_STICKY 14 | } 15 | 16 | override fun onBind(intent: Intent): IBinder? { 17 | return null 18 | } 19 | 20 | companion object { 21 | fun getStartIntent(context: Context): Intent { 22 | return Intent(context, SyncService::class.java) 23 | } 24 | 25 | fun start(context: Context) { 26 | context.startService(getStartIntent(context)) 27 | } 28 | 29 | fun stop(context: Context) { 30 | context.stopService(getStartIntent(context)) 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/settings/SettingContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.settings 2 | 3 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 4 | 5 | /** 6 | * Created by tom on 2019-04-18. 7 | */ 8 | interface SettingContract { 9 | interface View : BaseView { 10 | fun initSignOutTextView(enabled: Boolean) 11 | fun updateLoadingProgressView(showProgress: Boolean) 12 | fun showSuccessLoadingToast(successMessage: String?) 13 | fun showFailedLoadingToast(failedMessage: String?) 14 | fun updateLangUI(isVietnamese: Boolean) 15 | fun loadLanguage(languageToLoad: String) 16 | } 17 | 18 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 19 | fun onInitSignOutTextView() 20 | fun signOut() 21 | fun onLoadStoreFromServer() 22 | fun onSetupLanguage() 23 | fun saveLanguagePref() 24 | fun onLanguageChanged() 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/local/db/store/StoreDataSource.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.local.db.store 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 4 | 5 | /** 6 | * Created by tom on 7/15/18. 7 | */ 8 | interface StoreDataSource { 9 | 10 | fun getAllStores(): List 11 | 12 | fun setStores(storeList: List) 13 | 14 | fun getStoreInBounds(lat: Double, lng: Double, radius: Double): List 15 | 16 | fun findStores(queryString: String): List 17 | 18 | fun findStoresByCustomAddress(customQuerySearch: List): List 19 | 20 | fun findStoresBy(key: String, value: Int): List 21 | 22 | fun findStoresBy(key: String, values: List): List 23 | 24 | fun findStoresByType(type: Int): List 25 | 26 | fun findStoreById(id: Int): Store? 27 | 28 | fun findStoresByIds(ids: List): List 29 | 30 | fun deleteAllStores() 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/location/SystemLocationListener.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.location 2 | 3 | import android.os.Bundle 4 | 5 | /** 6 | * Created by tom on 2019-05-01. 7 | */ 8 | interface SystemLocationListener : LocationListener { 9 | /** 10 | * This method will be invoked if only you use android.location.SystemLocationManager 11 | * with GPS or Network Providers to receive location 12 | */ 13 | fun onStatusChanged(provider: String, status: Int, extras: Bundle) 14 | 15 | /** 16 | * This method will be invoked if only you use android.location.SystemLocationManager 17 | * with GPS or Network Providers to receive location 18 | */ 19 | fun onProviderEnabled(provider: String) 20 | 21 | /** 22 | * This method will be invoked if only you use android.location.SystemLocationManager 23 | * with GPS or Network Providers to receive location 24 | */ 25 | fun onProviderDisabled(provider: String) 26 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/main/map/storeinfo/StoreInfoContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.main.map.storeinfo 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 4 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 5 | 6 | interface StoreInfoContract { 7 | interface View : BaseView { 8 | fun updateNewStoreUI(store: Store?) 9 | fun openStoreDetailActivity(store: Store?) 10 | fun makeNativeCall(tel: String) 11 | fun addStoreToFavorite(store: Store) 12 | fun onDirectionChange(store: Store) 13 | fun showEmptyTelToast() 14 | fun exit() 15 | 16 | } 17 | 18 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 19 | fun handleExtras(store: Store?) 20 | fun setOnDetailTextViewClick() 21 | fun onMakeCallWithPermission() 22 | fun onAddToFavoriteButtonClick() 23 | fun onDirectionButtonClick() 24 | } 25 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | org.gradle.parallel=true 19 | org.gradle.daemon=true 20 | 21 | android.enableJetifier=true 22 | android.useAndroidX=true -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/local/db/user/model/UserStoreListEntity.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.local.db.user.model 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.UserStoreList 4 | 5 | import io.realm.RealmList 6 | import io.realm.RealmObject 7 | 8 | /** 9 | * Created by tom on 7/26/18. 10 | */ 11 | open class UserStoreListEntity : RealmObject { 12 | var id: Int = 0 13 | lateinit var listName: String 14 | var iconId: Int = 0 15 | lateinit var storeIdList: RealmList 16 | 17 | constructor() { 18 | // Realm required 19 | } 20 | 21 | constructor(userStoreList: UserStoreList) { 22 | map(userStoreList) 23 | } 24 | 25 | fun map(userStoreList: UserStoreList) { 26 | id = userStoreList.id 27 | listName = userStoreList.listName 28 | iconId = userStoreList.iconId 29 | storeIdList = RealmList() 30 | storeIdList.addAll(userStoreList.getStoreIdList()) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_detail_pencil.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/test/java/com/iceteaviet/fastfoodfinder/utils/RealmUtilsTest.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils 2 | 3 | import io.realm.RealmList 4 | import org.junit.Assert.assertEquals 5 | import org.junit.Test 6 | 7 | class RealmUtilsTest { 8 | @Test 9 | fun realmListToList_size() { 10 | val realmList = RealmList("realmObj1", "realmObj2", "realmObj3", "realmObj4", "realmObj5") 11 | assertEquals(5, realmListToList(realmList).size) 12 | } 13 | 14 | @Test 15 | fun realmListToList_items() { 16 | val realmList = RealmList("realmObj1", "realmObj2", "realmObj3", "realmObj4", "realmObj5") 17 | assertEquals("[realmObj1, realmObj2, realmObj3, realmObj4, realmObj5]", realmListToList(realmList).toString()) 18 | } 19 | 20 | @Test 21 | fun realmListToList_item() { 22 | val realmList = RealmList("realmObj1", "realmObj2", "realmObj3", "realmObj4", "realmObj5") 23 | assertEquals("realmObj4", realmListToList(realmList)[3]) 24 | } 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/store/comment/CommentContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.store.comment 2 | 3 | import android.os.Parcelable 4 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 5 | 6 | /** 7 | * Created by tom on 2019-04-18. 8 | */ 9 | interface CommentContract { 10 | interface View : BaseView { 11 | fun updateTextColor(overLimit: Boolean) 12 | fun setRemainCharCountText(remainCharCount: String) 13 | fun setPostButtonEnabled(enabled: Boolean) 14 | fun showCommentPostFailedWarning() 15 | fun exitWithResult(comment: Parcelable) 16 | fun exit() 17 | fun showCloseConfirmDialog() 18 | fun showGeneralErrorMessage() 19 | } 20 | 21 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 22 | fun afterCommentTextChanged(text: CharSequence) 23 | fun onPostButtonClick(commentText: CharSequence) 24 | fun onBackButtonClick(commentText: CharSequence) 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_detail_pencil_disable.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/test/java/com/iceteaviet/fastfoodfinder/data/remote/routing/GoogleMapsRoutingApiHelperTest.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote.routing 2 | 3 | import org.junit.After 4 | import org.junit.Before 5 | import org.mockito.MockitoAnnotations 6 | 7 | /** 8 | * Created by tom on 2019-05-29. 9 | */ 10 | class GoogleMapsRoutingApiHelperTest { 11 | private lateinit var mockAnnotations: AutoCloseable 12 | 13 | private var googleMapsRoutingApiHelper: GoogleMapsRoutingApiHelper? = null 14 | 15 | @Before 16 | fun setupPreferencesHelper() { 17 | // Mockito has a very convenient way to inject mocks by using the @Mock annotation. To 18 | // inject the mocks in the test the initMocks method needs to be called. 19 | mockAnnotations = MockitoAnnotations.openMocks(this) 20 | 21 | // Get a reference to the class under test 22 | googleMapsRoutingApiHelper = GoogleMapsRoutingApiHelper("api_key") 23 | } 24 | 25 | @After 26 | fun tearDown() { 27 | mockAnnotations.close() 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_detail_love.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/mock/java/com/iceteaviet/fastfoodfinder/data/remote/routing/FakeGoogleMapsRoutingApiHelper.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote.routing 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.routing.model.MapsDirection 4 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 5 | import com.iceteaviet.fastfoodfinder.utils.exception.NotFoundException 6 | import java.util.* 7 | 8 | /** 9 | * Created by tom on 7/18/18. 10 | */ 11 | class FakeGoogleMapsRoutingApiHelper : MapsRoutingApiHelper { 12 | 13 | private val DIRECTION_SERVICE_DATA: Map 14 | 15 | init { 16 | DIRECTION_SERVICE_DATA = TreeMap() 17 | } 18 | 19 | override fun getMapsDirection(queries: Map, store: Store, callback: MapsRoutingApiHelper.RoutingLoadCallback) { 20 | val response = DIRECTION_SERVICE_DATA.get(queries.toString()) 21 | if (response != null) 22 | callback.onSuccess(response) 23 | else 24 | callback.onError(NotFoundException()) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_detail_love_disable.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_detail_love_selected.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/local/db/user/model/UserEntity.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.local.db.user.model 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.User 4 | import io.realm.RealmList 5 | import io.realm.RealmObject 6 | 7 | /** 8 | * Created by Genius Doan on 2018. 9 | */ 10 | open class UserEntity : RealmObject() { 11 | var name: String = "" 12 | var email: String = "" 13 | private var uid: String = "" 14 | var photoUrl: String = "" 15 | var userStoreLists: RealmList = RealmList() 16 | 17 | fun getUid(): String { 18 | return uid 19 | } 20 | 21 | fun map(user: User) { 22 | name = user.name 23 | email = user.email 24 | uid = user.getUid() 25 | photoUrl = user.photoUrl 26 | this.userStoreLists = RealmList() 27 | val userStoreLists = user.getUserStoreLists() 28 | for (i in userStoreLists.indices) { 29 | this.userStoreLists.add(UserStoreListEntity(userStoreLists.get(i))) 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/domain/user/UserRepository.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.domain.user 2 | 3 | import androidx.core.util.Pair 4 | 5 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.User 6 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.UserStoreList 7 | 8 | import io.reactivex.Observable 9 | import io.reactivex.Single 10 | 11 | /** 12 | * Created by tom on 7/15/18. 13 | * 14 | * Main entry point for accessing user data. 15 | */ 16 | interface UserRepository { 17 | fun insertOrUpdateUser(name: String, email: String, photoUrl: String, uid: String, storeLists: List) 18 | 19 | fun insertOrUpdateUser(user: User) 20 | 21 | fun updateStoreListForUser(uid: String, storeLists: List) 22 | 23 | fun getUser(uid: String): Single 24 | 25 | fun isUserExists(uid: String): Single 26 | 27 | fun subscribeFavouriteStoresOfUser(uid: String): Observable> // Pair 28 | 29 | fun unsubscribeFavouriteStoresOfUser(uid: String) 30 | } 31 | -------------------------------------------------------------------------------- /core/worker/src/main/java/com/iceteaviet/fastfoodfinder/core/worker/IOWorker.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.core.worker 2 | 3 | import kotlinx.coroutines.CoroutineExceptionHandler 4 | import kotlinx.coroutines.CoroutineScope 5 | import kotlinx.coroutines.Dispatchers 6 | import kotlinx.coroutines.SupervisorJob 7 | import kotlinx.coroutines.cancel 8 | import kotlin.coroutines.CoroutineContext 9 | 10 | /** 11 | * Created by nhoxbypass on 20/04/2023. 12 | */ 13 | object IOWorker { 14 | private val UnboundIO = Dispatchers.IO 15 | 16 | private val exceptionHandler by lazy { 17 | CoroutineExceptionHandler { _, exception -> 18 | // TODO: Print logs 19 | } 20 | } 21 | private val coroutineContext by lazy { 22 | SupervisorJob() + UnboundIO + exceptionHandler 23 | } 24 | val scope by lazy { 25 | object : CoroutineScope { 26 | override val coroutineContext: CoroutineContext 27 | get() = this@IOWorker.coroutineContext 28 | } 29 | } 30 | 31 | fun cancelAll() { 32 | scope.cancel() 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/ar/model/AugmentedPOI.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.ar.model 2 | 3 | import androidx.annotation.DrawableRes 4 | import com.iceteaviet.fastfoodfinder.location.LatLngAlt 5 | 6 | /** 7 | * Created by Genius Doan on 20/07/2017. 8 | */ 9 | 10 | class AugmentedPOI(val name: String, lat: Double, lon: Double, alt: Double, @param:DrawableRes @field:DrawableRes val icon: Int) { 11 | private val location: LatLngAlt 12 | 13 | init { 14 | location = LatLngAlt(lat, lon, alt) 15 | } 16 | 17 | fun getLocation(): LatLngAlt { 18 | return location 19 | } 20 | 21 | override fun equals(other: Any?): Boolean { 22 | return if (other is AugmentedPOI) { 23 | name.equals(other.name) && location.equals(other.location) 24 | } else { 25 | false 26 | } 27 | } 28 | 29 | override fun hashCode(): Int { 30 | var result = name.hashCode() 31 | result = 31 * result + icon 32 | result = 31 * result + location.hashCode() 33 | return result 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_store_tag.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 25 | -------------------------------------------------------------------------------- /core/worker/src/main/java/com/iceteaviet/fastfoodfinder/core/worker/ComputationWorker.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.core.worker 2 | 3 | import kotlinx.coroutines.CoroutineExceptionHandler 4 | import kotlinx.coroutines.CoroutineScope 5 | import kotlinx.coroutines.Dispatchers 6 | import kotlinx.coroutines.SupervisorJob 7 | import kotlinx.coroutines.cancel 8 | import kotlin.coroutines.CoroutineContext 9 | 10 | /** 11 | * Created by nhoxbypass on 20/04/2023. 12 | */ 13 | object ComputationWorker { 14 | private val Computation = Dispatchers.Default 15 | 16 | private val exceptionHandler by lazy { 17 | CoroutineExceptionHandler { _, exception -> 18 | // TODO: Print logs 19 | } 20 | } 21 | private val coroutineContext by lazy { 22 | SupervisorJob() + Computation + exceptionHandler 23 | } 24 | val scope by lazy { 25 | object : CoroutineScope { 26 | override val coroutineContext: CoroutineContext 27 | get() = this@ComputationWorker.coroutineContext 28 | } 29 | } 30 | 31 | fun cancelAll() { 32 | scope.cancel() 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/main/search/SearchContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.main.search 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 4 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 5 | import com.iceteaviet.fastfoodfinder.ui.main.search.model.SearchStoreItem 6 | 7 | /** 8 | * Created by tom on 2019-04-18. 9 | */ 10 | interface SearchContract { 11 | interface View : BaseView { 12 | fun setSearchHistory(searchHistory: List, searchItems: List) 13 | fun setSearchStores(searchItems: List) 14 | fun showStoreListView() 15 | fun showGeneralErrorMessage() 16 | } 17 | 18 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 19 | fun onStoreSearchClick(store: Store) 20 | fun onQuickSearchItemClick(storeType: Int) 21 | fun onUpdateSearchList(searchText: String) 22 | fun onTopStoreButtonClick() 23 | fun onNearestStoreButtonClick() 24 | fun onTrendingStoreButtonClick() 25 | fun onConvenienceStoreButtonClick() 26 | } 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/remote/user/UserApiHelper.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote.user 2 | 3 | import androidx.core.util.Pair 4 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.User 5 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.UserStoreList 6 | import io.reactivex.Observable 7 | 8 | /** 9 | * Created by tom on 7/15/18. 10 | */ 11 | interface UserApiHelper { 12 | interface UserLoadCallback { 13 | fun onSuccess(data: T) 14 | 15 | fun onError(exception: Exception) 16 | } 17 | 18 | fun insertOrUpdate(name: String, email: String, photoUrl: String, uid: String, storeLists: List) 19 | 20 | fun insertOrUpdate(user: User) 21 | 22 | fun updateStoreListForUser(uid: String, storeLists: List) 23 | 24 | fun getUser(uid: String, callback: UserLoadCallback) 25 | 26 | fun isUserExists(uid: String, callback: UserLoadCallback) 27 | 28 | fun subscribeFavouriteStoresOfUser(uid: String): Observable> // Pair 29 | 30 | fun unsubscribeFavouriteStoresOfUser(uid: String) 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/location/LatLngAlt.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.location 2 | 3 | /** 4 | * Created by tom on 2019-06-10. 5 | */ 6 | class LatLngAlt { 7 | var latitude: Double 8 | var longitude: Double 9 | var altitude: Double 10 | 11 | constructor(lat: Double, lng: Double, alt: Double) { 12 | if (-180.0 <= lng && lng < 180.0) { 13 | this.longitude = lng 14 | } else { 15 | this.longitude = ((lng - 180.0) % 360.0 + 360.0) % 360.0 - 180.0 16 | } 17 | 18 | this.latitude = Math.max(-90.0, Math.min(90.0, lat)) 19 | this.altitude = alt 20 | } 21 | 22 | override fun equals(other: Any?): Boolean { 23 | return if (other is LatLngAlt) { 24 | latitude == other.latitude && longitude == other.longitude && altitude == other.altitude 25 | } else { 26 | false 27 | } 28 | } 29 | 30 | override fun hashCode(): Int { 31 | var result = latitude.hashCode() 32 | result = 31 * result + longitude.hashCode() 33 | result = 31 * result + altitude.hashCode() 34 | return result 35 | } 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/location/FailType.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.location 2 | 3 | import androidx.annotation.IntDef 4 | 5 | 6 | /** 7 | * Created by tom on 2019-05-01. 8 | */ 9 | @IntDef(FailType.UNKNOWN, FailType.TIMEOUT, FailType.PERMISSION_DENIED, FailType.NETWORK_NOT_AVAILABLE, FailType.GOOGLE_PLAY_SERVICES_NOT_AVAILABLE, FailType.GOOGLE_PLAY_SERVICES_CONNECTION_FAIL, FailType.GOOGLE_PLAY_SERVICES_SETTINGS_DIALOG, FailType.GOOGLE_PLAY_SERVICES_SETTINGS_DENIED, FailType.VIEW_DETACHED, FailType.VIEW_NOT_REQUIRED_TYPE) 10 | @Retention(AnnotationRetention.SOURCE) 11 | annotation class FailType { 12 | companion object { 13 | 14 | const val UNKNOWN = -1 15 | const val TIMEOUT = 1 16 | const val PERMISSION_DENIED = 2 17 | const val NETWORK_NOT_AVAILABLE = 3 18 | const val GOOGLE_PLAY_SERVICES_NOT_AVAILABLE = 4 19 | const val GOOGLE_PLAY_SERVICES_CONNECTION_FAIL = 5 20 | const val GOOGLE_PLAY_SERVICES_SETTINGS_DIALOG = 6 21 | const val GOOGLE_PLAY_SERVICES_SETTINGS_DENIED = 7 22 | const val VIEW_DETACHED = 8 23 | const val VIEW_NOT_REQUIRED_TYPE = 9 24 | } 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/local/db/store/model/StoreEntity.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.local.db.store.model 2 | 3 | import com.google.android.gms.maps.model.LatLng 4 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 5 | 6 | import io.realm.RealmObject 7 | 8 | /** 9 | * Created by Genius Doan on 11/20/2016. 10 | */ 11 | open class StoreEntity : RealmObject() { 12 | 13 | var type: Int = 0 14 | private set 15 | var id: Int = 0 16 | var title: String = "" 17 | private set 18 | var address: String = "" 19 | var latitude: Double = 0.toDouble() 20 | private set 21 | var longitude: Double = 0.toDouble() 22 | private set 23 | var telephone: String = "" 24 | 25 | val position: LatLng 26 | get() = LatLng(latitude, longitude) 27 | 28 | fun map(store: Store) { 29 | id = store.id 30 | title = store.title 31 | address = store.address 32 | latitude = java.lang.Double.parseDouble(store.lat) 33 | longitude = java.lang.Double.parseDouble(store.lng) 34 | telephone = store.tel 35 | type = store.type 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/DataManager.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data 2 | 3 | import android.content.Context 4 | import com.iceteaviet.fastfoodfinder.data.auth.ClientAuth 5 | import com.iceteaviet.fastfoodfinder.data.domain.prefs.PreferencesRepository 6 | import com.iceteaviet.fastfoodfinder.data.domain.routing.MapsRoutingRepository 7 | import com.iceteaviet.fastfoodfinder.data.domain.store.StoreRepository 8 | import com.iceteaviet.fastfoodfinder.data.domain.user.UserRepository 9 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 10 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.User 11 | import io.reactivex.Single 12 | 13 | /** 14 | * Created by tom on 7/9/18. 15 | * 16 | * Central data access point. 17 | * We may not need this if we use few repository. But it's important when we have many repositories 18 | */ 19 | interface DataManager : ClientAuth, StoreRepository, UserRepository, MapsRoutingRepository, PreferencesRepository { 20 | fun initialize(context: Context) 21 | 22 | fun loadStoresFromServer(): Single> 23 | 24 | fun getCurrentUser(): User? 25 | 26 | fun updateCurrentUser(user: User?) 27 | } -------------------------------------------------------------------------------- /app/src/test/java/com/iceteaviet/fastfoodfinder/data/remote/user/FirebaseUserApiHelperTest.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote.user 2 | 3 | import com.google.firebase.database.DatabaseReference 4 | import org.junit.After 5 | import org.junit.Before 6 | import org.mockito.Mock 7 | import org.mockito.MockitoAnnotations 8 | 9 | /** 10 | * Created by tom on 2019-05-29. 11 | */ 12 | class FirebaseUserApiHelperTest { 13 | private lateinit var mockAnnotations: AutoCloseable 14 | 15 | private var firebaseUserRepository: FirebaseUserApiHelper? = null 16 | 17 | @Mock 18 | private lateinit var databaseRef: DatabaseReference 19 | 20 | @Before 21 | fun setupPreferencesHelper() { 22 | // Mockito has a very convenient way to inject mocks by using the @Mock annotation. To 23 | // inject the mocks in the test the initMocks method needs to be called. 24 | mockAnnotations = MockitoAnnotations.openMocks(this) 25 | 26 | // Get a reference to the class under test 27 | firebaseUserRepository = FirebaseUserApiHelper(databaseRef) 28 | } 29 | 30 | @After 31 | fun tearDown() { 32 | mockAnnotations.close() 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_ar_camera.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 18 | 19 | 20 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/test/java/com/iceteaviet/fastfoodfinder/data/remote/store/FirebaseStoreApiHelperTest.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote.store 2 | 3 | import com.google.firebase.database.DatabaseReference 4 | import org.junit.After 5 | import org.junit.Before 6 | import org.mockito.Mock 7 | import org.mockito.MockitoAnnotations 8 | 9 | /** 10 | * Created by tom on 2019-05-29. 11 | */ 12 | class FirebaseStoreApiHelperTest { 13 | private lateinit var mockAnnotations: AutoCloseable 14 | 15 | private var firebaseStoreRepository: FirebaseStoreApiHelper? = null 16 | 17 | @Mock 18 | private lateinit var databaseRef: DatabaseReference 19 | 20 | @Before 21 | fun setupPreferencesHelper() { 22 | // Mockito has a very convenient way to inject mocks by using the @Mock annotation. To 23 | // inject the mocks in the test the initMocks method needs to be called. 24 | mockAnnotations = MockitoAnnotations.openMocks(this) 25 | 26 | // Get a reference to the class under test 27 | firebaseStoreRepository = FirebaseStoreApiHelper(databaseRef) 28 | } 29 | 30 | @After 31 | fun tearDown() { 32 | mockAnnotations.close() 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/main/recently/MainRecentlyPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.main.recently 2 | 3 | import com.iceteaviet.fastfoodfinder.data.DataManager 4 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 5 | import com.iceteaviet.fastfoodfinder.ui.base.BasePresenter 6 | import com.iceteaviet.fastfoodfinder.utils.rx.SchedulerProvider 7 | 8 | /** 9 | * Created by tom on 2019-04-18. 10 | */ 11 | class MainRecentlyPresenter : BasePresenter, MainRecentlyContract.Presenter { 12 | 13 | private val mainRecentlyView: MainRecentlyContract.View 14 | 15 | constructor(dataManager: DataManager, schedulerProvider: SchedulerProvider, mainRecentlyView: MainRecentlyContract.View) : super(dataManager, schedulerProvider) { 16 | this.mainRecentlyView = mainRecentlyView 17 | } 18 | 19 | override fun subscribe() { 20 | val stores = ArrayList() 21 | //TODO: Load recently store from Realm 22 | 23 | mainRecentlyView.setStores(stores) 24 | } 25 | 26 | override fun onStoreItemClick(store: Store) { 27 | mainRecentlyView.showStoreDetailView(store) 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/FileUtils.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("FileUtils") 2 | @file:JvmMultifileClass 3 | 4 | package com.iceteaviet.fastfoodfinder.utils 5 | 6 | import android.content.Context 7 | import android.graphics.Bitmap 8 | import android.graphics.BitmapFactory 9 | import android.net.Uri 10 | import android.provider.MediaStore 11 | import java.io.IOException 12 | 13 | /** 14 | * Created by tom on 7/19/18. 15 | */ 16 | 17 | @Throws(IOException::class) 18 | fun getBitmapFromUri(context: Context, uri: Uri): Bitmap? { 19 | val filePathColumn = arrayOf(MediaStore.Images.Media.DATA) 20 | 21 | /*val cursor = context.contentResolver.query(uri, filePathColumn, null, null, null) 22 | cursor?.moveToFirst() 23 | cursor?.close()*/ 24 | 25 | var bmp: Bitmap? = null 26 | try { 27 | val parcelFileDescriptor = context.contentResolver.openFileDescriptor(uri, "r") 28 | val fileDescriptor = parcelFileDescriptor!!.fileDescriptor 29 | bmp = BitmapFactory.decodeFileDescriptor(fileDescriptor) 30 | 31 | parcelFileDescriptor.close() 32 | } catch (e: IOException) { 33 | e.printStackTrace() 34 | } 35 | 36 | 37 | return bmp 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_main_favourited.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 15 | 16 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/utils/NetworkUtils.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("NetworkUtils") 2 | 3 | package com.iceteaviet.fastfoodfinder.utils 4 | 5 | import android.content.Context 6 | import com.iceteaviet.fastfoodfinder.core.common.ext.getConnectivityManager 7 | import com.iceteaviet.fastfoodfinder.utils.shell.AppShell 8 | import java.io.IOException 9 | 10 | /** 11 | * Created by Genius Doan on 22/07/2017. 12 | */ 13 | 14 | /** 15 | * Check internet connection access 16 | */ 17 | fun isInternetConnected(): Boolean { 18 | val command = "ping -c 1 google.com" 19 | try { 20 | return AppShell.exec(command).waitFor() == 0 21 | } catch (se: SecurityException) { 22 | return false 23 | } catch (ioEx: IOException) { 24 | return false 25 | } catch (interruptException: InterruptedException) { 26 | return false 27 | } 28 | } 29 | 30 | /** 31 | * Check connected to any network (but don't need to have Internet access) 32 | */ 33 | fun isNetworkReachable(context: Context): Boolean { 34 | val conMgr = context.getConnectivityManager() 35 | val networkInfo = conMgr?.activeNetworkInfo 36 | 37 | return networkInfo != null && networkInfo.isConnected 38 | } 39 | -------------------------------------------------------------------------------- /core/worker/src/main/java/com/iceteaviet/fastfoodfinder/core/worker/SerialWorker.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.core.worker 2 | 3 | import kotlinx.coroutines.CoroutineExceptionHandler 4 | import kotlinx.coroutines.CoroutineScope 5 | import kotlinx.coroutines.Dispatchers 6 | import kotlinx.coroutines.ExperimentalCoroutinesApi 7 | import kotlinx.coroutines.SupervisorJob 8 | import kotlinx.coroutines.cancel 9 | import kotlin.coroutines.CoroutineContext 10 | 11 | /** 12 | * Created by nhoxbypass on 20/04/2023. 13 | */ 14 | @OptIn(ExperimentalCoroutinesApi::class) 15 | object SerialWorker { 16 | private val SingleThreadIO = Dispatchers.IO.limitedParallelism(1) 17 | 18 | private val exceptionHandler by lazy { 19 | CoroutineExceptionHandler { _, exception -> 20 | // TODO: Print logs 21 | } 22 | } 23 | private val coroutineContext by lazy { 24 | SupervisorJob() + SingleThreadIO + exceptionHandler 25 | } 26 | val scope by lazy { 27 | object : CoroutineScope { 28 | override val coroutineContext: CoroutineContext 29 | get() = this@SerialWorker.coroutineContext 30 | } 31 | } 32 | 33 | fun cancelAll() { 34 | scope.cancel() 35 | } 36 | } -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_setting_metric.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /core/common/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | id("org.jetbrains.kotlin.android") 4 | } 5 | 6 | android { 7 | namespace = "com.iceteaviet.fastfoodfinder.core.common" 8 | compileSdk = 34 9 | 10 | defaultConfig { 11 | minSdk = 24 12 | 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | consumerProguardFiles("consumer-rules.pro") 15 | } 16 | 17 | buildTypes { 18 | release { 19 | isMinifyEnabled = false 20 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility = JavaVersion.VERSION_1_8 25 | targetCompatibility = JavaVersion.VERSION_1_8 26 | } 27 | kotlinOptions { 28 | jvmTarget = "1.8" 29 | } 30 | } 31 | 32 | dependencies { 33 | 34 | implementation("androidx.core:core-ktx:1.10.1") 35 | implementation("androidx.appcompat:appcompat:1.7.0") 36 | implementation("com.google.android.material:material:1.12.0") 37 | testImplementation("junit:junit:4.13.2") 38 | androidTestImplementation("androidx.test.ext:junit:1.1.5") 39 | androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") 40 | } -------------------------------------------------------------------------------- /core/logger/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | id("org.jetbrains.kotlin.android") 4 | } 5 | 6 | android { 7 | namespace = "com.iceteaviet.fastfoodfinder.core.logger" 8 | compileSdk = 34 9 | 10 | defaultConfig { 11 | minSdk = 24 12 | 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | consumerProguardFiles("consumer-rules.pro") 15 | } 16 | 17 | buildTypes { 18 | release { 19 | isMinifyEnabled = false 20 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility = JavaVersion.VERSION_1_8 25 | targetCompatibility = JavaVersion.VERSION_1_8 26 | } 27 | kotlinOptions { 28 | jvmTarget = "1.8" 29 | } 30 | } 31 | 32 | dependencies { 33 | 34 | implementation("androidx.core:core-ktx:1.10.1") 35 | implementation("androidx.appcompat:appcompat:1.7.0") 36 | implementation("com.google.android.material:material:1.12.0") 37 | testImplementation("junit:junit:4.13.2") 38 | androidTestImplementation("androidx.test.ext:junit:1.1.5") 39 | androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") 40 | } -------------------------------------------------------------------------------- /core/worker/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | id("org.jetbrains.kotlin.android") 4 | } 5 | 6 | android { 7 | namespace = "com.iceteaviet.fastfoodfinder.core.worker" 8 | compileSdk = 34 9 | 10 | defaultConfig { 11 | minSdk = 24 12 | 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | consumerProguardFiles("consumer-rules.pro") 15 | } 16 | 17 | buildTypes { 18 | release { 19 | isMinifyEnabled = false 20 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility = JavaVersion.VERSION_1_8 25 | targetCompatibility = JavaVersion.VERSION_1_8 26 | } 27 | kotlinOptions { 28 | jvmTarget = "1.8" 29 | } 30 | } 31 | 32 | dependencies { 33 | 34 | implementation("androidx.core:core-ktx:1.10.1") 35 | implementation("androidx.appcompat:appcompat:1.7.0") 36 | implementation("com.google.android.material:material:1.12.0") 37 | testImplementation("junit:junit:4.13.2") 38 | androidTestImplementation("androidx.test.ext:junit:1.1.5") 39 | androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") 40 | } -------------------------------------------------------------------------------- /data/model/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | id("org.jetbrains.kotlin.android") 4 | } 5 | 6 | android { 7 | namespace = "com.iceteaviet.fastfoodfinder.data.model" 8 | compileSdk = 34 9 | 10 | defaultConfig { 11 | minSdk = 24 12 | 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | consumerProguardFiles("consumer-rules.pro") 15 | } 16 | 17 | buildTypes { 18 | release { 19 | isMinifyEnabled = false 20 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility = JavaVersion.VERSION_1_8 25 | targetCompatibility = JavaVersion.VERSION_1_8 26 | } 27 | kotlinOptions { 28 | jvmTarget = "1.8" 29 | } 30 | } 31 | 32 | dependencies { 33 | 34 | implementation("androidx.core:core-ktx:1.10.1") 35 | implementation("androidx.appcompat:appcompat:1.7.0") 36 | implementation("com.google.android.material:material:1.12.0") 37 | testImplementation("junit:junit:4.13.2") 38 | androidTestImplementation("androidx.test.ext:junit:1.1.5") 39 | androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") 40 | } -------------------------------------------------------------------------------- /data/stores/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | id("org.jetbrains.kotlin.android") 4 | } 5 | 6 | android { 7 | namespace = "com.iceteaviet.fastfoodfinder.data.stores" 8 | compileSdk = 34 9 | 10 | defaultConfig { 11 | minSdk = 24 12 | 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | consumerProguardFiles("consumer-rules.pro") 15 | } 16 | 17 | buildTypes { 18 | release { 19 | isMinifyEnabled = false 20 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility = JavaVersion.VERSION_1_8 25 | targetCompatibility = JavaVersion.VERSION_1_8 26 | } 27 | kotlinOptions { 28 | jvmTarget = "1.8" 29 | } 30 | } 31 | 32 | dependencies { 33 | 34 | implementation("androidx.core:core-ktx:1.10.1") 35 | implementation("androidx.appcompat:appcompat:1.7.0") 36 | implementation("com.google.android.material:material:1.12.0") 37 | testImplementation("junit:junit:4.13.2") 38 | androidTestImplementation("androidx.test.ext:junit:1.1.5") 39 | androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") 40 | } -------------------------------------------------------------------------------- /core/network/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | id("org.jetbrains.kotlin.android") 4 | } 5 | 6 | android { 7 | namespace = "com.iceteaviet.fastfoodfinder.core.network" 8 | compileSdk = 34 9 | 10 | defaultConfig { 11 | minSdk = 24 12 | 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | consumerProguardFiles("consumer-rules.pro") 15 | } 16 | 17 | buildTypes { 18 | release { 19 | isMinifyEnabled = false 20 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility = JavaVersion.VERSION_1_8 25 | targetCompatibility = JavaVersion.VERSION_1_8 26 | } 27 | kotlinOptions { 28 | jvmTarget = "1.8" 29 | } 30 | } 31 | 32 | dependencies { 33 | 34 | implementation("androidx.core:core-ktx:1.10.1") 35 | implementation("androidx.appcompat:appcompat:1.7.0") 36 | implementation("com.google.android.material:material:1.12.0") 37 | testImplementation("junit:junit:4.13.2") 38 | androidTestImplementation("androidx.test.ext:junit:1.1.5") 39 | androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") 40 | } -------------------------------------------------------------------------------- /data/database/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | id("org.jetbrains.kotlin.android") 4 | } 5 | 6 | android { 7 | namespace = "com.iceteaviet.fastfoodfinder.data.database" 8 | compileSdk = 34 9 | 10 | defaultConfig { 11 | minSdk = 24 12 | 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | consumerProguardFiles("consumer-rules.pro") 15 | } 16 | 17 | buildTypes { 18 | release { 19 | isMinifyEnabled = false 20 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility = JavaVersion.VERSION_1_8 25 | targetCompatibility = JavaVersion.VERSION_1_8 26 | } 27 | kotlinOptions { 28 | jvmTarget = "1.8" 29 | } 30 | } 31 | 32 | dependencies { 33 | 34 | implementation("androidx.core:core-ktx:1.10.1") 35 | implementation("androidx.appcompat:appcompat:1.7.0") 36 | implementation("com.google.android.material:material:1.12.0") 37 | testImplementation("junit:junit:4.13.2") 38 | androidTestImplementation("androidx.test.ext:junit:1.1.5") 39 | androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") 40 | } -------------------------------------------------------------------------------- /core/analytics/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | id("org.jetbrains.kotlin.android") 4 | } 5 | 6 | android { 7 | namespace = "com.iceteaviet.fastfoodfinder.core.analytics" 8 | compileSdk = 34 9 | 10 | defaultConfig { 11 | minSdk = 24 12 | 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | consumerProguardFiles("consumer-rules.pro") 15 | } 16 | 17 | buildTypes { 18 | release { 19 | isMinifyEnabled = false 20 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility = JavaVersion.VERSION_1_8 25 | targetCompatibility = JavaVersion.VERSION_1_8 26 | } 27 | kotlinOptions { 28 | jvmTarget = "1.8" 29 | } 30 | } 31 | 32 | dependencies { 33 | 34 | implementation("androidx.core:core-ktx:1.10.1") 35 | implementation("androidx.appcompat:appcompat:1.7.0") 36 | implementation("com.google.android.material:material:1.12.0") 37 | testImplementation("junit:junit:4.13.2") 38 | androidTestImplementation("androidx.test.ext:junit:1.1.5") 39 | androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") 40 | } -------------------------------------------------------------------------------- /data/datastore/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | id("org.jetbrains.kotlin.android") 4 | } 5 | 6 | android { 7 | namespace = "com.iceteaviet.fastfoodfinder.data.datastore" 8 | compileSdk = 34 9 | 10 | defaultConfig { 11 | minSdk = 24 12 | 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | consumerProguardFiles("consumer-rules.pro") 15 | } 16 | 17 | buildTypes { 18 | release { 19 | isMinifyEnabled = false 20 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility = JavaVersion.VERSION_1_8 25 | targetCompatibility = JavaVersion.VERSION_1_8 26 | } 27 | kotlinOptions { 28 | jvmTarget = "1.8" 29 | } 30 | } 31 | 32 | dependencies { 33 | 34 | implementation("androidx.core:core-ktx:1.10.1") 35 | implementation("androidx.appcompat:appcompat:1.7.0") 36 | implementation("com.google.android.material:material:1.12.0") 37 | testImplementation("junit:junit:4.13.2") 38 | androidTestImplementation("androidx.test.ext:junit:1.1.5") 39 | androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") 40 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/main/search/SuggestStoreSearchAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.main.search 2 | 3 | import android.view.LayoutInflater 4 | import android.view.View 5 | import android.view.ViewGroup 6 | import android.widget.TextView 7 | import com.iceteaviet.fastfoodfinder.R 8 | import com.iceteaviet.fastfoodfinder.ui.main.search.model.SearchStoreItem 9 | 10 | /** 11 | * Created by MyPC on 11/16/2016. 12 | */ 13 | class SuggestStoreSearchAdapter internal constructor() : BaseSearchAdapter() { 14 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseSearchViewHolder { 15 | val itemView = LayoutInflater.from(parent.context) 16 | .inflate(R.layout.item_search_suggestion, parent, false) 17 | return RecentlySearchStoreViewHolder(itemView) 18 | } 19 | 20 | inner class RecentlySearchStoreViewHolder(itemView: View) : BaseSearchViewHolder(itemView) { 21 | var txtTitle: TextView = itemView.findViewById(R.id.tv_item_title) 22 | var txtAddress: TextView = itemView.findViewById(R.id.tv_item_address) 23 | 24 | override fun setData(item: SearchStoreItem) { 25 | txtTitle.text = item.store?.title 26 | txtAddress.text = item.store?.address 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /core/notifications/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | id("org.jetbrains.kotlin.android") 4 | } 5 | 6 | android { 7 | namespace = "com.iceteaviet.fastfoodfinder.core.notifications" 8 | compileSdk = 34 9 | 10 | defaultConfig { 11 | minSdk = 24 12 | 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | consumerProguardFiles("consumer-rules.pro") 15 | } 16 | 17 | buildTypes { 18 | release { 19 | isMinifyEnabled = false 20 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility = JavaVersion.VERSION_1_8 25 | targetCompatibility = JavaVersion.VERSION_1_8 26 | } 27 | kotlinOptions { 28 | jvmTarget = "1.8" 29 | } 30 | } 31 | 32 | dependencies { 33 | 34 | implementation("androidx.core:core-ktx:1.10.1") 35 | implementation("androidx.appcompat:appcompat:1.7.0") 36 | implementation("com.google.android.material:material:1.12.0") 37 | testImplementation("junit:junit:4.13.2") 38 | androidTestImplementation("androidx.test.ext:junit:1.1.5") 39 | androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") 40 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/ar/LiveSightContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.ar 2 | 3 | import com.iceteaviet.fastfoodfinder.location.LatLngAlt 4 | import com.iceteaviet.fastfoodfinder.ui.ar.model.AugmentedPOI 5 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 6 | 7 | /** 8 | * Created by tom on 2019-04-16. 9 | */ 10 | 11 | interface LiveSightContract { 12 | interface View : BaseView { 13 | fun requestLocationPermission() 14 | fun isLocationPermissionGranted(): Boolean 15 | fun showCannotGetLocationMessage() 16 | fun showGeneralErrorMessage() 17 | fun requestCameraPermission() 18 | fun isCameraPermissionGranted(): Boolean 19 | fun updateLatestLocation(latestLocation: LatLngAlt) 20 | fun initARCameraView() 21 | fun initAROverlayView() 22 | fun initSensorService() 23 | fun releaseARCamera() 24 | fun addARPoint(arPoi: AugmentedPOI) 25 | fun setARPoints(arPoints: List) 26 | } 27 | 28 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 29 | fun startArCamera() 30 | fun onLocationPermissionGranted() 31 | fun onCameraPermissionGranted() 32 | fun requestCurrentLocation() 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/main/MainContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.main 2 | 3 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 4 | 5 | /** 6 | * Created by tom on 2019-04-18. 7 | */ 8 | interface MainContract { 9 | interface View : BaseView { 10 | fun showProfileView() 11 | fun showLoginView() 12 | fun setSearchQueryText(searchString: String) 13 | fun hideKeyboard() 14 | fun clearFocus() 15 | fun showSearchWarningMessage() 16 | fun showSearchView() 17 | fun hideSearchView() 18 | fun updateProfileHeader(showSignIn: Boolean) 19 | fun loadProfileHeaderAvatar(photoUrl: String) 20 | fun setProfileHeaderNameText(name: String) 21 | fun setProfileHeaderEmailText(email: String) 22 | fun showARLiveSightView() 23 | fun showSettingsView() 24 | } 25 | 26 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 27 | fun onProfileMenuItemClick() 28 | fun onSignInMenuItemClick() 29 | fun onSearchMenuItemExpand() 30 | fun onSearchMenuItemCollapse() 31 | fun onSearchQuerySubmit(query: String) 32 | fun onARLiveSightMenuItemClick() 33 | fun onSettingsMenuItemClick() 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/domain/routing/AppMapsRoutingRepository.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.domain.routing 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.routing.MapsRoutingApiHelper 4 | import com.iceteaviet.fastfoodfinder.data.remote.routing.model.MapsDirection 5 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 6 | import io.reactivex.Single 7 | 8 | /** 9 | * Created by tom on 7/18/18. 10 | */ 11 | class AppMapsRoutingRepository(private val mapsRoutingApiHelper: MapsRoutingApiHelper) : MapsRoutingRepository { 12 | 13 | override fun getMapsDirection(queries: Map, store: Store): Single { 14 | return Single.create { emitter -> 15 | mapsRoutingApiHelper.getMapsDirection(queries, store, object : MapsRoutingApiHelper.RoutingLoadCallback { 16 | override fun onSuccess(data: MapsDirection) { 17 | emitter.onSuccess(data) 18 | } 19 | 20 | override fun onError(throwable: Throwable) { 21 | emitter.onError(throwable) 22 | } 23 | }) 24 | } 25 | } 26 | 27 | companion object { 28 | private val TAG = AppMapsRoutingRepository::class.java.simpleName 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/remote/routing/model/MapsDirection.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote.routing.model 2 | 3 | import android.os.Parcel 4 | import android.os.Parcelable 5 | 6 | import com.google.gson.annotations.SerializedName 7 | 8 | /** 9 | * Created by Genius Doan on 11/11/2016. 10 | */ 11 | class MapsDirection : Parcelable { 12 | @SerializedName("routes") 13 | var routeList: List 14 | 15 | constructor() { 16 | routeList = ArrayList() 17 | } 18 | 19 | constructor(`in`: Parcel) : this() { 20 | routeList = `in`.createTypedArrayList(Route.CREATOR) ?: ArrayList() 21 | } 22 | 23 | constructor(routeList: List) : this() { 24 | this.routeList = routeList 25 | } 26 | 27 | override fun describeContents(): Int { 28 | return 0 29 | } 30 | 31 | override fun writeToParcel(parcel: Parcel, i: Int) { 32 | parcel.writeTypedList(routeList) 33 | } 34 | 35 | companion object CREATOR : Parcelable.Creator { 36 | override fun createFromParcel(parcel: Parcel): MapsDirection { 37 | return MapsDirection(parcel) 38 | } 39 | 40 | override fun newArray(size: Int): Array { 41 | return arrayOfNulls(size) 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /core/location/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.library") 3 | id("org.jetbrains.kotlin.android") 4 | } 5 | 6 | android { 7 | namespace = "com.iceteaviet.fastfoodfinder.core.location" 8 | compileSdk = 34 9 | 10 | defaultConfig { 11 | minSdk = 24 12 | 13 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" 14 | consumerProguardFiles("consumer-rules.pro") 15 | } 16 | 17 | buildTypes { 18 | release { 19 | isMinifyEnabled = false 20 | proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") 21 | } 22 | } 23 | compileOptions { 24 | sourceCompatibility = JavaVersion.VERSION_1_8 25 | targetCompatibility = JavaVersion.VERSION_1_8 26 | } 27 | kotlinOptions { 28 | jvmTarget = "1.8" 29 | } 30 | } 31 | 32 | dependencies { 33 | // Kotlin 34 | implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.22") 35 | implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0") 36 | 37 | // AndroidX 38 | implementation("androidx.appcompat:appcompat:1.6.1") 39 | 40 | // Google Play Services 41 | implementation("com.google.android.gms:play-services-location:21.3.0") 42 | 43 | // Testing 44 | testImplementation("junit:junit:4.13.2") 45 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/domain/store/StoreRepository.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.domain.store 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Comment 4 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 5 | 6 | import io.reactivex.Single 7 | 8 | /** 9 | * Created by tom on 7/15/18. 10 | * 11 | * Main entry point for accessing store data. 12 | */ 13 | interface StoreRepository { 14 | 15 | fun getAllStores(): Single> 16 | 17 | fun setStores(storeList: List) 18 | 19 | fun getStoreInBounds(lat: Double, lng: Double, radius: Double): Single> 20 | 21 | fun findStores(queryString: String): Single> 22 | 23 | fun findStoresByCustomAddress(customQuerySearch: List): Single> 24 | 25 | fun findStoresBy(key: String, value: Int): Single> 26 | 27 | fun findStoresBy(key: String, values: List): Single> 28 | 29 | fun findStoresByType(type: Int): Single> 30 | 31 | fun findStoreById(id: Int): Single 32 | 33 | fun findStoresByIds(ids: List): Single> 34 | 35 | fun deleteAllStores() 36 | 37 | fun getComments(storeId: String): Single> 38 | 39 | fun insertOrUpdateComment(storeId: String, comment: Comment) 40 | } 41 | -------------------------------------------------------------------------------- /app/src/mock/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "12345", 4 | "project_id": "my-project-12345" 5 | }, 6 | "client": [ 7 | { 8 | "client_info": { 9 | "mobilesdk_app_id": "1:123456789012:android:1234567890123456", 10 | "android_client_info": { 11 | "package_name": "com.iceteaviet.fastfoodfinder.mock" 12 | } 13 | }, 14 | "oauth_client": [ 15 | { 16 | "client_id": "oauth_client_client_id_3", 17 | "client_type": 3 18 | }, 19 | { 20 | "client_id": "oauth_client_client_id_1", 21 | "client_type": 1, 22 | "android_info": { 23 | "package_name": "com.iceteaviet.fastfoodfinder.mock", 24 | "certificate_hash": "" 25 | } 26 | } 27 | ], 28 | "api_key": [ 29 | { 30 | "current_key": "" 31 | } 32 | ], 33 | "services": { 34 | "analytics_service": { 35 | "status": 2, 36 | "analytics_property": { 37 | "tracking_id": "" 38 | } 39 | }, 40 | "appinvite_service": { 41 | "status": 1, 42 | "other_platform_oauth_client": [] 43 | }, 44 | "ads_service": { 45 | "status": 1 46 | } 47 | } 48 | } 49 | ], 50 | "configuration_version": "1" 51 | } -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 16 | 17 | 22 | 23 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/data/remote/routing/model/MapCoordination.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote.routing.model 2 | 3 | import android.os.Parcel 4 | import android.os.Parcelable 5 | 6 | import com.google.android.gms.maps.model.LatLng 7 | import com.google.gson.annotations.SerializedName 8 | 9 | /** 10 | * Created by Genius Doan on 11/11/2016. 11 | */ 12 | class MapCoordination() : Parcelable { 13 | @SerializedName("lat") 14 | var latitude: Double = 0.0 15 | 16 | @SerializedName("lng") 17 | var longitude: Double = 0.0 18 | 19 | val location: LatLng 20 | get() = LatLng(latitude, longitude) 21 | 22 | constructor(`in`: Parcel) : this() { 23 | latitude = `in`.readDouble() 24 | longitude = `in`.readDouble() 25 | } 26 | 27 | override fun describeContents(): Int { 28 | return 0 29 | } 30 | 31 | override fun writeToParcel(parcel: Parcel, i: Int) { 32 | parcel.writeDouble(latitude) 33 | parcel.writeDouble(longitude) 34 | } 35 | 36 | companion object CREATOR : Parcelable.Creator { 37 | override fun createFromParcel(parcel: Parcel): MapCoordination { 38 | return MapCoordination(parcel) 39 | } 40 | 41 | override fun newArray(size: Int): Array { 42 | return arrayOfNulls(size) 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/profile/cover/UpdateCoverPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.profile.cover 2 | 3 | import android.graphics.drawable.Drawable 4 | import androidx.annotation.VisibleForTesting 5 | import com.iceteaviet.fastfoodfinder.data.DataManager 6 | import com.iceteaviet.fastfoodfinder.ui.base.BasePresenter 7 | import com.iceteaviet.fastfoodfinder.utils.rx.SchedulerProvider 8 | 9 | /** 10 | * Created by tom on 2019-04-18. 11 | */ 12 | class UpdateCoverPresenter : BasePresenter, UpdateCoverContract.Presenter { 13 | 14 | private val updateCoverView: UpdateCoverContract.View 15 | 16 | @VisibleForTesting 17 | var selectedImage: Drawable? = null 18 | 19 | constructor(dataManager: DataManager, schedulerProvider: SchedulerProvider, updateCoverView: UpdateCoverContract.View) : super(dataManager, schedulerProvider) { 20 | this.updateCoverView = updateCoverView 21 | } 22 | 23 | override fun subscribe() { 24 | } 25 | 26 | override fun onImageBrowserButtonClick() { 27 | updateCoverView.openImageFilePicker() 28 | } 29 | 30 | override fun onCoverImageSelect(selectedImage: Drawable) { 31 | this.selectedImage = selectedImage 32 | 33 | updateCoverView.setSelectedImage(selectedImage) 34 | } 35 | 36 | override fun onDoneButtonClick() { 37 | updateCoverView.dismissWithResult(selectedImage) 38 | } 39 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/settings/discountnotify/DiscountNotifyPresenter.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.settings.discountnotify 2 | 3 | import com.iceteaviet.fastfoodfinder.utils.getStoreNameByKey 4 | 5 | class DiscountNotifyPresenter : DiscountNotifyContract.Presenter { 6 | 7 | private val discountNotifyView: DiscountNotifyContract.View 8 | 9 | 10 | constructor(view: DiscountNotifyContract.View) { 11 | discountNotifyView = view 12 | } 13 | 14 | override fun unsubscribe() { 15 | } 16 | 17 | override fun subscribe() { 18 | } 19 | 20 | override fun onCancelButtonClick() { 21 | discountNotifyView.cancelDialog() 22 | } 23 | 24 | override fun onDoneButtonClick() { 25 | discountNotifyView.doneDialog() 26 | } 27 | 28 | companion object { 29 | const val KEY_CIRCLE_K = "circle_k" 30 | const val KEY_MINI_STOP = "mini_stop" 31 | const val KEY_FAMILY_MART = "family_mark" 32 | const val KEY_BSMART = "bsmart" 33 | const val KEY_SHOP_N_GO = "shop_n_go" 34 | 35 | private val LIST_STORES = arrayOf(KEY_BSMART, KEY_CIRCLE_K, KEY_FAMILY_MART, KEY_MINI_STOP, KEY_SHOP_N_GO) 36 | } 37 | 38 | override fun onSetupTagContainer() { 39 | discountNotifyView.setupTagContainer(LIST_STORES) 40 | } 41 | 42 | 43 | override fun getStoreName(key: String): String { 44 | return getStoreNameByKey(key) 45 | } 46 | } -------------------------------------------------------------------------------- /app/src/main/java/com/iceteaviet/fastfoodfinder/ui/profile/ProfileContract.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.ui.profile 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.user.model.UserStoreList 4 | import com.iceteaviet.fastfoodfinder.ui.base.BaseView 5 | 6 | /** 7 | * Created by tom on 2019-04-18. 8 | */ 9 | interface ProfileContract { 10 | interface View : BaseView { 11 | fun openLoginActivity() 12 | fun loadAvatarPhoto(photoUrl: String) 13 | fun setName(name: String) 14 | fun setEmail(email: String) 15 | fun setStoreListCount(storeCount: String) 16 | fun setUserStoreLists(userStoreLists: List) 17 | fun addUserStoreList(list: UserStoreList) 18 | fun setSavedStoreCount(size: Int) 19 | fun setFavouriteStoreCount(size: Int) 20 | fun showCreateNewListDialog() 21 | fun dismissCreateNewListDialog() 22 | fun warningListNameExisted() 23 | fun showGeneralErrorMessage() 24 | fun openListDetail(userStoreList: UserStoreList, photoUrl: String) 25 | } 26 | 27 | interface Presenter : com.iceteaviet.fastfoodfinder.ui.base.Presenter { 28 | fun onCreateNewListButtonClick() 29 | fun onCreateNewList(listName: String, iconId: Int) 30 | fun onSavedListClick() 31 | fun onFavouriteListClick() 32 | fun onStoreListClick(listPacket: UserStoreList) 33 | fun onStoreListLongClick(position: Int) 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 28 | 29 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/test/java/com/iceteaviet/fastfoodfinder/utils/RetrofitUtilsTest.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.utils 2 | 3 | import com.iceteaviet.fastfoodfinder.App 4 | import org.junit.Assert.assertEquals 5 | import org.junit.Before 6 | import org.junit.Test 7 | 8 | class RetrofitUtilsTest { 9 | @Before 10 | fun setup() { 11 | App.PACKAGE_NAME = "com.iceteaviet.fastfoodfinder" 12 | App.SHA1 = "11:22:50:33:44:a8:55:66:6a:77:88:e9:99:00:2c:5e:5a:5d:78:a0" 13 | } 14 | 15 | @Test 16 | fun get_baseUrl() { 17 | assertEquals("https://maps.googleapis.com/maps/api/directions/", get("some_api_key", "https://maps.googleapis.com/maps/api/directions/").baseUrl().toString()) 18 | } 19 | 20 | @Test 21 | fun get_baseUrl_hostName() { 22 | assertEquals("maps.googleapis.com", get("some_api_key", "https://maps.googleapis.com/maps/api/directions/").baseUrl().host()) 23 | } 24 | 25 | @Test 26 | fun get_baseUrl_path() { 27 | assertEquals("/maps/api/directions/", get("some_api_key", "https://maps.googleapis.com/maps/api/directions/").baseUrl().encodedPath()) 28 | } 29 | 30 | @Test 31 | fun get_baseUrl_nullQuery() { 32 | assertEquals(null, get("some_api_key", "https://maps.googleapis.com/maps/api/directions/").baseUrl().query()) 33 | } 34 | 35 | @Test 36 | fun get_baseUrl_https() { 37 | assertEquals(true, get("some_api_key", "https://maps.googleapis.com/maps/api/directions/").baseUrl().isHttps) 38 | } 39 | } -------------------------------------------------------------------------------- /app/src/main/res/layout-v21/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 28 | 29 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/mock/java/com/iceteaviet/fastfoodfinder/data/remote/store/FakeFirebaseStoreApiHelper.kt: -------------------------------------------------------------------------------- 1 | package com.iceteaviet.fastfoodfinder.data.remote.store 2 | 3 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Comment 4 | import com.iceteaviet.fastfoodfinder.data.remote.store.model.Store 5 | import com.iceteaviet.fastfoodfinder.utils.exception.NotFoundException 6 | import java.util.* 7 | import kotlin.collections.ArrayList 8 | 9 | /** 10 | * Created by tom on 7/17/18. 11 | */ 12 | class FakeFirebaseStoreApiHelper : StoreApiHelper { 13 | 14 | private var STORE_SERVICE_DATA: MutableList = ArrayList() 15 | private var STORE_COMMENT_SERVICE_DATA: MutableMap> = TreeMap() 16 | 17 | override fun getAllStores(callback: StoreApiHelper.StoreLoadCallback>) { 18 | if (!STORE_SERVICE_DATA.isEmpty()) 19 | callback.onSuccess(STORE_SERVICE_DATA) 20 | else 21 | callback.onError(NotFoundException()) 22 | } 23 | 24 | override fun getComments(storeId: String, callback: StoreApiHelper.StoreLoadCallback>) { 25 | callback.onSuccess(STORE_COMMENT_SERVICE_DATA.get(storeId) ?: ArrayList()) 26 | } 27 | 28 | override fun insertOrUpdateComment(storeId: String, comment: Comment) { 29 | var comments = STORE_COMMENT_SERVICE_DATA.get(storeId) 30 | if (comments == null) { 31 | comments = ArrayList() 32 | } 33 | comments.add(comment) 34 | STORE_COMMENT_SERVICE_DATA.put(storeId, comments) 35 | } 36 | } 37 | --------------------------------------------------------------------------------