Skip to content

Commit

Permalink
fixed breaking code
Browse files Browse the repository at this point in the history
  • Loading branch information
MuindiStephen committed Oct 1, 2024
1 parent 82713fb commit c4459f5
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 201 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,5 @@ object NetworkModule {
return retrofit.create(FarmProduceApiService::class.java)
}

// @Singleton
// @Provides
// fun providesDarajaApiClient(): DarajaApiClient {
// return DarajaApiClient(
// consumerKey = "NgGUJ2LGJlVvjdLu8P7yDGIs6v4RmMF1114mYRUVTVOjsCii",
// consumerSecret = "L5Ur0sgEuGfBAB7u8ynlH0bzerD1VABt7ABASfBAozvATLKETNHGcpTieX1vzLyv",
// environment = Constants.SANDBOX_BASE_URL
// )
// }

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.steve_md.smartmkulima.di

import PaymentRepository
import com.steve_md.smartmkulima.data.remote.DarajaApiClient
import com.steve_md.smartmkulima.data.remote.FarmProduceApiService
import com.steve_md.smartmkulima.data.repositories.AuthRepository
import com.steve_md.smartmkulima.data.repositories.FarmCycleRepository
Expand Down Expand Up @@ -52,13 +50,6 @@ object RepositoryModule {
return AuthRepositoryImpl()
}

// @Singleton
// @Provides
// fun providesPaymentRepository(
// darajaApiClient: DarajaApiClient,
// appDatabase: AppDatabase): PaymentRepository {
// return PaymentRepository(darajaApiClient,appDatabase)
// }


}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DetailedFarmCycleActivity : AppCompatActivity() {
private val viewModel: MainViewModel by viewModels()
private lateinit var binding: ActivityDetailedFarmCycleBinding
private val tasksAdapter by lazy { LocalFarmCycleTasksAdapter() }
// private lateinit var navController: NavController
// private lateinit var navController: NavController


@RequiresApi(Build.VERSION_CODES.O)
Expand Down Expand Up @@ -101,7 +101,7 @@ class DetailedFarmCycleActivity : AppCompatActivity() {
// Marking the Crop Cycle As DONE
binding.buttonMarkAsDoneCropCycle.setOnClickListener {
showChangeCropCycleStatusDialog()
// textViewComments.isVisible = false
// textViewComments.isVisible = false
}

binding.buttonOpenRecordsExpensesAndRevenues.setOnClickListener {
Expand Down Expand Up @@ -169,12 +169,20 @@ class DetailedFarmCycleActivity : AppCompatActivity() {
}

private fun showCropCycleCancelledAddCommentsBottomSheetDialog() {
val modal = CropCycleCancelledStatusCommentsFragment()

val localFarmCycle: LocalFarmCycle? = intent.getParcelableExtra("localFarmCycle")

val modal = CropCycleCancelledStatusCommentsFragment().apply {
arguments = Bundle().apply {
putString("cropCycleName", localFarmCycle?.cropName)
}
}
supportFragmentManager.let {
modal.show(it, CropCycleCancelledStatusCommentsFragment.TAG)
modal.show(it, CropCycleCancelledStatusCommentsFragment.TAG)
}
}


private fun showViewCropCycleAnalyticsBottomSheet() {

val localFarmCycle: LocalFarmCycle? = intent.getParcelableExtra("localFarmCycle")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,17 @@ class CropCycleCancelledStatusCommentsFragment : BottomSheetDialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

val cropName = arguments?.getString("cropCycleName")

// update or add comments why cancel crop cycle
binding.btnSubmitCommentsForCropCycleCancelling.setOnClickListener {

if (validateInputs()) {
viewModel.updateToNewCommentsCropCycleCancelled(
binding.inputCommentsForCancelCropCycle.text.toString()
)
if (cropName != null) {
viewModel.updateToNewCommentsCropCycleCancelled(
binding.inputCommentsForCancelCropCycle.text.toString(), cropName
)
}
displaySnackBar("Added comments.")

//view.findViewById<TextView>(R.id.textViewComments).isVisible = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class DetailedFarmCycleFragment : Fragment() {
}

val setStatus = binding.spinnerStatusOfFarmCycle.selectedItem.toString()
viewModel.updateTaskStatus(setStatus)
localFarmCycle?.let { viewModel.updateTaskStatus(setStatus, it.cropName) }
binding.textView86.text = setStatus

// val cycle = args.cycle
Expand Down

This file was deleted.

0 comments on commit c4459f5

Please sign in to comment.