-
Notifications
You must be signed in to change notification settings - Fork 1
Use the In-app review framework provided by google #2
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
Open
masterwok
wants to merge
19
commits into
master
Choose a base branch
from
jt/in-app-reviews
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e077960
Removed review actions from about fragment
masterwok d3643ae
Progress on in app reviews
masterwok 7596256
Test build
masterwok fb9f505
Cleanup
masterwok 1d58b62
Showing snack
masterwok 1b88267
DI configuration
masterwok 11d88d9
Removed dead code
masterwok 5004775
Changed to long
masterwok 048f0d7
const val
masterwok 5a4e3c0
count
masterwok 56bb42b
Bumped versions using flow for settings fragment
masterwok ba9f3ff
Update settings using coroutine
masterwok 1aaa64b
build eerror
masterwok 37b7d26
Removed dead code
masterwok bfead57
Using inner class
masterwok efa4af5
Fixed review
masterwok a2a7f1e
PR Change
masterwok 0e87729
Increased review count
masterwok 959b58f
Import cleanup
masterwok 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
37 changes: 37 additions & 0 deletions
37
...erwok/shrimplesearch/common/data/repositories/SharedPreferencesConfigurationRepository.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 |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package com.masterwok.shrimplesearch.common.data.repositories | ||
|
|
||
| import android.content.Context | ||
| import com.masterwok.shrimplesearch.common.data.repositories.contracts.ConfigurationRepository | ||
| import com.masterwok.shrimplesearch.di.modules.RepositoryModule | ||
| import javax.inject.Inject | ||
| import javax.inject.Named | ||
|
|
||
| class SharedPreferencesConfigurationRepository @Inject constructor( | ||
| appContext: Context, | ||
| @Named(RepositoryModule.NAMED_SHARED_PREFERENCES_NAME) sharedPreferencesName: String | ||
| ) : ConfigurationRepository { | ||
|
|
||
| private val sharedPreferences = appContext.getSharedPreferences( | ||
| sharedPreferencesName, | ||
| Context.MODE_PRIVATE | ||
| ) | ||
|
|
||
| override suspend fun incrementResultTapCount() { | ||
| val resultItemCount = getResultItemTapCount() | ||
|
|
||
| sharedPreferences | ||
| .edit() | ||
| .putLong(NAME_RESULT_ITEM_TAP_COUNT, resultItemCount + 1L) | ||
| .apply() | ||
| } | ||
|
|
||
| override suspend fun getResultItemTapCount(): Long = sharedPreferences.getLong( | ||
| NAME_RESULT_ITEM_TAP_COUNT, | ||
| 0 | ||
| ) | ||
|
|
||
| companion object { | ||
| private const val NAME_RESULT_ITEM_TAP_COUNT = "configuration.result_item_tap_count" | ||
| } | ||
|
|
||
| } | ||
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
6 changes: 6 additions & 0 deletions
6
...om/masterwok/shrimplesearch/common/data/repositories/contracts/ConfigurationRepository.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 |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| package com.masterwok.shrimplesearch.common.data.repositories.contracts | ||
|
|
||
| interface ConfigurationRepository { | ||
| suspend fun incrementResultTapCount() | ||
| suspend fun getResultItemTapCount(): Long | ||
| } |
7 changes: 6 additions & 1 deletion
7
...com/masterwok/shrimplesearch/common/data/repositories/contracts/UserSettingsRepository.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,15 +1,20 @@ | ||
| package com.masterwok.shrimplesearch.common.data.repositories.contracts | ||
|
|
||
| import com.masterwok.shrimplesearch.common.data.models.UserSettings | ||
| import kotlinx.coroutines.ExperimentalCoroutinesApi | ||
| import kotlinx.coroutines.flow.Flow | ||
|
|
||
| interface UserSettingsRepository { | ||
|
|
||
| fun read(): UserSettings | ||
|
|
||
| fun update(userSettings: UserSettings) | ||
| suspend fun update(userSettings: UserSettings) | ||
|
|
||
| fun getThemeId(): Int | ||
|
|
||
| fun getSplashThemeId(): Int | ||
|
|
||
| @ExperimentalCoroutinesApi | ||
| fun getUserSettingsAsFlow(): Flow<UserSettings> | ||
|
|
||
| } |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document.