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

Going Multiplatform #51

Draft
wants to merge 1,657 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1657 commits
Select commit Hold shift + click to select a range
7b1f5a5
Outsource mapping of EntryListItemState
Faltenreich Oct 9, 2024
dbeee76
Refactor mapper of EntryListItemState into use case
Faltenreich Oct 9, 2024
5e2a15c
Refactor MapEntryListItemStateUseCase
Faltenreich Oct 9, 2024
d407034
Localize food seed
Faltenreich Oct 12, 2024
d0c2c5b
Localize seed tags
Faltenreich Oct 13, 2024
d544c51
Open Statistic from Dashboard
Faltenreich Oct 13, 2024
a738fdf
Fix invalidation of dashboard by instantiating its use cases via fact…
Faltenreich Oct 13, 2024
90d0704
Fix latest BloodSugar in dashboard
Faltenreich Oct 13, 2024
26f5196
Adjust module for TagSeedQueries
Faltenreich Oct 14, 2024
143485f
Prepare KeyValueStore as interface by converting inline functions
Faltenreich Oct 14, 2024
8618980
Fix opt-in for expected and actual declarations
Faltenreich Oct 14, 2024
7b6db3e
Convert KeyValueStore into interface
Faltenreich Oct 14, 2024
21fb6d3
Fake KeyValueStory in tests
Faltenreich Oct 14, 2024
0c064f9
Set java version via toolchain
Faltenreich Oct 14, 2024
98520d5
Update Java version in GitHub Action
Faltenreich Oct 14, 2024
b125cc1
Update dependency of GitHub Action for validating Gradle wrapper
Faltenreich Oct 14, 2024
01975a6
Update Ktor
Faltenreich Oct 14, 2024
33acaed
Revert "Update dependency of GitHub Action for validating Gradle wrap…
Faltenreich Oct 14, 2024
fb42560
Revert "Update Java version in GitHub Action"
Faltenreich Oct 14, 2024
25c334d
Revert "Revert "Update Java version in GitHub Action""
Faltenreich Oct 14, 2024
54334d8
Revert "Revert "Update dependency of GitHub Action for validating Gra…
Faltenreich Oct 14, 2024
7d41c50
Limit concurrency in GitHub Action
Faltenreich Oct 14, 2024
d509841
Verify on push to feature branch
Faltenreich Oct 14, 2024
5ea4b7d
Fix code smell
Faltenreich Oct 14, 2024
4cec611
Fix badge for GitHub Actions
Faltenreich Oct 15, 2024
6fb3155
Map MeasurementValue for EntryListItem in MapEntryListItemStateUseCase
Faltenreich Oct 15, 2024
58f3ff2
Fix MeasurementValueSqlDelightDao.getAverageByPropertyId
Faltenreich Oct 15, 2024
02b53a6
Refactor upper view models
Faltenreich Oct 15, 2024
aa78f92
Replace deprecated GitHub Action for validating Gradle wrapper
Faltenreich Oct 16, 2024
46aeed1
Merge remote-tracking branch 'origin/feature/multiplatform' into feat…
Faltenreich Oct 16, 2024
d0d1d20
Prepare preference screen for food
Faltenreich Oct 16, 2024
9bf0667
Prepare Composable for FoodPreferenceList
Faltenreich Oct 16, 2024
9bd1fa6
Upgrade Android toolchain
Faltenreich Oct 16, 2024
56a1a82
Divide preferences into overview and reusable list
Faltenreich Oct 16, 2024
170f82d
Adopt food preferences to reusable list
Faltenreich Oct 16, 2024
b146b1d
Return PreferenceListItems from GetFoodPreferencesUseCase
Faltenreich Oct 16, 2024
7c3bf36
Read and write real values for FoodPreference
Faltenreich Oct 17, 2024
7ba801e
Style PreferenceListItemLayout with content
Faltenreich Oct 17, 2024
123edd4
Add button to food search field to open preferences
Faltenreich Oct 17, 2024
4a7d2b8
Prepare filtering of food search according to preference
Faltenreich Oct 17, 2024
e2c1213
Prepare query for filtered food
Faltenreich Oct 17, 2024
c7479ec
Nullify blank properties of user-generated food
Faltenreich Oct 17, 2024
6450bfb
Update food search after changing preference
Faltenreich Oct 17, 2024
b221869
Simplify validation of food
Faltenreich Oct 17, 2024
161e279
Refactor validation of food input
Faltenreich Oct 17, 2024
5d73621
Refresh food search onResume
Faltenreich Oct 18, 2024
d087a05
Avoid dependency injection in TopAppBar via slotting
Faltenreich Oct 18, 2024
0c25792
Display latest HbA1c in dashboard
Faltenreich Oct 18, 2024
f0a2660
Prepare estimated HbA1c
Faltenreich Oct 18, 2024
8e70acd
Fix retrieval of average BloodSugar in GetCurrentHbA1cUseCase
Faltenreich Oct 18, 2024
7b17d2c
Fix formula for estimated HbA1c
Faltenreich Oct 18, 2024
c895bb2
Open latest HbA1c or show formula for estimated value on click in das…
Faltenreich Oct 18, 2024
361434e
Simplify retrieval of selected unit in GetCurrentHbA1cUseCase
Faltenreich Oct 18, 2024
45baed2
Encapsulate logic from GetCurrentHbA1cUseCase
Faltenreich Oct 18, 2024
a851814
Refactor HbA1c in dashboard
Faltenreich Oct 19, 2024
2616607
Observe property by key
Faltenreich Oct 19, 2024
0f79f93
Adjust tests
Faltenreich Oct 19, 2024
d2e5eed
Adjust DashboardViewModelTest
Faltenreich Oct 19, 2024
bf100a0
Fix DashboardViewModelTest
Faltenreich Oct 25, 2024
0135b39
Fix code coverage reports for long-lasting branches
Faltenreich Oct 25, 2024
33e39f6
Prepare in-memory database for unit tests
Faltenreich Oct 25, 2024
6922634
Reduced logs during import
Faltenreich Oct 25, 2024
9a624cf
Replace every fake dao with in-memory database
Faltenreich Oct 25, 2024
6d456cb
Merge branch 'develop' into feature/multiplatform
Faltenreich Oct 25, 2024
fde181b
Avoid redundant checks on pushing to feature branch
Faltenreich Oct 25, 2024
3e4ede1
Restored fake daos
Faltenreich Oct 25, 2024
2c225fc
Revert "Restored fake daos"
Faltenreich Oct 25, 2024
a485a5c
Test GetTodayUseCase
Faltenreich Oct 26, 2024
b6506eb
Restore fake daos
Faltenreich Oct 26, 2024
678a084
Default to fakes instead of in-memory database to speed up unit tests
Faltenreich Oct 26, 2024
4a74635
Close fake daos
Faltenreich Oct 26, 2024
492daa8
Split up import of seed and legacy
Faltenreich Oct 26, 2024
39fff3e
Simplified test import in TestSuite
Faltenreich Oct 26, 2024
571e65c
Improve test of GetTodayUseCase
Faltenreich Oct 26, 2024
2309362
Refactor SeedImportUseCase
Faltenreich Oct 26, 2024
c934f50
Update fixme for observeAverageByPropertyKey
Faltenreich Oct 26, 2024
27e8836
Fix NullPointerException on fetching average with deep relations from…
Faltenreich Oct 26, 2024
6b1223c
Fix DashboardViewModelTest
Faltenreich Oct 27, 2024
265d9b6
Remove optionals from DashboardState
Faltenreich Oct 27, 2024
d531251
Simplify DashboardViewModelTest
Faltenreich Oct 27, 2024
4d1107d
Remove broken DependencyInjectionTest
Faltenreich Oct 27, 2024
8d34117
Extract setup from MainViewModel
Faltenreich Oct 27, 2024
0d0078f
Test MainViewModel via Turbine
Faltenreich Oct 27, 2024
d2e9c44
Improve MainViewModelTest
Faltenreich Oct 27, 2024
7b1c826
Extend MainViewModelTest
Faltenreich Oct 27, 2024
6e81d25
Exclude ui from test reports (for now)
Faltenreich Oct 27, 2024
9c22fd2
Extend DashboardViewModelTest
Faltenreich Oct 27, 2024
de4acc7
Change default HbA1c in dashboard
Faltenreich Oct 27, 2024
703e9df
Update comments about code coverage
Faltenreich Oct 29, 2024
56119a4
Refactoring
Faltenreich Oct 29, 2024
6c87eed
Fix DashboardViewModelTest
Faltenreich Oct 29, 2024
8556d36
Fix MeasurementPropertySqlDelightDao.observeByKey
Faltenreich Oct 29, 2024
119e58d
Harden MeasurementPropertyDao.observeByKey
Faltenreich Oct 29, 2024
76aea21
Remove obsolete MeasurementUnitDao.getByKey
Faltenreich Oct 29, 2024
937e1a9
Fix exclude of Screens from code coverage
Faltenreich Oct 29, 2024
c111fde
Exclude generated resources from code coverage
Faltenreich Oct 29, 2024
4d63cef
Test tag suggestion in EntryFormViewModel
Faltenreich Oct 29, 2024
7b3ecab
Test tags in EntryFormViewModel
Faltenreich Oct 29, 2024
d172ae9
Divide Navigation
Faltenreich Oct 30, 2024
46efdbc
Simplify Navigation
Faltenreich Oct 30, 2024
3eaf93a
Move screen caching from ScreenNavigation into Navigation to simplify…
Faltenreich Oct 30, 2024
1a19013
Fix EntryFormViewModelTest for opening food search by faking ScreenNa…
Faltenreich Oct 30, 2024
f2ddae3
Remove obsolete property from MainState
Faltenreich Oct 30, 2024
5e342cb
Prepare view model for event-based navigation
Faltenreich Nov 1, 2024
9d7bff3
Replace navigation for pushing and popping screen
Faltenreich Nov 1, 2024
355caaf
Remove obsolete ScreenNavigation.canPop
Faltenreich Nov 1, 2024
f9e1060
Rename events for pushing and popping screen
Faltenreich Nov 1, 2024
c9ce385
Remove ScreenNavigation
Faltenreich Nov 1, 2024
79d8585
Replace navigation for showing snackbars
Faltenreich Nov 1, 2024
1ceb013
Replace navigation for modals
Faltenreich Nov 1, 2024
b9d2a99
Replace navigation for bottom sheets
Faltenreich Nov 1, 2024
8c5d5c4
Select food for entry form via shared view model
Faltenreich Nov 1, 2024
ef2dfa0
Remove obsolete SavedStateHandle
Faltenreich Nov 1, 2024
678eafd
Delegate NavigationEvent through MainViewModel
Faltenreich Nov 2, 2024
58218f4
Restructure Navigation
Faltenreich Nov 2, 2024
9436bf5
Adapt tests to new navigation
Faltenreich Nov 2, 2024
957e73d
Encapsulate Navigation from MainViewModel
Faltenreich Nov 2, 2024
7a58ef5
Remove default parameters from MainMenuViewModel
Faltenreich Nov 2, 2024
c575ba4
Add todo for MainMenuState.currentScreen
Faltenreich Nov 2, 2024
f5b9bdf
Upgrade toolchain
Faltenreich Nov 2, 2024
92f7afb
Fix delegation of NavigationEvent in MainViewModel
Faltenreich Nov 2, 2024
656b35c
Decouple NavigationEvent from MainViewModel
Faltenreich Nov 2, 2024
a43a983
Test MainIntent.PopScreen
Faltenreich Nov 2, 2024
a7f93c7
Test intents and events of TimelineViewModel
Faltenreich Nov 2, 2024
afb121f
Test data of TimelineViewModel
Faltenreich Nov 2, 2024
36102af
Test TimelineIntent.SetCurrentDate
Faltenreich Nov 2, 2024
5b4a741
Test values in TimelineState.data
Faltenreich Nov 2, 2024
bff0795
Test TagFormViewModel
Faltenreich Nov 2, 2024
451a304
Exclude ComposableSingletons from code coverage
Faltenreich Nov 2, 2024
bd95da3
Test all intents of TagDetailViewModel
Faltenreich Nov 2, 2024
6730ee9
Test TagListViewModel
Faltenreich Nov 2, 2024
9ce6f63
Test state of TagListViewModel
Faltenreich Nov 2, 2024
0afe192
Test StatisticViewModel
Faltenreich Nov 2, 2024
7cdff28
Test intents of FoodFormViewModel
Faltenreich Nov 2, 2024
f2c0363
Harden TagDetailViewModelTest
Faltenreich Nov 2, 2024
f2f8632
Remove Nothing from view models
Faltenreich Nov 2, 2024
23d1258
Test FoodFormIntent.EditNutrient
Faltenreich Nov 2, 2024
9f76d68
Test more of FoodFormViewModel
Faltenreich Nov 2, 2024
4a5b92a
Differentiate FoodFormViewModelTest with and without given food
Faltenreich Nov 2, 2024
100b264
Test more of FoodFormViewModel
Faltenreich Nov 2, 2024
5d68cf8
Test FoodFormIntent.Delete without food
Faltenreich Nov 2, 2024
d4c2791
Test intents of FoodSearchViewModel
Faltenreich Nov 2, 2024
6df5028
Differentiate dependencies for pdf
Faltenreich Nov 2, 2024
6ab7895
Introduce interface for PdfExport
Faltenreich Nov 2, 2024
2750f88
Test ExportFormViewModel
Faltenreich Nov 2, 2024
7e44b0a
Prepare test for ExportFormViewModel.categories
Faltenreich Nov 2, 2024
52df561
Fix code smells
Faltenreich Nov 3, 2024
7027eea
Move form components of export into dedicated package
Faltenreich Nov 3, 2024
fd42ce2
Simplify properties of ExportFormViewModel
Faltenreich Nov 3, 2024
19e61f8
Replace mutableStates of ExportFormViewModel with mutableStateFlows
Faltenreich Nov 3, 2024
9b44dbf
Adapt tests to new ExportFormViewModel
Faltenreich Nov 3, 2024
acde7d0
Test categories of ExportFormViewModel
Faltenreich Nov 3, 2024
6238890
Test state changes of ExportFormViewModel
Faltenreich Nov 3, 2024
e3756c2
Fix code smell
Faltenreich Nov 3, 2024
8cc3b9c
Replace heavyweight currentScreen in MainMenu with lightweight parameter
Faltenreich Nov 3, 2024
d1780a8
Fix selected item in MainMenu
Faltenreich Nov 3, 2024
6007307
Remove obsolete currentScreen from Navigation
Faltenreich Nov 3, 2024
78ee469
Fix tests
Faltenreich Nov 3, 2024
431ae20
Simplify update of categories in export form
Faltenreich Nov 4, 2024
1aa1a70
Merge ExportFormMeasurementCategory into ExportFormState
Faltenreich Nov 4, 2024
c2b9a09
Test ExportFormIntent.SetCategory
Faltenreich Nov 4, 2024
b00f609
Merge mutable properties of EntryFormViewModel into EntryFormState
Faltenreich Nov 7, 2024
6d9a93c
Revert "Merge mutable properties of EntryFormViewModel into EntryForm…
Faltenreich Nov 7, 2024
51aea28
Disable debounce for food search temporarily to fix performance
Faltenreich Nov 7, 2024
068aa0f
Improve performance of EntryForm
Faltenreich Nov 7, 2024
0896e27
Add fixme for unit tests
Faltenreich Nov 10, 2024
e31d152
Fix broken tests in EntryFormViewModel
Faltenreich Nov 10, 2024
2f734f9
Harden EntryFormViewModel
Faltenreich Nov 10, 2024
1f3a439
Test editing and submitting entry form
Faltenreich Nov 10, 2024
437ec2e
Fix tests
Faltenreich Nov 10, 2024
d6a53cb
Test deletion of entry in EntryFormViewModel
Faltenreich Nov 10, 2024
c1dd04f
Test food in EntryFormViewModel
Faltenreich Nov 10, 2024
0caf8de
Test time in EntryFormViewModel
Faltenreich Nov 10, 2024
d9b5673
Convert BuildConfig into interface to be able to swap implementation …
Faltenreich Nov 10, 2024
f5ae9d8
Fake BuildConfig in tests
Faltenreich Nov 10, 2024
6bbac38
Make PreferenceListItem testable
Faltenreich Nov 10, 2024
46e0cc7
Convert PreferenceListItem into sealed interface to support implement…
Faltenreich Nov 10, 2024
e96daf1
Simplify labels of PreferenceListListItem.Option
Faltenreich Nov 10, 2024
80c55df
Test overview preferences
Faltenreich Nov 10, 2024
f91ee18
Test DecimalPlacesFormViewModel
Faltenreich Nov 10, 2024
537e5c8
Test DecimalPlacesFormViewModel
Faltenreich Nov 10, 2024
85c4547
Test FoodPreferenceViewModel
Faltenreich Nov 10, 2024
521f77a
Fix OverviewPreferenceViewModelTest
Faltenreich Nov 10, 2024
6077627
Test FoodEatenListViewModel
Faltenreich Nov 10, 2024
a831ab3
Test LogViewModel
Faltenreich Nov 11, 2024
36a7d48
Prepare tests for EntrySearchViewModel
Faltenreich Nov 11, 2024
054b4fb
Test MeasurementCategoryListViewModel
Faltenreich Nov 11, 2024
c320185
Test MeasurementCategoryFormViewModel
Faltenreich Nov 16, 2024
0c20351
Test MeasurementPropertyFormViewModel
Faltenreich Nov 16, 2024
df5de96
Update toolchain
Faltenreich Nov 16, 2024
c272941
Refactor TimelineTable
Faltenreich Nov 17, 2024
064da12
Improve explanation of decimal places
Faltenreich Nov 17, 2024
08fd7ed
Prepare screen for color scheme preference
Faltenreich Nov 17, 2024
83cc746
Implement ColorSchemeFormViewModel.kt
Faltenreich Nov 17, 2024
33ea0d2
Refactor ColorSchemeForm
Faltenreich Nov 17, 2024
5889eba
Convert preference for start screen into bottom sheet
Faltenreich Nov 17, 2024
6c2fa8d
Style StartScreenListItem
Faltenreich Nov 17, 2024
c6f3b5e
Refactor preferences
Faltenreich Nov 17, 2024
cde227c
Fix tests
Faltenreich Nov 17, 2024
7810d05
Improve layout of preferences
Faltenreich Nov 18, 2024
3db671a
Remove obsolete PreferenceListListItem
Faltenreich Nov 18, 2024
1da322d
Prepare screen for backup
Faltenreich Nov 18, 2024
3b7672e
Prepare basic structure for BackupForm
Faltenreich Nov 18, 2024
5f041ba
Improve layout of BackupForm
Faltenreich Nov 18, 2024
fc3d765
Split up preference entries for backup
Faltenreich Nov 19, 2024
27ef083
Prepare screens for writing and reading backups
Faltenreich Nov 19, 2024
f7698af
Prepare layout for backup steps
Faltenreich Nov 19, 2024
c2042f9
Improve WizardStepListItem
Faltenreich Nov 20, 2024
9d499e0
Prepare state for WriteBackupForm
Faltenreich Nov 20, 2024
e8e3343
Update WriteBackupForm according to current state
Faltenreich Nov 20, 2024
f45c254
Improve WriteBackupForm
Faltenreich Nov 20, 2024
536a5ee
Move button for WriteBackupForm into BottomAppBar
Faltenreich Nov 20, 2024
d7da1e1
Move button for WriteBackupForm into layout
Faltenreich Nov 20, 2024
12009dd
Move content into WizardStepListItem
Faltenreich Nov 21, 2024
7695259
Implement state for ReadBackupForm
Faltenreich Nov 21, 2024
2bc27fc
Improve ReadBackupFormState
Faltenreich Nov 21, 2024
08189b1
Prepare SharedPreferences for legacy key-value store
Faltenreich Nov 22, 2024
ae35093
Prepare import of legacy preferences
Faltenreich Nov 22, 2024
2184a16
Prepare sealed preferences
Faltenreich Nov 22, 2024
f5d9655
Simplify LegacyDao
Faltenreich Nov 23, 2024
36dd626
Introduce KeyValueLegacyQueries
Faltenreich Nov 23, 2024
f366ce0
Add todo
Faltenreich Nov 23, 2024
cc8f2ff
Harden LegacyPreference
Faltenreich Nov 23, 2024
2a357bf
Change api of legacy preferences
Faltenreich Nov 24, 2024
294513d
Remove obsolete components for legacy preferences
Faltenreich Nov 24, 2024
e78b2a4
Extract legacy import for preferences
Faltenreich Nov 24, 2024
631f1ec
Extract legacy import for database
Faltenreich Nov 24, 2024
9087583
Rename ImportSeedUseCase
Faltenreich Nov 26, 2024
ed746cb
Fix tests
Faltenreich Nov 26, 2024
db6941b
Prepare SharedPreferencesTest
Faltenreich Nov 26, 2024
c307061
Prepare SharedPreferencesTest
Faltenreich Nov 26, 2024
242470d
Test KeyValueLegacyQueries
Faltenreich Nov 26, 2024
7472b73
Test legacy preference for theme
Faltenreich Nov 26, 2024
8463545
Test KeyValueLegacyQueries
Faltenreich Nov 26, 2024
c21a92a
Prepare preference for version code
Faltenreich Nov 26, 2024
6966198
Improve migration
Faltenreich Nov 29, 2024
03ee619
Improve logging for legacy import of preferences
Faltenreich Nov 29, 2024
d7e44b8
Link to system settings from preferences for reminders
Faltenreich Nov 29, 2024
d2db640
Enable desugaring for java.time on API 25 and older
Faltenreich Nov 29, 2024
b00804c
Re-enable legacy migration
Faltenreich Nov 29, 2024
ba96f8b
Fix tests
Faltenreich Nov 29, 2024
e964920
Fix tests
Faltenreich Nov 29, 2024
012ca5a
Open system settings for reminder preferences on older API levels
Faltenreich Nov 29, 2024
ba34e20
Fix warning regarding Koin context for Compose
Faltenreich Nov 29, 2024
54d5f22
Replace error Snackbar in EntryForm with permanent ui
Faltenreich Nov 29, 2024
0c2628d
Replace error Snackbar in FoodForm with permanent ui
Faltenreich Nov 29, 2024
f489a09
Prepare bottom sheet for HbA1c info
Faltenreich Nov 29, 2024
7c7782a
Prepare data for HbA1cInfo
Faltenreich Nov 29, 2024
74993e4
Improve text of HbA1cInfo
Faltenreich Nov 29, 2024
29b36fb
Map HbA1cInfoState
Faltenreich Nov 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 33 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Setup
description: Prepares workspace

