|
|
|
|
@ -18,6 +18,8 @@ public abstract class MarketStrategy {
|
|
|
|
|
*/
|
|
|
|
|
abstract public Intent generateMarketLink(String packageName);
|
|
|
|
|
|
|
|
|
|
abstract public String strategyId();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return if this market has power pack
|
|
|
|
|
*/
|
|
|
|
|
@ -50,6 +52,18 @@ public abstract class MarketStrategy {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class NoMarketStrategy extends MarketStrategy {
|
|
|
|
|
@Override
|
|
|
|
|
public Intent generateMarketLink(String packageName) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String strategyId() {
|
|
|
|
|
return "no_market"; //$NON-NLS-1$
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class AndroidMarketStrategy extends MarketStrategy {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@ -59,6 +73,11 @@ public abstract class MarketStrategy {
|
|
|
|
|
packageName));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String strategyId() {
|
|
|
|
|
return "android_market"; //$NON-NLS-1$
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class WebMarketStrategy extends MarketStrategy {
|
|
|
|
|
@ -69,6 +88,11 @@ public abstract class MarketStrategy {
|
|
|
|
|
Uri.parse("http://weloveastrid.com/store")); //$NON-NLS-1$
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String strategyId() {
|
|
|
|
|
return "web_market"; //$NON-NLS-1$
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class AmazonMarketStrategy extends MarketStrategy {
|
|
|
|
|
@ -109,6 +133,11 @@ public abstract class MarketStrategy {
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String strategyId() {
|
|
|
|
|
return "amazon_market"; //$NON-NLS-1$
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class NookMarketStrategy extends MarketStrategy {
|
|
|
|
|
@ -146,6 +175,11 @@ public abstract class MarketStrategy {
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String strategyId() {
|
|
|
|
|
return "nook_market"; //$NON-NLS-1$
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|