-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/v4.2.1' into 'master'
Release v4.2.1 See merge request mobile/android/android!1895
- Loading branch information
Showing
57 changed files
with
2,150 additions
and
2,587 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
38 changes: 38 additions & 0 deletions
38
app/src/gms/java/mega/privacy/android/app/service/iar/RatingHandlerImpl.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,38 @@ | ||
package mega.privacy.android.app.service.iar | ||
|
||
import android.content.Context | ||
import com.google.android.play.core.review.ReviewInfo | ||
import com.google.android.play.core.review.ReviewManager | ||
import com.google.android.play.core.review.ReviewManagerFactory | ||
import com.google.android.play.core.tasks.Task | ||
import mega.privacy.android.app.MegaApplication | ||
import mega.privacy.android.app.middlelayer.iar.OnCompleteListener | ||
import mega.privacy.android.app.middlelayer.iar.RatingHandler | ||
import mega.privacy.android.app.utils.LogUtil | ||
|
||
/** | ||
* Implement rating feature for Google play store using google APIs | ||
* | ||
* @param context Context for getting rating dialog | ||
*/ | ||
class RatingHandlerImpl(context: Context) : RatingHandler(context) { | ||
|
||
override fun showReviewDialog(context: Context, listener: OnCompleteListener) { | ||
val manager: ReviewManager = ReviewManagerFactory.create(context) | ||
val request: Task<ReviewInfo> = manager.requestReviewFlow() | ||
request.addOnCompleteListener { task -> | ||
if (task.isSuccessful) { | ||
val reviewInfo: ReviewInfo = task.result | ||
MegaApplication.getInstance().currentActivity?.let { | ||
val flow: Task<Void> = manager.launchReviewFlow(it, reviewInfo) | ||
flow.addOnCompleteListener { | ||
LogUtil.logDebug("Rating Task Complete") | ||
listener.onComplete() | ||
} | ||
} | ||
} else { | ||
LogUtil.logError("RatingTask is failed") | ||
} | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/hms/java/mega/privacy/android/app/service/iar/RatingHandlerImpl.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 mega.privacy.android.app.service.iar | ||
|
||
import android.content.Context | ||
import mega.privacy.android.app.middlelayer.iar.OnCompleteListener | ||
import mega.privacy.android.app.middlelayer.iar.RatingHandler | ||
import mega.privacy.android.app.utils.LogUtil | ||
/** | ||
* Implement rating feature for HMS by using huawei APIs | ||
* | ||
* @param context Context for getting rating dialog | ||
*/ | ||
class RatingHandlerImpl(context: Context) : RatingHandler(context) { | ||
|
||
override fun showReviewDialog(context: Context, listener: OnCompleteListener) { | ||
LogUtil.logDebug("showHmsReviewDialog") | ||
} | ||
} |
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
Oops, something went wrong.