-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #681 Signed-off-by: Leonardo Colman Lopes <[email protected]>
- Loading branch information
Showing
8 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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 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 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
10 changes: 10 additions & 0 deletions
10
app/src/main/kotlin/br/com/colman/petals/review/ReviewAppRequester.kt
This file contains 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,10 @@ | ||
package br.com.colman.petals.review | ||
|
||
import android.app.Activity | ||
import timber.log.Timber | ||
|
||
interface ReviewAppRequester { | ||
fun requestReview(activity: Activity) { | ||
Timber.d("Default RequestReview Behaviour (No-Op)") | ||
} | ||
} |
This file contains 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 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
17 changes: 17 additions & 0 deletions
17
...src/playstore/kotlin/br/com/colman/petals/playstore/review/ReviewAppPlaystoreRequester.kt
This file contains 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,17 @@ | ||
package br.com.colman.petals.playstore.review | ||
|
||
import android.app.Activity | ||
import android.content.Context | ||
import br.com.colman.petals.review.ReviewAppRequester | ||
import com.google.android.play.core.review.ReviewManagerFactory | ||
import timber.log.Timber | ||
|
||
class ReviewAppPlaystoreRequester(context: Context) : ReviewAppRequester { | ||
|
||
private val reviewManager = ReviewManagerFactory.create(context) | ||
|
||
override fun requestReview(activity: Activity) { | ||
Timber.d("Requesting review") | ||
reviewManager.requestReviewFlow().addOnSuccessListener { reviewManager.launchReviewFlow(activity, it) } | ||
} | ||
} |
This file contains 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