-
-
Notifications
You must be signed in to change notification settings - Fork 7
ScanSettings View model refactor #136
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
551589b
ScanSettings view model refactor to be independent of Compose
Chrisimx 7d59884
Remove getCurrentUserLocale from ScanSettingsComposableViewModel
Chrisimx 491d5b7
Modernize ScanSettingsComposableViewModel
Chrisimx 0699c03
Apply format
Chrisimx 4e7a0a9
Fix missing qualification for enum names
Chrisimx 6c21535
Jump to the right page when starting scan
Chrisimx 6905141
Correct name for mm string resource
Chrisimx 1d2d34e
Add placeholder for current unit to string resources
Chrisimx 7c54c7b
Correct name for mm string resource
Chrisimx f08179d
Account for duplex setting in setInputSource of ScanSettings viewModel
Chrisimx 96c68fe
Improve name for invalidResolutionSetting variable in ScanSettingsCom…
Chrisimx 111fd46
Remove unnecessary Forest Companion property access
Chrisimx a6f0d1b
Convert ScanSettingsComposableViewModel.kt to a state holder class
Chrisimx 7fdfb5c
Apply format
Chrisimx 02b4775
Use validated values to determine selected input source caps when reu…
Chrisimx 618cc6c
Actual use pageNr in ScanningScreenViewModel.scrollToPage
Chrisimx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
app/src/main/java/io/github/chrisimx/scanbridge/ScanBridgeApplication.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,33 @@ | ||
| package io.github.chrisimx.scanbridge | ||
|
|
||
| import android.app.Application | ||
| import io.github.chrisimx.scanbridge.data.ui.ScanSettingsComposableStateHolder | ||
| import io.github.chrisimx.scanbridge.data.ui.ScanningScreenViewModel | ||
| import io.github.chrisimx.scanbridge.services.AndroidLocaleProvider | ||
| import io.github.chrisimx.scanbridge.services.LocaleProvider | ||
| import org.koin.android.ext.koin.androidContext | ||
| import org.koin.core.context.startKoin | ||
| import org.koin.dsl.bind | ||
| import org.koin.dsl.module | ||
| import org.koin.plugin.module.dsl.factory | ||
| import org.koin.plugin.module.dsl.single | ||
| import org.koin.plugin.module.dsl.viewModel | ||
| import timber.log.Timber | ||
|
|
||
| val appModule = module { | ||
| single<AndroidLocaleProvider>() bind LocaleProvider::class | ||
| factory<ScanSettingsComposableStateHolder>() | ||
| viewModel<ScanningScreenViewModel>() | ||
| } | ||
|
|
||
| class ScanBridgeApplication : Application() { | ||
| override fun onCreate() { | ||
| super.onCreate() | ||
| startKoin { | ||
| androidContext(this@ScanBridgeApplication) | ||
| modules(appModule) | ||
| } | ||
|
|
||
| Timber.plant(Timber.DebugTree()) | ||
| } | ||
| } | ||
182 changes: 83 additions & 99 deletions
182
app/src/main/java/io/github/chrisimx/scanbridge/ScanSettings.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.