v0.8.2c: added reviews to the structure of update services
This commit is contained in:
parent
210c96c02c
commit
2675901bea
|
@ -22,6 +22,7 @@
|
|||
package com.shatteredpixel.shatteredpixeldungeon.services.updates;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.SPDSettings;
|
||||
import com.watabou.utils.Callback;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -92,4 +93,17 @@ public class Updates {
|
|||
}
|
||||
}
|
||||
|
||||
public static void launchReview(Callback callback){
|
||||
if (supportsUpdates()){
|
||||
service.initializeReview(new UpdateService.ReviewResultCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
callback.call();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback.call();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.services.updates;
|
||||
|
||||
//TODO with install and review functionality, this service is less and less just about updates
|
||||
// perhaps rename to PlatformService, StoreService, DistributionService, etc?
|
||||
public abstract class UpdateService {
|
||||
|
||||
public static abstract class UpdateResultCallback {
|
||||
|
@ -41,4 +43,10 @@ public abstract class UpdateService {
|
|||
|
||||
public abstract void initializeInstall();
|
||||
|
||||
public static abstract class ReviewResultCallback {
|
||||
public abstract void onComplete();
|
||||
}
|
||||
|
||||
public abstract void initializeReview( ReviewResultCallback callback );
|
||||
|
||||
}
|
||||
|
|
|
@ -65,4 +65,10 @@ public class DebugUpdates extends UpdateService {
|
|||
//does nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeReview(ReviewResultCallback callback) {
|
||||
//does nothing
|
||||
callback.onComplete();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -135,4 +135,9 @@ public class GitHubUpdates extends UpdateService {
|
|||
//does nothing, always installed
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeReview(ReviewResultCallback callback) {
|
||||
//does nothing, no review functionality here
|
||||
callback.onComplete();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user