v2.2.0: removed support for android instant apps
This commit is contained in:
@@ -44,7 +44,6 @@
|
||||
<activity
|
||||
android:name=".AndroidMissingNativesHandler">
|
||||
</activity>
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
||||
@@ -81,7 +81,6 @@ scenes.interlevelscene$mode.resurrect=Resurrecting...
|
||||
scenes.interlevelscene$mode.return=Returning...
|
||||
scenes.interlevelscene$mode.fall=Falling...
|
||||
scenes.interlevelscene$mode.reset=Resetting...
|
||||
scenes.interlevelscene.install=Install the Game
|
||||
scenes.interlevelscene.file_not_found=Save file not found. If this error persists after restarting, it may mean this save game is corrupted. Sorry about that.
|
||||
scenes.interlevelscene.io_error=Cannot read save file. If this error persists after restarting, it may mean this save game is corrupted. Sorry about that.
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ windows.wndenergizeitem.energize_all=Turn all into %d energy
|
||||
windows.wnderror.title=ERROR
|
||||
|
||||
windows.wndgame.settings=Settings
|
||||
windows.wndgame.install=Install the Game
|
||||
windows.wndgame.challenges=Challenges
|
||||
windows.wndgame.rankings=Rankings
|
||||
windows.wndgame.start=Start New Game
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
package com.shatteredpixel.shatteredpixeldungeon.scenes;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Chrome;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
|
||||
@@ -38,12 +37,8 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.SpecialRoom;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.services.updates.Updates;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.GameLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RenderedTextBlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.StyledButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.BArray;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndError;
|
||||
import com.watabou.gltextures.TextureCache;
|
||||
@@ -164,11 +159,7 @@ public class InterlevelScene extends PixelScene {
|
||||
else if (lastRegion == 5) loadingAsset = Assets.Interfaces.LOADING_HALLS;
|
||||
else loadingAsset = Assets.Interfaces.SHADOW;
|
||||
|
||||
//slow down transition when displaying an install prompt
|
||||
if (Updates.isInstallable()){
|
||||
fadeTime += 0.5f; //adds 1 second total
|
||||
//speed up transition when debugging
|
||||
} else if (DeviceCompat.isDebug()){
|
||||
if (DeviceCompat.isDebug()){
|
||||
fadeTime = 0f;
|
||||
}
|
||||
|
||||
@@ -220,30 +211,6 @@ public class InterlevelScene extends PixelScene {
|
||||
align(message);
|
||||
add( message );
|
||||
|
||||
if (Updates.isInstallable()){
|
||||
StyledButton install = new StyledButton(Chrome.Type.GREY_BUTTON_TR, Messages.get(this, "install")){
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
float p = timeLeft / fadeTime;
|
||||
if (phase == Phase.FADE_IN) alpha(1 - p);
|
||||
else if (phase == Phase.FADE_OUT) alpha(p);
|
||||
else alpha(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
super.onClick();
|
||||
Updates.launchInstall();
|
||||
}
|
||||
};
|
||||
install.icon(Icons.get(Icons.CHANGES));
|
||||
install.textColor(Window.SHPX_COLOR);
|
||||
install.setSize(install.reqWidth()+5, 20);
|
||||
install.setPos((Camera.main.width - install.width())/2, (Camera.main.height - message.bottom())/3 + message.bottom());
|
||||
add(install);
|
||||
}
|
||||
|
||||
phase = Phase.FADE_IN;
|
||||
timeLeft = fadeTime;
|
||||
|
||||
|
||||
@@ -279,10 +279,9 @@ public class TitleScene extends PixelScene {
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (!updateShown && (Updates.updateAvailable() || Updates.isInstallable())){
|
||||
if (!updateShown && Updates.updateAvailable()){
|
||||
updateShown = true;
|
||||
if (Updates.isInstallable()) text(Messages.get(TitleScene.class, "install"));
|
||||
else text(Messages.get(TitleScene.class, "update"));
|
||||
text(Messages.get(TitleScene.class, "update"));
|
||||
}
|
||||
|
||||
if (updateShown){
|
||||
@@ -292,10 +291,7 @@ public class TitleScene extends PixelScene {
|
||||
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (Updates.isInstallable()){
|
||||
Updates.launchInstall();
|
||||
|
||||
} else if (Updates.updateAvailable()){
|
||||
if (Updates.updateAvailable()){
|
||||
AvailableUpdateData update = Updates.updateData();
|
||||
|
||||
ShatteredPixelDungeon.scene().addToFront( new WndOptions(
|
||||
|
||||
@@ -37,8 +37,8 @@ public class Updates {
|
||||
private static Date lastCheck = null;
|
||||
private static final long CHECK_DELAY = 1000*60*60; //1 hour
|
||||
|
||||
public static boolean isUpdateable(){
|
||||
return supportsUpdates() && service.isUpdateable();
|
||||
public static boolean supportsUpdatePrompts(){
|
||||
return supportsUpdates() && service.supportsUpdatePrompts();
|
||||
}
|
||||
|
||||
public static boolean supportsBetaChannel(){
|
||||
@@ -46,7 +46,7 @@ public class Updates {
|
||||
}
|
||||
|
||||
public static void checkForUpdate(){
|
||||
if (!isUpdateable()) return;
|
||||
if (!supportsUpdatePrompts()) return;
|
||||
if (lastCheck != null && (new Date().getTime() - lastCheck.getTime()) < CHECK_DELAY) return;
|
||||
|
||||
//We do this so that automatically enabled beta checking (for users who DLed a beta) persists afterward
|
||||
@@ -92,16 +92,6 @@ public class Updates {
|
||||
lastCheck = null;
|
||||
}
|
||||
|
||||
public static boolean isInstallable(){
|
||||
return supportsUpdates() && service.isInstallable();
|
||||
}
|
||||
|
||||
public static void launchInstall(){
|
||||
if (supportsUpdates()){
|
||||
service.initializeInstall();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean supportsReviews() {
|
||||
return supportsUpdates() && service.supportsReviews();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.HeroSelectScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.InterlevelScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.RankingsScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.TitleScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.services.updates.Updates;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Icons;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
|
||||
@@ -62,18 +61,6 @@ public class WndGame extends Window {
|
||||
});
|
||||
curBtn.icon(Icons.get(Icons.PREFS));
|
||||
|
||||
//install prompt
|
||||
if (Updates.isInstallable()){
|
||||
addButton( curBtn = new RedButton( Messages.get(this, "install") ) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
Updates.launchInstall();
|
||||
}
|
||||
} );
|
||||
curBtn.textColor(Window.SHPX_COLOR);
|
||||
curBtn.icon(Icons.get(Icons.CHANGES));
|
||||
}
|
||||
|
||||
// Challenges window
|
||||
if (Dungeon.challenges > 0) {
|
||||
addButton( curBtn = new RedButton( Messages.get(this, "challenges") ) {
|
||||
|
||||
@@ -824,7 +824,7 @@ public class WndSettings extends WndTabbed {
|
||||
chkNews.checked(SPDSettings.news());
|
||||
add(chkNews);
|
||||
|
||||
if (Updates.supportsUpdates() && Updates.isUpdateable()) {
|
||||
if (Updates.supportsUpdates() && Updates.supportsUpdatePrompts()) {
|
||||
chkUpdates = new CheckBox(Messages.get(this, "updates")) {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.services.updates;
|
||||
|
||||
//TODO with install and review functionality, this service is less and less just about updates
|
||||
//TODO with review functionality, this service is about more than just updates
|
||||
// perhaps rename to PlatformService, StoreService, DistributionService, etc?
|
||||
public abstract class UpdateService {
|
||||
|
||||
@@ -31,8 +31,8 @@ public abstract class UpdateService {
|
||||
public abstract void onConnectionFailed();
|
||||
}
|
||||
|
||||
//whether the app is updateable via an ingame prompt (e.g. not a demo or an android instant app)
|
||||
public abstract boolean isUpdateable();
|
||||
//whether the service supports offering update notifications via an ingame prompt
|
||||
public abstract boolean supportsUpdatePrompts();
|
||||
|
||||
//whether the service supports an opt-in channel for betas
|
||||
public abstract boolean supportsBetaChannel();
|
||||
@@ -41,15 +41,11 @@ public abstract class UpdateService {
|
||||
|
||||
public abstract void initializeUpdate( AvailableUpdateData update );
|
||||
|
||||
//whether the app installable via an ingame prompt (e.g. a demo, or an android instant app)
|
||||
public abstract boolean isInstallable();
|
||||
|
||||
public abstract void initializeInstall();
|
||||
|
||||
public static abstract class ReviewResultCallback {
|
||||
public abstract void onComplete();
|
||||
}
|
||||
|
||||
//whether the service supports prompts to review the game via and ingame prompt
|
||||
public abstract boolean supportsReviews();
|
||||
|
||||
public abstract void initializeReview( ReviewResultCallback callback );
|
||||
|
||||
@@ -29,7 +29,7 @@ public class DebugUpdates extends UpdateService {
|
||||
private static AvailableUpdateData debugUpdateInfo;
|
||||
|
||||
@Override
|
||||
public boolean isUpdateable() {
|
||||
public boolean supportsUpdatePrompts() {
|
||||
return false; //turn on to debug update prompts
|
||||
}
|
||||
|
||||
@@ -59,16 +59,6 @@ public class DebugUpdates extends UpdateService {
|
||||
Game.platform.openURI( update.URL );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInstallable() {
|
||||
return false; //turn on to test install prompts
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeInstall() {
|
||||
//does nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsReviews() {
|
||||
return false; //turn on to debug review prompts
|
||||
|
||||
@@ -38,7 +38,7 @@ public class GitHubUpdates extends UpdateService {
|
||||
private static Pattern versionCodePattern = Pattern.compile("internal version number: ([0-9]*)", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
@Override
|
||||
public boolean isUpdateable() {
|
||||
public boolean supportsUpdatePrompts() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -127,16 +127,6 @@ public class GitHubUpdates extends UpdateService {
|
||||
Game.platform.openURI( update.URL );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInstallable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeInstall() {
|
||||
//does nothing, always installed
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsReviews() {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user