runs:
using: "composite"
steps:
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "21"
cache: "gradle"

- name: Set up Android SDK
uses: android-actions/setup-android@v3

- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Grant execute permission for Gradle wrapper
shell: bash
run: chmod +x gradlew

- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
!~/.gradle/wrapper/dists/**/gradle*.zip
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', 'gradle/libs.versions.toml') }}
restore-keys: |
${{ runner.os }}-gradle-
106 changes: 56 additions & 50 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,63 +12,69 @@ concurrency:
cancel-in-progress: true

jobs:
android:
runs-on: macos-13
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
api-level:
- 21
- 29

test:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Test
run: ./gradlew koverXmlReport

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Report
uses: mi-kas/kover-report@v1
with:
path: ${{ github.workspace }}/shared/build/reports/kover/report.xml
title: Code Coverage
update-comment: true
min-coverage-changed-files: 80

- name: Set up Android SDK
uses: android-actions/setup-android@v3
- name: Upload
uses: actions/upload-artifact@v4
with:
name: test-reports
path: "**/build/reports"
if: always()

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v3
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Grant execute permission for Gradle wrapper
run: chmod +x gradlew
- name: Lint
run: ./gradlew lintDebug

- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
!~/.gradle/wrapper/dists/**/gradle*.zip
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Upload
uses: actions/upload-artifact@v4
with:
name: lint-reports
path: "**/build/reports/lint-results-debug.html"
if: always()

