Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve package structure, refactor Manage Symptoms Screen #204

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/src/main/java/com/mensinator/app/App.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.mensinator.app

import android.app.Application
import com.mensinator.app.business.*
import com.mensinator.app.settings.SettingsViewModel
import com.mensinator.app.statistics.StatisticsViewModel
import com.mensinator.app.symptoms.ManageSymptomsViewModel
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin
Expand All @@ -22,6 +24,7 @@ class App : Application() {
singleOf(::ExportImport) { bind<IExportImport>() }
singleOf(::NotificationScheduler) { bind<INotificationScheduler>() }

viewModel { ManageSymptomsViewModel(get()) }
viewModel { SettingsViewModel(get(), get(), get()) }
viewModel { StatisticsViewModel(get(), get(), get(), get(), get()) }
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/mensinator/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import android.view.WindowManager
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import com.mensinator.app.navigation.MensinatorApp
import com.mensinator.app.ui.navigation.MensinatorApp
import com.mensinator.app.ui.theme.MensinatorTheme

class MainActivity : AppCompatActivity() {
Expand Down
275 changes: 0 additions & 275 deletions app/src/main/java/com/mensinator/app/ManageSymptomScreen.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mensinator.app
package com.mensinator.app.business

import android.util.Log
import com.mensinator.app.extensions.roundToTwoDecimalPoints
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mensinator.app
package com.mensinator.app.business

import android.database.sqlite.SQLiteDatabase

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mensinator.app
package com.mensinator.app.business

import android.content.ContentValues
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mensinator.app
package com.mensinator.app.business

import java.time.LocalDate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mensinator.app
package com.mensinator.app.business

interface IExportImport {
fun getDocumentsExportFilePath(): String
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mensinator.app
package com.mensinator.app.business

import java.time.LocalDate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mensinator.app
package com.mensinator.app.business

import java.time.LocalDate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.mensinator.app
package com.mensinator.app.business

import android.database.sqlite.SQLiteDatabase
import androidx.annotation.WorkerThread
import com.mensinator.app.data.Symptom
import com.mensinator.app.data.Setting
import java.time.LocalDate

interface IPeriodDatabaseHelper {
Expand Down Expand Up @@ -39,7 +41,7 @@ interface IPeriodDatabaseHelper {
fun updateSymptomDate(dates: List<LocalDate>, symptomId: List<Int>)

// This function is used to get symptoms for a given date
fun getSymptomsFromDate(date: LocalDate): List<Int>
fun getActiveSymptomIdsForDate(date: LocalDate): List<Int>

fun getSymptomColorForDate(date: LocalDate): List<String>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mensinator.app
package com.mensinator.app.business

import java.time.LocalDate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mensinator.app
package com.mensinator.app.business


import android.app.AlarmManager
Expand All @@ -7,6 +7,7 @@ import android.content.Context
import android.content.Intent
import android.util.Log
import androidx.core.app.NotificationManagerCompat
import com.mensinator.app.NotificationReceiver
import java.time.LocalDate
import java.time.ZoneId

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.mensinator.app
package com.mensinator.app.business

import android.util.Log
import java.time.LocalDate
Expand Down
Loading