Skip to content

Commit

Permalink
Update SDK from 34 to 35, AGP from 8.0.2 to 8.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
muindi.stephen committed Nov 5, 2024
1 parent 3338140 commit f2068b8
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -42,6 +43,14 @@ class IoTGraphsFragment : Fragment() {
setUpSoilMoisture()
setUpLightDensity()
setUpSoilTemperature()

initBinding()
}

private fun initBinding() {
binding.materialToolbarioTGraphs.setOnClickListener {
findNavController().navigateUp()
}
}

private fun setUpSoilTemperature() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class MonitorFarmConditionFragment : Fragment(),OnMapReadyCallback {

(activity as AppCompatActivity).supportActionBar?.hide()

initBinding()

if (!isLocationEnabled()) {
promptEnableLocationServices()
Expand Down Expand Up @@ -118,6 +119,13 @@ class MonitorFarmConditionFragment : Fragment(),OnMapReadyCallback {
setUpChart()
}

private fun initBinding() {
view?.findViewById<TextView>(R.id.textViewViewAllGraphs)
?.setOnClickListener {
findNavController().navigate(R.id.ioTGraphsFragment)
}
}


private fun isLocationEnabled(): Boolean {
val locationManager = requireContext().getSystemService(Context.LOCATION_SERVICE) as LocationManager
Expand Down
17 changes: 16 additions & 1 deletion app/src/main/res/layout/fragment_io_t_graphs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
android:layout_width="match_parent"
android:layout_height="match_parent">



<com.github.mikephil.charting.charts.LineChart
android:id="@+id/lineChartTemperature"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:layout_marginTop="68dp"
android:layout_marginEnd="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down Expand Up @@ -68,6 +70,19 @@
android:layout_marginBottom="@dimen/_16dp"
app:layout_constraintTop_toBottomOf="@+id/lineChartLightDensity"/>

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/materialToolbarioTGraphs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:navigationIcon="@drawable/ic_arrow_back"
app:subtitle="Graphs"
app:subtitleTextColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />


</androidx.constraintlayout.widget.ConstraintLayout>
Expand Down
37 changes: 35 additions & 2 deletions app/src/main/res/layout/fragment_monitor_farm_condition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -364,13 +364,46 @@
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"
android:layout_marginEnd="@dimen/_16dp"
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" />

<TextView
android:id="@+id/textView181"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginBottom="2dp"
android:text="Summary Graph"
android:fontFamily="@font/nunito_sans"
android:textSize="14sp"
android:textStyle="bold"
android:clickable="true"
android:focusable="true"
android:textColor="@color/black"
app:layout_constraintBottom_toTopOf="@+id/pieChart"
app:layout_constraintStart_toStartOf="parent" />

<TextView
android:id="@+id/textViewViewAllGraphs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_marginBottom="2dp"
android:text="View all graphs"
android:foreground="?selectableItemBackground"
android:fontFamily="@font/nunito_sans"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="@color/black"
android:clickable="true"
android:focusable="true"
app:layout_constraintBottom_toTopOf="@+id/pieChart"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
8 changes: 8 additions & 0 deletions app/src/main/res/navigation/navigation_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@
<argument
android:name="newfarmfield"
app:argType="com.steve_md.smartmkulima.model.NewFarmField" />
<action
android:id="@+id/action_monitorFarmConditionFragment_to_ioTGraphsFragment"
app:destination="@id/ioTGraphsFragment" />
</fragment>
<fragment
android:id="@+id/locateAgriTechCompaniesFragment"
Expand Down Expand Up @@ -839,6 +842,11 @@
android:name="com.steve_md.smartmkulima.ui.fragments.others.SettingsFragment"
android:label="fragment_settings"
tools:layout="@layout/fragment_settings" />
<fragment
android:id="@+id/ioTGraphsFragment"
android:name="com.steve_md.smartmkulima.ui.fragments.main.IoTGraphsFragment"
android:label="fragment_io_t_graphs"
tools:layout="@layout/fragment_io_t_graphs" />


</navigation>
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"
}
}

Expand Down

0 comments on commit f2068b8

Please sign in to comment.