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

Refactor code based on review #3

Merged
merged 22 commits into from
Jan 10, 2020
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
03a41df
Move adapters to ui package
zsmb13 Jan 7, 2020
964d5f7
Autoformat code, optimize imports
zsmb13 Jan 7, 2020
b2c294c
Move Viewmodel initialization to onCreate
zsmb13 Jan 7, 2020
95ebf91
Use viewLifecycleOwner for LiveData observation
zsmb13 Jan 7, 2020
7385d6a
Move View initialization code to onViewCreated
zsmb13 Jan 7, 2020
3916b47
Remove unused LiveData
zsmb13 Jan 7, 2020
e9625b1
Simplify convertColor function, add support annotations
zsmb13 Jan 7, 2020
2cf3ba9
Rewrite ViewPagerAdapter
zsmb13 Jan 7, 2020
5c3dca5
Replace nullable "static" variables with lateinit
zsmb13 Jan 7, 2020
0f4d3ff
Make APIService an object
zsmb13 Jan 7, 2020
2bc8d9a
Fix bug in PokemonColorUtil
zsmb13 Jan 7, 2020
96a246b
Add explicit lambda parameter names
zsmb13 Jan 7, 2020
053a1c4
Replace elementAtOrNull usages with getOrNull
zsmb13 Jan 7, 2020
12b51db
Use isVisible for setting visibility
zsmb13 Jan 7, 2020
d380051
Replace .let calls for arguments with checkNotNull checks
zsmb13 Jan 7, 2020
595f1e4
Return single value from getPokemonById database query
zsmb13 Jan 7, 2020
af08dab
Clean up null handling with ?.let calls
zsmb13 Jan 7, 2020
3ebd4a2
Use REPLACE strategy for database writes
zsmb13 Jan 7, 2020
07afada
Use a single database write for inserting all Pokemon instances
zsmb13 Jan 7, 2020
9edc0fc
Add requireFragmentManager() and requireContext() usages
zsmb13 Jan 7, 2020
be88a76
Perform manual formatting (new lines)
zsmb13 Jan 7, 2020
a2ab162
Merge branch 'feature/lets-review'
zsmb13 Jan 7, 2020
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
Prev Previous commit
Next Next commit
Use REPLACE strategy for database writes
  • Loading branch information
zsmb13 committed Jan 7, 2020
commit 3ebd4a2c570c131ef017696d5ab2fd0257e62e7c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface PokemonDAO {
@Query("SELECT * FROM pokemon")
fun all(): LiveData<List<Pokemon>>

@Insert(onConflict = OnConflictStrategy.IGNORE)
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun add(vararg pokemon: Pokemon)

@Query("DELETE FROM pokemon")
Expand Down