File tree Expand file tree Collapse file tree 5 files changed +12
-13
lines changed
app/src/main/java/com/d4rk/androidtutorials/java Expand file tree Collapse file tree 5 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 11package com .d4rk .androidtutorials .java .domain .help ;
22
3- import android .app .Activity ;
43import com .d4rk .androidtutorials .java .ui .screens .help .repository .HelpRepository ;
54
65/** Requests the Google Play review flow. */
@@ -11,7 +10,7 @@ public RequestReviewFlowUseCase(HelpRepository repository) {
1110 this .repository = repository ;
1211 }
1312
14- public void invoke (Activity activity , HelpRepository .OnReviewInfoListener listener ) {
15- repository .requestReviewFlow (activity , listener );
13+ public void invoke (HelpRepository .OnReviewInfoListener listener ) {
14+ repository .requestReviewFlow (listener );
1615 }
1716}
Original file line number Diff line number Diff line change 11package com .d4rk .androidtutorials .java .domain .support ;
22
33import java .util .List ;
4- import com .android .billingclient .api .ProductDetails ;
54import com .d4rk .androidtutorials .java .ui .screens .support .repository .SupportRepository ;
65
76/** Queries in-app product details. */
87public class QueryProductDetailsUseCase {
98 private final SupportRepository repository ;
109
11- public interface Listener extends SupportRepository .OnProductDetailsListener {}
12-
1310 public QueryProductDetailsUseCase (SupportRepository repository ) {
1411 this .repository = repository ;
1512 }
1613
17- public void invoke (List <String > productIds , Listener listener ) {
14+ public void invoke (List <String > productIds ,
15+ SupportRepository .OnProductDetailsListener listener ) {
1816 repository .queryProductDetails (productIds , listener );
1917 }
2018}
Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ public HelpViewModel(@NonNull Application application) {
3232 * Requests a review flow. On success, you get a ReviewInfo.
3333 * On failure, handle the exception (like fallback to the Play Store).
3434 */
35- public void requestReviewFlow (Activity activity , HelpRepository .OnReviewInfoListener listener ) {
36- requestReviewFlowUseCase .invoke (activity , listener );
35+ public void requestReviewFlow (HelpRepository .OnReviewInfoListener listener ) {
36+ requestReviewFlowUseCase .invoke (listener );
3737 }
3838
3939 /**
Original file line number Diff line number Diff line change 11package com .d4rk .androidtutorials .java .ui .screens .help .repository ;
22
33import android .app .Activity ;
4+ import android .content .Context ;
45
56import androidx .annotation .NonNull ;
67
@@ -15,8 +16,8 @@ public class HelpRepository {
1516
1617 private final ReviewManager reviewManager ;
1718
18- public HelpRepository (@ NonNull Activity activity ) {
19- this .reviewManager = ReviewManagerFactory .create (activity );
19+ public HelpRepository (@ NonNull Context context ) {
20+ this .reviewManager = ReviewManagerFactory .create (context );
2021 }
2122
2223 /**
Original file line number Diff line number Diff line change 11package com .d4rk .androidtutorials .java .ui .screens .startup .repository ;
22
33import android .app .Activity ;
4+ import android .content .Context ;
45
56import com .google .android .ump .ConsentForm ;
67import com .google .android .ump .ConsentInformation ;
@@ -17,8 +18,8 @@ public class StartupRepository {
1718 private final ConsentInformation consentInformation ;
1819 private ConsentForm consentForm ;
1920
20- public StartupRepository (Activity activity ) {
21- consentInformation = UserMessagingPlatform .getConsentInformation (activity );
21+ public StartupRepository (Context context ) {
22+ consentInformation = UserMessagingPlatform .getConsentInformation (context );
2223 }
2324
2425 /**
You can’t perform that action at this time.
0 commit comments