Commit Graph

102 Commits

Author SHA1 Message Date
Cutiful
93ddf492bf chore: remove redundant newlines in SensorUtils.kt 2025-07-10 18:22:04 +07:00
Cutiful
50524c2a84 feat: add SensorExtention to extract NPK sensor values 2025-07-10 18:21:55 +07:00
Cutiful
155dea7be7 feat: Add NPK graphic day response data model 2025-07-10 18:21:44 +07:00
Cutiful
4e58b0394e feat: add Koin network module for growth recipe feature 2025-07-10 18:21:32 +07:00
Cutiful
fafc3c5854 feat: implement navigation for growth recipe feature 2025-07-10 18:21:21 +07:00
Cutiful
38bc640806 refactor: remove unused melon_large.png 2025-07-10 18:21:11 +07:00
Cutiful
e99f92390b feat: Add ListItemClustering Composable 2025-07-10 18:20:55 +07:00
Cutiful
ba998f96a0 style: remove surface container from LineChart background 2025-07-10 18:20:41 +07:00
Cutiful
e60f8eec33 refactor: remove kabocha pumpkin image 2025-07-10 18:20:22 +07:00
Cutiful
82bd172dc8 Fix: Truncate long diagnosis text in history items 2025-07-10 18:20:11 +07:00
Cutiful
1d6e018bc4 feat: add GrowthRecipeViewModel for fetching graphic data 2025-07-10 18:20:00 +07:00
Cutiful
bbd4eef60c feat: Add GrowthRecipeService for NPK data retrieval 2025-07-10 18:19:49 +07:00
Cutiful
c35e388bda feat: implement Growth Recipe Screen UI and logic 2025-07-10 18:19:36 +07:00
Cutiful
d9ecb961aa feat: Add GrowthRecipeFeatureBanner composable 2025-07-10 18:19:21 +07:00
Cutiful
a27c9a65c9 feat: integrate Koin and navigation in GrowthRecipeActivity 2025-07-10 18:19:10 +07:00
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