Commit Graph

89 Commits

Author SHA1 Message Date
Cutiful
75b5397932 feat: add GrowthLineChart composable 2025-07-10 18:18:58 +07:00
Cutiful
b2d0620219 feat: Add GraphicDataRepository for fetching NPK sensor data 2025-07-10 18:18:45 +07:00
Cutiful
c994b3c529 Refactor: reduce delay in DetailViewModel 2025-07-10 18:18:35 +07:00
Cutiful
3ceeeabf0b feat: add custom button component 2025-07-10 18:18:22 +07:00
Cutiful
94b655481c feat: add ClusterViewModel for recommendation feature
This commit introduces `ClusterViewModel` to manage the state and logic for fetching growth recipe recommendations.

Key functionalities:
- Manages a `StateFlow` named `_state` to represent the current state of the recommendation request (Idle, Loading, Success, Error).
- Provides a public `state` flow for observing changes in the recommendation request.
- Implements a `getRecommendation()` function that:
    - Sets the state to `Loading`.
    - Calls the `getRecommendation()` method of the `ClusteringRepository`.
    - If successful and data is present, updates the state to `Success` with the last item from the response.
    - If the response is empty, updates the state to `Error` with a "Data tidak ditemukan" message.
    - Catches exceptions, maps them to user-friendly error messages, and updates the state to `Error`.
    - Logs detailed error messages if fetching data fails.
2025-07-10 18:18:07 +07:00
Cutiful
e274873e43 feat: add cluster screen for displaying recommendation
This commit introduces the `ClusterScreen.kt` composable, which displays plant care recommendations.

The screen includes:
- A top app bar with the title "Rekomendasi Perawatan".
- Pull-to-refresh functionality to update recommendations.
- Display of an image based on the cluster number (1, 2, or 3).
- "Diperbarui Pada" (Updated On) timestamp, formatted to Indonesian locale.
- A "Rekomendasi" section showing general advice and specific care instructions.
- An image of a plant.
- `ListItemClustering` to display humidity, temperature, and pH values.
- Loading and error states handling.

A private `formatDate` utility function is included to format timestamps to "dd MMMM yyyy, HH:mm" in Indonesian.
2025-07-10 18:17:55 +07:00
Cutiful
acc732871f feat: Add Koin module for clustering network service
This commit introduces a Koin module, `clusterNetworkModule`, to provide instances for network-related dependencies for the clustering feature.

Specifically, it provides:
- An `OkHttpClient` instance with a 5-second connection timeout.
- A `Retrofit` instance configured with a base URL ("http://labai.polinema.ac.id:5050/"), the provided `OkHttpClient`, and `GsonConverterFactory`.
- A `ClusteringService` instance created by the `Retrofit` instance.
2025-07-10 18:17:45 +07:00
Cutiful
6a103f7680 feat: Add ClusteringService interface
This commit introduces the `ClusteringService` interface.

