From f2068b88c3152c9f2d8af6dd8723e03a3bffdc42 Mon Sep 17 00:00:00 2001 From: "muindi.stephen" Date: Tue, 5 Nov 2024 13:27:36 +0300 Subject: [PATCH] Update SDK from 34 to 35, AGP from 8.0.2 to 8.6.0 --- app/build.gradle | 4 +- .../ui/fragments/main/IoTGraphsFragment.kt | 9 +++++ .../main/MonitorFarmConditionFragment.kt | 8 ++++ .../main/res/layout/fragment_io_t_graphs.xml | 17 ++++++++- .../fragment_monitor_farm_condition.xml | 37 ++++++++++++++++++- .../main/res/navigation/navigation_graph.xml | 8 ++++ build.gradle | 3 +- 7 files changed, 80 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index eebeab5b..f76df7e1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,12 +11,12 @@ plugins { android { namespace 'com.steve_md.smartmkulima' - compileSdk 34 + compileSdk 35 defaultConfig { applicationId "com.steve_md.smartmkulima" minSdk 23 - targetSdk 34 + targetSdk 35 versionCode 2 versionName "1.0" diff --git a/app/src/main/java/com/steve_md/smartmkulima/ui/fragments/main/IoTGraphsFragment.kt b/app/src/main/java/com/steve_md/smartmkulima/ui/fragments/main/IoTGraphsFragment.kt index cfd8abe4..4bced2fc 100644 --- a/app/src/main/java/com/steve_md/smartmkulima/ui/fragments/main/IoTGraphsFragment.kt +++ b/app/src/main/java/com/steve_md/smartmkulima/ui/fragments/main/IoTGraphsFragment.kt @@ -7,6 +7,7 @@ import android.view.View import android.view.ViewGroup import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment +import androidx.navigation.fragment.findNavController import com.github.mikephil.charting.data.Entry import com.github.mikephil.charting.data.LineData import com.github.mikephil.charting.data.LineDataSet @@ -42,6 +43,14 @@ class IoTGraphsFragment : Fragment() { setUpSoilMoisture() setUpLightDensity() setUpSoilTemperature() + + initBinding() + } + + private fun initBinding() { + binding.materialToolbarioTGraphs.setOnClickListener { + findNavController().navigateUp() + } } private fun setUpSoilTemperature() { diff --git a/app/src/main/java/com/steve_md/smartmkulima/ui/fragments/main/MonitorFarmConditionFragment.kt b/app/src/main/java/com/steve_md/smartmkulima/ui/fragments/main/MonitorFarmConditionFragment.kt index b93ca559..9d2b88fb 100644 --- a/app/src/main/java/com/steve_md/smartmkulima/ui/fragments/main/MonitorFarmConditionFragment.kt +++ b/app/src/main/java/com/steve_md/smartmkulima/ui/fragments/main/MonitorFarmConditionFragment.kt @@ -83,6 +83,7 @@ class MonitorFarmConditionFragment : Fragment(),OnMapReadyCallback { (activity as AppCompatActivity).supportActionBar?.hide() + initBinding() if (!isLocationEnabled()) { promptEnableLocationServices() @@ -118,6 +119,13 @@ class MonitorFarmConditionFragment : Fragment(),OnMapReadyCallback { setUpChart() } + private fun initBinding() { + view?.findViewById(R.id.textViewViewAllGraphs) + ?.setOnClickListener { + findNavController().navigate(R.id.ioTGraphsFragment) + } + } + private fun isLocationEnabled(): Boolean { val locationManager = requireContext().getSystemService(Context.LOCATION_SERVICE) as LocationManager diff --git a/app/src/main/res/layout/fragment_io_t_graphs.xml b/app/src/main/res/layout/fragment_io_t_graphs.xml index 6ae33f67..d43fe24c 100644 --- a/app/src/main/res/layout/fragment_io_t_graphs.xml +++ b/app/src/main/res/layout/fragment_io_t_graphs.xml @@ -11,12 +11,14 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + + + diff --git a/app/src/main/res/layout/fragment_monitor_farm_condition.xml b/app/src/main/res/layout/fragment_monitor_farm_condition.xml index 34661bc3..43d1fb81 100644 --- a/app/src/main/res/layout/fragment_monitor_farm_condition.xml +++ b/app/src/main/res/layout/fragment_monitor_farm_condition.xml @@ -327,7 +327,7 @@ android:layout_width="match_parent" android:layout_height="300dp" android:layout_marginStart="16dp" - android:layout_marginTop="68dp" + android:layout_marginTop="100dp" android:layout_marginEnd="16dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -364,7 +364,7 @@ android:id="@+id/textView103" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="8dp" + android:layout_marginBottom="32dp" android:fontFamily="@font/nunito_sans" android:textSize="14sp" android:layout_marginStart="16dp" @@ -372,5 +372,38 @@ android:text="Below is your farm monitoring in summary, \nrepresented in a visual chart" app:layout_constraintBottom_toTopOf="@+id/pieChart" app:layout_constraintStart_toStartOf="parent" /> + + + + \ No newline at end of file diff --git a/app/src/main/res/navigation/navigation_graph.xml b/app/src/main/res/navigation/navigation_graph.xml index 331b2fb0..038fa4df 100644 --- a/app/src/main/res/navigation/navigation_graph.xml +++ b/app/src/main/res/navigation/navigation_graph.xml @@ -321,6 +321,9 @@ + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 90c7341b..cad7b6c3 100644 --- a/build.gradle +++ b/build.gradle @@ -15,6 +15,7 @@ buildscript { mockk_version = "1.10.5" roboelectric_version = "4.5.1" mockito_version = "3.2.0" + agp_version = '8.6.0' } repositories { @@ -32,7 +33,7 @@ buildscript { classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.8.3" classpath 'com.google.dagger:hilt-android-gradle-plugin:2.51.1' classpath 'com.google.gms:google-services:4.4.2' - classpath "com.android.tools.build:gradle:8.0.2" + classpath "com.android.tools.build:gradle:$agp_version" } }