Use boolean constant to make free/plus builds easier to generate

This commit is contained in:
Anthony Restaino 2015-04-28 19:17:48 -04:00
parent 2b59ea1906
commit 4fb1a50f03
5 changed files with 12 additions and 3 deletions

View File

@ -3,8 +3,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="acr.browser.lightning"
android:versionCode="76"
android:versionName="4.0.8a" >
android:versionCode="77"
android:versionName="4.0.9a" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />

View File

@ -30,7 +30,7 @@ public class AdBlock {
}
private AdBlock(Context context) {
if (mBlockedDomainsList.isEmpty()) {
if (mBlockedDomainsList.isEmpty() && Constants.FULL_VERSION) {
loadBlockedDomainsList(context);
}
mBlockAds = PreferenceManager.getInstance().getAdBlockEnabled();

View File

@ -1135,6 +1135,11 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
}
protected synchronized boolean newTab(String url, boolean show) {
// Limit number of tabs for limited version of app
if (!Constants.FULL_VERSION && mWebViews.size() >= 10) {
Utils.showToast(this, this.getString(R.string.max_tabs));
return false;
}
mIsNewIntent = false;
LightningView startingTab = new LightningView(mActivity, url, mDarkTheme);
if (mIdGenerator == 0) {

View File

@ -10,6 +10,8 @@ public final class Constants {
private Constants() {
}
public static final boolean FULL_VERSION = true;
public static final String DESKTOP_USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36";
public static final String MOBILE_USER_AGENT = "Mozilla/5.0 (Linux; U; Android 4.4; en-us; Nexus 4 Build/JOP24G) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30";
public static final int API = android.os.Build.VERSION.SDK_INT;

View File

@ -61,6 +61,7 @@ public class SettingsActivity extends ThemableSettingsActivity {
// initialize UI
RelativeLayout layoutFlash = (RelativeLayout) findViewById(R.id.layoutFlash);
RelativeLayout layoutBlockAds = (RelativeLayout) findViewById(R.id.layoutAdBlock);
layoutBlockAds.setEnabled(Constants.FULL_VERSION);
RelativeLayout layoutImages = (RelativeLayout) findViewById(R.id.layoutImages);
RelativeLayout layoutEnableJS = (RelativeLayout) findViewById(R.id.layoutEnableJS);
RelativeLayout layoutOrbot = (RelativeLayout) findViewById(R.id.layoutUseOrbot);
@ -85,6 +86,7 @@ public class SettingsActivity extends ThemableSettingsActivity {
CheckBox flash = (CheckBox) findViewById(R.id.cbFlash);
CheckBox adblock = (CheckBox) findViewById(R.id.cbAdblock);
adblock.setEnabled(Constants.FULL_VERSION);
CheckBox images = (CheckBox) findViewById(R.id.cbImageBlock);
CheckBox enablejs = (CheckBox) findViewById(R.id.cbJavascript);
CheckBox orbot = (CheckBox) findViewById(R.id.cbOrbot);