feat(filter,settings): calendar filter in drawer + settings (v0.5.0)
M3 — calendar filter: the navigation drawer now hosts the calendar list inline (grouped by account, colour swatch + checkbox per calendar). Hidden calendars are persisted app-side and filtered centrally in the repository, so month/week/day re-filter live the moment a checkbox flips. Drawer trimmed to Today, the calendar filter, and Settings, with leading icons and a clear title/section type scale; the stubbed jump-to-date entry (M2) was removed. M4 — settings: full-screen destination with appearance (theme System/Light/ Dark, Material You dynamic colour auto-disabled < API 31, week start Auto/Mon/ Sun), language (per-app locales via AppCompat, persisted to API 29), and an about section (version, licence, source link). Theme is driven by one activity-scoped settings source so changes apply app-wide at once. Week start now drives the month grid and week view; Auto follows the locale. Also: - default view switched from month to week - Settings screen handles system back (was closing the app) - fix pre-existing NonObservableLocale/LocalContextConfigurationRead lint errors in EventDetailScreen so CI lint is green again - versionName/versionCode bumped to 0.5.0 / 5 Tests: repository hidden-filter (incl. live re-emit), SettingsPrefs round-trip + week-start resolution, filter grouping. lint + unit tests + assembleDebug green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package de.jeanlucmakiola.calendula.data.calendar
|
||||
|
||||
import android.Manifest
|
||||
import androidx.datastore.core.DataStore
|
||||
import androidx.datastore.preferences.core.PreferenceDataStoreFactory
|
||||
import androidx.datastore.preferences.core.Preferences
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.rule.GrantPermissionRule
|
||||
import com.google.common.truth.Truth.assertThat
|
||||
import de.jeanlucmakiola.calendula.data.prefs.CalendarPrefs
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.first
|
||||
import kotlinx.coroutines.runBlocking
|
||||
@@ -24,7 +28,10 @@ class CalendarRepositorySmokeTest {
|
||||
|
||||
private fun newRepo(): CalendarRepositoryImpl {
|
||||
val dataSource = AndroidCalendarDataSource(context)
|
||||
return CalendarRepositoryImpl(dataSource, Dispatchers.IO)
|
||||
val store: DataStore<Preferences> = PreferenceDataStoreFactory.create(
|
||||
produceFile = { context.cacheDir.resolve("smoke_test_prefs.preferences_pb") },
|
||||
)
|
||||
return CalendarRepositoryImpl(dataSource, CalendarPrefs(store), Dispatchers.IO)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user