├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values-land
│ │ │ │ └── dimens.xml
│ │ │ ├── values-w1240dp
│ │ │ │ └── dimens.xml
│ │ │ ├── values-w600dp
│ │ │ │ └── dimens.xml
│ │ │ ├── drawable
│ │ │ │ ├── bowl.jpg
│ │ │ │ ├── cake.jpg
│ │ │ │ ├── fav1.jpg
│ │ │ │ ├── fav3.jpg
│ │ │ │ ├── pie.jpg
│ │ │ │ ├── s1.jpg
│ │ │ │ ├── ver1.jpg
│ │ │ │ ├── coffe.jpg
│ │ │ │ ├── crepe.jpg
│ │ │ │ ├── curry.jpg
│ │ │ │ ├── dinner.jpg
│ │ │ │ ├── fries1.jpg
│ │ │ │ ├── hummus.jpg
│ │ │ │ ├── kebab.jpg
│ │ │ │ ├── lunch.jpg
│ │ │ │ ├── muffin.jpg
│ │ │ │ ├── open1.jpg
│ │ │ │ ├── quinoa.jpg
│ │ │ │ ├── salad.jpg
│ │ │ │ ├── salmon.jpg
│ │ │ │ ├── shake.jpg
│ │ │ │ ├── snacks.jpg
│ │ │ │ ├── steak.jpg
│ │ │ │ ├── sweets.jpg
│ │ │ │ ├── toast.jpg
│ │ │ │ ├── bolognese.jpg
│ │ │ │ ├── breakfast.jpg
│ │ │ │ ├── chicken.jpg
│ │ │ │ ├── dessert.jpg
│ │ │ │ ├── granola.jpg
│ │ │ │ ├── hamburger.jpg
│ │ │ │ ├── icecream.jpg
│ │ │ │ ├── oatmeal.jpg
│ │ │ │ ├── omelette.jpg
│ │ │ │ ├── pancakes.jpg
│ │ │ │ ├── sandwich2.jpg
│ │ │ │ ├── waffles.jpg
│ │ │ │ ├── welcome.jpg
│ │ │ │ ├── background.jpg
│ │ │ │ ├── festivoats.jpg
│ │ │ │ ├── oatpancake.jpg
│ │ │ │ ├── upload_image.png
│ │ │ │ ├── upload_image1.png
│ │ │ │ ├── btn_bg_design.xml
│ │ │ │ ├── category_img_design.xml
│ │ │ │ ├── btn_food_prefrences.xml
│ │ │ │ ├── search_bg.xml
│ │ │ │ ├── custom_edittext.xml
│ │ │ │ ├── side_nav_bar.xml
│ │ │ │ ├── foreground_design.xml
│ │ │ │ ├── ic_baseline_home_24.xml
│ │ │ │ ├── ic_upload.xml
│ │ │ │ ├── ic_baseline_upload.xml
│ │ │ │ ├── ic_home_black_24dp.xml
│ │ │ │ ├── ic_baseline_clear_24.xml
│ │ │ │ ├── ic_dashboard_black_24dp.xml
│ │ │ │ ├── background_white.xml
│ │ │ │ ├── background_peach.xml
│ │ │ │ ├── ic_baseline_email_24.xml
│ │ │ │ ├── ic_baseline_image_24.xml
│ │ │ │ ├── ic_menu_slideshow.xml
│ │ │ │ ├── ic_menu_gallery.xml
│ │ │ │ ├── ic_baseline_favorite_24.xml
│ │ │ │ ├── ic_notifications_black_24dp.xml
│ │ │ │ ├── ic_baseline_map_24.xml
│ │ │ │ ├── ic_baseline_search_24.xml
│ │ │ │ ├── ic_time.xml
│ │ │ │ ├── ic_baseline_account_circle_24.xml
│ │ │ │ ├── ic_baseline_list_alt_24.xml
│ │ │ │ ├── ic_menu_camera.xml
│ │ │ │ ├── ic_baseline_password_24.xml
│ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── drawable-v24
│ │ │ │ ├── user.png
│ │ │ │ ├── user1.png
│ │ │ │ ├── search.png
│ │ │ │ ├── add_photo.png
│ │ │ │ ├── cookbooklogo.png
│ │ │ │ ├── ic_baseline_delete.xml
│ │ │ │ ├── ic_baseline_edit.xml
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── values
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── themes.xml
│ │ │ │ └── strings.xml
│ │ │ ├── menu
│ │ │ │ ├── main.xml
│ │ │ │ ├── bottom_nav_menu.xml
│ │ │ │ └── activity_main_drawer.xml
│ │ │ ├── xml
│ │ │ │ ├── backup_rules.xml
│ │ │ │ └── data_extraction_rules.xml
│ │ │ ├── layout
│ │ │ │ ├── activity_map.xml
│ │ │ │ ├── progress_layout.xml
│ │ │ │ ├── content_main.xml
│ │ │ │ ├── fragment_notifications.xml
│ │ │ │ ├── app_bar_main.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── fragment_detailrecipe.xml
│ │ │ │ ├── nav_header_main.xml
│ │ │ │ ├── home_item.xml
│ │ │ │ ├── activity_my_recipes.xml
│ │ │ │ ├── fragment_my_category.xml
│ │ │ │ ├── fragment_category.xml
│ │ │ │ ├── fragment_home.xml
│ │ │ │ ├── my_recipes_item.xml
│ │ │ │ ├── activity_edit_profile.xml
│ │ │ │ ├── activity_my_detaile_recipe.xml
│ │ │ │ ├── activity_my_recipe_update.xml
│ │ │ │ ├── activity_welcome.xml
│ │ │ │ ├── activity_login.xml
│ │ │ │ ├── activity_map_detail.xml
│ │ │ │ └── category_item.xml
│ │ │ ├── values-night
│ │ │ │ └── themes.xml
│ │ │ └── navigation
│ │ │ │ └── mobile_navigation.xml
│ │ ├── ic_launcher-playstore.png
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── myrecipebook
│ │ │ │ ├── ui
│ │ │ │ ├── notifications
│ │ │ │ │ ├── NotificationsViewModel.java
│ │ │ │ │ └── NotificationsFragment.java
│ │ │ │ ├── home
│ │ │ │ │ └── HomeFragment.java
│ │ │ │ ├── slideshow
│ │ │ │ │ ├── ProfileFragment.java
│ │ │ │ │ └── MyRecipeFragment.java
│ │ │ │ ├── categories
│ │ │ │ │ └── CategoryFragment.java
│ │ │ │ └── map
│ │ │ │ │ └── MapFragment.java
│ │ │ │ ├── models
│ │ │ │ ├── HomeItemModel.java
│ │ │ │ ├── CategoryModel.java
│ │ │ │ ├── UserData.java
│ │ │ │ ├── LocationMarker.java
│ │ │ │ └── DetailRecipeModel.java
│ │ │ │ ├── DataClass.java
│ │ │ │ ├── activities
│ │ │ │ ├── WelcomeActivity.java
│ │ │ │ ├── DetailRecipeActivity.java
│ │ │ │ ├── MyDetailRecipe.java
│ │ │ │ ├── MapDetailActivity.java
│ │ │ │ ├── LoginActivity.java
│ │ │ │ ├── EditProfileActivity.java
│ │ │ │ └── MyRecipeUpdateActivity.java
│ │ │ │ └── adapters
│ │ │ │ ├── HomeItemAdapter.java
│ │ │ │ ├── MyRecipesAdapter.java
│ │ │ │ └── CategoryAdapter.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── myrecipebook
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── myrecipebook
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
├── google-services.json
└── build.gradle
├── .idea
├── .name
├── .gitignore
├── compiler.xml
├── vcs.xml
├── misc.xml
└── gradle.xml
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── settings.gradle
├── gradle.properties
├── gradlew.bat
├── README.md
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | My Recipe Book
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 48dp
3 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w1240dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 200dp
3 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 48dp
3 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bowl.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/bowl.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/cake.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/cake.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/fav1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/fav1.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/fav3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/fav3.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/pie.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/pie.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/s1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/s1.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ver1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/ver1.jpg
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/drawable/coffe.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/coffe.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/crepe.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/crepe.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/curry.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/curry.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/dinner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/dinner.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/fries1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/fries1.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/hummus.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/hummus.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/kebab.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/kebab.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/lunch.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/lunch.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/muffin.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/muffin.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/open1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/open1.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/quinoa.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/quinoa.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/salad.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/salad.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/salmon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/salmon.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shake.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/shake.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/snacks.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/snacks.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/steak.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/steak.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/sweets.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/sweets.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/toast.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/toast.jpg
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/ic_launcher-playstore.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable-v24/user.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/user1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable-v24/user1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bolognese.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/bolognese.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/breakfast.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/breakfast.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/chicken.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/chicken.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/dessert.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/dessert.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/granola.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/granola.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/hamburger.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/hamburger.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/icecream.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/icecream.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/oatmeal.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/oatmeal.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/omelette.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/omelette.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/pancakes.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/pancakes.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/sandwich2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/sandwich2.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/waffles.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/waffles.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/welcome.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/welcome.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable-v24/search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/background.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/background.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/festivoats.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/festivoats.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/oatpancake.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/oatpancake.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/add_photo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable-v24/add_photo.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/upload_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/upload_image.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/upload_image1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable/upload_image1.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/cookbooklogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/drawable-v24/cookbooklogo.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #E84A11
4 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanibider/Recipe-Book-Android-App/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_bg_design.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/category_img_design.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_food_prefrences.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/search_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Mar 01 10:32:01 IST 2023
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/custom_edittext.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/side_nav_bar.xml:
--------------------------------------------------------------------------------
1 |
3 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/foreground_design.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_home_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_upload.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_upload.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_home_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 8dp
6 | 176dp
7 | 16dp
8 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | gradlePluginPortal()
4 | google()
5 | mavenCentral()
6 | }
7 | }
8 | dependencyResolutionManagement {
9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10 | repositories {
11 | google()
12 | mavenCentral()
13 | }
14 | }
15 | rootProject.name = "My Recipe Book"
16 | include ':app'
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_baseline_delete.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_clear_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_dashboard_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/background_white.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/background_peach.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_email_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_image_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_baseline_edit.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_slideshow.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_gallery.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_favorite_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/test/java/com/example/myrecipebook/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_notifications_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_map_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_search_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_map.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_time.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_account_circle_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_list_alt_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/ui/notifications/NotificationsViewModel.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.ui.notifications;
2 |
3 | import androidx.lifecycle.LiveData;
4 | import androidx.lifecycle.MutableLiveData;
5 | import androidx.lifecycle.ViewModel;
6 |
7 | public class NotificationsViewModel extends ViewModel {
8 |
9 | private final MutableLiveData mText;
10 |
11 | public NotificationsViewModel() {
12 | mText = new MutableLiveData<>();
13 | mText.setValue("This is notifications fragment");
14 | }
15 |
16 | public LiveData getText() {
17 | return mText;
18 | }
19 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #FDF3F2
5 | #F8DCD8
6 | #F5CAC3
7 | #F0B1A7
8 | #F28482
9 | #EC998C
10 | #FF000000
11 | #FFFFFFFF
12 | #dee2e6
13 | #212529
14 | #00000000
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_menu_camera.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/data_extraction_rules.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/models/HomeItemModel.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.models;
2 |
3 | //Data (in Home Screen)
4 | public class HomeItemModel {
5 | int image;
6 | String name;
7 |
8 | public HomeItemModel(int image, String name) {
9 | this.image = image;
10 | this.name = name;
11 | }
12 |
13 | public int getImage() {
14 | return image;
15 | }
16 |
17 | public void setImage(int image) {
18 | this.image = image;
19 | }
20 |
21 | public String getName() {
22 | return name;
23 | }
24 |
25 | public void setName(String name) {
26 | this.name = name;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/bottom_nav_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/progress_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
12 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_password_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/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/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/example/myrecipebook/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 | assertEquals("com.example.myrecipebook", appContext.getPackageName());
25 | }
26 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/models/CategoryModel.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.models;
2 |
3 | //Data (in Category Screen)
4 | public class CategoryModel {
5 | int image;
6 | String name;
7 | String detail;
8 |
9 | public CategoryModel(int image, String name, String detail) {
10 | this.image = image;
11 | this.name = name;
12 | this.detail= detail;
13 |
14 | }
15 |
16 |
17 | public int getImage() {
18 | return image;
19 | }
20 |
21 | public void setImage(int image) {
22 | this.image = image;
23 | }
24 |
25 | public String getName() {
26 | return name;
27 | }
28 |
29 | public void setName(String name) {
30 | this.name = name;
31 | }
32 |
33 |
34 | public String getDetail() {
35 | return detail;
36 | }
37 |
38 | public void setDetail(String detail) {
39 | this.detail = detail;
40 | }
41 |
42 |
43 |
44 |
45 |
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_notifications.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/DataClass.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook;
2 |
3 | public class DataClass {
4 |
5 |
6 |
7 | //for upload data
8 | private String dataTitle;
9 | private String dataDesc;
10 | private String dataLang;
11 | private String dataImage;
12 | private String key;
13 |
14 | public String getKey() {
15 | return key;
16 | }
17 |
18 | public void setKey(String key) {
19 | this.key = key;
20 | }
21 |
22 | public String getDataTitle() {
23 | return dataTitle;
24 | }
25 |
26 | public String getDataDesc() {
27 | return dataDesc;
28 | }
29 |
30 | public String getDataLang() {
31 | return dataLang;
32 | }
33 |
34 | public String getDataImage() {
35 | return dataImage;
36 | }
37 |
38 | public DataClass(String dataTitle, String dataDesc, String dataLang, String dataImage) {
39 | this.dataTitle = dataTitle;
40 | this.dataDesc = dataDesc;
41 | this.dataLang = dataLang;
42 | this.dataImage = dataImage;
43 | }
44 |
45 | public DataClass() {
46 | }
47 |
48 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_bar_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "186137096272",
4 | "project_id": "my-recipe-book-c4d0d",
5 | "storage_bucket": "my-recipe-book-c4d0d.appspot.com"
6 | },
7 | "client": [
8 | {
9 | "client_info": {
10 | "mobilesdk_app_id": "1:186137096272:android:f89eff4bb33bf1c1102155",
11 | "android_client_info": {
12 | "package_name": "com.example.myrecipebook"
13 | }
14 | },
15 | "oauth_client": [
16 | {
17 | "client_id": "186137096272-kfnkkh865g32vi12l4rj8j0kvp81j4ro.apps.googleusercontent.com",
18 | "client_type": 3
19 | }
20 | ],
21 | "api_key": [
22 | {
23 | "current_key": "AIzaSyAOMl5RMctFyB8u_XbcMlNLyhvKiLRaEmo"
24 | }
25 | ],
26 | "services": {
27 | "appinvite_service": {
28 | "other_platform_oauth_client": [
29 | {
30 | "client_id": "186137096272-kfnkkh865g32vi12l4rj8j0kvp81j4ro.apps.googleusercontent.com",
31 | "client_type": 3
32 | }
33 | ]
34 | }
35 | }
36 | }
37 | ],
38 | "configuration_version": "1"
39 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/models/UserData.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.models;
2 |
3 |
4 | public class UserData {
5 |
6 | String name, email, username, profileImage;
7 |
8 | public String getName() {
9 | return name;
10 | }
11 |
12 | public void setName(String name) {
13 | this.name = name;
14 | }
15 |
16 | public String getEmail() {
17 | return email;
18 | }
19 |
20 | public void setEmail(String email) {
21 | this.email = email;
22 | }
23 |
24 | public String getUsername() {
25 | return username;
26 | }
27 |
28 | public void setUsername(String username) {
29 | this.username = username;
30 | }
31 |
32 | public String getProfileImage() {
33 | return profileImage;
34 | }
35 |
36 | public void setProfileImage(String profileImage) {
37 | this.profileImage = profileImage;
38 | }
39 |
40 | public UserData(String name, String email, String username, String profileImage) {
41 | this.name = name;
42 | this.email = email;
43 | this.username = username;
44 | this.profileImage = profileImage;
45 | }
46 |
47 | public UserData() {
48 | }
49 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/models/LocationMarker.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.models;
2 |
3 |
4 | import com.google.android.gms.maps.model.LatLng;
5 |
6 | public class LocationMarker {
7 |
8 | String title, address, hours;
9 | double lat, lng;
10 |
11 | public String getTitle() {
12 | return title;
13 | }
14 | public String getHours() {
15 | return hours;
16 | }
17 | public String getAddress() {
18 | return address;
19 | }
20 |
21 | public void setTitle(String title) {
22 | this.title = title;
23 | }
24 | public void setHours(String hours) {
25 | this.hours = hours;
26 | }
27 | public void setAddress(String address) {
28 | this.address = address;
29 | }
30 |
31 | public double getLat() { return lat;}
32 | public double getLng() { return lng;}
33 |
34 | public void setLat(double lat) {this.lat = lat;}
35 | public void setLng(double lng) {this.lng = lng;}
36 |
37 | public LocationMarker(String title, double lat, double lng, String address, String hours) {
38 | this.title = title;
39 | this.lat = lat;
40 | this.lng = lng;
41 | this.address = address;
42 | this.hours = hours;
43 | }
44 |
45 | public LocationMarker() {
46 | }
47 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Enables namespacing of each library's R class so that its R class includes only the
19 | # resources declared in the library itself and none from the library's dependencies,
20 | # thereby reducing the size of the R class for that library
21 | android.nonTransitiveRClass=true
--------------------------------------------------------------------------------
/app/src/main/res/menu/activity_main_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/ui/notifications/NotificationsFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.ui.notifications;
2 |
3 | import android.os.Bundle;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.TextView;
8 |
9 | import androidx.annotation.NonNull;
10 | import androidx.fragment.app.Fragment;
11 | import androidx.lifecycle.ViewModelProvider;
12 |
13 | import com.example.myrecipebook.databinding.FragmentNotificationsBinding;
14 |
15 | public class NotificationsFragment extends Fragment {
16 |
17 | private FragmentNotificationsBinding binding;
18 |
19 | public View onCreateView(@NonNull LayoutInflater inflater,
20 | ViewGroup container, Bundle savedInstanceState) {
21 | NotificationsViewModel notificationsViewModel =
22 | new ViewModelProvider(this).get(NotificationsViewModel.class);
23 |
24 | binding = FragmentNotificationsBinding.inflate(inflater, container, false);
25 | View root = binding.getRoot();
26 |
27 | final TextView textView = binding.textNotifications;
28 | notificationsViewModel.getText().observe(getViewLifecycleOwner(), textView::setText);
29 | return root;
30 | }
31 |
32 | @Override
33 | public void onDestroyView() {
34 | super.onDestroyView();
35 | binding = null;
36 | }
37 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
17 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/models/DetailRecipeModel.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.models;
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 |
6 | public class DetailRecipeModel implements Serializable {
7 | String user;
8 | public String name;
9 | public List category;
10 | public List healthLabels;
11 | public String ingredients;
12 | public String instruction;
13 | public String totalTime;
14 | public String imageUrl;
15 |
16 |
17 | public DetailRecipeModel(String user, String name, List category, List healthLabels, String ingredients, String instruction, String totalTime, String imageUrl) {
18 | this.user = user;
19 | this.name = name;
20 | this.category = category;
21 | this.healthLabels = healthLabels;
22 | this.ingredients = ingredients;
23 | this.instruction = instruction;
24 | this.totalTime = totalTime;
25 | this.imageUrl = imageUrl;
26 | }
27 |
28 | public String getName() {
29 | return name;
30 | }
31 |
32 | public String getUser() {
33 | return user;
34 | }
35 |
36 | public List getCategory() {
37 | return category;
38 | }
39 |
40 | public List getHealthLabels() {
41 | return healthLabels;
42 | }
43 |
44 | public String getIngredients() {
45 | return ingredients;
46 | }
47 |
48 | public String getInstruction() {
49 | return instruction;
50 | }
51 |
52 | public String getTotalTime() {
53 | return totalTime;
54 | }
55 |
56 | public String getImageUrl() {
57 | return imageUrl;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/activities/WelcomeActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.activities;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.view.Window;
9 | import android.view.WindowManager;
10 |
11 | import com.example.myrecipebook.MainActivity;
12 | import com.example.myrecipebook.R;
13 | import com.example.myrecipebook.models.RestApiThread;
14 | import com.google.firebase.auth.FirebaseAuth;
15 | import com.google.firebase.auth.FirebaseUser;
16 |
17 | public class WelcomeActivity extends AppCompatActivity {
18 |
19 | private FirebaseAuth auth;
20 | FirebaseUser user;
21 |
22 | @Override
23 | protected void onCreate(Bundle savedInstanceState) {
24 | super.onCreate(savedInstanceState);
25 |
26 | auth = FirebaseAuth.getInstance();
27 | user = auth.getCurrentUser();
28 |
29 |
30 | if(user != null){
31 | startActivity(new Intent(WelcomeActivity.this, MainActivity.class));
32 | finish();
33 | }
34 |
35 | requestWindowFeature(Window.FEATURE_NO_TITLE);
36 | this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
37 |
38 | setContentView(R.layout.activity_welcome);
39 | RestApiThread restApiThread = new RestApiThread();
40 | restApiThread.start();
41 | }
42 |
43 | public void register(View view) {
44 | startActivity(new Intent(WelcomeActivity.this, RegisterActivity.class));
45 | }
46 |
47 | public void login(View view) {
48 | startActivity(new Intent(WelcomeActivity.this, LoginActivity.class));
49 |
50 | }
51 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
29 |
30 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_detailrecipe.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
22 |
23 |
24 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/nav_header_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
25 |
26 |
36 |
37 |
48 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/home_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
18 |
19 |
28 |
29 |
30 |
31 |
32 |
38 |
39 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_my_recipes.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
25 |
26 |
27 |
34 |
35 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/activities/DetailRecipeActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.activities;
2 | import android.annotation.SuppressLint;
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.widget.ImageView;
6 | import android.widget.TextView;
7 |
8 | import androidx.annotation.NonNull;
9 | import androidx.appcompat.app.AppCompatActivity;
10 | import androidx.recyclerview.widget.LinearLayoutManager;
11 | import androidx.recyclerview.widget.RecyclerView;
12 |
13 | import com.example.myrecipebook.R;
14 | import com.example.myrecipebook.adapters.DetailRecipeAdapter;
15 | import com.example.myrecipebook.models.DetailRecipeModel;
16 | import com.google.firebase.database.DataSnapshot;
17 | import com.google.firebase.database.DatabaseError;
18 | import com.google.firebase.database.DatabaseReference;
19 | import com.google.firebase.database.FirebaseDatabase;
20 | import com.google.firebase.database.GenericTypeIndicator;
21 | import com.google.firebase.database.ValueEventListener;
22 |
23 | import java.util.ArrayList;
24 | import java.util.List;
25 |
26 | public class DetailRecipeActivity extends AppCompatActivity {
27 |
28 | RecyclerView recyclerView;
29 | List detailModelList;
30 | DetailRecipeAdapter detailRecipeAdapter;
31 |
32 |
33 | protected void onCreate (Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 |
36 | setContentView(R.layout.fragment_detailrecipe);
37 |
38 | Intent intent = getIntent();
39 | int position = intent.getExtras().getInt("number");
40 | detailModelList = (List) intent.getSerializableExtra("recipeList");
41 | recyclerView = (RecyclerView) findViewById(R.id.recipes_recList);
42 |
43 | recyclerView.setLayoutManager(new LinearLayoutManager(DetailRecipeActivity.this));
44 |
45 | detailRecipeAdapter = new DetailRecipeAdapter(DetailRecipeActivity.this, detailModelList.get(position), position);
46 | recyclerView.setAdapter(detailRecipeAdapter);
47 | detailRecipeAdapter.notifyDataSetChanged();
48 | }
49 | }
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | My Recipe Book
3 | Open navigation drawer
4 | Close navigation drawer
5 | Android Studio
6 | android.studio@android.com
7 | Navigation header
8 | Settings
9 | Map
10 | Store Detail
11 | Home
12 | Gallery
13 | Slideshow
14 | MainActivity2
15 | Home
16 | Dashboard
17 | Notifications
18 | My Recipe Book
19 | my cook book
20 | sign_in
21 | full name
22 | Email address
23 | password
24 | Favourites
25 | Preferences
26 | my_recipes
27 |
28 |
29 |
30 | Hello blank fragment
31 | profile
32 | Profile
33 | Name
34 | User Name
35 | email
36 |
37 |
38 | - All
39 | - Breakfast
40 | - Lunch
41 | - Dinner
42 | - Dessert
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_my_category.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
32 |
33 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_category.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
32 |
33 |
34 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/navigation/mobile_navigation.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
15 |
16 |
21 |
22 |
27 |
32 |
33 |
38 |
39 |
40 |
45 |
50 |
55 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.android.application'
3 | id 'com.google.gms.google-services'
4 | }
5 |
6 | android {
7 | namespace 'com.example.myrecipebook'
8 | compileSdk 33
9 |
10 | defaultConfig {
11 | applicationId "com.example.myrecipebook"
12 | minSdk 21
13 | targetSdk 32
14 | versionCode 1
15 | versionName "1.0"
16 |
17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 | compileOptions {
27 | sourceCompatibility JavaVersion.VERSION_1_8
28 | targetCompatibility JavaVersion.VERSION_1_8
29 | }
30 | buildFeatures {
31 | viewBinding true
32 | }
33 | }
34 |
35 | dependencies {
36 |
37 | implementation 'androidx.appcompat:appcompat:1.5.1'
38 | implementation 'com.google.android.material:material:1.7.0'
39 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
40 | implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
41 | implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
42 | implementation 'androidx.navigation:navigation-fragment:2.4.1'
43 | implementation 'androidx.navigation:navigation-ui:2.4.1'
44 | implementation 'com.google.firebase:firebase-database:20.1.0'
45 | implementation 'com.google.firebase:firebase-storage:20.1.0'
46 | implementation 'com.google.firebase:firebase-auth:21.1.0'
47 | implementation 'com.google.firebase:firebase-firestore:24.4.4'
48 | testImplementation 'junit:junit:4.13.2'
49 | androidTestImplementation 'androidx.test.ext:junit:1.1.4'
50 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
51 | implementation 'com.google.android.gms:play-services-maps:18.1.0'
52 | implementation 'com.google.android.gms:play-services-location:21.0.1'
53 | implementation 'com.android.support:multidex:1.0.3'
54 | implementation 'com.squareup.picasso:picasso:2.71828'
55 |
56 | implementation 'com.github.bumptech.glide:glide:4.12.0'
57 | annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
58 |
59 | implementation "androidx.room:room-runtime:2.5.0"
60 | annotationProcessor "androidx.room:room-compiler:2.5.0"
61 |
62 |
63 |
64 |
65 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
23 |
24 |
25 |
36 |
37 |
38 |
39 |
49 |
50 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/ui/home/HomeFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.ui.home;
2 | import android.content.Intent;
3 | import android.os.Bundle;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.Button;
8 |
9 | import androidx.annotation.NonNull;
10 | import androidx.fragment.app.Fragment;
11 | import androidx.recyclerview.widget.GridLayoutManager;
12 | import androidx.recyclerview.widget.RecyclerView;
13 |
14 | import com.example.myrecipebook.R;
15 | import com.example.myrecipebook.activities.UploadActivity;
16 | import com.example.myrecipebook.adapters.HomeItemAdapter;
17 | import com.example.myrecipebook.databinding.FragmentHomeBinding;
18 | import com.example.myrecipebook.models.HomeItemModel;
19 | import com.google.android.material.floatingactionbutton.FloatingActionButton;
20 |
21 | import java.util.LinkedList;
22 | import java.util.List;
23 |
24 | //ATTACHING ADAPTER TO RECYCLERVIEW
25 |
26 | public class HomeFragment extends Fragment {
27 |
28 | private FragmentHomeBinding binding;
29 | RecyclerView homeItemRecList;
30 | List HomeModelList;
31 | HomeItemAdapter homeItemAdapter;
32 |
33 | FloatingActionButton fab;
34 |
35 | public View onCreateView(@NonNull LayoutInflater inflater,
36 | ViewGroup container, Bundle savedInstanceState) {
37 |
38 | binding = FragmentHomeBinding.inflate(inflater, container, false);
39 | View root = binding.getRoot();
40 |
41 | homeItemRecList = root.findViewById(R.id.home_items_recList);
42 |
43 | fab = root.findViewById(R.id.fab1);
44 |
45 | //Upload new recipe button
46 | fab.setOnClickListener(new View.OnClickListener() {
47 | @Override
48 | public void onClick(View view) {
49 | Intent intent = new Intent(getActivity(), UploadActivity.class);
50 | startActivity(intent);
51 | }
52 | });
53 |
54 |
55 | HomeModelList = new LinkedList<>();
56 |
57 | HomeModelList.add(new HomeItemModel(R.drawable.breakfast, "Breakfast"));
58 | HomeModelList.add(new HomeItemModel(R.drawable.lunch, "Lunch"));
59 | HomeModelList.add(new HomeItemModel(R.drawable.dinner, "Dinner"));
60 | HomeModelList.add(new HomeItemModel(R.drawable.dessert, "Dessert"));
61 |
62 | homeItemAdapter = new HomeItemAdapter(getActivity(),HomeModelList);
63 | homeItemRecList.setAdapter(homeItemAdapter);
64 | homeItemRecList.setLayoutManager(new GridLayoutManager(getContext(), 2, GridLayoutManager.VERTICAL, false));
65 | homeItemRecList.setHasFixedSize(true);
66 | homeItemRecList.setNestedScrollingEnabled(false);
67 | return root;
68 | }
69 |
70 | @Override
71 | public void onDestroyView() {
72 | super.onDestroyView();
73 | binding = null;
74 | }
75 | }
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/my_recipes_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
16 |
19 |
20 |
21 |
22 |
32 |
33 |
34 |
43 |
44 |
54 |
65 |
66 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/adapters/HomeItemAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.adapters;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.ImageView;
10 | import android.widget.TextView;
11 |
12 | import androidx.annotation.NonNull;
13 | import androidx.cardview.widget.CardView;
14 | import androidx.navigation.Navigation;
15 | import androidx.recyclerview.widget.RecyclerView;
16 |
17 | import com.example.myrecipebook.R;
18 | import com.example.myrecipebook.models.HomeItemModel;
19 | import com.example.myrecipebook.ui.categories.CategoryFragment;
20 | import com.example.myrecipebook.ui.home.HomeFragment;
21 |
22 | import java.util.List;
23 |
24 | //ADAPTER + VIEWHOLDER
25 |
26 | //5.ADAPTER (manage all the viewholders)
27 | public class HomeItemAdapter extends RecyclerView.Adapter {
28 |
29 | Context context;
30 | List list;
31 |
32 |
33 | public HomeItemAdapter(Context context, List list) {
34 | this.context = context;
35 | this.list = list;
36 | }
37 |
38 | @NonNull
39 | @Override
40 | //create a new list row object= new view holder object (one line of view)
41 | //inside we inflate the view of itemView and return new ViewHolder object containing this layout
42 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
43 | //inflater create view object from xml file (home_item.xml)
44 | //then wrap it in view older object
45 | return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.home_item, parent, false));
46 | }
47 |
48 | //set the view holder properties according to the object is displayed (Bind data to line)
49 | @Override
50 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
51 | int itemPosition = position;
52 | holder.imageView.setImageResource(list.get(position).getImage());
53 | holder.name.setText(list.get(position).getName());
54 |
55 | holder.cardView.setOnClickListener(new View.OnClickListener() {
56 | @Override
57 | public void onClick(View v) {
58 | Bundle bundle = new Bundle();
59 | bundle.putString("categoryName", list.get(itemPosition).getName());
60 | Navigation.findNavController(v).navigate(R.id.nav_categories, bundle);
61 | }
62 | });
63 | }
64 |
65 | //number of objects to display in the list
66 | @Override
67 | public int getItemCount() {
68 | return list.size();
69 | }
70 |
71 | //VIEWHOLDER
72 | //hold object of view of one line and save references to his elements (image & text)
73 | public class ViewHolder extends RecyclerView.ViewHolder {
74 |
75 | //references to the views for each data item
76 | ImageView imageView;
77 | TextView name;
78 | CardView cardView;
79 |
80 | public ViewHolder(@NonNull View itemView) {
81 | super(itemView);
82 |
83 | imageView= itemView.findViewById(R.id.category_img);
84 | name= itemView.findViewById(R.id.category_title);
85 | cardView = itemView.findViewById(R.id.homeCard);
86 | }
87 | }
88 | }
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_edit_profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
18 |
25 |
33 |
34 |
43 |
44 |
55 |
56 |
67 |
68 |
69 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/adapters/MyRecipesAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.adapters;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | import androidx.annotation.NonNull;
12 | import androidx.cardview.widget.CardView;
13 | import androidx.recyclerview.widget.RecyclerView;
14 |
15 | import com.example.myrecipebook.DataClass;
16 | import com.example.myrecipebook.R;
17 | import com.example.myrecipebook.activities.DetailRecipeActivity;
18 | import com.example.myrecipebook.models.DetailRecipeModel;
19 | import com.squareup.picasso.Picasso;
20 |
21 | import java.io.Serializable;
22 | import java.util.ArrayList;
23 | import java.util.List;
24 |
25 |
26 | public class MyRecipesAdapter extends RecyclerView.Adapter {
27 |
28 | Context context;
29 | List categoryList;
30 |
31 | //CTOR
32 | public MyRecipesAdapter(Context context, List categoryList) {
33 | this.context = context;
34 | this.categoryList = categoryList;
35 | }
36 |
37 | @Override
38 | //return viewHolder that contain view *object*, that create from match xml file, using inflater
39 | public MyRecipesAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
40 | return new MyRecipesAdapter.ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.category_item, parent, false ));
41 | }
42 |
43 | //Bind data to line
44 | //(bind the items with each item of the oneCategoryList list which than will be shown in recycler view)
45 | @Override
46 | public void onBindViewHolder(@NonNull MyRecipesAdapter.ViewHolder holder, int position) {
47 | Picasso.get().load(categoryList.get(position).getImageUrl()).into(holder.imageView);
48 | holder.name.setText(categoryList.get(position).getName());
49 | holder.detail.setText(categoryList.get(position).getTotalTime());
50 |
51 |
52 | //this connect between recipe card (in category) and his own recipe detail
53 | holder.cardView.setOnClickListener(new View.OnClickListener() {
54 | @Override
55 | public void onClick(View view) {
56 |
57 | Intent intent = new Intent(context, DetailRecipeActivity.class);
58 | intent.putExtra("number", holder.getAdapterPosition());
59 | intent.putExtra("recipeList", (Serializable) categoryList);
60 | context.startActivity(intent);
61 |
62 | }
63 | });
64 | }
65 |
66 | @Override
67 | public int getItemCount() {
68 | return categoryList.size();
69 | }
70 |
71 | public void updateList(List newList) {
72 | categoryList = newList;
73 | notifyDataSetChanged();
74 | }
75 |
76 | //ViewHolder inner class
77 | //hold object of view of one line and save references to his elements
78 | public class ViewHolder extends RecyclerView.ViewHolder {
79 |
80 | //references to the views for each data item (from xml file)
81 | // ImageView imageView;
82 | TextView name, detail;
83 | ImageView imageView;
84 | CardView cardView;
85 |
86 |
87 | public ViewHolder(@NonNull View itemView) {
88 | super(itemView);
89 |
90 | imageView = itemView.findViewById(R.id.category_recipe_img);
91 | name = itemView.findViewById(R.id.category_recipe_name);
92 | detail = itemView.findViewById(R.id.category_recipe_detail);
93 | cardView = itemView.findViewById(R.id.myCardView);
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/adapters/CategoryAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.adapters;
2 | import android.content.Context;
3 | import android.content.Intent;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.ImageView;
8 | import android.widget.TextView;
9 |
10 | import androidx.annotation.NonNull;
11 | import androidx.cardview.widget.CardView;
12 | import androidx.recyclerview.widget.RecyclerView;
13 |
14 | import com.example.myrecipebook.R;
15 | import com.example.myrecipebook.activities.DetailRecipeActivity;
16 | import com.example.myrecipebook.models.CategoryModel;
17 | import com.example.myrecipebook.models.DetailRecipeModel;
18 | import com.squareup.picasso.Picasso;
19 |
20 | import java.io.Serializable;
21 | import java.util.List;
22 |
23 | //ADAPTER + VIEWHOLDER
24 |
25 | //5.ADAPTER class (manage all the viewHolders)
26 | public class CategoryAdapter extends RecyclerView.Adapter {
27 |
28 | Context context;
29 | List categoryList;
30 |
31 | //CTOR
32 | public CategoryAdapter(Context context, List categoryList) {
33 | this.context = context;
34 | this.categoryList = categoryList;
35 | }
36 |
37 | @Override
38 | //return viewHolder that contain view *object*, that create from match xml file, using inflater
39 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
40 | return new ViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.category_item, parent, false ));
41 | }
42 |
43 | //Bind data to line
44 | //(bind the items with each item of the oneCategoryList list which than will be shown in recycler view)
45 | @Override
46 | public void onBindViewHolder(@NonNull CategoryAdapter.ViewHolder holder, int position) {
47 | Picasso.get().load(categoryList.get(position).getImageUrl()).into(holder.imageView);
48 | holder.name.setText(categoryList.get(position).getName());
49 | holder.detail.setText(categoryList.get(position).getTotalTime());
50 |
51 |
52 | //this connect between recipe card (in category) and his own recipe detail
53 | holder.cardView.setOnClickListener(new View.OnClickListener() {
54 | @Override
55 | public void onClick(View view) {
56 |
57 | Intent intent = new Intent(context, DetailRecipeActivity.class);
58 | intent.putExtra("number", holder.getAdapterPosition());
59 | intent.putExtra("recipeList", (Serializable) categoryList);
60 | context.startActivity(intent);
61 |
62 | }
63 | });
64 | }
65 |
66 | @Override
67 | public int getItemCount() {
68 | return categoryList.size();
69 | }
70 |
71 | public void updateList(List newList) {
72 | categoryList = newList;
73 | notifyDataSetChanged();
74 | }
75 |
76 | //ViewHolder inner class
77 | //hold object of view of one line and save references to his elements
78 | public class ViewHolder extends RecyclerView.ViewHolder {
79 |
80 | //references to the views for each data item (from xml file)
81 | // ImageView imageView;
82 | TextView name, detail;
83 | ImageView imageView;
84 | CardView cardView;
85 |
86 |
87 | public ViewHolder(@NonNull View itemView) {
88 | super(itemView);
89 |
90 | imageView = itemView.findViewById(R.id.category_recipe_img);
91 | name = itemView.findViewById(R.id.category_recipe_name);
92 | detail = itemView.findViewById(R.id.category_recipe_detail);
93 | cardView = itemView.findViewById(R.id.myCardView);
94 | }
95 | }
96 | }
97 |
98 |
99 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_my_detaile_recipe.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
32 |
43 |
44 |
55 |
56 |
57 |
60 |
61 |
62 |
72 |
73 |
74 |
84 |
85 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/activities/MyDetailRecipe.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.activities;
2 |
3 | import androidx.appcompat.app.AppCompatActivity;
4 |
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | import com.bumptech.glide.Glide;
12 | import com.example.myrecipebook.MainActivity;
13 | import com.example.myrecipebook.R;
14 | import com.google.android.material.floatingactionbutton.FloatingActionButton;
15 |
16 | //My Detailed recipe
17 | public class MyDetailRecipe extends AppCompatActivity {
18 |
19 | TextView detailTitle, detailIngr, detailInst;
20 | ImageView detailImage;
21 | String key = "";
22 | String imageUrl = "";
23 | FloatingActionButton deleteButton, editButton;
24 |
25 |
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 | setContentView(R.layout.activity_my_detaile_recipe);
30 |
31 | detailTitle = findViewById(R.id.detailTitle);
32 | detailImage = findViewById(R.id.detailImage);
33 | detailIngr = findViewById(R.id.detailIngr);
34 | detailInst = findViewById(R.id.detailInst);
35 |
36 | deleteButton = findViewById(R.id.deleteButton);
37 | editButton = findViewById(R.id.editButton);
38 |
39 |
40 | Bundle bundle = getIntent().getExtras();
41 |
42 | if (bundle != null){
43 |
44 | detailIngr.setText(bundle.getString("ingredients"));
45 | detailTitle.setText(bundle.getString("Title"));
46 | detailInst.setText(bundle.getString("Instructions"));
47 | detailInst.setText(bundle.getString("Instructions"));
48 | key = bundle.getString("Key");
49 | imageUrl = bundle.getString("Image");
50 | Glide.with(this).load(bundle.getString("Image")).into(detailImage);
51 |
52 | }
53 | editButton.setOnClickListener(new View.OnClickListener() {
54 | @Override
55 | public void onClick(View view) {
56 | Intent intent = new Intent(MyDetailRecipe.this, MyRecipeUpdateActivity.class)
57 | .putExtra("Title", detailTitle.getText().toString())
58 | .putExtra("ingredients", detailIngr.getText().toString())
59 | .putExtra("Instructions", detailInst.getText().toString())
60 | .putExtra("Image", imageUrl)
61 | .putExtra("Key", key);
62 | startActivity(intent);
63 | }
64 | });
65 |
66 | }
67 | }
68 |
69 |
70 |
71 |
72 |
73 | /*
74 | deleteButton.setOnClickListener(new View.OnClickListener() {
75 | @Override
76 | public void onClick(View view) {
77 | final DatabaseReference reference = FirebaseDatabase.getInstance().getReference("Android Tutorials");
78 | FirebaseStorage storage = FirebaseStorage.getInstance();
79 | StorageReference storageReference = storage.getReferenceFromUrl(imageUrl);
80 | storageReference.delete().addOnSuccessListener(new OnSuccessListener() {
81 | @Override
82 | public void onSuccess(Void unused) {
83 | reference.child(key).removeValue();
84 | Toast.makeText(DetailActivity.this, "Deleted", Toast.LENGTH_SHORT).show();
85 | startActivity(new Intent(getApplicationContext(), MainnActivity.class));
86 | finish();
87 | }
88 | });
89 | }
90 | });
91 |
92 |
93 | */
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_my_recipe_update.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
19 |
26 |
33 |
42 |
51 |
61 |
70 |
79 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/activities/MapDetailActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.activities;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.appcompat.app.AppCompatActivity;
5 | import android.os.Bundle;
6 | import android.widget.TextView;
7 |
8 | import com.example.myrecipebook.R;
9 | import com.example.myrecipebook.models.LocationMarker;
10 | import com.example.myrecipebook.models.UserData;
11 | import com.google.firebase.database.DataSnapshot;
12 | import com.google.firebase.database.DatabaseError;
13 | import com.google.firebase.database.DatabaseReference;
14 | import com.google.firebase.database.FirebaseDatabase;
15 | import com.google.firebase.database.ValueEventListener;
16 |
17 | // retrieves the details of a location from a Firebase Realtime Database and displays them
18 | public class MapDetailActivity extends AppCompatActivity {
19 |
20 | TextView storeTitle;
21 | TextView address;
22 | TextView hours;
23 |
24 | @Override
25 | protected void onCreate(Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | setContentView(R.layout.activity_map_detail);
28 |
29 | storeTitle = findViewById(R.id.titleNameStore);
30 | address = findViewById(R.id.AdrressName);
31 | hours = findViewById(R.id.StoreHours);
32 |
33 | //retrieves any extras that were passed to the activity
34 | Bundle extras = getIntent().getExtras();
35 | if (extras != null) {
36 | //and updates the views with the markerTitle value
37 | String markerTitle = extras.getString("markerTitle");
38 | storeTitle.setText(markerTitle);
39 | updateTexts(markerTitle);
40 | }
41 | }
42 |
43 | //retrieves data from a Firebase Realtime Database using a DatabaseReference
44 | private void updateTexts(String markerTitle)
45 | {
46 | FirebaseDatabase database = FirebaseDatabase.getInstance();
47 | DatabaseReference reference = database.getReference("locations");
48 |
49 | //adds valueEventListener to the reference, which listens for changes to the data at the location referenced by markerTitle
50 | reference.child(markerTitle).addListenerForSingleValueEvent(new ValueEventListener() {
51 | @Override
52 | //the onDataChange() method is called with a DataSnapshot containing the updated data
53 | public void onDataChange(DataSnapshot dataSnapshot) {
54 | //The method then extracts the address and hours from the LocationMarker object and updates the corresponding views
55 | LocationMarker locationMarker = dataSnapshot.getValue(LocationMarker.class);
56 | if(locationMarker != null)
57 | {
58 | address.setText(locationMarker.getAddress());
59 | hours.setText(locationMarker.getHours());
60 | }
61 | }
62 |
63 | @Override
64 | public void onCancelled(DatabaseError databaseError) {
65 | System.out.println("The read failed: " + databaseError.getCode());
66 | }
67 | });
68 | }
69 | }
70 |
71 |
72 |
73 | /*
74 | Bundle-
75 | used to store and transfer data between activities, fragments, and services within an app. It's a way to pass data from one component of the app to another without having to rely on global variables.
76 | A bundle can be used to store any type of data that can be serialized and deserialized.
77 | To create a bundle, you can use the putExtra() method on an Intent object, which is typically used to start a new activity or service.
78 | In the receiving activity, you can retrieve the data from the bundle using the getXXX().
79 |
80 | For example:
81 | // Get the Bundle object from the Intent
82 | Bundle bundle = getIntent().getExtras();
83 |
84 | // Get the data from the Bundle
85 | String value1 = bundle.getString("key1");
86 | int value2 = bundle.getInt("key2");
87 |
88 | */
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/ui/slideshow/ProfileFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.ui.slideshow;
2 | import android.content.Intent;
3 | import android.os.Bundle;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.Button;
8 | import android.widget.ImageView;
9 | import android.widget.TextView;
10 |
11 | import androidx.annotation.NonNull;
12 | import androidx.fragment.app.Fragment;
13 |
14 | import com.example.myrecipebook.MainActivity;
15 | import com.example.myrecipebook.R;
16 | import com.example.myrecipebook.activities.EditProfileActivity;
17 | import com.example.myrecipebook.activities.WelcomeActivity;
18 | import com.example.myrecipebook.models.UserData;
19 | import com.google.android.gms.tasks.OnCompleteListener;
20 | import com.google.android.gms.tasks.Task;
21 | import com.google.firebase.auth.FirebaseAuth;
22 | import com.google.firebase.database.DataSnapshot;
23 | import com.google.firebase.database.DatabaseError;
24 | import com.google.firebase.database.DatabaseReference;
25 | import com.google.firebase.database.FirebaseDatabase;
26 | import com.google.firebase.database.ValueEventListener;
27 | import com.squareup.picasso.Picasso;
28 |
29 |
30 | public class ProfileFragment extends Fragment {
31 |
32 | FirebaseAuth auth;
33 | TextView profileName, profileUsername ,profileEmail;
34 | Button editProfile;
35 | ImageView userImage;
36 |
37 | @Override
38 | public void onResume() {
39 | super.onResume();
40 |
41 | UpdateUserData();
42 | }
43 |
44 | public View onCreateView(@NonNull LayoutInflater inflater,
45 | ViewGroup container, Bundle savedInstanceState) {
46 |
47 | //inflate the layout for this fragment
48 | View root = inflater.inflate(R.layout.activity_profile, container, false);
49 |
50 | profileEmail = root.findViewById(R.id.profileEmail);
51 | profileName = root.findViewById(R.id.profileName);
52 | profileUsername = root.findViewById(R.id.profileUsername);
53 | userImage = root.findViewById(R.id.user_image);
54 |
55 |
56 | editProfile = root.findViewById(R.id.edit_profile);
57 |
58 |
59 |
60 |
61 | editProfile.setOnClickListener(new View.OnClickListener() {
62 | @Override
63 | public void onClick(View v) {
64 | startActivity(new Intent(getActivity(), EditProfileActivity.class));
65 | }
66 | });
67 |
68 | UpdateUserData();
69 |
70 | return root;
71 | }
72 |
73 | void UpdateUserData()
74 | {
75 | auth = FirebaseAuth.getInstance();
76 | if(auth.getUid() != null)
77 | {
78 | FirebaseDatabase database = FirebaseDatabase.getInstance();
79 | DatabaseReference usersRef = database.getReference("users");
80 |
81 | usersRef.child(auth.getUid()).addListenerForSingleValueEvent(new ValueEventListener() {
82 | @Override
83 | public void onDataChange(DataSnapshot dataSnapshot) {
84 | UserData profileData = dataSnapshot.getValue(UserData.class);
85 | if(profileData != null)
86 | {
87 | profileEmail.setText(profileData.getEmail());
88 | profileName.setText(profileData.getName());
89 | profileUsername.setText(profileData.getUsername());
90 | if(!profileData.getProfileImage().isEmpty())
91 | {
92 | Picasso.get().load(profileData.getProfileImage()).into(userImage);
93 | }
94 |
95 | }
96 | }
97 |
98 | @Override
99 | public void onCancelled(DatabaseError databaseError) {
100 | System.out.println("The read failed: " + databaseError.getCode());
101 | }
102 | });
103 | }
104 |
105 | }
106 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/activities/LoginActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.activities;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.appcompat.app.AppCompatActivity;
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import android.util.Patterns;
8 | import android.view.View;
9 | import android.widget.Button;
10 | import android.widget.EditText;
11 | import android.widget.TextView;
12 | import android.widget.Toast;
13 |
14 | import com.example.myrecipebook.MainActivity;
15 | import com.example.myrecipebook.R;
16 | import com.example.myrecipebook.ui.home.HomeFragment;
17 | import com.google.android.gms.tasks.OnFailureListener;
18 | import com.google.android.gms.tasks.OnSuccessListener;
19 | import com.google.firebase.auth.AuthResult;
20 | import com.google.firebase.auth.FirebaseAuth;
21 | import com.google.firebase.auth.FirebaseUser;
22 | import com.google.firebase.database.DataSnapshot;
23 | import com.google.firebase.database.DatabaseError;
24 | import com.google.firebase.database.DatabaseReference;
25 | import com.google.firebase.database.FirebaseDatabase;
26 | import com.google.firebase.database.Query;
27 | import com.google.firebase.database.ValueEventListener;
28 | import java.util.Objects;
29 | public class LoginActivity extends AppCompatActivity {
30 |
31 | private EditText loginEmail, loginPassword;
32 | private TextView signupRedirectText;
33 | private Button loginButton;
34 | private FirebaseAuth auth;
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 |
40 | setContentView(R.layout.activity_login);
41 |
42 | loginEmail = findViewById(R.id.login_email);
43 | loginPassword = findViewById(R.id.login_password);
44 | loginButton = findViewById(R.id.login_button);
45 | signupRedirectText = findViewById(R.id.login_not_yet);
46 |
47 | auth = FirebaseAuth.getInstance();
48 |
49 | loginButton.setOnClickListener(new View.OnClickListener() {
50 | @Override
51 | public void onClick(View v) {
52 | String email = loginEmail.getText().toString();
53 | String pass = loginPassword.getText().toString();
54 |
55 | if (!email.isEmpty() && Patterns.EMAIL_ADDRESS.matcher(email).matches()) {
56 | if (!pass.isEmpty()) {
57 | auth.signInWithEmailAndPassword(email, pass)
58 | .addOnSuccessListener(new OnSuccessListener() {
59 |
60 | @Override
61 | public void onSuccess(AuthResult authResult) {
62 | Toast.makeText(LoginActivity.this, "Login Successful", Toast.LENGTH_SHORT).show();
63 | startActivity(new Intent(LoginActivity.this, MainActivity.class));
64 | finish();
65 | }
66 | }).addOnFailureListener(new OnFailureListener() {
67 | @Override
68 | public void onFailure(@NonNull Exception e) {
69 | Toast.makeText(LoginActivity.this, "Login Failed", Toast.LENGTH_SHORT).show();
70 | }
71 | });
72 | } else {
73 | loginPassword.setError("Empty fields are not allowed");
74 | }
75 | } else if (email.isEmpty()) {
76 | loginEmail.setError("Empty fields are not allowed");
77 | } else {
78 | loginEmail.setError("Please enter correct email");
79 | }
80 | }
81 | });
82 |
83 |
84 |
85 |
86 | signupRedirectText.setOnClickListener(new View.OnClickListener() {
87 | @Override
88 | public void onClick(View v) {
89 | startActivity(new Intent(LoginActivity.this, RegisterActivity.class));
90 | finish();
91 | }
92 | });
93 |
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
24 |
25 |
26 |
29 |
32 |
33 |
37 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
49 |
52 |
53 |
56 |
59 |
60 |
61 |
64 |
67 |
68 |
71 |
74 |
75 |
78 |
81 |
82 |
85 |
90 |
93 |
94 |
95 |
96 |
97 |
98 |
101 |
102 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_welcome.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
22 |
23 |
24 |
32 |
33 |
34 |
49 |
50 |
64 |
65 |
82 |
83 |
84 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
24 |
25 |
40 |
41 |
42 |
58 |
59 |
74 |
75 |
92 |
93 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_map_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
29 |
30 |
48 |
49 |
50 |
64 |
65 |
66 |
75 |
76 |
84 |
85 |
93 |
94 |
95 |
104 |
105 |
113 |
114 |
123 |
124 |
125 |
126 |
132 |
133 |
134 |
135 |
136 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/category_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
19 |
20 |
32 |
33 |
45 |
46 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # My Recipe Book Android App
4 | [](https://www.java.com/)
5 | [](https://developer.android.com/studio)
6 | [](https://firebase.google.com/)
7 |
8 | Welcome to My Recipe Book, your go-to Android application for organizing, sharing, and discovering delicious recipes. Built with Java and powered by Firebase, this app not only streamlines your personal recipe collection but also connects you with a community of fellow food enthusiasts. Let's dive into the details!
9 |
10 |
11 | ## 🚀 Overview
12 | My Recipe Book is a Java-based Android app developed in Android Studio, with Firebase Database integration for seamless data management. The app serves as a centralized hub for users to store, categorize, and share their favorite recipes. Whether you're a seasoned chef or a cooking novice, this app offers a practical solution for organizing recipes and a platform to connect with like-minded individuals.
13 |
14 |
15 | ## 🛠️ Languages, Tools, and Architecture
16 |
17 | ### 🛠️ Development Languages
18 | [](https://skillicons.dev)
19 | - [x] Java
20 | - [x] Android Studio
21 | - [x] Firebase Database
22 |
23 |
24 | ## 🌟 Tech Highlights
25 | - [x] **Real-Time Data Management:** Implemented real-time data storage and retrieval using Firebase, ensuring efficient and dynamic data handling.
26 |
27 | - [x] **Secure Authentication:** Ensured secure Firebase authentication to protect user data and maintain the integrity of the application.
28 |
29 | - [x] **External API Integration:** Utilized an external API to enhance the app's functionality and provide additional features.
30 |
31 |
32 |
33 | ## 🌟 Android Development in Java
34 |
35 | Java has been the foundation of Android app development, offering a robust, object-oriented environment. In **My Recipe Book**, Java handles core functionalities like UI interactions, data processing, and business logic.
36 |
37 | ### 📱 Components in MVC Style
38 |
39 | While **My Recipe Book** doesn't strictly adhere to the MVC architecture, the project is organized into distinct components that align with MVC principles:
40 |
41 | - [x] **Models**: Handle data operations and business logic. In our app, Models interact with Firebase to manage recipe data.
42 |
43 | - [x] **Fragments**: Represent the UI components and manage their lifecycle. Fragments in **My Recipe Book** correspond to different screens or views within the app, such as recipe lists, details, and user profiles.
44 |
45 | - [x] **Adapters**: Bridge the gap between Models and Fragments/Activities. Adapters in our app are used to populate data from Models into RecyclerViews or ListViews displayed in Fragments.
46 |
47 | - [x] **Activities**: Serve as the entry points and main controllers of the app. Activities in **My Recipe Book** manage the navigation between Fragments and handle user interactions.
48 |
49 | #### Benefits of Component-Based Architecture
50 |
51 | - **Separation of Concerns**: Each component has a specific responsibility, making the codebase more organized and maintainable.
52 | - **Reusability**: Components like Adapters can be reused across different parts of the application, reducing redundancy.
53 |
54 |
55 |
56 |
57 | ## 📌 Key Features
58 |
59 | ### 📚 Effortless Recipe Management
60 | - [x] **Add, Organize, and Categorize:** Users can easily add new recipes, organize them into categories, and manage their collection with ease.
61 |
62 | ### 🤝 Social Recipe Sharing
63 | - [x] **Create and Share Profiles:** Users can create profiles and share their own recipes with the community, fostering a vibrant social cooking experience.
64 |
65 | ### 🌍 Community Interaction
66 | - [x] **Explore and Try New Recipes:** Users can explore and try recipes shared by others, creating an interactive and engaging cooking community for users of all skill levels.
67 |
68 |
69 | ## 🛠️ Getting Started
70 | ### 📋 Prerequisites
71 | - Android Studio
72 | - Firebase Account
73 | - Android Device or Emulator
74 |
75 | ### 📥 Installation Steps
76 | 1. Clone the repository:
77 | ```
78 | git clone https://github.com/your-username/my-recipe-book.git
79 | ```
80 | 2. Open the project in Android Studio.
81 | 3. Connect the app to Firebase by adding your Firebase configuration file to the project.
82 | 4. Build and run the app on an Android device or emulator.
83 |
84 |
85 | Thank you for checking out My Recipe Book! We hope you find it useful and enjoy using it as much as we enjoyed developing it. Happy cooking! 🍳👩🍳👨🍳
86 |
87 |
88 |
89 | ### 👉 Feed example:
90 |
91 |
92 |
93 |
94 | ### Our screens:
95 |
96 |
97 | 
98 | 
99 | 
100 | 
101 |
102 |
103 |
104 |
105 |
106 | ---
107 |
108 |
109 |
110 | ## 🔗 Connect with me 👩💻😊
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
123 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/activities/EditProfileActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.activities;
2 |
3 | import androidx.activity.result.ActivityResult;
4 | import androidx.activity.result.ActivityResultCallback;
5 | import androidx.activity.result.ActivityResultLauncher;
6 | import androidx.activity.result.contract.ActivityResultContracts;
7 | import androidx.annotation.NonNull;
8 | import androidx.appcompat.app.AppCompatActivity;
9 |
10 | import android.app.Activity;
11 | import android.content.Intent;
12 | import android.net.Uri;
13 | import android.os.Bundle;
14 | import android.view.View;
15 | import android.widget.Button;
16 | import android.widget.EditText;
17 | import android.widget.ImageView;
18 | import android.widget.NumberPicker;
19 | import android.widget.Toast;
20 |
21 | import com.example.myrecipebook.R;
22 | import com.google.android.gms.tasks.Continuation;
23 | import com.google.android.gms.tasks.OnCompleteListener;
24 | import com.google.android.gms.tasks.Task;
25 | import com.google.firebase.auth.FirebaseAuth;
26 | import com.google.firebase.database.DataSnapshot;
27 | import com.google.firebase.database.DatabaseError;
28 | import com.google.firebase.database.DatabaseReference;
29 | import com.google.firebase.database.FirebaseDatabase;
30 | import com.google.firebase.database.ValueEventListener;
31 | import com.google.firebase.storage.FirebaseStorage;
32 | import com.google.firebase.storage.StorageReference;
33 | import com.google.firebase.storage.UploadTask;
34 |
35 | public class EditProfileActivity extends AppCompatActivity {
36 |
37 | EditText editName, editUsername;
38 | Button saveButton;
39 | DatabaseReference reference;
40 | FirebaseAuth auth;
41 | ImageView imageSelectButton;
42 |
43 | Uri uri;
44 |
45 | @Override
46 | protected void onCreate(Bundle savedInstanceState) {
47 | super.onCreate(savedInstanceState);
48 |
49 | setContentView(R.layout.activity_edit_profile);
50 |
51 | reference = FirebaseDatabase.getInstance().getReference("users");
52 | auth = FirebaseAuth.getInstance();
53 |
54 | editName = findViewById(R.id.editName);
55 | editUsername = findViewById(R.id.editUsername);
56 | saveButton = findViewById(R.id.saveButton);
57 | imageSelectButton = findViewById(R.id.btnChooseImage);
58 |
59 | saveButton.setOnClickListener(new View.OnClickListener() {
60 | @Override
61 | public void onClick(View view) {
62 | if (isDataChanged()){
63 | Toast.makeText(EditProfileActivity.this, "Saved", Toast.LENGTH_SHORT).show();
64 | } else {
65 | Toast.makeText(EditProfileActivity.this, "No Changes Found", Toast.LENGTH_SHORT).show();
66 | }
67 | }
68 | });
69 |
70 |
71 | ActivityResultLauncher activityResultLauncher = registerForActivityResult(
72 | new ActivityResultContracts.StartActivityForResult(),
73 | new ActivityResultCallback() {
74 |
75 | @Override
76 | public void onActivityResult(ActivityResult result) {
77 | if (result.getResultCode() == Activity.RESULT_OK) {
78 | Intent data = result.getData();
79 | uri = data.getData();
80 | imageSelectButton.setImageURI(uri);
81 | } else {
82 |
83 | }
84 | }
85 | }
86 | );
87 |
88 | imageSelectButton.setOnClickListener(new View.OnClickListener() {
89 | @Override
90 | public void onClick(View view) {
91 | Intent photoPicker = new Intent(Intent.ACTION_PICK);
92 | photoPicker.setType("image/*");
93 | activityResultLauncher.launch(photoPicker);
94 | }
95 | });
96 |
97 | }
98 |
99 | void returnActivity()
100 | {
101 | finish();
102 | }
103 |
104 | @Override
105 | protected void onResume() {
106 | super.onResume();
107 |
108 | reference = FirebaseDatabase.getInstance().getReference("users");
109 | auth = FirebaseAuth.getInstance();
110 | }
111 |
112 | private void uploadImage()
113 | {
114 |
115 | if(reference == null || uri == null)
116 | {
117 | return;
118 | }
119 |
120 | StorageReference imageRef = FirebaseStorage.getInstance().getReference().child("profile_images/" + auth.getUid() + ".jpg");
121 | UploadTask uploadTask = imageRef.putFile(uri);
122 |
123 | uploadTask.continueWithTask(new Continuation>() {
124 | @Override
125 | public Task then(@NonNull Task task) throws Exception {
126 | if (!task.isSuccessful()) {
127 | throw task.getException();
128 | }
129 | return imageRef.getDownloadUrl();
130 | }
131 | }).addOnCompleteListener(new OnCompleteListener() {
132 | @Override
133 | public void onComplete(@NonNull Task task) {
134 | if (task.isSuccessful()) {
135 | Uri downloadUri = task.getResult();
136 | if (downloadUri != null) {
137 | String imageURL = downloadUri.toString();
138 | reference.child(auth.getUid()).child("profileImage").setValue(imageURL);
139 | returnActivity();
140 | }
141 | }
142 | }
143 | });
144 | }
145 |
146 |
147 | private boolean isDataChanged() {
148 | String newName = editName.getText().toString();
149 | String newUsername = editUsername.getText().toString();
150 |
151 | if (auth == null || auth.getUid() == null || newName.isEmpty() || newUsername.isEmpty()){
152 | return false;
153 | } else {
154 | reference.child(auth.getUid()).child("name").setValue(newName);
155 | reference.child(auth.getUid()).child("username").setValue(newUsername);
156 | uploadImage();
157 | return true;
158 | }
159 | }
160 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/ui/categories/CategoryFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.ui.categories;
2 | import static java.lang.Thread.sleep;
3 |
4 | import android.os.Bundle;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.AdapterView;
9 | import android.widget.ArrayAdapter;
10 | import android.widget.ImageButton;
11 | import android.widget.Spinner;
12 | import android.widget.Toast;
13 |
14 | import androidx.annotation.NonNull;
15 | import androidx.fragment.app.Fragment;
16 | import androidx.recyclerview.widget.GridLayoutManager;
17 | import androidx.recyclerview.widget.LinearLayoutManager;
18 | import androidx.recyclerview.widget.RecyclerView;
19 |
20 | import com.example.myrecipebook.R;
21 | import com.example.myrecipebook.adapters.CategoryAdapter;
22 | import com.example.myrecipebook.models.CategoryModel;
23 | import com.example.myrecipebook.models.DetailRecipeModel;
24 | import com.google.firebase.database.DataSnapshot;
25 | import com.google.firebase.database.DatabaseError;
26 | import com.google.firebase.database.DatabaseReference;
27 | import com.google.firebase.database.FirebaseDatabase;
28 | import com.google.firebase.database.GenericTypeIndicator;
29 | import com.google.firebase.database.ValueEventListener;
30 |
31 | import java.util.ArrayList;
32 | import java.util.List;
33 | import java.util.Locale;
34 |
35 | //List of recipes on one category
36 | public class CategoryFragment extends Fragment implements AdapterView.OnItemSelectedListener {
37 |
38 | RecyclerView recyclerView;
39 | List dataRecipeList;
40 | CategoryAdapter categoryAdapter;
41 |
42 | public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
43 |
44 | View root = inflater.inflate(R.layout.fragment_category, container, false);
45 | Bundle bundle = getArguments();
46 | String categoryName = "All";
47 | if (bundle != null) {
48 | categoryName = bundle.getString("categoryName");
49 | }
50 | Spinner spinner = root.findViewById(R.id.spinner_category);
51 | ArrayAdapter adapter = ArrayAdapter.createFromResource(this.getContext(), R.array.spinner_cate, android.R.layout.simple_spinner_item);
52 | adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
53 | spinner.setAdapter(adapter);
54 | spinner.setOnItemSelectedListener(this);
55 |
56 | recyclerView = root.findViewById(R.id.category_recipes_recList);
57 | recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
58 | dataRecipeList = new ArrayList<>();
59 | FirebaseDatabase database = FirebaseDatabase.getInstance();
60 | DatabaseReference recipeRef = database.getReference("Recipes");
61 | recipeRef.addValueEventListener(new ValueEventListener() {
62 | @Override
63 | public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
64 | dataRecipeList.clear();
65 | System.out.println("children count "+dataSnapshot.getChildrenCount());
66 | for (DataSnapshot recipeSnapshot : dataSnapshot.getChildren()) {
67 | String recipeName = recipeSnapshot.child("name").getValue(String.class);
68 | String recipeUser = recipeSnapshot.child("user").getValue(String.class);
69 | String user = recipeSnapshot.child("user").getValue(String.class);
70 | String recipeTotalTime = "";
71 | if (recipeSnapshot.child("totalTime").getValue(String.class).charAt(0) != '-')
72 | recipeTotalTime = recipeSnapshot.child("totalTime").getValue(String.class);
73 | String recipeIngredients = recipeSnapshot.child("ingredients").getValue(String.class);
74 | String recipeInstruction = recipeSnapshot.child("instruction").getValue(String.class);
75 | List recipeCategory = recipeSnapshot.child("category").getValue(new GenericTypeIndicator>() {});
76 | List recipeHealthLabels = recipeSnapshot.child("healthLabels").getValue(new GenericTypeIndicator>() {});
77 | String imageUrl = recipeSnapshot.child("imageUrl").getValue(String.class);
78 | DetailRecipeModel recipeModel = new DetailRecipeModel(user, recipeName, recipeCategory, recipeHealthLabels, recipeIngredients, recipeInstruction, recipeTotalTime, imageUrl);
79 | dataRecipeList.add(recipeModel);
80 | }
81 | filterList(spinner.getSelectedItem().toString());
82 |
83 | categoryAdapter.notifyDataSetChanged(); // update the adapter with the new data
84 | }
85 |
86 | @Override
87 | public void onCancelled(@NonNull DatabaseError databaseError) {
88 | System.out.println(databaseError);
89 | }
90 | });
91 | categoryAdapter= new CategoryAdapter(getContext(), dataRecipeList);
92 | recyclerView.setAdapter(categoryAdapter);
93 | int index = adapter.getPosition(categoryName);
94 | spinner.setSelection(index);
95 | categoryAdapter.notifyDataSetChanged();
96 | return root;
97 | }
98 |
99 | @Override
100 | public void onItemSelected(AdapterView> parent, View view, int position, long id) {
101 | String text = parent.getItemAtPosition(position).toString();
102 | Toast.makeText(parent.getContext(), text, Toast.LENGTH_SHORT).show();
103 |
104 | String selectedCategory = parent.getItemAtPosition(position).toString();
105 | filterList(selectedCategory);
106 | }
107 |
108 | @Override
109 | public void onNothingSelected(AdapterView> parent) {
110 |
111 | }
112 |
113 | public void filterList (String selectedCategory) {
114 | List filteredRecipeList = new ArrayList<>();
115 | for (DetailRecipeModel recipe : dataRecipeList) {
116 | if (recipe.getCategory().contains(selectedCategory.toLowerCase()) || selectedCategory.equals("All")) {
117 | filteredRecipeList.add(recipe);
118 | }
119 | }
120 | categoryAdapter.updateList(filteredRecipeList);
121 | }
122 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/activities/MyRecipeUpdateActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.activities;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.net.Uri;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.widget.Button;
9 | import android.widget.EditText;
10 | import android.widget.ImageView;
11 | import android.widget.Toast;
12 |
13 | import androidx.activity.result.ActivityResult;
14 | import androidx.activity.result.ActivityResultCallback;
15 | import androidx.activity.result.ActivityResultLauncher;
16 | import androidx.activity.result.contract.ActivityResultContracts;
17 | import androidx.annotation.NonNull;
18 | import androidx.appcompat.app.AlertDialog;
19 | import androidx.appcompat.app.AppCompatActivity;
20 |
21 | import com.bumptech.glide.Glide;
22 | import com.example.myrecipebook.DataClass;
23 | import com.example.myrecipebook.R;
24 | import com.google.android.gms.tasks.OnCompleteListener;
25 | import com.google.android.gms.tasks.OnFailureListener;
26 | import com.google.android.gms.tasks.OnSuccessListener;
27 | import com.google.android.gms.tasks.Task;
28 | import com.google.firebase.database.DatabaseReference;
29 | import com.google.firebase.database.FirebaseDatabase;
30 | import com.google.firebase.storage.FirebaseStorage;
31 | import com.google.firebase.storage.StorageReference;
32 | import com.google.firebase.storage.UploadTask;
33 |
34 |
35 | public class MyRecipeUpdateActivity extends AppCompatActivity {
36 |
37 | ImageView updateImage;
38 | Button updateButton;
39 |
40 | EditText updateTitle,updateIngr, updateInst, updateTime;
41 | String title, desc, lang;
42 |
43 | String imageUrl;
44 | String key, oldImageURL;
45 | Uri uri;
46 | DatabaseReference databaseReference;
47 | StorageReference storageReference;
48 |
49 | @Override
50 | protected void onCreate(Bundle savedInstanceState) {
51 | super.onCreate(savedInstanceState);
52 |
53 | setContentView(R.layout.activity_my_recipe_update);
54 |
55 | updateTitle = findViewById(R.id.updateTitle);
56 | updateButton = findViewById(R.id.updateButton);
57 | updateIngr = findViewById(R.id.updateIngr);
58 | updateInst = findViewById(R.id.updateInst);
59 | updateImage = findViewById(R.id.updateImage);
60 | updateTime = findViewById(R.id.updateTime);
61 |
62 |
63 | ActivityResultLauncher activityResultLauncher = registerForActivityResult(
64 | new ActivityResultContracts.StartActivityForResult(),
65 | new ActivityResultCallback() {
66 | @Override
67 | public void onActivityResult(ActivityResult result) {
68 | if (result.getResultCode() == Activity.RESULT_OK){
69 | Intent data = result.getData();
70 | uri = data.getData();
71 | updateImage.setImageURI(uri);
72 | } else {
73 | Toast.makeText(MyRecipeUpdateActivity.this, "No Image Selected", Toast.LENGTH_SHORT).show();
74 | }
75 | }
76 | }
77 | );
78 |
79 |
80 | Bundle bundle = getIntent().getExtras();
81 |
82 | if (bundle != null){
83 | Glide.with(MyRecipeUpdateActivity.this).load(bundle.getString("Image")).into(updateImage);
84 | updateTitle.setText(bundle.getString("Title"));
85 | updateIngr.setText(bundle.getString("Description"));
86 | updateInst.setText(bundle.getString("Language"));
87 | key = bundle.getString("Key");
88 | oldImageURL = bundle.getString("Image");
89 | }
90 |
91 |
92 | databaseReference = FirebaseDatabase.getInstance().getReference("Android Tutorials").child(key);
93 |
94 | updateImage.setOnClickListener(new View.OnClickListener() {
95 | @Override
96 | public void onClick(View view) {
97 | Intent photoPicker = new Intent(Intent.ACTION_PICK);
98 | photoPicker.setType("image/*");
99 | activityResultLauncher.launch(photoPicker);
100 | }
101 | });
102 |
103 |
104 | updateButton.setOnClickListener(new View.OnClickListener() {
105 | @Override
106 | public void onClick(View view) {
107 | saveData();
108 | // Intent intent = new Intent(MyRecipeUpdateActivity.this, MyRecipesActivity.class);
109 | // startActivity(intent);
110 | }
111 | });
112 | }
113 |
114 |
115 | public void saveData(){
116 | storageReference = FirebaseStorage.getInstance().getReference().child("Android Images").child(uri.getLastPathSegment());
117 | AlertDialog.Builder builder = new AlertDialog.Builder(MyRecipeUpdateActivity.this);
118 | builder.setCancelable(false);
119 | builder.setView(R.layout.progress_layout);
120 | AlertDialog dialog = builder.create();
121 | dialog.show();
122 | storageReference.putFile(uri).addOnSuccessListener(new OnSuccessListener() {
123 | @Override
124 | public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
125 | Task uriTask = taskSnapshot.getStorage().getDownloadUrl();
126 | while (!uriTask.isComplete());
127 | Uri urlImage = uriTask.getResult();
128 | imageUrl = urlImage.toString();
129 | updateData();
130 | dialog.dismiss();
131 | }
132 | }).addOnFailureListener(new OnFailureListener() {
133 | @Override
134 | public void onFailure(@NonNull Exception e) {
135 | dialog.dismiss();
136 | }
137 | });
138 | }
139 |
140 |
141 | public void updateData(){
142 | //change this
143 | title = updateTitle.getText().toString().trim();
144 | desc = updateIngr.getText().toString().trim();
145 | lang = updateInst.getText().toString();
146 | DataClass dataClass = new DataClass(title, desc, lang, imageUrl);
147 |
148 |
149 |
150 |
151 | databaseReference.setValue(dataClass).addOnCompleteListener(new OnCompleteListener() {
152 | @Override
153 | public void onComplete(@NonNull Task task) {
154 | if (task.isSuccessful()){
155 | StorageReference reference = FirebaseStorage.getInstance().getReferenceFromUrl(oldImageURL);
156 | reference.delete();
157 | Toast.makeText(MyRecipeUpdateActivity.this, "Updated", Toast.LENGTH_SHORT).show();
158 | finish();
159 | }
160 | }
161 | }).addOnFailureListener(new OnFailureListener() {
162 | @Override
163 | public void onFailure(@NonNull Exception e) {
164 | Toast.makeText(MyRecipeUpdateActivity.this, e.getMessage().toString(), Toast.LENGTH_SHORT).show();
165 | }
166 | });
167 | }
168 | }
169 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/ui/map/MapFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.ui.map;
2 | import android.Manifest;
3 | import android.content.Intent;
4 | import android.content.pm.PackageManager;
5 | import android.location.Location;
6 | import android.os.Bundle;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.Toast;
11 |
12 | import androidx.annotation.NonNull;
13 | import androidx.core.app.ActivityCompat;
14 | import androidx.fragment.app.Fragment;
15 |
16 | import com.example.myrecipebook.MainActivity;
17 | import com.example.myrecipebook.R;
18 | import com.example.myrecipebook.activities.LoginActivity;
19 | import com.example.myrecipebook.activities.MapDetailActivity;
20 | import com.example.myrecipebook.databinding.FragmentHomeBinding;
21 | import com.example.myrecipebook.models.LocationMarker;
22 | import com.example.myrecipebook.models.UserData;
23 | import com.google.android.gms.location.FusedLocationProviderClient;
24 | import com.google.android.gms.location.LocationServices;
25 | import com.google.android.gms.location.Priority;
26 | import com.google.android.gms.maps.CameraUpdateFactory;
27 | import com.google.android.gms.maps.GoogleMap;
28 | import com.google.android.gms.maps.OnMapReadyCallback;
29 | import com.google.android.gms.maps.SupportMapFragment;
30 | import com.google.android.gms.maps.model.BitmapDescriptorFactory;
31 | import com.google.android.gms.maps.model.LatLng;
32 | import com.google.android.gms.maps.model.Marker;
33 | import com.google.android.gms.maps.model.MarkerOptions;
34 | import com.google.android.gms.tasks.CancellationTokenSource;
35 | import com.google.android.gms.tasks.OnSuccessListener;
36 | import com.google.android.gms.tasks.Task;
37 | import com.google.android.material.floatingactionbutton.FloatingActionButton;
38 | import com.google.firebase.database.DataSnapshot;
39 | import com.google.firebase.database.DatabaseError;
40 | import com.google.firebase.database.DatabaseReference;
41 | import com.google.firebase.database.FirebaseDatabase;
42 | import com.google.firebase.database.ValueEventListener;
43 |
44 | public class MapFragment extends Fragment implements OnMapReadyCallback {
45 |
46 | private FragmentHomeBinding binding;
47 | FloatingActionButton fab;
48 |
49 | Location currentLocation;
50 | FusedLocationProviderClient fusedLocationProviderClient;
51 | private static final int REQUEST_CODE = 101;
52 |
53 | GoogleMap myGooglemap;
54 |
55 | public View onCreateView(@NonNull LayoutInflater inflater,
56 | ViewGroup container, Bundle savedInstanceState) {
57 | View view = inflater.inflate(R.layout.activity_map, container, false);
58 |
59 | fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(getActivity());
60 | fetchLocation();
61 |
62 | return view;
63 | }
64 |
65 |
66 | private void fetchLocation() {
67 | if (ActivityCompat.checkSelfPermission(
68 | getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(
69 | getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
70 | ActivityCompat.requestPermissions(getActivity(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_CODE);
71 | return;
72 | }
73 | CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
74 | Task task = fusedLocationProviderClient.getCurrentLocation(Priority.PRIORITY_HIGH_ACCURACY, cancellationTokenSource.getToken())
75 | .addOnSuccessListener(getActivity(), new OnSuccessListener() {
76 | @Override
77 | public void onSuccess(Location location) {
78 | if (location != null) {
79 | }
80 | }
81 | });
82 |
83 | task.addOnSuccessListener(new OnSuccessListener() {
84 | @Override
85 | public void onSuccess(Location location) {
86 | if (location != null) {
87 | currentLocation = location;
88 | SupportMapFragment mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map_activity);
89 | mapFragment.getMapAsync(MapFragment.this);
90 |
91 | assert mapFragment != null;
92 | }
93 | }
94 | });
95 | }
96 |
97 | @Override
98 | public void onDestroyView() {
99 | super.onDestroyView();
100 | binding = null;
101 | }
102 |
103 |
104 | @Override
105 | public void onMapReady(@NonNull GoogleMap googleMap) {
106 | myGooglemap = googleMap;
107 |
108 | FirebaseDatabase database = FirebaseDatabase.getInstance();
109 | DatabaseReference reference = database.getReference("locations");
110 | reference.addValueEventListener(new ValueEventListener() {
111 | @Override
112 | public void onDataChange(@NonNull DataSnapshot snapshot) {
113 | if(myGooglemap != null)
114 | {
115 | for (DataSnapshot dsp : snapshot.getChildren()) {
116 | LocationMarker locationMarker = dsp.getValue(LocationMarker.class);
117 | UpdateMap(locationMarker);
118 | }
119 | }
120 | }
121 |
122 | @Override
123 | public void onCancelled(@NonNull DatabaseError error) {
124 |
125 | }
126 | });
127 |
128 | googleMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
129 | public boolean onMarkerClick(Marker marker) {
130 | String markerTitle = marker.getTitle();
131 |
132 | if(!markerTitle.contains("here!"))
133 | {
134 | Intent intent = new Intent(getActivity(), MapDetailActivity.class);
135 | intent.putExtra("markerTitle", markerTitle);
136 | startActivity(intent);
137 | }
138 |
139 | return false;
140 | }
141 | });
142 |
143 | LatLng latLng = new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude());
144 | MarkerOptions markerOptions = new MarkerOptions().position(latLng).title("I am here!").icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_CYAN));
145 | googleMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));
146 | googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 5));
147 | googleMap.addMarker(markerOptions);
148 |
149 | googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 13));
150 |
151 | }
152 |
153 | void UpdateMap(LocationMarker locationMarker)
154 | {
155 | if(myGooglemap != null)
156 | {
157 | LatLng loc = new LatLng(locationMarker.getLat(), locationMarker.getLng());
158 | myGooglemap.addMarker(new MarkerOptions()
159 | .position(loc)
160 | .title(locationMarker.getTitle()));
161 | }
162 | }
163 |
164 | }
165 |
166 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/myrecipebook/ui/slideshow/MyRecipeFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.myrecipebook.ui.slideshow;
2 |
3 | import android.os.Bundle;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.AdapterView;
8 | import android.widget.ArrayAdapter;
9 | import android.widget.Spinner;
10 | import android.widget.Toast;
11 |
12 | import androidx.annotation.NonNull;
13 | import androidx.fragment.app.Fragment;
14 | import androidx.recyclerview.widget.LinearLayoutManager;
15 | import androidx.recyclerview.widget.RecyclerView;
16 |
17 | import com.example.myrecipebook.R;
18 | import com.example.myrecipebook.adapters.CategoryAdapter;
19 | import com.example.myrecipebook.adapters.MyRecipesAdapter;
20 | import com.example.myrecipebook.models.DetailRecipeModel;
21 | import com.google.android.material.floatingactionbutton.FloatingActionButton;
22 | import com.google.firebase.auth.FirebaseAuth;
23 | import com.google.firebase.database.DataSnapshot;
24 | import com.google.firebase.database.DatabaseError;
25 | import com.google.firebase.database.DatabaseReference;
26 | import com.google.firebase.database.FirebaseDatabase;
27 | import com.google.firebase.database.GenericTypeIndicator;
28 | import com.google.firebase.database.ValueEventListener;
29 |
30 | import java.util.ArrayList;
31 | import java.util.List;
32 |
33 | public class MyRecipeFragment extends Fragment implements AdapterView.OnItemSelectedListener{
34 |
35 | RecyclerView recyclerView;
36 | List dataRecipeList;
37 | MyRecipesAdapter myRecipesAdapter;
38 | FloatingActionButton deleteButton, editButton;
39 |
40 | public View onCreateView(@NonNull LayoutInflater inflater,
41 | ViewGroup container, Bundle savedInstanceState) {
42 |
43 | View root = inflater.inflate(R.layout.fragment_my_category, container, false);
44 |
45 | Bundle bundle = getArguments();
46 |
47 | String categoryName = "All";
48 |
49 | if (bundle != null) {
50 | categoryName = bundle.getString("categoryName");
51 | }
52 | Spinner spinner = root.findViewById(R.id.spinner_my_category);
53 | ArrayAdapter adapter = ArrayAdapter.createFromResource(this.getContext(), R.array.spinner_cate, android.R.layout.simple_spinner_item);
54 | adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
55 | spinner.setAdapter(adapter);
56 | spinner.setOnItemSelectedListener(this);
57 |
58 | recyclerView = root.findViewById(R.id.my_category_recipes_recList);
59 |
60 | recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
61 |
62 | dataRecipeList = new ArrayList<>();
63 |
64 | FirebaseDatabase database = FirebaseDatabase.getInstance();
65 |
66 | DatabaseReference recipeRef = database.getReference("Recipes");
67 |
68 | //listener to "Recipes" node that listens for changes to the data at this node
69 | recipeRef.addValueEventListener(new ValueEventListener() {
70 | @Override
71 | public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
72 | dataRecipeList.clear();
73 | System.out.println("children count "+dataSnapshot.getChildrenCount());
74 |
75 | //iterate through each child node of "Recipes" using DataSnapshot.getChildren()
76 | //For each child node, the code retrieves the values of the child
77 | for (DataSnapshot recipeSnapshot : dataSnapshot.getChildren()) {
78 | String recipeName = recipeSnapshot.child("name").getValue(String.class);
79 | String recipeUser = recipeSnapshot.child("user").getValue(String.class);
80 | String user = recipeSnapshot.child("user").getValue(String.class);
81 | String recipeTotalTime = "";
82 | if (recipeSnapshot.child("totalTime").getValue(String.class).charAt(0) != '-')
83 | recipeTotalTime = recipeSnapshot.child("totalTime").getValue(String.class);
84 | String recipeIngredients = recipeSnapshot.child("ingredients").getValue(String.class);
85 | String recipeInstruction = recipeSnapshot.child("instruction").getValue(String.class);
86 | List recipeCategory = recipeSnapshot.child("category").getValue(new GenericTypeIndicator>() {});
87 | List recipeHealthLabels = recipeSnapshot.child("healthLabels").getValue(new GenericTypeIndicator>() {});
88 | String imageUrl = recipeSnapshot.child("imageUrl").getValue(String.class);
89 | //The retrieved values are then used to create a new DetailRecipeModel object and added to the dataRecipeList ArrayList.
90 | DetailRecipeModel recipeModel = new DetailRecipeModel(user, recipeName, recipeCategory, recipeHealthLabels, recipeIngredients, recipeInstruction, recipeTotalTime, imageUrl);
91 | dataRecipeList.add(recipeModel);
92 | }
93 | filterList(spinner.getSelectedItem().toString());
94 |
95 | myRecipesAdapter.notifyDataSetChanged(); // update the adapter with the new data
96 | }
97 |
98 | @Override
99 | public void onCancelled(@NonNull DatabaseError databaseError) {
100 | System.out.println(databaseError);
101 | }
102 | });
103 |
104 | // creates a new instance of a custom adapter, passing the Context object and a list of recipe data
105 | myRecipesAdapter= new MyRecipesAdapter(getContext(), dataRecipeList);
106 | recyclerView.setAdapter(myRecipesAdapter);
107 | //retrieves the index position of a particular item in a spinner widget's list of items
108 | //getPosition() method is called on a separate adapter instance (called adapter) which is associated with spinner widget
109 | int index = adapter.getPosition(categoryName);
110 | //This line sets the selection of the spinner widget to the item at the retrieved index position. (display the item at this position as its selected item)
111 | spinner.setSelection(index);
112 | myRecipesAdapter.notifyDataSetChanged();
113 | return root;
114 | }
115 |
116 | @Override
117 | public void onItemSelected(AdapterView> parent, View view, int position, long id) {
118 | String text = parent.getItemAtPosition(position).toString();
119 | Toast.makeText(parent.getContext(), text, Toast.LENGTH_SHORT).show();
120 |
121 | String selectedCategory = parent.getItemAtPosition(position).toString();
122 | filterList(selectedCategory);
123 | }
124 |
125 | @Override
126 | public void onNothingSelected(AdapterView> parent) {
127 |
128 | }
129 |
130 | public void filterList (String selectedCategory) {
131 | List filteredRecipeList = new ArrayList<>();
132 | String curUser = FirebaseAuth.getInstance().getUid();
133 | for (DetailRecipeModel recipe : dataRecipeList) {
134 | if (recipe.getUser().equals(curUser)) {
135 | if (recipe.getCategory().contains(selectedCategory.toLowerCase()) || selectedCategory.equals("All")) {
136 | filteredRecipeList.add(recipe);
137 | }
138 | }
139 | }
140 | myRecipesAdapter.updateList(filteredRecipeList);
141 | }
142 | }
--------------------------------------------------------------------------------