├── .gitignore ├── .idea ├── .gitignore ├── compiler.xml ├── deploymentTargetDropDown.xml ├── gradle.xml ├── misc.xml ├── render.experimental.xml └── vcs.xml ├── Databases ├── English DB │ ├── Crops_DB.xlsx │ ├── Diseases And Control.xlsx │ ├── Flowers_DB.xlsx │ ├── Fruits_DB.xlsx │ ├── How_To_Expand_DB.xlsx │ └── Insect_and_control.xlsx └── Hindi DB │ ├── Crops_DB.xlsx │ ├── Diseases And Control.xlsx │ ├── Flowers_DB.xlsx │ ├── Fruits_DB.xlsx │ ├── How_To_Expand_DB.xlsx │ └── Insect_and_control.xlsx ├── README.md ├── app ├── .gitignore ├── build.gradle ├── google-services.json ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── project │ │ └── agroworld │ │ └── ExampleInstrumentedTest.java │ ├── debug │ ├── ic_launcher-playstore.png │ └── res │ │ ├── drawable │ │ ├── baseline_access_time_filled_24.xml │ │ ├── baseline_add_location_alt_24.xml │ │ ├── baseline_calendar_month_24.xml │ │ ├── baseline_email_24.xml │ │ ├── baseline_flag_24.xml │ │ ├── baseline_history_24.xml │ │ ├── baseline_language_24.xml │ │ ├── baseline_live_help_24.xml │ │ ├── baseline_logout_24.xml │ │ ├── baseline_my_location_24.xml │ │ ├── baseline_remove_circle_24.xml │ │ ├── baseline_shopping_cart_24.xml │ │ ├── couldy_sky1.jpeg │ │ ├── ic_launcher_background.xml │ │ ├── left_chat_bg.xml │ │ ├── search_bg.xml │ │ ├── send.png │ │ ├── sky2_bg.jpeg │ │ ├── sky_bg.jpeg │ │ └── weather_sky_light.jpeg │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ │ └── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── project │ │ │ └── agroworldapp │ │ │ ├── articles │ │ │ ├── activity │ │ │ │ ├── ArticleDetailsActivity.java │ │ │ │ ├── CropsActivity.java │ │ │ │ ├── DiseasesActivity.java │ │ │ │ ├── DiseasesDetailsActivity.java │ │ │ │ ├── FlowersActivity.java │ │ │ │ ├── FruitsActivity.java │ │ │ │ └── HowToExpandActivity.java │ │ │ ├── adapter │ │ │ │ ├── CropsAdapter.java │ │ │ │ ├── DiseaseAdapter.java │ │ │ │ ├── FlowersAdapter.java │ │ │ │ ├── FruitsAdapter.java │ │ │ │ ├── HowToExpandAdapter.java │ │ │ │ └── InsectControlAdapter.java │ │ │ ├── listener │ │ │ │ ├── CropsClickListener.java │ │ │ │ ├── DiseasesListener.java │ │ │ │ ├── ExpandClickListener.java │ │ │ │ ├── FlowerClickListener.java │ │ │ │ ├── FruitsClickListener.java │ │ │ │ └── InsectControlListener.java │ │ │ ├── model │ │ │ │ ├── CropsResponse.java │ │ │ │ ├── DiseasesResponse.java │ │ │ │ ├── FlowersResponse.java │ │ │ │ ├── FruitsResponse.java │ │ │ │ ├── HowToExpandResponse.java │ │ │ │ ├── InsectControlResponse.java │ │ │ │ └── TechniquesResponse.java │ │ │ └── viewholder │ │ │ │ ├── ArticleListViewHolder.java │ │ │ │ └── DiseasesViewHolder.java │ │ │ ├── chatbot │ │ │ ├── ChatBotActivity.java │ │ │ ├── ChatBotAdapter.java │ │ │ ├── ChatBotListener.java │ │ │ ├── ChatBotModel.java │ │ │ ├── ChatBotViewHolder.java │ │ │ └── PerformRequest.java │ │ │ ├── db │ │ │ ├── FarmerDAO.java │ │ │ ├── FarmerDatabase.java │ │ │ ├── FarmerModel.java │ │ │ └── PreferenceHelper.java │ │ │ ├── manufacture │ │ │ ├── activity │ │ │ │ ├── ManufactureActivity.java │ │ │ │ └── ManufactureDataActivity.java │ │ │ ├── adapter │ │ │ │ └── ProductAdapter.java │ │ │ ├── listener │ │ │ │ └── ManufactureAdminListener.java │ │ │ └── viewholder │ │ │ │ ├── ProductAdminViewHolder.java │ │ │ │ └── ProductViewHolder.java │ │ │ ├── network │ │ │ ├── APIService.java │ │ │ └── Network.java │ │ │ ├── payment │ │ │ ├── activities │ │ │ │ ├── PaymentDetailsActivity.java │ │ │ │ └── PaymentHistoryActivity.java │ │ │ ├── adapter │ │ │ │ ├── HistoryAdapter.java │ │ │ │ └── HistoryListener.java │ │ │ ├── model │ │ │ │ └── PaymentModel.java │ │ │ └── viewholder │ │ │ │ └── HistoryViewHolder.java │ │ │ ├── shopping │ │ │ ├── activity │ │ │ │ ├── AddToCartActivity.java │ │ │ │ └── ProductDetailActivity.java │ │ │ ├── adapter │ │ │ │ └── ProductCartAdapter.java │ │ │ ├── listener │ │ │ │ ├── ItemCartActionListener.java │ │ │ │ └── OnProductListener.java │ │ │ ├── model │ │ │ │ └── ProductModel.java │ │ │ └── viewholder │ │ │ │ └── CartViewHolder.java │ │ │ ├── taskmanager │ │ │ ├── MusicControl.java │ │ │ ├── activity │ │ │ │ └── AddTaskActivity.java │ │ │ ├── adapter │ │ │ │ └── FarmerAdapter.java │ │ │ ├── listener │ │ │ │ └── OnItemClickListener.java │ │ │ ├── model │ │ │ │ ├── DateModel.java │ │ │ │ └── TimeModel.java │ │ │ ├── receiver │ │ │ │ ├── EventReceiver.java │ │ │ │ └── SnoozeReceiver.java │ │ │ ├── repository │ │ │ │ └── DatabaseRepository.java │ │ │ ├── viewholder │ │ │ │ └── FarmerViewHolder.java │ │ │ └── viewmodel │ │ │ │ └── FarmerViewModel.java │ │ │ ├── transport │ │ │ ├── activity │ │ │ │ ├── TransportActivity.java │ │ │ │ └── TransportDataActivity.java │ │ │ ├── adapter │ │ │ │ ├── OnVehicleCallClick.java │ │ │ │ └── VehicleAdapter.java │ │ │ ├── listener │ │ │ │ └── AdminListener.java │ │ │ ├── model │ │ │ │ └── VehicleModel.java │ │ │ └── viewHolder │ │ │ │ ├── VehicleAdminViewHolder.java │ │ │ │ └── VehicleViewHolder.java │ │ │ ├── ui │ │ │ ├── activity │ │ │ │ ├── DashboardActivity.java │ │ │ │ ├── SignInActivity.java │ │ │ │ ├── SignUpActivity.java │ │ │ │ ├── SplashScreen.java │ │ │ │ └── UserProfileActivity.java │ │ │ ├── adapter │ │ │ │ └── FragmentAdapter.java │ │ │ ├── fragments │ │ │ │ ├── EducationFragment.java │ │ │ │ ├── HomeFragment.java │ │ │ │ ├── NewsFragment.java │ │ │ │ ├── ProfileFragment.java │ │ │ │ ├── ShoppingFragment.java │ │ │ │ └── TransportFragment.java │ │ │ └── repository │ │ │ │ └── AgroWorldRepositoryImpl.java │ │ │ ├── utils │ │ │ ├── CircleProgressBar.java │ │ │ ├── Constants.java │ │ │ ├── CustomMultiColorProgressBar.java │ │ │ ├── DialogUtils.java │ │ │ ├── MaterialProgressDrawable.java │ │ │ ├── NotificationHelper.java │ │ │ ├── Permissions.java │ │ │ └── Resource.java │ │ │ ├── viewmodel │ │ │ ├── AgroViewModel.java │ │ │ └── AgroWorldViewModelFactory.java │ │ │ └── weather │ │ │ ├── activity │ │ │ ├── WeatherActivity.java │ │ │ └── WeatherForecastActivity.java │ │ │ ├── adapter │ │ │ └── WeatherForecastAdapter.java │ │ │ ├── listener │ │ │ └── WeatherForecastListener.java │ │ │ ├── model │ │ │ ├── weather_data │ │ │ │ ├── Clouds.java │ │ │ │ ├── Coord.java │ │ │ │ ├── Main.java │ │ │ │ ├── Sys.java │ │ │ │ ├── WeatherItem.java │ │ │ │ ├── WeatherResponse.java │ │ │ │ └── Wind.java │ │ │ └── weatherlist │ │ │ │ ├── City.java │ │ │ │ ├── Clouds.java │ │ │ │ ├── Coord.java │ │ │ │ ├── ListItem.java │ │ │ │ ├── Main.java │ │ │ │ ├── Sys.java │ │ │ │ ├── WeatherDatesResponse.java │ │ │ │ ├── WeatherItem.java │ │ │ │ └── Wind.java │ │ │ └── viewholder │ │ │ └── WeatherForecastViewHolder.java │ └── res │ │ ├── anim │ │ ├── down.xml │ │ └── up.xml │ │ ├── drawable-v24 │ │ └── button_bgd.xml │ │ ├── drawable │ │ ├── all_buttons.xml │ │ ├── app_icon4.png │ │ ├── background_shape.xml │ │ ├── baseline_language_24.xml │ │ ├── baseline_logout_24.xml │ │ ├── baseline_more_vert_24.xml │ │ ├── cart_bottom_bg.xml │ │ ├── disease.png │ │ ├── expand.jpeg │ │ ├── farmer_in.jpeg │ │ ├── findingtwo.png │ │ ├── flowers.jpeg │ │ ├── fruits.png │ │ ├── ic_baseline_add_circle_24.xml │ │ ├── ic_baseline_call_24.xml │ │ ├── ic_baseline_cancel_24.xml │ │ ├── ic_baseline_emoji_transportation_24.xml │ │ ├── ic_baseline_home_24.xml │ │ ├── ic_baseline_menu_book_24.xml │ │ ├── ic_baseline_newspaper_24.xml │ │ ├── ic_baseline_person_24.xml │ │ ├── ic_baseline_photo_camera_24.xml │ │ ├── ic_baseline_search_24.xml │ │ ├── ic_baseline_shop_two_24.xml │ │ ├── ic_baseline_warning_24.xml │ │ ├── ic_launcher_background.xml │ │ ├── item_crt_price.xml │ │ ├── item_view_bgd.xml │ │ ├── navigation_background.xml │ │ ├── payment.png │ │ ├── plant3.png │ │ ├── search_bgd.xml │ │ ├── side_white_panel.xml │ │ └── weather.png │ │ ├── font │ │ ├── average_sans.xml │ │ ├── averia_libre_bold.xml │ │ ├── cantora_one.xml │ │ ├── coiny.xml │ │ ├── copse.xml │ │ ├── days_one.xml │ │ ├── fredoka_one.xml │ │ ├── lemon.xml │ │ ├── lexend_bold.xml │ │ ├── new_rocker.xml │ │ ├── poppins_medium.xml │ │ └── rowdies.xml │ │ ├── layout │ │ ├── activity_add_task.xml │ │ ├── activity_add_to_cart.xml │ │ ├── activity_article_details.xml │ │ ├── activity_chatbot.xml │ │ ├── activity_crops.xml │ │ ├── activity_dashboard.xml │ │ ├── activity_diseases.xml │ │ ├── activity_diseases_details.xml │ │ ├── activity_flowers.xml │ │ ├── activity_fruits.xml │ │ ├── activity_how_to_expand.xml │ │ ├── activity_login.xml │ │ ├── activity_main.xml │ │ ├── activity_manufacture.xml │ │ ├── activity_manufacture_data.xml │ │ ├── activity_manufacture_data_post.xml │ │ ├── activity_payment_details.xml │ │ ├── activity_payment_history.xml │ │ ├── activity_product_detail.xml │ │ ├── activity_sign_up.xml │ │ ├── activity_transport.xml │ │ ├── activity_transport_data.xml │ │ ├── activity_weather.xml │ │ ├── activity_weather_forecast.xml │ │ ├── article_item_layout.xml │ │ ├── cart_item_layout.xml │ │ ├── dialog_custom_multicolor_progressbar.xml │ │ ├── dialog_warning.xml │ │ ├── farmer_item_layout.xml │ │ ├── forecast_item_layout.xml │ │ ├── fragment_education.xml │ │ ├── fragment_home.xml │ │ ├── fragment_news.xml │ │ ├── fragment_profile.xml │ │ ├── fragment_shopping.xml │ │ ├── fragment_transport.xml │ │ ├── message.xml │ │ ├── product_admin_layout.xml │ │ ├── product_item_layout.xml │ │ ├── shimmer_layout.xml │ │ ├── transaction_item_layout.xml │ │ ├── transport_admin_layout.xml │ │ ├── transport_item_layout.xml │ │ └── vehicle_shimmer.xml │ │ ├── menu │ │ ├── filter_menu.xml │ │ ├── forecast_menu_item.xml │ │ ├── home_menu.xml │ │ ├── location_menu.xml │ │ ├── logout_menu.xml │ │ ├── priority_menu.xml │ │ ├── profile_menu.xml │ │ ├── shopping_menu.xml │ │ └── transport_menu.xml │ │ ├── raw │ │ └── cool.mp3 │ │ ├── values-hi │ │ └── strings.xml │ │ ├── values-land │ │ ├── dimens.xml │ │ ├── style.xml │ │ └── styles.xml │ │ ├── values-night │ │ └── themes.xml │ │ ├── values-w1240dp │ │ └── dimens.xml │ │ ├── values-w600dp │ │ └── dimens.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── font_certs.xml │ │ ├── preloaded_fonts.xml │ │ ├── strings.xml │ │ └── themes.xml │ │ └── xml │ │ ├── backup_rules.xml │ │ └── data_extraction_rules.xml │ └── test │ └── java │ └── com │ └── project │ └── agroworld │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.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 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/deploymentTargetDropDown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /.idea/render.experimental.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Databases/English DB/Crops_DB.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/Databases/English DB/Crops_DB.xlsx -------------------------------------------------------------------------------- /Databases/English DB/Diseases And Control.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/Databases/English DB/Diseases And Control.xlsx -------------------------------------------------------------------------------- /Databases/English DB/Flowers_DB.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/Databases/English DB/Flowers_DB.xlsx -------------------------------------------------------------------------------- /Databases/English DB/Fruits_DB.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/Databases/English DB/Fruits_DB.xlsx -------------------------------------------------------------------------------- /Databases/English DB/How_To_Expand_DB.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/Databases/English DB/How_To_Expand_DB.xlsx -------------------------------------------------------------------------------- /Databases/English DB/Insect_and_control.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/Databases/English DB/Insect_and_control.xlsx -------------------------------------------------------------------------------- /Databases/Hindi DB/Crops_DB.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/Databases/Hindi DB/Crops_DB.xlsx -------------------------------------------------------------------------------- /Databases/Hindi DB/Diseases And Control.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/Databases/Hindi DB/Diseases And Control.xlsx -------------------------------------------------------------------------------- /Databases/Hindi DB/Flowers_DB.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/Databases/Hindi DB/Flowers_DB.xlsx -------------------------------------------------------------------------------- /Databases/Hindi DB/Fruits_DB.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/Databases/Hindi DB/Fruits_DB.xlsx -------------------------------------------------------------------------------- /Databases/Hindi DB/How_To_Expand_DB.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/Databases/Hindi DB/How_To_Expand_DB.xlsx -------------------------------------------------------------------------------- /Databases/Hindi DB/Insect_and_control.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/Databases/Hindi DB/Insect_and_control.xlsx -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # **Agro World** 3 | It is a farming application that helps farmers to track climate data and forecast information as well as find manufacturers and transporters from which the farmer can purchase seeds at an affordable price. The farmer can also communicate with the owner of the vehicle through the application. Additionally, this app provides information regarding crops, flowers, fruits, diseases, and how to expand skills to farmers. Furthermore to this, farmer can view the live farming news with relevant information; the most helpful feature is the Task Manager application, which will assist in reminding farmer when to water, care for plants, and other tasks. It is available in both Hindi and English. 4 | 5 | # 🔗Open-Source Library 6 | 7 | * [Glide](https://github.com/bumptech/glide) 8 | * [Firebase](https://firebase.google.com/docs/auth) 9 | * [LiveData](https://developer.android.com/reference/androidx/lifecycle/LiveData) 10 | * [Retrofit](https://square.github.io/retrofit/) 11 | 12 | # Things I used while making this application 13 | 14 | * GitHub 15 | * Firebase 16 | * ViewPager 17 | * OpenWeatherMap 18 | * GeoCoder 19 | * Razorpay 20 | * Alarm Manager 21 | * Glide 22 | * Retrofit 23 | * JSON 24 | * shimmer 25 | * Fragments 26 | 27 | # Tech Stack ✨ 28 | 29 | * [Android Studio](https://developer.android.com/studio) 30 | * [Java](https://www.java.com/en/) 31 | 32 | # Clone this Repo To Your System Using Android Studio✨ 33 | 34 | * Step 1: Open your Android Studio then go to the File > New > Project from Version Control as shown in the below image. 35 | * Step 2: After clicking on the Project from Version Control a pop-up screen will arise like below. In the Version control choose Git from the drop-down menu. 36 | * Step 3: Then at last paste the link in the URL and choose your Directory. Click on the Clone button and you are done. 37 | 38 | # Developers 👨🏻‍💻 39 | 40 | * [Ashish Gavade](https://www.instagram.com/theashishgavade/) 41 | * [Deven Padhye](https://www.instagram.com/deven_23/) 42 | * [Shubham Khedekar]() 43 | * [Rohit Gupta](https://www.instagram.com/_rohit__gupta_/) 44 | 45 | ## Happy Learning!✨✨ 46 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "110633362018", 4 | "firebase_url": "https://agroworld-963b9-default-rtdb.firebaseio.com", 5 | "project_id": "agroworld-963b9", 6 | "storage_bucket": "agroworld-963b9.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:110633362018:android:a621099191234fa25de73b", 12 | "android_client_info": { 13 | "package_name": "com.project.agroworldapp" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "110633362018-mgamke32ogocroqe8llmeagtr3vg2slr.apps.googleusercontent.com", 19 | "client_type": 1, 20 | "android_info": { 21 | "package_name": "com.project.agroworldapp", 22 | "certificate_hash": "0f9a86268052ad94c64565d35f9685743bd42b0a" 23 | } 24 | }, 25 | { 26 | "client_id": "110633362018-8gp3gj1mebi67lh4euk8sip9n433rtev.apps.googleusercontent.com", 27 | "client_type": 3 28 | } 29 | ], 30 | "api_key": [ 31 | { 32 | "current_key": "AIzaSyDQRMjra2oGEk7sG75xJNtvIU-pXIuS9rE" 33 | } 34 | ], 35 | "services": { 36 | "appinvite_service": { 37 | "other_platform_oauth_client": [ 38 | { 39 | "client_id": "110633362018-2gc18ankqo1a4k2im9n490n0761aobbk.apps.googleusercontent.com", 40 | "client_type": 3 41 | } 42 | ] 43 | } 44 | } 45 | } 46 | ], 47 | "configuration_version": "1" 48 | } -------------------------------------------------------------------------------- /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/androidTest/java/com/project/agroworld/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworld; 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.project.agroworld", appContext.getPackageName()); 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/debug/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/debug/res/drawable/baseline_access_time_filled_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/baseline_add_location_alt_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/baseline_calendar_month_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/baseline_email_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/baseline_flag_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/baseline_history_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/baseline_language_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/baseline_live_help_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/baseline_logout_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/baseline_my_location_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/baseline_remove_circle_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/baseline_shopping_cart_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/couldy_sky1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/drawable/couldy_sky1.jpeg -------------------------------------------------------------------------------- /app/src/debug/res/drawable/left_chat_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/search_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/debug/res/drawable/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/drawable/send.png -------------------------------------------------------------------------------- /app/src/debug/res/drawable/sky2_bg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/drawable/sky2_bg.jpeg -------------------------------------------------------------------------------- /app/src/debug/res/drawable/sky_bg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/drawable/sky_bg.jpeg -------------------------------------------------------------------------------- /app/src/debug/res/drawable/weather_sky_light.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/drawable/weather_sky_light.jpeg -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/debug/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/adapter/CropsAdapter.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.adapter; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.ViewGroup; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.recyclerview.widget.RecyclerView; 8 | 9 | import com.project.agroworldapp.articles.listener.CropsClickListener; 10 | import com.project.agroworldapp.articles.model.CropsResponse; 11 | import com.project.agroworldapp.articles.viewholder.ArticleListViewHolder; 12 | import com.project.agroworldapp.databinding.ArticleItemLayoutBinding; 13 | 14 | import java.util.ArrayList; 15 | 16 | public class CropsAdapter extends RecyclerView.Adapter { 17 | private final ArrayList cropsResponseArrayList; 18 | private final CropsClickListener listener; 19 | 20 | public CropsAdapter(ArrayList cropsResponseArrayList, CropsClickListener listener) { 21 | this.cropsResponseArrayList = cropsResponseArrayList; 22 | this.listener = listener; 23 | } 24 | 25 | @NonNull 26 | @Override 27 | public ArticleListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 28 | return new ArticleListViewHolder(ArticleItemLayoutBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); 29 | } 30 | 31 | @Override 32 | public void onBindViewHolder(@NonNull ArticleListViewHolder holder, int position) { 33 | CropsResponse cropsResponses = cropsResponseArrayList.get(position); 34 | holder.bindCropsData(cropsResponses, listener); 35 | } 36 | 37 | @Override 38 | public int getItemCount() { 39 | return cropsResponseArrayList.size(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/adapter/DiseaseAdapter.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.adapter; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.ViewGroup; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.recyclerview.widget.RecyclerView; 8 | 9 | import com.project.agroworldapp.articles.listener.DiseasesListener; 10 | import com.project.agroworldapp.articles.model.DiseasesResponse; 11 | import com.project.agroworldapp.articles.viewholder.DiseasesViewHolder; 12 | import com.project.agroworldapp.databinding.ArticleItemLayoutBinding; 13 | 14 | import java.util.List; 15 | 16 | public class DiseaseAdapter extends RecyclerView.Adapter { 17 | 18 | private final List diseasesResponseList; 19 | private final DiseasesListener listener; 20 | 21 | public DiseaseAdapter(List diseasesResponseList, DiseasesListener listener) { 22 | this.diseasesResponseList = diseasesResponseList; 23 | this.listener = listener; 24 | } 25 | 26 | @NonNull 27 | @Override 28 | public DiseasesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 29 | return new DiseasesViewHolder(ArticleItemLayoutBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); 30 | } 31 | 32 | @Override 33 | public void onBindViewHolder(@NonNull DiseasesViewHolder holder, int position) { 34 | DiseasesResponse response = diseasesResponseList.get(position); 35 | holder.binDiseasesData(response, listener); 36 | } 37 | 38 | @Override 39 | public int getItemCount() { 40 | return diseasesResponseList.size(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/adapter/FlowersAdapter.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.adapter; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.ViewGroup; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.recyclerview.widget.RecyclerView; 8 | 9 | import com.project.agroworldapp.articles.listener.FlowerClickListener; 10 | import com.project.agroworldapp.articles.model.FlowersResponse; 11 | import com.project.agroworldapp.articles.viewholder.ArticleListViewHolder; 12 | import com.project.agroworldapp.databinding.ArticleItemLayoutBinding; 13 | 14 | import java.util.ArrayList; 15 | 16 | public class FlowersAdapter extends RecyclerView.Adapter { 17 | private final ArrayList flowersResponseArrayList; 18 | private final FlowerClickListener listener; 19 | 20 | public FlowersAdapter(ArrayList flowersResponseArrayList, FlowerClickListener listener) { 21 | this.flowersResponseArrayList = flowersResponseArrayList; 22 | this.listener = listener; 23 | } 24 | 25 | @NonNull 26 | @Override 27 | public ArticleListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 28 | return new ArticleListViewHolder(ArticleItemLayoutBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); 29 | } 30 | 31 | @Override 32 | public void onBindViewHolder(@NonNull ArticleListViewHolder holder, int position) { 33 | FlowersResponse response = flowersResponseArrayList.get(position); 34 | holder.bindFlowersData(response, listener); 35 | } 36 | 37 | @Override 38 | public int getItemCount() { 39 | return flowersResponseArrayList.size(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/adapter/FruitsAdapter.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.adapter; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.ViewGroup; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.recyclerview.widget.RecyclerView; 8 | 9 | import com.project.agroworldapp.articles.listener.FruitsClickListener; 10 | import com.project.agroworldapp.articles.model.FruitsResponse; 11 | import com.project.agroworldapp.articles.viewholder.ArticleListViewHolder; 12 | import com.project.agroworldapp.databinding.ArticleItemLayoutBinding; 13 | 14 | import java.util.ArrayList; 15 | 16 | public class FruitsAdapter extends RecyclerView.Adapter { 17 | private final ArrayList fruitsResponseArrayList; 18 | private final FruitsClickListener listener; 19 | 20 | public FruitsAdapter(ArrayList fruitsResponseArrayList, FruitsClickListener listener) { 21 | this.fruitsResponseArrayList = fruitsResponseArrayList; 22 | this.listener = listener; 23 | } 24 | 25 | @NonNull 26 | @Override 27 | public ArticleListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 28 | return new ArticleListViewHolder(ArticleItemLayoutBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); 29 | } 30 | 31 | @Override 32 | public void onBindViewHolder(@NonNull ArticleListViewHolder holder, int position) { 33 | FruitsResponse response = fruitsResponseArrayList.get(position); 34 | holder.bindFruitsData(response, listener); 35 | } 36 | 37 | @Override 38 | public int getItemCount() { 39 | return fruitsResponseArrayList.size(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/adapter/HowToExpandAdapter.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.adapter; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.ViewGroup; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.recyclerview.widget.RecyclerView; 8 | 9 | import com.project.agroworldapp.articles.listener.ExpandClickListener; 10 | import com.project.agroworldapp.articles.model.HowToExpandResponse; 11 | import com.project.agroworldapp.articles.viewholder.ArticleListViewHolder; 12 | import com.project.agroworldapp.databinding.ArticleItemLayoutBinding; 13 | 14 | import java.util.ArrayList; 15 | 16 | public class HowToExpandAdapter extends RecyclerView.Adapter { 17 | private final ArrayList howToExpandResponseArrayList; 18 | private final ExpandClickListener listener; 19 | 20 | public HowToExpandAdapter(ArrayList howToExpandResponseArrayList, ExpandClickListener listener) { 21 | this.howToExpandResponseArrayList = howToExpandResponseArrayList; 22 | this.listener = listener; 23 | } 24 | 25 | @NonNull 26 | @Override 27 | public ArticleListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 28 | return new ArticleListViewHolder(ArticleItemLayoutBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); 29 | } 30 | 31 | @Override 32 | public void onBindViewHolder(@NonNull ArticleListViewHolder holder, int position) { 33 | HowToExpandResponse cropsResponses = howToExpandResponseArrayList.get(position); 34 | holder.bindHowToExpandData(cropsResponses, listener); 35 | } 36 | 37 | @Override 38 | public int getItemCount() { 39 | return howToExpandResponseArrayList.size(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/adapter/InsectControlAdapter.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.adapter; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.ViewGroup; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.recyclerview.widget.RecyclerView; 8 | 9 | import com.project.agroworldapp.articles.listener.InsectControlListener; 10 | import com.project.agroworldapp.articles.model.InsectControlResponse; 11 | import com.project.agroworldapp.articles.viewholder.DiseasesViewHolder; 12 | import com.project.agroworldapp.databinding.ArticleItemLayoutBinding; 13 | 14 | import java.util.List; 15 | 16 | public class InsectControlAdapter extends RecyclerView.Adapter { 17 | private final List insectControlResponseList; 18 | private final InsectControlListener listener; 19 | 20 | public InsectControlAdapter(List insectControlResponseList, InsectControlListener listener) { 21 | this.insectControlResponseList = insectControlResponseList; 22 | this.listener = listener; 23 | } 24 | 25 | @NonNull 26 | @Override 27 | public DiseasesViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 28 | return new DiseasesViewHolder(ArticleItemLayoutBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); 29 | } 30 | 31 | @Override 32 | public void onBindViewHolder(@NonNull DiseasesViewHolder holder, int position) { 33 | InsectControlResponse response = insectControlResponseList.get(position); 34 | holder.bindInsectControlData(response, listener); 35 | } 36 | 37 | @Override 38 | public int getItemCount() { 39 | return insectControlResponseList.size(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/listener/CropsClickListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.listener; 2 | 3 | import com.project.agroworldapp.articles.model.CropsResponse; 4 | 5 | public interface CropsClickListener { 6 | void onCropsClick(CropsResponse response); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/listener/DiseasesListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.listener; 2 | 3 | import com.project.agroworldapp.articles.model.DiseasesResponse; 4 | 5 | public interface DiseasesListener { 6 | void onDiseaseItemClick(DiseasesResponse response); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/listener/ExpandClickListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.listener; 2 | 3 | import com.project.agroworldapp.articles.model.HowToExpandResponse; 4 | 5 | public interface ExpandClickListener { 6 | void onExpandItemClick(HowToExpandResponse response); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/listener/FlowerClickListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.listener; 2 | 3 | import com.project.agroworldapp.articles.model.FlowersResponse; 4 | 5 | public interface FlowerClickListener { 6 | void onFlowersClick(FlowersResponse response); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/listener/FruitsClickListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.listener; 2 | 3 | import com.project.agroworldapp.articles.model.FruitsResponse; 4 | 5 | public interface FruitsClickListener { 6 | void onFruitClick(FruitsResponse response); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/listener/InsectControlListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.listener; 2 | 3 | import com.project.agroworldapp.articles.model.InsectControlResponse; 4 | 5 | public interface InsectControlListener { 6 | void onInsectControlItemClick(InsectControlResponse response); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/model/DiseasesResponse.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.model; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | 9 | public class DiseasesResponse implements Serializable { 10 | 11 | @SerializedName("symptoms") 12 | private String symptoms; 13 | 14 | @SerializedName("image_link") 15 | private String imageLink; 16 | 17 | @SerializedName("disease_name") 18 | private String diseaseName; 19 | 20 | @SerializedName("protect") 21 | private String protect; 22 | 23 | @SerializedName("plant_name") 24 | private String plantName; 25 | 26 | public String getSymptoms() { 27 | return symptoms; 28 | } 29 | 30 | public void setSymptoms(String symptoms) { 31 | this.symptoms = symptoms; 32 | } 33 | 34 | public String getImageLink() { 35 | return imageLink; 36 | } 37 | 38 | public void setImageLink(String imageLink) { 39 | this.imageLink = imageLink; 40 | } 41 | 42 | public String getDiseaseName() { 43 | return diseaseName; 44 | } 45 | 46 | public void setDiseaseName(String diseaseName) { 47 | this.diseaseName = diseaseName; 48 | } 49 | 50 | public String getProtect() { 51 | return protect; 52 | } 53 | 54 | public void setProtect(String protect) { 55 | this.protect = protect; 56 | } 57 | 58 | public String getPlantName() { 59 | return plantName; 60 | } 61 | 62 | public void setPlantName(String plantName) { 63 | this.plantName = plantName; 64 | } 65 | 66 | @NonNull 67 | @Override 68 | public String toString() { 69 | return 70 | "DiseasesResponse{" + 71 | "symptoms = '" + symptoms + '\'' + 72 | ",image_link = '" + imageLink + '\'' + 73 | ",disease_name = '" + diseaseName + '\'' + 74 | ",protect = '" + protect + '\'' + 75 | ",plant_name = '" + plantName + '\'' + 76 | "}"; 77 | } 78 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/model/HowToExpandResponse.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.model; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | 9 | public class HowToExpandResponse implements Serializable { 10 | 11 | @SerializedName("irrigation") 12 | private String irrigation; 13 | 14 | @SerializedName("image_link") 15 | private String imageLink; 16 | 17 | @SerializedName("seed") 18 | private String seed; 19 | 20 | @SerializedName("harvesting") 21 | private String harvesting; 22 | 23 | @SerializedName("required_temperature") 24 | private String requiredTemperature; 25 | 26 | @SerializedName("crop_info") 27 | private String cropInfo; 28 | 29 | @SerializedName("crop_name") 30 | private String cropName; 31 | 32 | @SerializedName("season") 33 | private String season; 34 | 35 | @SerializedName("fertilizer") 36 | private String fertilizer; 37 | 38 | public String getIrrigation() { 39 | return irrigation; 40 | } 41 | 42 | public String getImageLink() { 43 | return imageLink; 44 | } 45 | 46 | public String getSeed() { 47 | return seed; 48 | } 49 | 50 | public String getHarvesting() { 51 | return harvesting; 52 | } 53 | 54 | public String getRequiredTemperature() { 55 | return requiredTemperature; 56 | } 57 | 58 | public String getCropInfo() { 59 | return cropInfo; 60 | } 61 | 62 | public String getCropName() { 63 | return cropName; 64 | } 65 | 66 | public String getSeason() { 67 | return season; 68 | } 69 | 70 | public String getFertilizer() { 71 | return fertilizer; 72 | } 73 | 74 | @NonNull 75 | @Override 76 | public String toString() { 77 | return 78 | "HowToExpandResponse{" + 79 | "irrigation = '" + irrigation + '\'' + 80 | ",image_link = '" + imageLink + '\'' + 81 | ",seed = '" + seed + '\'' + 82 | ",harvesting = '" + harvesting + '\'' + 83 | ",required_temperature = '" + requiredTemperature + '\'' + 84 | ",crop_info = '" + cropInfo + '\'' + 85 | ",crop_name = '" + cropName + '\'' + 86 | ",season = '" + season + '\'' + 87 | ",fertilizer = '" + fertilizer + '\'' + 88 | "}"; 89 | } 90 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/model/InsectControlResponse.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.model; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | 9 | public class InsectControlResponse implements Serializable { 10 | 11 | @SerializedName("symptoms") 12 | private String symptoms; 13 | 14 | @SerializedName("image_link") 15 | private String imageLink; 16 | 17 | @SerializedName("insect_name") 18 | private String insectName; 19 | 20 | @SerializedName("protect") 21 | private String protect; 22 | 23 | @SerializedName("plant_name") 24 | private String plantName; 25 | 26 | public String getSymptoms() { 27 | return symptoms; 28 | } 29 | 30 | public void setSymptoms(String symptoms) { 31 | this.symptoms = symptoms; 32 | } 33 | 34 | public String getImageLink() { 35 | return imageLink; 36 | } 37 | 38 | public void setImageLink(String imageLink) { 39 | this.imageLink = imageLink; 40 | } 41 | 42 | public String getInsectName() { 43 | return insectName; 44 | } 45 | 46 | public void setInsectName(String insectName) { 47 | this.insectName = insectName; 48 | } 49 | 50 | public String getProtect() { 51 | return protect; 52 | } 53 | 54 | public void setProtect(String protect) { 55 | this.protect = protect; 56 | } 57 | 58 | public String getPlantName() { 59 | return plantName; 60 | } 61 | 62 | public void setPlantName(String plantName) { 63 | this.plantName = plantName; 64 | } 65 | 66 | @NonNull 67 | @Override 68 | public String toString() { 69 | return 70 | "InsectControlResponse{" + 71 | "symptoms = '" + symptoms + '\'' + 72 | ",image_link = '" + imageLink + '\'' + 73 | ",insect_name = '" + insectName + '\'' + 74 | ",protect = '" + protect + '\'' + 75 | ",plant_name = '" + plantName + '\'' + 76 | "}"; 77 | } 78 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/model/TechniquesResponse.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.model; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | 9 | public class TechniquesResponse implements Serializable { 10 | 11 | @SerializedName("advantages") 12 | private String advantages; 13 | 14 | @SerializedName("image_link") 15 | private String imageLink; 16 | 17 | @SerializedName("reference_link") 18 | private String referenceLink; 19 | 20 | @SerializedName("need_of_it") 21 | private String needOfIt; 22 | 23 | @SerializedName("technique_name") 24 | private String techniqueName; 25 | 26 | @SerializedName("technique_detail") 27 | private String techniqueDetail; 28 | 29 | public String getAdvantages() { 30 | return advantages; 31 | } 32 | 33 | public void setAdvantages(String advantages) { 34 | this.advantages = advantages; 35 | } 36 | 37 | public String getImageLink() { 38 | return imageLink; 39 | } 40 | 41 | public void setImageLink(String imageLink) { 42 | this.imageLink = imageLink; 43 | } 44 | 45 | public String getReferenceLink() { 46 | return referenceLink; 47 | } 48 | 49 | public void setReferenceLink(String referenceLink) { 50 | this.referenceLink = referenceLink; 51 | } 52 | 53 | public String getNeedOfIt() { 54 | return needOfIt; 55 | } 56 | 57 | public void setNeedOfIt(String needOfIt) { 58 | this.needOfIt = needOfIt; 59 | } 60 | 61 | public String getTechniqueName() { 62 | return techniqueName; 63 | } 64 | 65 | public void setTechniqueName(String techniqueName) { 66 | this.techniqueName = techniqueName; 67 | } 68 | 69 | public String getTechniqueDetail() { 70 | return techniqueDetail; 71 | } 72 | 73 | public void setTechniqueDetail(String techniqueDetail) { 74 | this.techniqueDetail = techniqueDetail; 75 | } 76 | 77 | @NonNull 78 | @Override 79 | public String toString() { 80 | return 81 | "FruitsResponse{" + 82 | "advantages = '" + advantages + '\'' + 83 | ",image_link = '" + imageLink + '\'' + 84 | ",reference_link = '" + referenceLink + '\'' + 85 | ",need_of_it = '" + needOfIt + '\'' + 86 | ",technique_name = '" + techniqueName + '\'' + 87 | ",technique_detail = '" + techniqueDetail + '\'' + 88 | "}"; 89 | } 90 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/viewholder/ArticleListViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.viewholder; 2 | 3 | import androidx.recyclerview.widget.RecyclerView; 4 | 5 | import com.project.agroworldapp.articles.listener.CropsClickListener; 6 | import com.project.agroworldapp.articles.listener.ExpandClickListener; 7 | import com.project.agroworldapp.articles.listener.FlowerClickListener; 8 | import com.project.agroworldapp.articles.listener.FruitsClickListener; 9 | import com.project.agroworldapp.articles.model.CropsResponse; 10 | import com.project.agroworldapp.articles.model.FlowersResponse; 11 | import com.project.agroworldapp.articles.model.FruitsResponse; 12 | import com.project.agroworldapp.articles.model.HowToExpandResponse; 13 | import com.project.agroworldapp.databinding.ArticleItemLayoutBinding; 14 | import com.project.agroworldapp.utils.Constants; 15 | 16 | public class ArticleListViewHolder extends RecyclerView.ViewHolder { 17 | 18 | private final ArticleItemLayoutBinding binding; 19 | 20 | public ArticleListViewHolder(ArticleItemLayoutBinding binding) { 21 | super(binding.getRoot()); 22 | this.binding = binding; 23 | } 24 | 25 | public void bindFlowersData(FlowersResponse responses, FlowerClickListener listener) { 26 | 27 | binding.tvTitleArticleItem.setText(responses.getTitle()); 28 | binding.tvSeasonArticleItem.setText(responses.getSeason()); 29 | Constants.bindImage(binding.getRoot(), responses.getImageLink(), binding.ivArticleItem); 30 | binding.crdArticleItem.setOnClickListener(v -> { 31 | listener.onFlowersClick(responses); 32 | }); 33 | } 34 | 35 | public void bindCropsData(CropsResponse responses, CropsClickListener listener) { 36 | binding.tvTitleArticleItem.setText(responses.getTitle()); 37 | binding.tvSeasonArticleItem.setText(responses.getSeason()); 38 | Constants.bindImage(binding.getRoot(), responses.getImageLink(), binding.ivArticleItem); 39 | binding.crdArticleItem.setOnClickListener(v -> { 40 | listener.onCropsClick(responses); 41 | }); 42 | } 43 | 44 | public void bindHowToExpandData(HowToExpandResponse responses, ExpandClickListener listener) { 45 | binding.tvTitleArticleItem.setText(responses.getCropName()); 46 | binding.tvSeasonArticleItem.setText(responses.getSeason()); 47 | Constants.bindImage(binding.getRoot(), responses.getImageLink(), binding.ivArticleItem); 48 | binding.crdArticleItem.setOnClickListener(v -> { 49 | listener.onExpandItemClick(responses); 50 | }); 51 | } 52 | 53 | public void bindFruitsData(FruitsResponse responses, FruitsClickListener listener) { 54 | binding.tvTitleArticleItem.setText(responses.getTitle()); 55 | binding.tvSeasonArticleItem.setText(responses.getSeason()); 56 | Constants.bindImage(binding.getRoot(), responses.getImageLink(), binding.ivArticleItem); 57 | binding.crdArticleItem.setOnClickListener(v -> { 58 | listener.onFruitClick(responses); 59 | }); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/articles/viewholder/DiseasesViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.articles.viewholder; 2 | 3 | import androidx.recyclerview.widget.RecyclerView; 4 | 5 | import com.project.agroworldapp.articles.listener.DiseasesListener; 6 | import com.project.agroworldapp.articles.listener.InsectControlListener; 7 | import com.project.agroworldapp.articles.model.DiseasesResponse; 8 | import com.project.agroworldapp.articles.model.InsectControlResponse; 9 | import com.project.agroworldapp.databinding.ArticleItemLayoutBinding; 10 | import com.project.agroworldapp.utils.Constants; 11 | 12 | public class DiseasesViewHolder extends RecyclerView.ViewHolder { 13 | 14 | ArticleItemLayoutBinding binding; 15 | 16 | public DiseasesViewHolder(ArticleItemLayoutBinding binding) { 17 | super(binding.getRoot()); 18 | this.binding = binding; 19 | } 20 | 21 | public void binDiseasesData(DiseasesResponse response, DiseasesListener listener) { 22 | binding.tvTitleArticleItem.setText(response.getDiseaseName()); 23 | binding.tvSeasonArticleItem.setText(response.getPlantName()); 24 | Constants.bindImage(binding.ivArticleItem, response.getImageLink(), binding.ivArticleItem); 25 | binding.crdArticleItem.setOnClickListener(v -> { 26 | listener.onDiseaseItemClick(response); 27 | }); 28 | } 29 | 30 | public void bindInsectControlData(InsectControlResponse response, InsectControlListener listener) { 31 | binding.tvTitleArticleItem.setText(response.getInsectName()); 32 | binding.tvSeasonArticleItem.setText(response.getPlantName()); 33 | Constants.bindImage(binding.ivArticleItem, response.getImageLink(), binding.ivArticleItem); 34 | binding.crdArticleItem.setOnClickListener(v -> { 35 | listener.onInsectControlItemClick(response); 36 | }); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/chatbot/ChatBotAdapter.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.chatbot; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | 7 | import androidx.annotation.NonNull; 8 | import androidx.recyclerview.widget.RecyclerView; 9 | 10 | 11 | import com.project.agroworldapp.R; 12 | 13 | import java.util.ArrayList; 14 | 15 | public class ChatBotAdapter extends RecyclerView.Adapter { 16 | private final ArrayList chatBotModels; 17 | 18 | public ChatBotAdapter(ArrayList chatBotModels) { 19 | this.chatBotModels = chatBotModels; 20 | } 21 | 22 | @NonNull 23 | @Override 24 | public ChatBotViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 25 | View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.message, parent, false); 26 | return new ChatBotViewHolder(itemView); 27 | } 28 | 29 | @Override 30 | public void onBindViewHolder(@NonNull ChatBotViewHolder holder, int position) { 31 | String message = chatBotModels.get(position).getMessage(); 32 | boolean type = chatBotModels.get(position).getType(); 33 | holder.bindMessageData(message, type); 34 | } 35 | 36 | @Override 37 | public int getItemCount() { 38 | return chatBotModels.size(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/chatbot/ChatBotListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.chatbot; 2 | 3 | public interface ChatBotListener { 4 | void onError(String message); 5 | 6 | void onResponse(String reply); 7 | } 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/chatbot/ChatBotModel.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.chatbot; 2 | 3 | public class ChatBotModel { 4 | // Type 0 for sent, 1 for received 5 | private final boolean type; 6 | // Message content 7 | private String message; 8 | 9 | public ChatBotModel(boolean type, String message) { 10 | this.type = type; 11 | this.message = message; 12 | } 13 | 14 | public String getMessage() { 15 | return message; 16 | } 17 | 18 | public void setMessage(String message) { 19 | this.message = message; 20 | } 21 | 22 | public boolean getType() { 23 | return this.type; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/chatbot/ChatBotViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.chatbot; 2 | 3 | import android.view.View; 4 | import android.widget.LinearLayout; 5 | import android.widget.TextView; 6 | 7 | import androidx.recyclerview.widget.RecyclerView; 8 | 9 | import com.project.agroworldapp.R; 10 | 11 | public class ChatBotViewHolder extends RecyclerView.ViewHolder { 12 | private final LinearLayout sentLayout; 13 | private final LinearLayout receivedLayout; 14 | private final TextView sentText; 15 | private final TextView receivedText; 16 | 17 | public ChatBotViewHolder(final View itemView) { 18 | super(itemView); 19 | sentLayout = itemView.findViewById(R.id.sentLayout); 20 | receivedLayout = itemView.findViewById(R.id.receivedLayout); 21 | sentText = itemView.findViewById(R.id.sentTextView); 22 | receivedText = itemView.findViewById(R.id.receivedTextView); 23 | } 24 | 25 | public void bindMessageData(String message, boolean type) { 26 | if (type) { 27 | //If a message is sent 28 | sentLayout.setVisibility(LinearLayout.VISIBLE); 29 | sentText.setText(message); 30 | // Set visibility as GONE to remove the space taken up 31 | receivedLayout.setVisibility(LinearLayout.GONE); 32 | } else { 33 | //Message is received 34 | receivedLayout.setVisibility(LinearLayout.VISIBLE); 35 | receivedText.setText(message); 36 | // Set visibility as GONE to remove the space taken up 37 | sentLayout.setVisibility(LinearLayout.GONE); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/chatbot/PerformRequest.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.chatbot; 2 | 3 | import android.content.Context; 4 | import android.util.Log; 5 | 6 | import com.android.volley.Request; 7 | import com.android.volley.RequestQueue; 8 | import com.android.volley.Response; 9 | import com.android.volley.toolbox.JsonObjectRequest; 10 | import com.android.volley.toolbox.Volley; 11 | import com.project.agroworldapp.BuildConfig; 12 | import com.project.agroworldapp.utils.Constants; 13 | 14 | import org.json.JSONException; 15 | import org.json.JSONObject; 16 | 17 | public class PerformRequest { 18 | private final RequestQueue queue; 19 | private String reply; 20 | private final char[] illegalChars = {'#', '<', '>', '$', '+', '%', '!', '`', '&', 21 | '*', '\'', '\"', '|', '{', '}', '/', '\\', ':', '@'}; 22 | 23 | public PerformRequest(Context context) { 24 | queue = Volley.newRequestQueue(context); 25 | } 26 | 27 | private String formatMessage(String message) { 28 | 29 | message = message.replace(' ', '-'); 30 | for (char illegalChar : illegalChars) { 31 | message = message.replace(illegalChar, '-'); 32 | } 33 | return message; 34 | } 35 | 36 | public void getResponse(String message, final ChatBotListener volleyResponseListener) { 37 | message = formatMessage(message); 38 | String url = "http://api.brainshop.ai/get?bid=" + BuildConfig.BRAIN_ID + "&key=" + BuildConfig.CHAT_BOT_API + "&uid=1&msg=" + message; 39 | Log.d("URL", url); 40 | JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, url, null, 41 | new Response.Listener() { 42 | @Override 43 | public void onResponse(JSONObject response) { 44 | try { 45 | reply = response.getString("cnt"); 46 | Log.d("RESPONSE", reply); 47 | volleyResponseListener.onResponse(reply); 48 | 49 | } catch (JSONException e) { 50 | e.printStackTrace(); 51 | volleyResponseListener.onError("JSON Exception"); 52 | } 53 | 54 | } 55 | }, 56 | error -> { 57 | error.printStackTrace(); 58 | volleyResponseListener.onError("Volley Error"); 59 | }); 60 | queue.add(request); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/db/FarmerDAO.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.db; 2 | 3 | 4 | import androidx.lifecycle.LiveData; 5 | import androidx.room.Dao; 6 | import androidx.room.Delete; 7 | import androidx.room.Insert; 8 | import androidx.room.Query; 9 | import androidx.room.Update; 10 | 11 | import java.util.List; 12 | 13 | @Dao 14 | public interface FarmerDAO { 15 | 16 | @Insert 17 | void insert(FarmerModel model); 18 | 19 | @Update 20 | void update(FarmerModel model); 21 | 22 | @Delete 23 | void delete(FarmerModel model); 24 | 25 | @Query("DELETE FROM farmer_table") 26 | void deleteRoutines(); 27 | 28 | @Query("SELECT * FROM farmer_table ORDER BY id DESC") 29 | LiveData> getFarmerRoutines(); 30 | 31 | @Query("SELECT MAX(id) FROM farmer_table") 32 | LiveData getMaxCount(); 33 | 34 | 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/db/FarmerDatabase.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.db; 2 | 3 | import android.content.Context; 4 | import android.os.AsyncTask; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.room.Database; 8 | import androidx.room.Room; 9 | import androidx.room.RoomDatabase; 10 | import androidx.sqlite.db.SupportSQLiteDatabase; 11 | 12 | @Database(entities = {FarmerModel.class}, version = 1) 13 | public abstract class FarmerDatabase extends RoomDatabase { 14 | 15 | private static FarmerDatabase instance; 16 | private static final RoomDatabase.Callback roomCallback = new RoomDatabase.Callback() { 17 | @Override 18 | public void onCreate(@NonNull SupportSQLiteDatabase db) { 19 | super.onCreate(db); 20 | new PopulateDbAsyncTask(instance).execute(); 21 | } 22 | }; 23 | 24 | public static synchronized FarmerDatabase getInstance(Context context) { 25 | 26 | if (instance == null) { 27 | 28 | instance = Room.databaseBuilder(context.getApplicationContext(), 29 | FarmerDatabase.class, "farmer_database") 30 | .fallbackToDestructiveMigration() 31 | .addCallback(roomCallback) 32 | .build(); 33 | } 34 | return instance; 35 | } 36 | 37 | public abstract FarmerDAO taskDao(); 38 | 39 | private static class PopulateDbAsyncTask extends AsyncTask { 40 | PopulateDbAsyncTask(FarmerDatabase instance) { 41 | FarmerDAO dao = instance.taskDao(); 42 | } 43 | 44 | @Override 45 | protected Void doInBackground(Void... voids) { 46 | return null; 47 | } 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/db/FarmerModel.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.db; 2 | 3 | import androidx.room.ColumnInfo; 4 | import androidx.room.Entity; 5 | import androidx.room.PrimaryKey; 6 | 7 | import java.io.Serializable; 8 | 9 | @Entity(tableName = "farmer_table") 10 | public class FarmerModel implements Serializable { 11 | 12 | @PrimaryKey(autoGenerate = true) 13 | private int id; 14 | @ColumnInfo(name = "task") 15 | private String task; 16 | 17 | @ColumnInfo(name = "desc") 18 | private String desc; 19 | 20 | @ColumnInfo(name = "date") 21 | private String date; 22 | 23 | @ColumnInfo(name = "time") 24 | private String time; 25 | 26 | public int getId() { 27 | return id; 28 | } 29 | 30 | public void setId(int id) { 31 | this.id = id; 32 | } 33 | 34 | public String getTask() { 35 | return task; 36 | } 37 | 38 | public void setTask(String task) { 39 | this.task = task; 40 | } 41 | 42 | public String getDesc() { 43 | return desc; 44 | } 45 | 46 | public void setDesc(String desc) { 47 | this.desc = desc; 48 | } 49 | 50 | public String getDate() { 51 | return date; 52 | } 53 | 54 | public void setDate(String date) { 55 | this.date = date; 56 | } 57 | 58 | public String getTime() { 59 | return time; 60 | } 61 | 62 | public void setTime(String time) { 63 | this.time = time; 64 | } 65 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/db/PreferenceHelper.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.db; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | 6 | public class PreferenceHelper { 7 | private static PreferenceHelper preferenceHelper; 8 | private SharedPreferences sharedPreferences; 9 | 10 | private PreferenceHelper(Context context) { 11 | if (context != null) { 12 | sharedPreferences = context.getSharedPreferences("prep_helper", Context.MODE_PRIVATE); 13 | } 14 | } 15 | 16 | public static PreferenceHelper getInstance(Context context) { 17 | if (preferenceHelper == null) { 18 | preferenceHelper = new PreferenceHelper(context); 19 | } 20 | return preferenceHelper; 21 | } 22 | 23 | public void saveData(String key, boolean value) { 24 | SharedPreferences.Editor prefsEditor = sharedPreferences.edit(); 25 | prefsEditor.putBoolean(key, value); 26 | prefsEditor.apply(); 27 | } 28 | 29 | public void saveID(String key, int value) { 30 | SharedPreferences.Editor prefsEditor = sharedPreferences.edit(); 31 | prefsEditor.putInt(key, value); 32 | prefsEditor.apply(); 33 | } 34 | 35 | public int getAlarmID(String key) { 36 | return sharedPreferences.getInt(key, 0); 37 | } 38 | 39 | public boolean getData(String key) { 40 | if (sharedPreferences != null) { 41 | return sharedPreferences.getBoolean(key, false); 42 | } 43 | return false; 44 | } 45 | 46 | public void clearData() { 47 | SharedPreferences.Editor editor = sharedPreferences.edit(); 48 | editor.clear(); 49 | editor.apply(); 50 | } 51 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/manufacture/listener/ManufactureAdminListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.manufacture.listener; 2 | 3 | import com.project.agroworldapp.shopping.model.ProductModel; 4 | 5 | public interface ManufactureAdminListener { 6 | void performOnCardClickAction(ProductModel productModel); 7 | 8 | void performEditAction(ProductModel productModel, int position); 9 | 10 | void performDeleteAction(ProductModel productModel, int position); 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/manufacture/viewholder/ProductAdminViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.manufacture.viewholder; 2 | 3 | import android.content.Context; 4 | import android.widget.PopupMenu; 5 | 6 | import androidx.recyclerview.widget.RecyclerView; 7 | 8 | import com.project.agroworldapp.R; 9 | import com.project.agroworldapp.databinding.ProductAdminLayoutBinding; 10 | import com.project.agroworldapp.manufacture.listener.ManufactureAdminListener; 11 | import com.project.agroworldapp.shopping.model.ProductModel; 12 | import com.project.agroworldapp.utils.Constants; 13 | 14 | public class ProductAdminViewHolder extends RecyclerView.ViewHolder { 15 | 16 | final ProductAdminLayoutBinding binding; 17 | 18 | public ProductAdminViewHolder(ProductAdminLayoutBinding binding) { 19 | super(binding.getRoot()); 20 | this.binding = binding; 21 | } 22 | 23 | public void setData(Context context, ProductModel productModel, ManufactureAdminListener adminListener) { 24 | binding.tvProductName.setText(productModel.getTitle()); 25 | binding.tvProductPrice.setText("₹" + productModel.getPrice()); 26 | Constants.bindImage( 27 | binding.ivProductImage, 28 | productModel.getImageUrl(), 29 | binding.ivProductImage 30 | ); 31 | binding.crdProductView.setOnClickListener(v -> adminListener.performOnCardClickAction(productModel)); 32 | 33 | binding.ivProductMoreOption.setOnClickListener(v -> { 34 | PopupMenu popupMenu = new PopupMenu(context, binding.ivProductMoreOption); 35 | popupMenu.getMenuInflater().inflate(R.menu.transport_menu, popupMenu.getMenu()); 36 | popupMenu.setOnMenuItemClickListener(menuItem -> { 37 | switch (menuItem.getItemId()) { 38 | case R.id.editProductDetails: 39 | adminListener.performEditAction(productModel, getAbsoluteAdapterPosition()); 40 | return true; 41 | case R.id.deleteProductDetails: 42 | adminListener.performDeleteAction(productModel, getAbsoluteAdapterPosition()); 43 | return true; 44 | } 45 | return true; 46 | }); 47 | popupMenu.show(); 48 | }); 49 | 50 | } 51 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/manufacture/viewholder/ProductViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.manufacture.viewholder; 2 | 3 | import androidx.recyclerview.widget.RecyclerView; 4 | 5 | import com.project.agroworldapp.databinding.ProductItemLayoutBinding; 6 | import com.project.agroworldapp.shopping.listener.OnProductListener; 7 | import com.project.agroworldapp.shopping.model.ProductModel; 8 | import com.project.agroworldapp.utils.Constants; 9 | 10 | public class ProductViewHolder extends RecyclerView.ViewHolder { 11 | final ProductItemLayoutBinding binding; 12 | 13 | public ProductViewHolder(ProductItemLayoutBinding binding) { 14 | super(binding.getRoot()); 15 | this.binding = binding; 16 | } 17 | 18 | public void setData(ProductModel productModel, OnProductListener clickListener) { 19 | binding.tvProductName.setText(productModel.getTitle()); 20 | binding.tvProductPrice.setText("₹" + productModel.getPrice()); 21 | Constants.bindImage( 22 | binding.ivProductImage, 23 | productModel.getImageUrl(), 24 | binding.ivProductImage 25 | ); 26 | binding.crdProductView.setOnClickListener(v -> clickListener.onProductClick(productModel)); 27 | 28 | } 29 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/network/APIService.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.network; 2 | 3 | import com.project.agroworldapp.articles.model.CropsResponse; 4 | import com.project.agroworldapp.articles.model.DiseasesResponse; 5 | import com.project.agroworldapp.articles.model.FlowersResponse; 6 | import com.project.agroworldapp.articles.model.FruitsResponse; 7 | import com.project.agroworldapp.articles.model.HowToExpandResponse; 8 | import com.project.agroworldapp.articles.model.InsectControlResponse; 9 | import com.project.agroworldapp.weather.model.weather_data.WeatherResponse; 10 | import com.project.agroworldapp.weather.model.weatherlist.WeatherDatesResponse; 11 | 12 | import java.util.List; 13 | 14 | import retrofit2.Call; 15 | import retrofit2.http.GET; 16 | import retrofit2.http.Query; 17 | 18 | public interface APIService { 19 | //https://api.openweathermap.org/data/2.5/weather?lat=19.075975&lon=72.87738&appid=92f4e9a9c233be99f0b33d1c58c72386 20 | //https://api.openweathermap.org/data/2.5/forecast?lat=44.34&lon=10.99&appid=92f4e9a9c233be99f0b33d1c58c72386 21 | //https://sheetdb.io/api/v1/4hm2n4jziczjy 22 | 23 | @GET("weather") 24 | Call getWeatherData( 25 | @Query("lat") Double lat, 26 | @Query("lon") Double lon, 27 | @Query("appid") String apiKey); 28 | 29 | @GET("forecast") 30 | Call getWeatherForecastData( 31 | @Query("lat") Double lat, 32 | @Query("lon") Double lon, 33 | @Query("appid") String apiKey); 34 | 35 | @GET("pak7qin2yt7i8") 36 | Call> getDiseasesList(); 37 | @GET("cstwpz7gpz1da") 38 | Call> getLocalizedDiseasesList(); 39 | @GET("0kofxd6x0muzp") 40 | Call> getFruitsFromDB(); 41 | @GET("9ax3hlz0utbby") 42 | Call> getLocalizedFruitsList(); 43 | @GET("jzqcnwnhd7pms") 44 | Call> getFlowersList(); 45 | @GET("bekl2o7zqgxb8") 46 | Call> getLocalizedFlowersList(); 47 | @GET("54hyqipsecvsw") 48 | Call> getListOfCrops(); 49 | @GET("te4foxozbz2rk") 50 | Call> getLocalizedCropsList(); 51 | @GET("hw7m9n2kxvupq") 52 | Call> getListOfHowToExpandData(); 53 | @GET("qy85vf93vhlbc") 54 | Call> getLocalizedHowToExpandData(); 55 | @GET("jvv0uk3btu7ln") 56 | Call> getInsectAndControlList(); 57 | @GET("fg3ysaf8mkyxo") 58 | Call> getLocalizedInsectAndControlList(); 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/network/Network.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.network; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | import okhttp3.OkHttpClient; 6 | import okhttp3.logging.HttpLoggingInterceptor; 7 | import retrofit2.Retrofit; 8 | import retrofit2.converter.gson.GsonConverterFactory; 9 | 10 | public class Network { 11 | private static final HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY); 12 | static final OkHttpClient okHttpClient = new OkHttpClient().newBuilder() 13 | .connectTimeout(60, TimeUnit.SECONDS) 14 | .readTimeout(60, TimeUnit.SECONDS) 15 | .writeTimeout(60, TimeUnit.SECONDS) 16 | .addInterceptor(httpLoggingInterceptor) 17 | .build(); 18 | 19 | public static APIService getInstance(String baseURL) { 20 | Retrofit retrofit = new Retrofit.Builder() 21 | .baseUrl(baseURL) 22 | .addConverterFactory(GsonConverterFactory.create()) 23 | .client(okHttpClient) 24 | .build(); 25 | return retrofit.create(APIService.class); 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/payment/adapter/HistoryAdapter.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.payment.adapter; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.ViewGroup; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.recyclerview.widget.RecyclerView; 8 | 9 | import com.project.agroworldapp.databinding.TransactionItemLayoutBinding; 10 | import com.project.agroworldapp.payment.model.PaymentModel; 11 | import com.project.agroworldapp.payment.viewholder.HistoryViewHolder; 12 | 13 | import java.util.List; 14 | 15 | public class HistoryAdapter extends RecyclerView.Adapter { 16 | private final List paymentModelList; 17 | 18 | public HistoryAdapter(List paymentModelList) { 19 | this.paymentModelList = paymentModelList; 20 | } 21 | 22 | @NonNull 23 | @Override 24 | public HistoryViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 25 | return new HistoryViewHolder(TransactionItemLayoutBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); 26 | } 27 | 28 | @Override 29 | public void onBindViewHolder(@NonNull HistoryViewHolder holder, int position) { 30 | PaymentModel paymentModel = paymentModelList.get(position); 31 | holder.bindHistoryData(paymentModel); 32 | } 33 | 34 | @Override 35 | public int getItemCount() { 36 | return paymentModelList.size(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/payment/adapter/HistoryListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.payment.adapter; 2 | 3 | import com.project.agroworldapp.payment.model.PaymentModel; 4 | 5 | public interface HistoryListener { 6 | void onTransactionRemovedClick(PaymentModel paymentModel); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/payment/model/PaymentModel.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.payment.model; 2 | 3 | public class PaymentModel { 4 | 5 | private String productName; 6 | 7 | private String productImage; 8 | private double productPrice; 9 | private String paymentStatus; 10 | private String paymentID; 11 | private String paymentData; 12 | 13 | public PaymentModel() { 14 | 15 | } 16 | 17 | public PaymentModel(String productName, String productImage, double productPrice, String paymentStatus, String paymentID) { 18 | this.productName = productName; 19 | this.productImage = productImage; 20 | this.productPrice = productPrice; 21 | this.paymentStatus = paymentStatus; 22 | this.paymentID = paymentID; 23 | } 24 | 25 | public String getProductName() { 26 | return productName; 27 | } 28 | 29 | public void setProductName(String productName) { 30 | this.productName = productName; 31 | } 32 | 33 | public double getProductPrice() { 34 | return productPrice; 35 | } 36 | 37 | public void setProductPrice(double productPrice) { 38 | this.productPrice = productPrice; 39 | } 40 | 41 | public String getPaymentStatus() { 42 | return paymentStatus; 43 | } 44 | 45 | public void setPaymentStatus(String paymentStatus) { 46 | this.paymentStatus = paymentStatus; 47 | } 48 | 49 | public String getPaymentID() { 50 | return paymentID; 51 | } 52 | 53 | public void setPaymentID(String paymentID) { 54 | this.paymentID = paymentID; 55 | } 56 | 57 | public String getPaymentData() { 58 | return paymentData; 59 | } 60 | 61 | public void setPaymentData(String paymentData) { 62 | this.paymentData = paymentData; 63 | } 64 | 65 | public String getProductImage() { 66 | return productImage; 67 | } 68 | 69 | public void setProductImage(String productImage) { 70 | this.productImage = productImage; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/payment/viewholder/HistoryViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.payment.viewholder; 2 | 3 | import androidx.recyclerview.widget.RecyclerView; 4 | 5 | import com.project.agroworldapp.databinding.TransactionItemLayoutBinding; 6 | import com.project.agroworldapp.payment.model.PaymentModel; 7 | import com.project.agroworldapp.utils.Constants; 8 | 9 | public class HistoryViewHolder extends RecyclerView.ViewHolder { 10 | final TransactionItemLayoutBinding binding; 11 | 12 | public HistoryViewHolder(TransactionItemLayoutBinding binding) { 13 | super(binding.getRoot()); 14 | this.binding = binding; 15 | } 16 | 17 | public void bindHistoryData(PaymentModel paymentModel) { 18 | binding.tvTransTitle.setText(paymentModel.getProductName()); 19 | binding.tvTransID.setText("Id: " + paymentModel.getPaymentID()); 20 | binding.tvTransStatus.setText("Status: " + paymentModel.getPaymentStatus()); 21 | binding.tvTransPrice.setText(" " + paymentModel.getProductPrice()); 22 | Constants.bindImage(binding.ivHistoryProduct, paymentModel.getProductImage(), binding.ivHistoryProduct); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/shopping/adapter/ProductCartAdapter.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.shopping.adapter; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.ViewGroup; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.recyclerview.widget.RecyclerView; 8 | 9 | import com.project.agroworldapp.databinding.CartItemLayoutBinding; 10 | import com.project.agroworldapp.shopping.listener.ItemCartActionListener; 11 | import com.project.agroworldapp.shopping.model.ProductModel; 12 | import com.project.agroworldapp.shopping.viewholder.CartViewHolder; 13 | 14 | import java.util.List; 15 | 16 | public class ProductCartAdapter extends RecyclerView.Adapter { 17 | private final List productModelArrayList; 18 | private final ItemCartActionListener listener; 19 | 20 | public ProductCartAdapter(List productModelList, ItemCartActionListener listener) { 21 | this.productModelArrayList = productModelList; 22 | this.listener = listener; 23 | } 24 | 25 | @NonNull 26 | @Override 27 | public CartViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 28 | return new CartViewHolder(CartItemLayoutBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); 29 | 30 | } 31 | 32 | @Override 33 | public void onBindViewHolder(@NonNull CartViewHolder holder, int position) { 34 | ProductModel productModel = productModelArrayList.get(position); 35 | holder.bindItemData(productModel, listener); 36 | } 37 | 38 | @Override 39 | public int getItemCount() { 40 | return productModelArrayList.size(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/shopping/listener/ItemCartActionListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.shopping.listener; 2 | 3 | import com.project.agroworldapp.shopping.model.ProductModel; 4 | 5 | public interface ItemCartActionListener { 6 | void onIncreaseItemClick(ProductModel productModel, int quantity); 7 | 8 | void onDecreaseItemClick(ProductModel productModel, int quantity); 9 | 10 | void onRemovedItemClick(ProductModel productModel, int position); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/shopping/listener/OnProductListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.shopping.listener; 2 | 3 | import com.project.agroworldapp.shopping.model.ProductModel; 4 | 5 | public interface OnProductListener { 6 | void onProductClick(ProductModel productModel); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/shopping/model/ProductModel.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.shopping.model; 2 | 3 | import java.io.Serializable; 4 | 5 | public class ProductModel implements Serializable { 6 | private String title; 7 | private String description; 8 | private double price; 9 | private String imageUrl; 10 | 11 | private int quantity = 1; 12 | 13 | public ProductModel() { 14 | 15 | } 16 | 17 | public ProductModel(String title, String description, double price, String imageUrl, int quantity) { 18 | this.title = title; 19 | this.description = description; 20 | this.price = price; 21 | this.imageUrl = imageUrl; 22 | this.quantity = quantity; 23 | } 24 | 25 | public String getTitle() { 26 | return title; 27 | } 28 | 29 | public String getDescription() { 30 | return description; 31 | } 32 | 33 | public double getPrice() { 34 | return price; 35 | } 36 | 37 | public String getImageUrl() { 38 | return imageUrl; 39 | } 40 | 41 | public int getQuantity() { 42 | return quantity; 43 | } 44 | 45 | public void setQuantity(int quantity) { 46 | this.quantity = quantity; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/shopping/viewholder/CartViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.shopping.viewholder; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.recyclerview.widget.RecyclerView; 5 | 6 | import com.project.agroworldapp.databinding.CartItemLayoutBinding; 7 | import com.project.agroworldapp.shopping.listener.ItemCartActionListener; 8 | import com.project.agroworldapp.shopping.model.ProductModel; 9 | import com.project.agroworldapp.utils.Constants; 10 | 11 | public class CartViewHolder extends RecyclerView.ViewHolder { 12 | 13 | private final CartItemLayoutBinding binding; 14 | private int itemCount = 1; 15 | 16 | public CartViewHolder(@NonNull CartItemLayoutBinding binding) { 17 | super(binding.getRoot()); 18 | this.binding = binding; 19 | } 20 | 21 | public void bindItemData(ProductModel productModel, ItemCartActionListener listener) { 22 | 23 | binding.ivIncreaseCount.setOnClickListener(v -> { 24 | if (itemCount == 20) { 25 | Constants.showToast(v.getContext(), "Can't order more than 20 items at a time"); 26 | } else { 27 | itemCount++; 28 | binding.tvItemCount.setText(String.valueOf(itemCount)); 29 | listener.onIncreaseItemClick(productModel, itemCount); 30 | } 31 | 32 | }); 33 | 34 | binding.ivDecreaseCount.setOnClickListener(v -> { 35 | if (itemCount == 1) { 36 | Constants.showToast(v.getContext(), "Default value"); 37 | } else { 38 | itemCount--; 39 | binding.tvItemCount.setText(String.valueOf(itemCount)); 40 | listener.onDecreaseItemClick(productModel, itemCount); 41 | } 42 | }); 43 | 44 | binding.ivRemoveItem.setOnClickListener(v -> listener.onRemovedItemClick(productModel, getAbsoluteAdapterPosition())); 45 | 46 | binding.tvProductPrice.setText("₹" + productModel.getPrice()); 47 | binding.tvProductName.setText(productModel.getTitle()); 48 | Constants.bindImage(binding.getRoot(), productModel.getImageUrl(), binding.ivProductImage); 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/taskmanager/MusicControl.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.taskmanager; 2 | 3 | import android.content.Context; 4 | import android.media.MediaPlayer; 5 | 6 | import com.project.agroworldapp.R; 7 | 8 | public class MusicControl { 9 | private static MusicControl sInstance; 10 | private final Context mContext; 11 | private MediaPlayer mMediaPlayer; 12 | 13 | public MusicControl(Context context) { 14 | this.mContext = context; 15 | } 16 | 17 | public static MusicControl getInstance(Context context) { 18 | if (sInstance == null) { 19 | sInstance = new MusicControl(context); 20 | } 21 | return sInstance; 22 | } 23 | 24 | public void playMusic() { 25 | mMediaPlayer = MediaPlayer.create(mContext, R.raw.cool); 26 | mMediaPlayer.start(); 27 | } 28 | 29 | public void stopMusic() { 30 | if (mMediaPlayer != null) { 31 | mMediaPlayer.stop(); 32 | mMediaPlayer.seekTo(0); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/taskmanager/adapter/FarmerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.taskmanager.adapter; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.ViewGroup; 6 | 7 | import androidx.annotation.NonNull; 8 | import androidx.recyclerview.widget.DiffUtil; 9 | import androidx.recyclerview.widget.ListAdapter; 10 | 11 | import com.project.agroworldapp.databinding.FarmerItemLayoutBinding; 12 | import com.project.agroworldapp.db.FarmerModel; 13 | import com.project.agroworldapp.taskmanager.listener.OnItemClickListener; 14 | import com.project.agroworldapp.taskmanager.viewholder.FarmerViewHolder; 15 | 16 | public class FarmerAdapter extends ListAdapter { 17 | private static final DiffUtil.ItemCallback DIFF_CALLBACK = new DiffUtil.ItemCallback() { 18 | @Override 19 | public boolean areItemsTheSame(FarmerModel oldItem, FarmerModel newItem) { 20 | return oldItem.getId() == newItem.getId(); 21 | } 22 | 23 | @Override 24 | public boolean areContentsTheSame(FarmerModel oldItem, FarmerModel newItem) { 25 | // below line is to check the course name, description and course duration. 26 | return oldItem.getTask().equals(newItem.getTask()) && 27 | oldItem.getDesc().equals(newItem.getDesc()); 28 | } 29 | }; 30 | Context context; 31 | private final OnItemClickListener listener; 32 | 33 | public FarmerAdapter(Context context, OnItemClickListener listener) { 34 | super(DIFF_CALLBACK); 35 | this.context = context; 36 | this.listener = listener; 37 | } 38 | 39 | @NonNull 40 | @Override 41 | public FarmerViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 42 | return new FarmerViewHolder(FarmerItemLayoutBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); 43 | } 44 | 45 | @Override 46 | public void onBindViewHolder(@NonNull FarmerViewHolder holder, int position) { 47 | FarmerModel model = getCourseAt(position); 48 | holder.bindData(model, listener, context); 49 | } 50 | 51 | public FarmerModel getCourseAt(int position) { 52 | return getItem(position); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/taskmanager/listener/OnItemClickListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.taskmanager.listener; 2 | 3 | import com.project.agroworldapp.db.FarmerModel; 4 | 5 | public interface OnItemClickListener { 6 | void markTaskCompleted(FarmerModel model); 7 | 8 | void onDeleteClick(FarmerModel model); 9 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/taskmanager/model/DateModel.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.taskmanager.model; 2 | 3 | import java.io.Serializable; 4 | 5 | public class DateModel implements Serializable { 6 | 7 | private int year; 8 | private int month; 9 | private int day; 10 | 11 | public DateModel(int year, int month, int day) { 12 | this.year = year; 13 | this.month = month; 14 | this.day = day; 15 | } 16 | 17 | public int getYear() { 18 | return year; 19 | } 20 | 21 | public void setYear(int year) { 22 | this.year = year; 23 | } 24 | 25 | public int getMonth() { 26 | return month; 27 | } 28 | 29 | public void setMonth(int month) { 30 | this.month = month; 31 | } 32 | 33 | public int getDay() { 34 | return day; 35 | } 36 | 37 | public void setDay(int day) { 38 | this.day = day; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/taskmanager/model/TimeModel.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.taskmanager.model; 2 | 3 | import java.io.Serializable; 4 | 5 | public class TimeModel implements Serializable { 6 | 7 | private int hour; 8 | private int minute; 9 | private String timeToNotify; 10 | 11 | public TimeModel(int hour, int minute, String timeToNotify) { 12 | this.hour = hour; 13 | this.minute = minute; 14 | this.timeToNotify = timeToNotify; 15 | } 16 | 17 | public int getHour() { 18 | return hour; 19 | } 20 | 21 | public void setHour(int hour) { 22 | this.hour = hour; 23 | } 24 | 25 | public int getMinute() { 26 | return minute; 27 | } 28 | 29 | public void setMinute(int minute) { 30 | this.minute = minute; 31 | } 32 | 33 | public String getTimeToNotify() { 34 | return timeToNotify; 35 | } 36 | 37 | public void setTimeToNotify(String timeToNotify) { 38 | this.timeToNotify = timeToNotify; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/taskmanager/receiver/EventReceiver.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.taskmanager.receiver; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | 8 | import androidx.core.app.NotificationCompat; 9 | import androidx.core.app.NotificationManagerCompat; 10 | 11 | import com.project.agroworldapp.taskmanager.MusicControl; 12 | import com.project.agroworldapp.utils.NotificationHelper; 13 | 14 | public class EventReceiver extends BroadcastReceiver { 15 | @Override 16 | public void onReceive(Context context, Intent intent) { 17 | 18 | if (intent.getAction().equalsIgnoreCase("com.project.agroworld")) { 19 | Bundle bundle = intent.getExtras(); 20 | String task = bundle.getString("task"); 21 | String desc = bundle.getString("desc"); 22 | String date = bundle.getString("date"); 23 | String time = bundle.getString("time"); 24 | int maxIDCount = bundle.getInt("maxIDCount", 0); 25 | System.out.println("EventReceiverMaxID " + maxIDCount); 26 | 27 | if (bundle.getString("setNotify").equalsIgnoreCase("SetNotification")) { 28 | MusicControl.getInstance(context).playMusic(); 29 | NotificationHelper notificationHelper = new NotificationHelper(context); 30 | NotificationCompat.Builder nb = notificationHelper.getChannelNotification(context, task, desc, date, time, maxIDCount); 31 | NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context); 32 | notificationManager.notify(maxIDCount, nb.build()); 33 | } else { 34 | System.out.println("Notification also canceled for " + maxIDCount); 35 | NotificationManagerCompat notificationManager1 = NotificationManagerCompat.from(context); 36 | notificationManager1.cancel(maxIDCount); 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/taskmanager/receiver/SnoozeReceiver.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.taskmanager.receiver; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import com.project.agroworldapp.taskmanager.MusicControl; 8 | 9 | public class SnoozeReceiver extends BroadcastReceiver { 10 | @Override 11 | public void onReceive(Context context, Intent intent) { 12 | if (intent.getAction().equalsIgnoreCase("com.agroworld.SnoozeReceiver")) { 13 | MusicControl.getInstance(context).stopMusic(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/taskmanager/viewholder/FarmerViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.taskmanager.viewholder; 2 | 3 | import android.content.Context; 4 | import android.view.Menu; 5 | import android.widget.PopupMenu; 6 | 7 | import androidx.recyclerview.widget.RecyclerView; 8 | 9 | import com.project.agroworldapp.databinding.FarmerItemLayoutBinding; 10 | import com.project.agroworldapp.db.FarmerModel; 11 | import com.project.agroworldapp.taskmanager.listener.OnItemClickListener; 12 | 13 | public class FarmerViewHolder extends RecyclerView.ViewHolder { 14 | // view holder class to create a variable for each view. 15 | private final FarmerItemLayoutBinding binding; 16 | 17 | public FarmerViewHolder(FarmerItemLayoutBinding binding) { 18 | super(binding.getRoot()); 19 | this.binding = binding; 20 | } 21 | 22 | public void bindData(FarmerModel model, OnItemClickListener listener, Context context) { 23 | binding.tvRoutineDate.setText(model.getDate()); 24 | binding.tvRoutineTime.setText(model.getTime()); 25 | binding.tvRoutineDecs.setText(model.getDesc()); 26 | binding.tvRoutineTitle.setText(model.getTask()); 27 | 28 | binding.tvMenu.setOnClickListener(v -> { 29 | PopupMenu menu = new PopupMenu(context, v); 30 | menu.getMenu().add(Menu.NONE, 1, 1, "Delete"); 31 | menu.getMenu().add(Menu.NONE, 2, 2, "Completed"); 32 | menu.show(); 33 | menu.setOnMenuItemClickListener(item -> { 34 | int i = item.getItemId(); 35 | if (i == 1) { 36 | listener.onDeleteClick(model); 37 | return true; 38 | } else if (i == 2) { 39 | listener.markTaskCompleted(model); 40 | return true; 41 | } else { 42 | return false; 43 | } 44 | }); 45 | }); 46 | } 47 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/taskmanager/viewmodel/FarmerViewModel.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.taskmanager.viewmodel; 2 | 3 | import android.app.Application; 4 | 5 | import androidx.annotation.NonNull; 6 | import androidx.lifecycle.AndroidViewModel; 7 | import androidx.lifecycle.LiveData; 8 | 9 | import com.project.agroworldapp.db.FarmerModel; 10 | import com.project.agroworldapp.taskmanager.repository.DatabaseRepository; 11 | 12 | import java.util.List; 13 | 14 | public class FarmerViewModel extends AndroidViewModel { 15 | private final DatabaseRepository repository; 16 | private final LiveData> farmerRoutines; 17 | 18 | public FarmerViewModel(@NonNull Application application) { 19 | super(application); 20 | repository = new DatabaseRepository(application); 21 | farmerRoutines = repository.getFarmerRoutines(); 22 | LiveData maxIDCount = repository.getMaxIdCount(); 23 | } 24 | 25 | public void insert(FarmerModel model) { 26 | repository.insert(model); 27 | } 28 | 29 | public void delete(FarmerModel model) { 30 | repository.delete(model); 31 | } 32 | 33 | public void deleteAllData() { 34 | repository.deleteAllCourses(); 35 | } 36 | 37 | public LiveData> getRoutineList() { 38 | return farmerRoutines; 39 | } 40 | 41 | public LiveData getMaxIDCount() { 42 | return repository.getMaxIdCount(); 43 | } 44 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/transport/adapter/OnVehicleCallClick.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.transport.adapter; 2 | 3 | import com.project.agroworldapp.transport.model.VehicleModel; 4 | 5 | public interface OnVehicleCallClick { 6 | void callVehicleOwner(VehicleModel vehicleModel); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/transport/listener/AdminListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.transport.listener; 2 | 3 | import com.project.agroworldapp.transport.model.VehicleModel; 4 | 5 | public interface AdminListener { 6 | 7 | void performOnCardClickAction(VehicleModel vehicleModel); 8 | 9 | void performEditAction(VehicleModel vehicleModel); 10 | 11 | void performDeleteAction(VehicleModel vehicleModel); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/transport/model/VehicleModel.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.transport.model; 2 | 3 | import java.io.Serializable; 4 | 5 | public class VehicleModel implements Serializable { 6 | private String model; 7 | private String address; 8 | private String rates; 9 | private String unit; 10 | private String contact; 11 | private String imageUrl; 12 | 13 | public VehicleModel() { 14 | 15 | } 16 | 17 | public VehicleModel(String model, String address, String rates, String unit, String contact, String imageUrl) { 18 | this.model = model; 19 | this.address = address; 20 | this.rates = rates; 21 | this.unit = unit; 22 | this.contact = contact; 23 | this.imageUrl = imageUrl; 24 | } 25 | 26 | 27 | public String getImageUrl() { 28 | return imageUrl; 29 | } 30 | 31 | public String getContact() { 32 | return contact; 33 | } 34 | 35 | public String getRates() { 36 | return rates; 37 | } 38 | 39 | public String getUnit() { 40 | return unit; 41 | } 42 | 43 | public String getAddress() { 44 | return address; 45 | } 46 | 47 | public String getModel() { 48 | return model; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/transport/viewHolder/VehicleAdminViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.transport.viewHolder; 2 | 3 | import android.content.Context; 4 | import android.widget.PopupMenu; 5 | 6 | import androidx.recyclerview.widget.RecyclerView; 7 | 8 | 9 | import com.project.agroworldapp.R; 10 | import com.project.agroworldapp.databinding.TransportAdminLayoutBinding; 11 | import com.project.agroworldapp.transport.listener.AdminListener; 12 | import com.project.agroworldapp.transport.model.VehicleModel; 13 | import com.project.agroworldapp.utils.Constants; 14 | 15 | public class VehicleAdminViewHolder extends RecyclerView.ViewHolder { 16 | final TransportAdminLayoutBinding binding; 17 | 18 | public VehicleAdminViewHolder(TransportAdminLayoutBinding binding) { 19 | super(binding.getRoot()); 20 | this.binding = binding; 21 | } 22 | 23 | public void setData(VehicleModel vehicleModel, AdminListener adminListener, Context context) { 24 | 25 | binding.tvVehicleName.setText(vehicleModel.getModel()); 26 | binding.tvVehicleLocation.setText(vehicleModel.getAddress()); 27 | Constants.bindImage( 28 | binding.ivTransport, vehicleModel.getImageUrl(), binding.ivTransport 29 | ); 30 | binding.tvVehiclePrice.setText("₹ " + vehicleModel.getRates() + "/" + vehicleModel.getUnit()); 31 | binding.btnVehicleOwnerCall.setOnClickListener(v -> adminListener.performOnCardClickAction(vehicleModel)); 32 | 33 | binding.ivMoreOptionTransport.setOnClickListener(v -> { 34 | PopupMenu popupMenu = new PopupMenu(context, binding.ivMoreOptionTransport); 35 | popupMenu.getMenuInflater().inflate(R.menu.transport_menu, popupMenu.getMenu()); 36 | popupMenu.setOnMenuItemClickListener(menuItem -> { 37 | switch (menuItem.getItemId()) { 38 | case R.id.editProductDetails: 39 | adminListener.performEditAction(vehicleModel); 40 | return true; 41 | case R.id.deleteProductDetails: 42 | adminListener.performDeleteAction(vehicleModel); 43 | return true; 44 | } 45 | return true; 46 | }); 47 | popupMenu.show(); 48 | }); 49 | } 50 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/transport/viewHolder/VehicleViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.transport.viewHolder; 2 | 3 | import androidx.recyclerview.widget.RecyclerView; 4 | 5 | import com.project.agroworldapp.databinding.TransportItemLayoutBinding; 6 | import com.project.agroworldapp.transport.adapter.OnVehicleCallClick; 7 | import com.project.agroworldapp.transport.model.VehicleModel; 8 | import com.project.agroworldapp.utils.Constants; 9 | 10 | public class VehicleViewHolder extends RecyclerView.ViewHolder { 11 | final TransportItemLayoutBinding binding; 12 | 13 | public VehicleViewHolder(TransportItemLayoutBinding binding) { 14 | super(binding.getRoot()); 15 | this.binding = binding; 16 | } 17 | 18 | public void setData(VehicleModel vehicleModel, OnVehicleCallClick vehicleCallClick) { 19 | binding.tvVehicleName.setText(vehicleModel.getModel()); 20 | binding.tvVehicleLocation.setText(vehicleModel.getAddress()); 21 | Constants.bindImage( 22 | binding.ivTransport, vehicleModel.getImageUrl(), binding.ivTransport 23 | ); 24 | binding.tvVehiclePrice.setText("₹ " + vehicleModel.getRates() + "/" + vehicleModel.getUnit()); 25 | binding.btnVehicleOwnerCall.setOnClickListener(v -> vehicleCallClick.callVehicleOwner(vehicleModel)); 26 | } 27 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/ui/activity/SplashScreen.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.ui.activity; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.os.Handler; 6 | 7 | import androidx.appcompat.app.ActionBar; 8 | import androidx.appcompat.app.AppCompatActivity; 9 | 10 | import com.google.firebase.auth.FirebaseAuth; 11 | import com.google.firebase.auth.FirebaseUser; 12 | import com.project.agroworldapp.BuildConfig; 13 | import com.project.agroworldapp.R; 14 | import com.project.agroworldapp.db.PreferenceHelper; 15 | import com.project.agroworldapp.utils.Constants; 16 | 17 | public class SplashScreen extends AppCompatActivity { 18 | FirebaseAuth mAuth; 19 | FirebaseUser user; 20 | PreferenceHelper preferenceHelper; 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | preferenceHelper = PreferenceHelper.getInstance(this); 26 | boolean isHindi = preferenceHelper.getData(Constants.HINDI_KEY); 27 | if (isHindi) { 28 | Constants.setAppLocale(SplashScreen.this, "hi"); 29 | } else { 30 | Constants.setAppLocale(SplashScreen.this, "en"); 31 | } 32 | setContentView(R.layout.activity_main); 33 | 34 | mAuth = FirebaseAuth.getInstance(); 35 | user = mAuth.getCurrentUser(); 36 | ActionBar actionBar = getSupportActionBar(); 37 | actionBar.hide(); 38 | 39 | /** 40 | identifyUser()- It will identify user type & It will navigate user to the appropriate screen. 41 | -> Manufacturer user 42 | -> Transport user 43 | -> Farmer 44 | */ 45 | 46 | new Handler().postDelayed(new Runnable() { 47 | @Override 48 | public void run() { 49 | if (user != null) { 50 | Constants.identifyUser(user, SplashScreen.this); 51 | } else { 52 | Intent splashIntent = new Intent(SplashScreen.this, SignInActivity.class); 53 | startActivity(splashIntent); 54 | } 55 | finish(); 56 | } 57 | }, 2000); 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/ui/adapter/FragmentAdapter.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.ui.adapter; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.annotation.NonNull; 6 | import androidx.fragment.app.Fragment; 7 | import androidx.fragment.app.FragmentManager; 8 | import androidx.fragment.app.FragmentPagerAdapter; 9 | 10 | import java.util.ArrayList; 11 | 12 | public class FragmentAdapter extends FragmentPagerAdapter { 13 | 14 | Context context; 15 | ArrayList fragments; 16 | 17 | public FragmentAdapter(FragmentManager fm, Context context, ArrayList fragments) { 18 | super(fm); 19 | this.context = context; 20 | this.fragments = fragments; 21 | } 22 | 23 | @Override 24 | public int getCount() { 25 | return fragments.size(); 26 | } 27 | 28 | 29 | @NonNull 30 | @Override 31 | public Fragment getItem(int i) { 32 | return fragments.get(i); 33 | } 34 | 35 | 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/utils/CustomMultiColorProgressBar.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.utils; 2 | 3 | 4 | import android.app.Dialog; 5 | import android.content.Context; 6 | import android.graphics.Color; 7 | import android.graphics.drawable.ColorDrawable; 8 | import android.widget.TextView; 9 | 10 | import com.project.agroworldapp.R; 11 | 12 | public class CustomMultiColorProgressBar extends Dialog { 13 | CircleProgressBar circle_multicolor_progressbar; 14 | public static CustomMultiColorProgressBar progressBarObj; 15 | 16 | public CustomMultiColorProgressBar(Context context, String dialog_msg) { 17 | super(context); 18 | requestWindowFeature(1); 19 | setContentView(R.layout.dialog_custom_multicolor_progressbar); 20 | circle_multicolor_progressbar = findViewById(R.id.bar); 21 | circle_multicolor_progressbar.setColorSchemeResources(android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_blue_light, android.R.color.holo_red_light); 22 | getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); 23 | setCancelable(false); 24 | setCanceledOnTouchOutside(false); 25 | ((TextView) findViewById(R.id.messg)).setText(dialog_msg); 26 | } 27 | 28 | public static CustomMultiColorProgressBar getInstance(Context c, String dialog_msg) { 29 | if (progressBarObj == null) { 30 | progressBarObj = new CustomMultiColorProgressBar(c, dialog_msg); 31 | progressBarObj.show(); 32 | } else { 33 | progressBarObj.updateMessage(dialog_msg); 34 | } 35 | return progressBarObj; 36 | } 37 | 38 | public void hideProgressBar() { 39 | if (this != null) { 40 | dismiss(); 41 | progressBarObj = null; 42 | } 43 | } 44 | 45 | public void showProgressBar() { 46 | show(); 47 | } 48 | 49 | public void updateMessage(String dialog_msg) { 50 | ((TextView) findViewById(R.id.messg)).setText(dialog_msg); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/utils/DialogUtils.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.utils; 2 | 3 | import android.app.Activity; 4 | import android.app.Dialog; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.graphics.drawable.ColorDrawable; 8 | import android.provider.Settings; 9 | import android.view.ViewGroup; 10 | import android.view.Window; 11 | import android.widget.Button; 12 | import android.widget.ImageView; 13 | import android.widget.TextView; 14 | 15 | import androidx.core.content.ContextCompat; 16 | 17 | import com.project.agroworldapp.R; 18 | 19 | import java.util.Objects; 20 | 21 | public class DialogUtils { 22 | 23 | public static void showAlertDialog(Context context, String message) { 24 | final Dialog dialog = new Dialog(context); 25 | dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); 26 | Objects.requireNonNull(dialog.getWindow()).setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(context, android.R.color.transparent))); 27 | dialog.setContentView(R.layout.dialog_warning); 28 | dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); 29 | dialog.getWindow().getAttributes().windowAnimations = R.style.DialogAnimation_2; 30 | dialog.setCancelable(false); 31 | Button btn_ok = dialog.findViewById(R.id.btn_ok); 32 | TextView txt_msg = dialog.findViewById(R.id.txt_msg); 33 | ImageView tvDismiss = dialog.findViewById(R.id.tvDismiss); 34 | ImageView ivDialogStatus = dialog.findViewById(R.id.ivDialogIcon); 35 | ivDialogStatus.setImageResource(R.drawable.ic_baseline_warning_24); 36 | 37 | txt_msg.setText(message); 38 | tvDismiss.setOnClickListener(view -> dialog.dismiss()); 39 | 40 | btn_ok.setOnClickListener(v -> { 41 | dialog.dismiss(); 42 | if (message.equalsIgnoreCase(context.getString(R.string.enable_gps_service))) { 43 | Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); 44 | ((Activity) context).startActivityForResult(intent, Constants.GPS_REQUEST_CODE); 45 | } 46 | if (message.equalsIgnoreCase(context.getString(R.string.check_internet_connection))) { 47 | Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS); 48 | ((Activity) context).startActivityForResult(intent, Constants.REQUEST_CODE); 49 | } 50 | }); 51 | dialog.show(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/utils/Permissions.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.utils; 2 | 3 | import static android.content.Context.LOCATION_SERVICE; 4 | 5 | import android.app.Activity; 6 | import android.content.Context; 7 | import android.location.LocationManager; 8 | import android.net.ConnectivityManager; 9 | import android.net.NetworkInfo; 10 | 11 | import com.project.agroworldapp.R; 12 | 13 | public class Permissions { 14 | 15 | public static boolean isGpsEnable(Context context) { 16 | 17 | LocationManager locationManager = (LocationManager) context.getSystemService(LOCATION_SERVICE); 18 | boolean enableLocation = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); 19 | if (enableLocation) { 20 | return true; 21 | } else { 22 | if (context instanceof Activity) { 23 | DialogUtils.showAlertDialog(context, context.getString(R.string.enable_gps_service)); 24 | } 25 | } 26 | return false; 27 | } 28 | 29 | public static boolean isOnline(Context context) { 30 | ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); 31 | NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo(); 32 | return networkInfo != null && networkInfo.isConnectedOrConnecting(); 33 | } 34 | 35 | public static boolean checkConnection(Context context) { 36 | if (isOnline(context)) { 37 | return true; 38 | } else { 39 | DialogUtils.showAlertDialog(context, context.getString(R.string.check_internet_connection)); 40 | } 41 | return false; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/utils/Resource.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.utils; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.annotation.Nullable; 5 | 6 | public class Resource { 7 | 8 | @NonNull 9 | public final Status status; 10 | @Nullable 11 | public final T data; 12 | @Nullable 13 | public final String message; 14 | 15 | private Resource(@NonNull Status status, @Nullable T data, 16 | @Nullable String message) { 17 | this.status = status; 18 | this.data = data; 19 | this.message = message; 20 | } 21 | 22 | public static Resource success(@NonNull T data) { 23 | return new Resource<>(Status.SUCCESS, data, null); 24 | } 25 | 26 | public static Resource error(String msg, @Nullable T data) { 27 | return new Resource<>(Status.ERROR, data, msg); 28 | } 29 | 30 | public static Resource loading(@Nullable T data) { 31 | return new Resource<>(Status.LOADING, data, null); 32 | } 33 | 34 | 35 | public enum Status {SUCCESS, ERROR, LOADING} 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/viewmodel/AgroWorldViewModelFactory.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.viewmodel; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.annotation.NonNull; 6 | import androidx.lifecycle.ViewModel; 7 | import androidx.lifecycle.ViewModelProvider; 8 | import androidx.lifecycle.viewmodel.CreationExtras; 9 | 10 | import com.project.agroworldapp.ui.repository.AgroWorldRepositoryImpl; 11 | 12 | public class AgroWorldViewModelFactory implements ViewModelProvider.Factory { 13 | private AgroWorldRepositoryImpl agroWorldRepository; 14 | private Context context; 15 | 16 | public AgroWorldViewModelFactory(AgroWorldRepositoryImpl agroWorldRepository, Context context) { 17 | this.agroWorldRepository = agroWorldRepository; 18 | this.context = context; 19 | } 20 | 21 | @NonNull 22 | @Override 23 | public T create(@NonNull Class modelClass, @NonNull CreationExtras extras) { 24 | return (T) new AgroViewModel(agroWorldRepository, context); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/adapter/WeatherForecastAdapter.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.adapter; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.ViewGroup; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.recyclerview.widget.RecyclerView; 8 | 9 | import com.project.agroworldapp.databinding.ForecastItemLayoutBinding; 10 | import com.project.agroworldapp.weather.listener.WeatherForecastListener; 11 | import com.project.agroworldapp.weather.model.weatherlist.ListItem; 12 | import com.project.agroworldapp.weather.viewholder.WeatherForecastViewHolder; 13 | 14 | import java.util.List; 15 | 16 | public class WeatherForecastAdapter extends RecyclerView.Adapter { 17 | 18 | private final List weatherForecastItemList; 19 | private final WeatherForecastListener listener; 20 | 21 | public WeatherForecastAdapter(List weatherForecastItemList, WeatherForecastListener listener) { 22 | this.weatherForecastItemList = weatherForecastItemList; 23 | this.listener = listener; 24 | } 25 | 26 | @NonNull 27 | @Override 28 | public WeatherForecastViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 29 | return new WeatherForecastViewHolder(ForecastItemLayoutBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); 30 | } 31 | 32 | @Override 33 | public void onBindViewHolder(@NonNull WeatherForecastViewHolder holder, int position) { 34 | ListItem listItemModel = weatherForecastItemList.get(position); 35 | holder.bindForecastData(listItemModel, listener); 36 | } 37 | 38 | @Override 39 | public int getItemCount() { 40 | return weatherForecastItemList.size(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/listener/WeatherForecastListener.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.listener; 2 | 3 | public interface WeatherForecastListener { 4 | 5 | void onForecastWeatherCardClick(String description); 6 | } 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weather_data/Clouds.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weather_data; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | public class Clouds implements Serializable { 8 | 9 | @SerializedName("all") 10 | private int all; 11 | 12 | public int getAll() { 13 | return all; 14 | } 15 | 16 | public void setAll(int all) { 17 | this.all = all; 18 | } 19 | 20 | @Override 21 | public String toString() { 22 | return "Clouds{" + "all = '" + all + '\'' + "}"; 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weather_data/Coord.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weather_data; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | public class Coord implements Serializable { 8 | 9 | @SerializedName("lon") 10 | private Object lon; 11 | 12 | @SerializedName("lat") 13 | private Object lat; 14 | 15 | public Object getLon() { 16 | return lon; 17 | } 18 | 19 | public void setLon(Object lon) { 20 | this.lon = lon; 21 | } 22 | 23 | public Object getLat() { 24 | return lat; 25 | } 26 | 27 | public void setLat(Object lat) { 28 | this.lat = lat; 29 | } 30 | 31 | @Override 32 | public String toString() { 33 | return 34 | "Coord{" + 35 | "lon = '" + lon + '\'' + 36 | ",lat = '" + lat + '\'' + 37 | "}"; 38 | } 39 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weather_data/Main.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weather_data; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | public class Main implements Serializable { 8 | 9 | @SerializedName("temp") 10 | private double temp; 11 | 12 | @SerializedName("feels_like") 13 | private Object feelsLike; 14 | 15 | @SerializedName("temp_min") 16 | private double tempMin; 17 | 18 | @SerializedName("temp_max") 19 | private double tempMax; 20 | 21 | @SerializedName("pressure") 22 | private int pressure; 23 | 24 | @SerializedName("humidity") 25 | private int humidity; 26 | 27 | public double getTemp() { 28 | return temp; 29 | } 30 | 31 | public void setTemp(double temp) { 32 | this.temp = temp; 33 | } 34 | 35 | public Object getFeelsLike() { 36 | return feelsLike; 37 | } 38 | 39 | public void setFeelsLike(Object feelsLike) { 40 | this.feelsLike = feelsLike; 41 | } 42 | 43 | public double getTempMin() { 44 | return tempMin; 45 | } 46 | 47 | public void setTempMin(double tempMin) { 48 | this.tempMin = tempMin; 49 | } 50 | 51 | public double getTempMax() { 52 | return tempMax; 53 | } 54 | 55 | public void setTempMax(double tempMax) { 56 | this.tempMax = tempMax; 57 | } 58 | 59 | public int getPressure() { 60 | return pressure; 61 | } 62 | 63 | public void setPressure(int pressure) { 64 | this.pressure = pressure; 65 | } 66 | 67 | public int getHumidity() { 68 | return humidity; 69 | } 70 | 71 | public void setHumidity(int humidity) { 72 | this.humidity = humidity; 73 | } 74 | 75 | @Override 76 | public String toString() { 77 | return 78 | "Main{" + 79 | "temp = '" + temp + '\'' + 80 | ",feels_like = '" + feelsLike + '\'' + 81 | ",temp_min = '" + tempMin + '\'' + 82 | ",temp_max = '" + tempMax + '\'' + 83 | ",pressure = '" + pressure + '\'' + 84 | ",humidity = '" + humidity + '\'' + 85 | "}"; 86 | } 87 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weather_data/Sys.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weather_data; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | public class Sys implements Serializable { 8 | 9 | @SerializedName("type") 10 | private int type; 11 | 12 | @SerializedName("id") 13 | private int id; 14 | 15 | @SerializedName("country") 16 | private String country; 17 | 18 | @SerializedName("sunrise") 19 | private int sunrise; 20 | 21 | @SerializedName("sunset") 22 | private int sunset; 23 | 24 | public int getType() { 25 | return type; 26 | } 27 | 28 | public void setType(int type) { 29 | this.type = type; 30 | } 31 | 32 | public int getId() { 33 | return id; 34 | } 35 | 36 | public void setId(int id) { 37 | this.id = id; 38 | } 39 | 40 | public String getCountry() { 41 | return country; 42 | } 43 | 44 | public void setCountry(String country) { 45 | this.country = country; 46 | } 47 | 48 | public int getSunrise() { 49 | return sunrise; 50 | } 51 | 52 | public void setSunrise(int sunrise) { 53 | this.sunrise = sunrise; 54 | } 55 | 56 | public int getSunset() { 57 | return sunset; 58 | } 59 | 60 | public void setSunset(int sunset) { 61 | this.sunset = sunset; 62 | } 63 | 64 | @Override 65 | public String toString() { 66 | return 67 | "Sys{" + 68 | "type = '" + type + '\'' + 69 | ",id = '" + id + '\'' + 70 | ",country = '" + country + '\'' + 71 | ",sunrise = '" + sunrise + '\'' + 72 | ",sunset = '" + sunset + '\'' + 73 | "}"; 74 | } 75 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weather_data/WeatherItem.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weather_data; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | public class WeatherItem implements Serializable { 8 | 9 | @SerializedName("id") 10 | private int id; 11 | 12 | @SerializedName("main") 13 | private String main; 14 | 15 | @SerializedName("description") 16 | private String description; 17 | 18 | @SerializedName("icon") 19 | private String icon; 20 | 21 | public int getId() { 22 | return id; 23 | } 24 | 25 | public void setId(int id) { 26 | this.id = id; 27 | } 28 | 29 | public String getMain() { 30 | return main; 31 | } 32 | 33 | public void setMain(String main) { 34 | this.main = main; 35 | } 36 | 37 | public String getDescription() { 38 | return description; 39 | } 40 | 41 | public void setDescription(String description) { 42 | this.description = description; 43 | } 44 | 45 | public String getIcon() { 46 | return icon; 47 | } 48 | 49 | public void setIcon(String icon) { 50 | this.icon = icon; 51 | } 52 | 53 | @Override 54 | public String toString() { 55 | return 56 | "WeatherItem{" + 57 | "id = '" + id + '\'' + 58 | ",main = '" + main + '\'' + 59 | ",description = '" + description + '\'' + 60 | ",icon = '" + icon + '\'' + 61 | "}"; 62 | } 63 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weather_data/Wind.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weather_data; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | 7 | public class Wind implements Serializable { 8 | 9 | @SerializedName("speed") 10 | private Object speed; 11 | 12 | @SerializedName("deg") 13 | private int deg; 14 | 15 | public Object getSpeed() { 16 | return speed; 17 | } 18 | 19 | public void setSpeed(Object speed) { 20 | this.speed = speed; 21 | } 22 | 23 | public int getDeg() { 24 | return deg; 25 | } 26 | 27 | public void setDeg(int deg) { 28 | this.deg = deg; 29 | } 30 | 31 | @Override 32 | public String toString() { 33 | return 34 | "Wind{" + 35 | "speed = '" + speed + '\'' + 36 | ",deg = '" + deg + '\'' + 37 | "}"; 38 | } 39 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weatherlist/City.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weatherlist; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | 9 | public class City implements Serializable { 10 | 11 | @SerializedName("id") 12 | private int id; 13 | 14 | @SerializedName("name") 15 | private String name; 16 | 17 | @SerializedName("coord") 18 | private Coord coord; 19 | 20 | @SerializedName("country") 21 | private String country; 22 | 23 | @SerializedName("population") 24 | private int population; 25 | 26 | @SerializedName("timezone") 27 | private int timezone; 28 | 29 | @SerializedName("sunrise") 30 | private int sunrise; 31 | 32 | @SerializedName("sunset") 33 | private int sunset; 34 | 35 | public int getId() { 36 | return id; 37 | } 38 | 39 | public void setId(int id) { 40 | this.id = id; 41 | } 42 | 43 | public String getName() { 44 | return name; 45 | } 46 | 47 | public void setName(String name) { 48 | this.name = name; 49 | } 50 | 51 | public Coord getCoord() { 52 | return coord; 53 | } 54 | 55 | public void setCoord(Coord coord) { 56 | this.coord = coord; 57 | } 58 | 59 | public String getCountry() { 60 | return country; 61 | } 62 | 63 | public void setCountry(String country) { 64 | this.country = country; 65 | } 66 | 67 | public int getPopulation() { 68 | return population; 69 | } 70 | 71 | public void setPopulation(int population) { 72 | this.population = population; 73 | } 74 | 75 | public int getTimezone() { 76 | return timezone; 77 | } 78 | 79 | public void setTimezone(int timezone) { 80 | this.timezone = timezone; 81 | } 82 | 83 | public int getSunrise() { 84 | return sunrise; 85 | } 86 | 87 | public void setSunrise(int sunrise) { 88 | this.sunrise = sunrise; 89 | } 90 | 91 | public int getSunset() { 92 | return sunset; 93 | } 94 | 95 | public void setSunset(int sunset) { 96 | this.sunset = sunset; 97 | } 98 | 99 | @NonNull 100 | @Override 101 | public String toString() { 102 | return "City{" + "id = '" + id + '\'' + ",name = '" + name + '\'' + ",coord = '" + coord + '\'' + ",country = '" + country + '\'' + ",population = '" + population + '\'' + ",timezone = '" + timezone + '\'' + ",sunrise = '" + sunrise + '\'' + ",sunset = '" + sunset + '\'' + "}"; 103 | } 104 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weatherlist/Clouds.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weatherlist; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | 9 | public class Clouds implements Serializable { 10 | 11 | @SerializedName("all") 12 | private int all; 13 | 14 | public void setAll(int all) { 15 | this.all = all; 16 | } 17 | 18 | public int getAll() { 19 | return all; 20 | } 21 | 22 | @NonNull 23 | @Override 24 | public String toString() { 25 | return 26 | "Clouds{" + 27 | "all = '" + all + '\'' + 28 | "}"; 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weatherlist/Coord.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weatherlist; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | 9 | public class Coord implements Serializable { 10 | 11 | @SerializedName("lat") 12 | private Object lat; 13 | 14 | @SerializedName("lon") 15 | private Object lon; 16 | 17 | public Object getLat() { 18 | return lat; 19 | } 20 | 21 | public void setLat(Object lat) { 22 | this.lat = lat; 23 | } 24 | 25 | public Object getLon() { 26 | return lon; 27 | } 28 | 29 | public void setLon(Object lon) { 30 | this.lon = lon; 31 | } 32 | 33 | @NonNull 34 | @Override 35 | public String toString() { 36 | return "Coord{" + "lat = '" + lat + '\'' + ",lon = '" + lon + '\'' + "}"; 37 | } 38 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weatherlist/ListItem.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weatherlist; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | public class ListItem implements Serializable { 11 | 12 | @SerializedName("dt") 13 | private int dt; 14 | 15 | @SerializedName("main") 16 | private Main main; 17 | 18 | @SerializedName("weather") 19 | private List weather; 20 | 21 | @SerializedName("clouds") 22 | private Clouds clouds; 23 | 24 | @SerializedName("wind") 25 | private Wind wind; 26 | 27 | @SerializedName("visibility") 28 | private int visibility; 29 | 30 | @SerializedName("pop") 31 | private double pop; 32 | 33 | @SerializedName("sys") 34 | private Sys sys; 35 | 36 | @SerializedName("dt_txt") 37 | private String dtTxt; 38 | 39 | public int getDt() { 40 | return dt; 41 | } 42 | 43 | public void setDt(int dt) { 44 | this.dt = dt; 45 | } 46 | 47 | public Main getMain() { 48 | return main; 49 | } 50 | 51 | public void setMain(Main main) { 52 | this.main = main; 53 | } 54 | 55 | public List getWeather() { 56 | return weather; 57 | } 58 | 59 | public void setWeather(List weather) { 60 | this.weather = weather; 61 | } 62 | 63 | public Clouds getClouds() { 64 | return clouds; 65 | } 66 | 67 | public void setClouds(Clouds clouds) { 68 | this.clouds = clouds; 69 | } 70 | 71 | public Wind getWind() { 72 | return wind; 73 | } 74 | 75 | public void setWind(Wind wind) { 76 | this.wind = wind; 77 | } 78 | 79 | public int getVisibility() { 80 | return visibility; 81 | } 82 | 83 | public void setVisibility(int visibility) { 84 | this.visibility = visibility; 85 | } 86 | 87 | public double getPop() { 88 | return pop; 89 | } 90 | 91 | public void setPop(double pop) { 92 | this.pop = pop; 93 | } 94 | 95 | public Sys getSys() { 96 | return sys; 97 | } 98 | 99 | public void setSys(Sys sys) { 100 | this.sys = sys; 101 | } 102 | 103 | public String getDtTxt() { 104 | return dtTxt; 105 | } 106 | 107 | public void setDtTxt(String dtTxt) { 108 | this.dtTxt = dtTxt; 109 | } 110 | 111 | @NonNull 112 | @Override 113 | public String toString() { 114 | return "ListItem{" + "dt = '" + dt + '\'' + ",main = '" + main + '\'' + ",weather = '" + weather + '\'' + ",clouds = '" + clouds + '\'' + ",wind = '" + wind + '\'' + ",visibility = '" + visibility + '\'' + ",pop = '" + pop + '\'' + ",sys = '" + sys + '\'' + ",dt_txt = '" + dtTxt + '\'' + "}"; 115 | } 116 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weatherlist/Main.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weatherlist; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | 9 | public class Main implements Serializable { 10 | 11 | @SerializedName("temp") 12 | private double temp; 13 | 14 | @SerializedName("feels_like") 15 | private Object feelsLike; 16 | 17 | @SerializedName("temp_min") 18 | private Object tempMin; 19 | 20 | @SerializedName("temp_max") 21 | private Object tempMax; 22 | 23 | @SerializedName("pressure") 24 | private int pressure; 25 | 26 | @SerializedName("sea_level") 27 | private int seaLevel; 28 | 29 | @SerializedName("grnd_level") 30 | private int grndLevel; 31 | 32 | @SerializedName("humidity") 33 | private int humidity; 34 | 35 | @SerializedName("temp_kf") 36 | private Object tempKf; 37 | 38 | public double getTemp() { 39 | return temp; 40 | } 41 | 42 | public void setTemp(double temp) { 43 | this.temp = temp; 44 | } 45 | 46 | public Object getFeelsLike() { 47 | return feelsLike; 48 | } 49 | 50 | public void setFeelsLike(Object feelsLike) { 51 | this.feelsLike = feelsLike; 52 | } 53 | 54 | public Object getTempMin() { 55 | return tempMin; 56 | } 57 | 58 | public void setTempMin(Object tempMin) { 59 | this.tempMin = tempMin; 60 | } 61 | 62 | public Object getTempMax() { 63 | return tempMax; 64 | } 65 | 66 | public void setTempMax(Object tempMax) { 67 | this.tempMax = tempMax; 68 | } 69 | 70 | public int getPressure() { 71 | return pressure; 72 | } 73 | 74 | public void setPressure(int pressure) { 75 | this.pressure = pressure; 76 | } 77 | 78 | public int getSeaLevel() { 79 | return seaLevel; 80 | } 81 | 82 | public void setSeaLevel(int seaLevel) { 83 | this.seaLevel = seaLevel; 84 | } 85 | 86 | public int getGrndLevel() { 87 | return grndLevel; 88 | } 89 | 90 | public void setGrndLevel(int grndLevel) { 91 | this.grndLevel = grndLevel; 92 | } 93 | 94 | public int getHumidity() { 95 | return humidity; 96 | } 97 | 98 | public void setHumidity(int humidity) { 99 | this.humidity = humidity; 100 | } 101 | 102 | public Object getTempKf() { 103 | return tempKf; 104 | } 105 | 106 | public void setTempKf(Object tempKf) { 107 | this.tempKf = tempKf; 108 | } 109 | 110 | @NonNull 111 | @Override 112 | public String toString() { 113 | return "Main{" + "temp = '" + temp + '\'' + ",feels_like = '" + feelsLike + '\'' + ",temp_min = '" + tempMin + '\'' + ",temp_max = '" + tempMax + '\'' + ",pressure = '" + pressure + '\'' + ",sea_level = '" + seaLevel + '\'' + ",grnd_level = '" + grndLevel + '\'' + ",humidity = '" + humidity + '\'' + ",temp_kf = '" + tempKf + '\'' + "}"; 114 | } 115 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weatherlist/Sys.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weatherlist; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | 9 | public class Sys implements Serializable { 10 | 11 | @SerializedName("pod") 12 | private String pod; 13 | 14 | public String getPod() { 15 | return pod; 16 | } 17 | 18 | public void setPod(String pod) { 19 | this.pod = pod; 20 | } 21 | 22 | @NonNull 23 | @Override 24 | public String toString() { 25 | return 26 | "Sys{" + 27 | "pod = '" + pod + '\'' + 28 | "}"; 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weatherlist/WeatherDatesResponse.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weatherlist; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | import java.util.List; 9 | 10 | public class WeatherDatesResponse implements Serializable { 11 | 12 | @SerializedName("cod") 13 | private String cod; 14 | 15 | @SerializedName("message") 16 | private int message; 17 | 18 | @SerializedName("cnt") 19 | private int cnt; 20 | 21 | @SerializedName("list") 22 | private List list; 23 | 24 | @SerializedName("city") 25 | private City city; 26 | 27 | public String getCod() { 28 | return cod; 29 | } 30 | 31 | public void setCod(String cod) { 32 | this.cod = cod; 33 | } 34 | 35 | public int getMessage() { 36 | return message; 37 | } 38 | 39 | public void setMessage(int message) { 40 | this.message = message; 41 | } 42 | 43 | public int getCnt() { 44 | return cnt; 45 | } 46 | 47 | public void setCnt(int cnt) { 48 | this.cnt = cnt; 49 | } 50 | 51 | public List getList() { 52 | return list; 53 | } 54 | 55 | public void setList(List list) { 56 | this.list = list; 57 | } 58 | 59 | public City getCity() { 60 | return city; 61 | } 62 | 63 | public void setCity(City city) { 64 | this.city = city; 65 | } 66 | 67 | @NonNull 68 | @Override 69 | public String toString() { 70 | return "WeatherDatesResponse{" + "cod = '" + cod + '\'' + ",message = '" + message + '\'' + ",cnt = '" + cnt + '\'' + ",list = '" + list + '\'' + ",city = '" + city + '\'' + "}"; 71 | } 72 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weatherlist/WeatherItem.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weatherlist; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | 9 | public class WeatherItem implements Serializable { 10 | 11 | @SerializedName("id") 12 | private int id; 13 | 14 | @SerializedName("main") 15 | private String main; 16 | 17 | @SerializedName("description") 18 | private String description; 19 | 20 | @SerializedName("icon") 21 | private String icon; 22 | 23 | public void setId(int id) { 24 | this.id = id; 25 | } 26 | 27 | public int getId() { 28 | return id; 29 | } 30 | 31 | public void setMain(String main) { 32 | this.main = main; 33 | } 34 | 35 | public String getMain() { 36 | return main; 37 | } 38 | 39 | public void setDescription(String description) { 40 | this.description = description; 41 | } 42 | 43 | public String getDescription() { 44 | return description; 45 | } 46 | 47 | public void setIcon(String icon) { 48 | this.icon = icon; 49 | } 50 | 51 | public String getIcon() { 52 | return icon; 53 | } 54 | 55 | @NonNull 56 | @Override 57 | public String toString() { 58 | return 59 | "WeatherItem{" + 60 | "id = '" + id + '\'' + 61 | ",main = '" + main + '\'' + 62 | ",description = '" + description + '\'' + 63 | ",icon = '" + icon + '\'' + 64 | "}"; 65 | } 66 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/model/weatherlist/Wind.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.model.weatherlist; 2 | 3 | import androidx.annotation.NonNull; 4 | 5 | import com.google.gson.annotations.SerializedName; 6 | 7 | import java.io.Serializable; 8 | 9 | public class Wind implements Serializable { 10 | 11 | @SerializedName("speed") 12 | private Object speed; 13 | 14 | @SerializedName("deg") 15 | private int deg; 16 | 17 | @SerializedName("gust") 18 | private Object gust; 19 | 20 | public Object getSpeed() { 21 | return speed; 22 | } 23 | 24 | public void setSpeed(Object speed) { 25 | this.speed = speed; 26 | } 27 | 28 | public int getDeg() { 29 | return deg; 30 | } 31 | 32 | public void setDeg(int deg) { 33 | this.deg = deg; 34 | } 35 | 36 | public Object getGust() { 37 | return gust; 38 | } 39 | 40 | public void setGust(Object gust) { 41 | this.gust = gust; 42 | } 43 | 44 | @NonNull 45 | @Override 46 | public String toString() { 47 | return "Wind{" + "speed = '" + speed + '\'' + ",deg = '" + deg + '\'' + ",gust = '" + gust + '\'' + "}"; 48 | } 49 | } -------------------------------------------------------------------------------- /app/src/main/java/com/project/agroworldapp/weather/viewholder/WeatherForecastViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworldapp.weather.viewholder; 2 | 3 | import android.view.View; 4 | 5 | import androidx.annotation.NonNull; 6 | import androidx.recyclerview.widget.RecyclerView; 7 | 8 | import com.bumptech.glide.Glide; 9 | import com.project.agroworldapp.weather.listener.WeatherForecastListener; 10 | import com.project.agroworldapp.R; 11 | import com.project.agroworldapp.databinding.ForecastItemLayoutBinding; 12 | import com.project.agroworldapp.weather.model.weatherlist.ListItem; 13 | 14 | public class WeatherForecastViewHolder extends RecyclerView.ViewHolder { 15 | private final ForecastItemLayoutBinding binding; 16 | 17 | public WeatherForecastViewHolder(@NonNull ForecastItemLayoutBinding binding) { 18 | super(binding.getRoot()); 19 | this.binding = binding; 20 | } 21 | 22 | public void bindForecastData(ListItem item, WeatherForecastListener listener) { 23 | String iconUrl = "http://openweathermap.org/img/wn/" + item.getWeather().get(0).getIcon() + "@2x.png"; 24 | String mainTemp = String.format("%.0f", (item.getMain().getTemp() + 0.01) - 273.15); 25 | String[] dates = item.getDtTxt().split(" "); 26 | binding.tvForecastDate.setText(dates[0] + "\n" + dates[1]); 27 | binding.tvForecastTemp.setText(mainTemp + "°C"); 28 | binding.tvForecastStatus.setText(item.getWeather().get(0).getDescription()); 29 | Glide.with(binding.ivForecastIcon).load(iconUrl).placeholder(R.drawable.weather).dontAnimate().into(binding.ivForecastIcon); 30 | 31 | binding.crdForecast.setOnClickListener(new View.OnClickListener() { 32 | @Override 33 | public void onClick(View v) { 34 | listener.onForecastWeatherCardClick(item.getWeather().get(0).getDescription()); 35 | } 36 | }); 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/res/anim/down.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/up.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/button_bgd.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/all_buttons.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 35 | 36 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/app_icon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/main/res/drawable/app_icon4.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/background_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/baseline_language_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/baseline_logout_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/baseline_more_vert_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/cart_bottom_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/disease.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/main/res/drawable/disease.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/expand.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/main/res/drawable/expand.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/farmer_in.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/main/res/drawable/farmer_in.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/findingtwo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/main/res/drawable/findingtwo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/flowers.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/main/res/drawable/flowers.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/fruits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/main/res/drawable/fruits.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_add_circle_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_call_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_cancel_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_emoji_transportation_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_home_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_menu_book_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_newspaper_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_person_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_photo_camera_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_search_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_shop_two_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_warning_24.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_crt_price.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 8 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_view_bgd.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/navigation_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/payment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/main/res/drawable/payment.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/plant3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/main/res/drawable/plant3.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/search_bgd.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/side_white_panel.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/weather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/main/res/drawable/weather.png -------------------------------------------------------------------------------- /app/src/main/res/font/average_sans.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/averia_libre_bold.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/cantora_one.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/coiny.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/copse.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/days_one.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/fredoka_one.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/lemon.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/lexend_bold.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/new_rocker.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/poppins_medium.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/font/rowdies.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_crops.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 14 | 15 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_dashboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 20 | 21 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_diseases.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 20 | 21 | 30 | 31 | 40 | 41 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_flowers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 14 | 15 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_fruits.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 18 | 19 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_how_to_expand.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 18 | 19 | 29 | 30 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_payment_history.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 23 | 24 | 30 | 31 | 37 | 38 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_weather_forecast.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 20 | 21 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/layout/article_item_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 16 | 17 | 23 | 24 | 34 | 35 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_custom_multicolor_progressbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_news.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 18 | 19 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/message.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 24 | 25 | 26 | 27 | 34 | 35 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /app/src/main/res/layout/shimmer_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/vehicle_shimmer.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/menu/filter_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/menu/forecast_menu_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/menu/home_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 10 | 11 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/menu/logout_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 12 | 13 | 16 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/menu/priority_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/menu/profile_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 12 | 15 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/menu/shopping_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/menu/transport_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/raw/cool.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/app/src/main/res/raw/cool.mp3 -------------------------------------------------------------------------------- /app/src/main/res/values-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/values-land/style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/values-land/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/values-w1240dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/values-w600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #19CF40 4 | #0d0233 5 | #00fffb 6 | 7 | #FFF 8 | #FFFFFF 9 | #FF404A3A 10 | #5D1F91 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 20dp 4 | 10dp 5 | 30dp 6 | 15dp 7 | 25sp 8 | 50dp 9 | 100dp 10 | 15sp 11 | 20sp 12 | 40dp 13 | 25dp 14 | 70dp 15 | 150dp 16 | 75dp 17 | 60dp 18 | 80dp 19 | 200dp 20 | 18sp 21 | 18sp 22 | 16sp 23 | 8dp 24 | 5dp 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/values/preloaded_fonts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @font/average_sans 5 | @font/averia_libre_bold 6 | @font/cantora_one 7 | @font/coiny 8 | @font/copse 9 | @font/days_one 10 | @font/fredoka_one 11 | @font/lemon 12 | @font/lexend_bold 13 | @font/new_rocker 14 | @font/poppins_medium 15 | @font/rowdies 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/xml/data_extraction_rules.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /app/src/test/java/com/project/agroworld/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.project.agroworld; 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 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | dependencies { 3 | classpath 'com.google.gms:google-services:4.3.14' 4 | classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.4' 5 | classpath 'com.android.tools.build:gradle:3.4.0' 6 | } 7 | }// Top-level build file where you can add configuration options common to all sub-projects/modules. 8 | plugins { 9 | id 'com.android.application' version '7.3.0' apply false 10 | id 'com.android.library' version '7.3.0' apply false 11 | id 'com.google.gms.google-services' version '4.3.10' apply false 12 | id 'org.jetbrains.kotlin.android' version '1.6.10' apply false 13 | 14 | } -------------------------------------------------------------------------------- /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 22 | android.enableJetifier=true 23 | CHAT_BOT_API="HC5OGdHhUQPzfMOy"; 24 | RAZORPAY_KEY_ID="rzp_test_HrFw0vaoVIDlP9"; 25 | API_KEY="92f4e9a9c233be99f0b33d1c58c72386"; 26 | BRAIN_ID="174019"; 27 | LANGUAGE_REQUEST_CODE=139; 28 | 29 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theashishgavade/AgroWorldapp/1f15c67d7414930e3378281e6f74bb27178a4de3/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Oct 31 21:34:27 IST 2022 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 = "AgroWorld" 16 | include ':app' 17 | --------------------------------------------------------------------------------