- name: Build
run: ./gradlew build --no-daemon
detekt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run unit tests
run: ./gradlew testBetaDebugUnitTest
- name: Setup
uses: ./.github/actions/setup

- name: Run instrumentation tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
script: ./gradlew connectedBetaDebugAndroidTest
- name: Detekt
run: ./gradlew detektMetadataMain

- name: Upload test reports
uses: actions/upload-artifact@v4
with:
name: reports
path: app/build/reports
overwrite: true
if: always()
- name: Upload
uses: actions/upload-artifact@v4
with:
name: detekt-reports
path: "**/build/reports/detekt"
if: always()
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ captures/
*.aab
output.json
output-metadata.json

.kotlin/
31 changes: 13 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
> [!NOTE]
> This app is currently being redeveloped in [Kotlin Multiplatform](https://kotlinlang.org/docs/multiplatform.html) to support additional platforms such as iOS.
> You can follow its development on branch [feature/multiplatform](https://github.com/Faltenreich/Diaguard/tree/feature/multiplatform) and pull request [#51](https://github.com/Faltenreich/Diaguard/pull/51).
> Therefore development for the native version on this branch has been slowed down but pull requests will be accepted nonetheless.

# Diaguard

[![version](https://img.shields.io/badge/Release-3.13.0-478063.svg)](https://github.com/Faltenreich/Diaguard/releases)
[![ci](https://github.com/Faltenreich/Diaguard/actions/workflows/verify.yml/badge.svg)](https://github.com/Faltenreich/Diaguard/actions/workflows/verify.yml)
[![version](https://img.shields.io/badge/Release-4.0.0-478063.svg)](https://github.com/Faltenreich/Diaguard/releases)
[![pipeline](https://github.com/Faltenreich/Diaguard/actions/workflows/verify.yml/badge.svg)](https://github.com/Faltenreich/Diaguard/actions/workflows/verify.yml)

<img src="./resource/image/marketing/showcase.png" width="750" alt="">
<img src="./resource/image/marketing/showcase.png" width="750">

Diaguard is an Android app for people with diabetes mellitus.

Expand All @@ -26,13 +21,13 @@ It replaces the handwritten diary and helps the user to quickly and easily recor
* Estimated HbA1c
* Statistics
* Dark Mode
* Localized in English, German, French, Spanish, Italian and Russian
* Localized in English, German, French, Spanish and Italian

<img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" width="100" alt=""> <img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" width="100" alt=""> <img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/3.png" width="100" alt=""> <img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/4.png" width="100" alt=""> <img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/5.png" width="100" alt=""> <img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/6.png" width="100" alt=""> <img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/7.png" width="100" alt="">
<img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/1.png" width="100"> <img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/2.png" width="100"> <img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/3.png" width="100"> <img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/4.png" width="100"> <img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/5.png" width="100"> <img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/6.png" width="100"> <img src="./fastlane/metadata/android/en-US/images/phoneScreenshots/7.png" width="100">

## Distribution

<a href='https://play.google.com/store/apps/details?id=com.faltenreich.diaguard'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png' width="250"/></a><a href='https://f-droid.org/de/packages/com.faltenreich.diaguard'><img alt='Get it on F-Droid' src='https://f-droid.org/badge/get-it-on.png' width="250"/></a>
<a href='https://play.google.com/store/apps/details?id=com.faltenreich.diaguard'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png' width="250"/></a><a href='https://f-droid.org/de/packages/com.faltenreich.diaguard'><img alt='Get it on F-Droid' src='https://gitlab.com/fdroid/artwork/-/raw/master/badge/get-it-on.png' width="250"/></a>

## About

Expand Down Expand Up @@ -63,7 +58,7 @@ For these reasons, Diaguard has been, is and will always be free of cost.
If you want to buy me a beer or support me in general, please use the donate button and be aware of my thanks.

<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AM6HG633T4BWY&source=url">
<img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" width="100" alt=""/>
<img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" width="100"/>
</a>

## Development
Expand All @@ -82,9 +77,9 @@ English is used as general language for naming things. Everything except the loc

Localization takes place locally and affects following components:

* User interfaces: localized via [Android resources](https://developer.android.com/guide/topics/resources/localization) (one [strings.xml](/app/src/main/res/values/strings.xml) per language)
* Common food: localized via custom file import (one [food_common.csv](/app/src/main/assets/seed/food_common.csv) for all languages)
* Default tags: localized via custom file import (one [tags.csv](/app/src/main/assets/seed/tags.csv) for all languages)
* User interfaces: localized via [Android resources](https://developer.android.com/guide/topics/resources/localization) (one [strings.xml](/shared/src/commonMain/resources/MR/base/strings.xml) per language)
* Common food: localized via custom file import (one [food_common.csv](/shared/src/commonMain/resources/MR/files/food_common.csv) for all languages)
* Default tags: localized via custom file import (one [tags.csv](/shared/src/commonMain/resources/MR/files/tags.csv) for all languages)

Currently the localization process requires certain programming skills. This should and could be improved by using an external service in order to support localizations by non-developers.

Expand All @@ -98,7 +93,7 @@ Domain-driven design improves the structure by grouping files in features. Every

#### Testing

Testing takes place via [JUnit](https://junit.org) and [Espresso](https://developer.android.com/training/testing/espresso). Tests are few in number and far from perfect, since most of Diaguard has been developed in the early of days of one developer. However the decision to go open source came with a code of conduct, and instrumentation testing major features was the first step in a right direction. The goal now is to unit- and instrumentation test every new and edited feature in order to increase the quality with every commit.
Testing takes place via [JUnit](https://junit.org), [Espresso](https://developer.android.com/training/testing/espresso) and [Robolectric](http://robolectric.org). Tests are few in number and far from perfect, since most of Diaguard has been developed in the early of days of one developer. However the decision to go open source came with a code of conduct, and instrumentation testing major features was the first step in a right direction. The goal now is to unit- and instrumentation test every new and edited feature in order to increase the quality with every commit.

#### Third-party licenses

Expand All @@ -109,7 +104,6 @@ This software uses following technologies with great appreciation:
* [Apache Commons Text](http://commons.apache.org/proper/commons-text)
* [App Privacy Policy Generator](https://github.com/nisrulz/app-privacy-policy-generator)
* [BetterPickers](https://github.com/code-troopers/android-betterpickers)
* [Droid Sans](https://github.com/google/fonts)
* [EventBus](https://github.com/greenrobot/EventBus)
* [FloatingActionButton](https://github.com/Clans/FloatingActionButton)
* [Gson](https://github.com/google/gson)
Expand All @@ -126,6 +120,7 @@ This software uses following technologies with great appreciation:
* [PDFjet](http://pdfjet.com)
* [Picasso](http://square.github.io/picasso)
* [Retrofit](https://square.github.io/retrofit)
* [Robolectric](http://robolectric.org)
* [Schweizer Nährwertdatenbank](http://naehrwertdaten.ch)
* [Shields.io](https://shields.io)

Expand Down Expand Up @@ -156,4 +151,4 @@ Additionally to the permissions, conditions and limitations of the GPLv3, the pe
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

<img src="./resource/image/logo/logo_legacy.png" width="100" alt="">
<img src="./resource/image/logo/logo_legacy.png" width="100">
80 changes: 80 additions & 0 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.compose.compiler)
}

android {
namespace = Constants.NameSpace
compileSdk = Constants.CompileSdk

defaultConfig {
minSdk = Constants.MinSdk
targetSdk = Constants.TargetSdk
versionCode = Constants.VersionCode
versionName = Constants.VersionName
testInstrumentationRunner = "${Constants.NameSpace}.TestInstrumentationRunner"
testInstrumentationRunnerArguments["clearPackageData"] = "true"
}

buildTypes {
getByName("debug") {
isMinifyEnabled = false
isShrinkResources = false
}
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
}
}

flavorDimensions += "version"
productFlavors {
create("demo") {
applicationId = Constants.NameSpace
}
create("beta") {
applicationId = "${Constants.NameSpace}.beta"
}
create("store") {
applicationId = Constants.NameSpace
}
}

buildFeatures {
buildConfig = true
compose = true
}

compileOptions {
// Support for java.time on API 25 and older
isCoreLibraryDesugaringEnabled = true
}

packagingOptions.resources.excludes += "META-INF/versions/9/previous-compilation-data.bin"
}

kotlin {
jvmToolchain(Constants.JavaVersion)
}

dependencies {
implementation(project(":shared"))

coreLibraryDesugaring(libs.android.desugar)

testImplementation(libs.junit)

androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.androidx.test.junit)
androidTestImplementation(libs.androidx.test.junit.ktx)
androidTestImplementation(platform(libs.koin.bom))
androidTestImplementation(libs.koin.test)

implementation(libs.activity.compose)

implementation(platform(libs.koin.bom))
implementation(libs.koin.core)
implementation(libs.koin.android)
implementation(libs.koin.compose)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.faltenreich.diaguard

import android.app.Application
import androidx.test.core.app.ApplicationProvider
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.startKoin
import org.koin.core.context.stopKoin

class TestApplication : Application() {

override fun onCreate() {
super.onCreate()
startKoin {
androidContext(ApplicationProvider.getApplicationContext())
modules(appModules())
}
}

override fun onTerminate() {
stopKoin()
super.onTerminate()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.faltenreich.diaguard

import android.app.Application
import android.content.Context
import androidx.test.runner.AndroidJUnitRunner

class TestInstrumentationRunner : AndroidJUnitRunner() {

override fun newApplication(
classLoader: ClassLoader?,
className: String?,
context: Context?,
): Application {
return super.newApplication(classLoader, TestApplication::class.java.name, context)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.faltenreich.diaguard.export.pdf

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class AndroidPdfExportTest {

@Test
fun testExport() {
val context = InstrumentationRegistry.getInstrumentation().targetContext
// TODO: val file = File.createTempFile("tmp", "pdf", context.cacheDir)
val export = AndroidPdfExport(context)
// TODO: Inject file
export (
document { }
)
}
}
Loading
Loading