This interface defines a suspend function `getRecommendations` to fetch clustering recommendations from the "api/data" endpoint. It is expected to return a list of `ClusteringResponse` objects.
2025-07-10 18:17:35 +07:00
Cutiful
aebb7d7127 feat: add clustering response model 2025-07-10 18:17:29 +07:00
Cutiful
ff0341e2e0 feat: Add ClusteringRepository for fetching recommendations 2025-07-10 18:17:20 +07:00
Cutiful
32933d9ad3 Bump version to 1.0.1 (13) 2025-07-10 18:17:07 +07:00
Cutiful
45a81e1e35 feat: Add Koin module for growth recipe feature 2025-07-10 18:16:52 +07:00
Cutiful
cfa75a4289 add plant image 2025-07-05 11:27:25 +07:00
Cutiful
fc9c9614ba feat: implement register feature 2025-07-05 11:26:07 +07:00
Cutiful
90df005a3f feat: enhance UI/UX of plant disease detection feature 2025-07-05 11:25:42 +07:00
Cutiful
0dae042e54 refactor: remove flash and history buttons from camera shutter 2025-07-05 11:25:03 +07:00
Cutiful
1ef33bcfda feat: add custom snackbar and UI events for control feature 2025-07-05 11:24:41 +07:00
Cutiful
0f65748195 fix: rename Log to ActuatorLog in ControlLogResponse 2025-07-05 11:24:07 +07:00
Cutiful
5899b77556 feat: implement snackbar for control actuator 2025-07-05 11:23:49 +07:00
Cutiful
18c5b81ccf feat: disable history button on camera screen 2025-07-05 11:23:34 +07:00
Cutiful
00799be513 feat: add register functionality to AuthRepository 2025-07-05 11:23:24 +07:00
Cutiful
3ac9920e0f fix: adjust leading icon size in AppTextField 2025-07-05 11:23:13 +07:00
Cutiful
a2672f7a6b feat: add modifier parameter to AppButton 2025-07-05 11:23:03 +07:00
Cutiful
35a5e7a016 feat: implement register functionality in ApiService 2025-07-05 11:22:52 +07:00
Cutiful
eed504f04e feat: add actuator history functionality and refactor API calls 2025-07-05 11:22:32 +07:00
Cutiful
66b7159bf6 feat: implement actuator control history feature 2025-07-05 11:21:56 +07:00
Cutiful
c147cd0151 feat: add image assets for calendar, pumpkins, melon, and solar history 2025-06-29 07:54:58 +07:00
Cutiful
1b8efcbfe6 feat: add some library 2025-06-29 07:54:37 +07:00
Cutiful
c2aa13e4ce feat: implement detail screen for NPK and DHT sensors 2025-06-29 07:53:51 +07:00
Cutiful
f48a96c96c feat: implement actuator control with Koin DI and API integration 2025-06-29 07:53:10 +07:00
Cutiful
287d5774e8 feat: implement history and save detection result to local database 2025-06-29 07:51:50 +07:00
Cutiful
5151379922 add draft report 2025-06-20 22:35:00 +07:00
Cutiful
42d9ff8510 feat: add DatabaseModule for plant disease detection feature 2025-06-15 15:58:41 +07:00
Cutiful
b6f232f655 feat: navigate to history screen from camera 2025-06-15 15:58:06 +07:00
Cutiful
99d76703e7 feat: add Bitmap extension functions for image manipulation 2025-06-15 15:57:44 +07:00
Cutiful
117785c957 feat: Add AppDatabase for plant disease detection feature 2025-06-15 15:57:30 +07:00
Cutiful
7c427b7945 feat: add data model for sensor response and new image assets 2025-06-13 13:47:54 +07:00
Cutiful
b0a3130cb9 feat: refactor package 2025-06-13 13:47:25 +07:00
Cutiful
6b5010d37d feat: integrate plant disease detection, growth recipe, and commodity price prediction features 2025-06-12 11:43:45 +07:00
Cutiful
17e2762f3b feat: implement commodity price prediction and growth recipe features 2025-06-12 11:43:17 +07:00
Cutiful
46b65e4b99 refactor: move NavGraph to navigation package and add auth flow 2025-06-12 11:42:54 +07:00
Cutiful
6c52d6c008 feat: add network security config and update themes 2025-06-12 11:42:24 +07:00
Cutiful
f4a23460d1 feat: add Bitmap to Base64 conversion extension 2025-06-12 11:41:47 +07:00
Cutiful
1230d015ce feat: Add ViewModel module for Koin 2025-06-12 11:41:12 +07:00
Cutiful
4068a878f9 feat: Add SensorDataRepository 2025-06-12 11:40:55 +07:00
Cutiful
f564f91f69 feat: add data models for NPK graphic data 2025-06-12 11:40:39 +07:00
Cutiful
2395f9b3f6 feat: remove unused imports in CameraViewModel 2025-06-12 11:40:17 +07:00
Cutiful
79878f6fb5 feat: remove unused imports in CameraViewModel 2025-06-12 11:40:07 +07:00
Cutiful
c6108fc807 fix: adjust control grid height and card padding 2025-06-12 11:39:51 +07:00
Cutiful
39224f66c4 feat: implement user authentication and profile display 2025-06-12 11:39:22 +07:00