Move java files to sub-packages for better organization
This commit is contained in:
parent
db734dfa7d
commit
f8c2d0096d
3
.idea/misc.xml
generated
3
.idea/misc.xml
generated
@ -1,4 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="EntryPointsManager">
|
||||||
|
<entry_points version="2.0" />
|
||||||
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK" />
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK" />
|
||||||
</project>
|
</project>
|
@ -42,7 +42,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Without this rule, openFileChooser does not get called on KitKat
|
# Without this rule, openFileChooser does not get called on KitKat
|
||||||
-keep class acr.browser.lightning.LightningView$LightningChromeClient {
|
-keep class acr.browser.lightning.view.LightningView$LightningChromeClient {
|
||||||
void openFileChooser(android.webkit.ValueCallback);
|
void openFileChooser(android.webkit.ValueCallback);
|
||||||
void openFileChooser(android.webkit.ValueCallback, java.lang.String);
|
void openFileChooser(android.webkit.ValueCallback, java.lang.String);
|
||||||
void openFileChooser(android.webkit.ValueCallback, java.lang.String, java.lang.String);
|
void openFileChooser(android.webkit.ValueCallback, java.lang.String, java.lang.String);
|
||||||
|
@ -29,13 +29,13 @@
|
|||||||
android:targetSdkVersion="22" />
|
android:targetSdkVersion="22" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name="acr.browser.lightning.BrowserApp"
|
android:name=".activity.BrowserApp"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name" >
|
android:label="@string/app_name" >
|
||||||
<activity
|
<activity
|
||||||
android:name="acr.browser.lightning.MainActivity"
|
android:name=".activity.MainActivity"
|
||||||
android:alwaysRetainTaskState="true"
|
android:alwaysRetainTaskState="true"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
@ -63,6 +63,8 @@
|
|||||||
<!--
|
<!--
|
||||||
For these schemes where any of these particular MIME types
|
For these schemes where any of these particular MIME types
|
||||||
have been supplied, we are a good candidate.
|
have been supplied, we are a good candidate.
|
||||||
|
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
@ -102,7 +104,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="acr.browser.lightning.SettingsActivity"
|
android:name=".activity.SettingsActivity"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||||
android:label="@string/settings"
|
android:label="@string/settings"
|
||||||
android:theme="@style/Theme.SettingsTheme" >
|
android:theme="@style/Theme.SettingsTheme" >
|
||||||
@ -113,7 +115,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="acr.browser.lightning.GeneralSettingsActivity"
|
android:name=".activity.GeneralSettingsActivity"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||||
android:label="@string/settings_general"
|
android:label="@string/settings_general"
|
||||||
android:theme="@style/Theme.SettingsTheme" >
|
android:theme="@style/Theme.SettingsTheme" >
|
||||||
@ -124,7 +126,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="acr.browser.lightning.DisplaySettingsActivity"
|
android:name=".activity.DisplaySettingsActivity"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||||
android:label="@string/settings_display"
|
android:label="@string/settings_display"
|
||||||
android:theme="@style/Theme.SettingsTheme" >
|
android:theme="@style/Theme.SettingsTheme" >
|
||||||
@ -135,7 +137,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="acr.browser.lightning.PrivacySettingsActivity"
|
android:name=".activity.PrivacySettingsActivity"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||||
android:label="@string/settings_privacy"
|
android:label="@string/settings_privacy"
|
||||||
android:theme="@style/Theme.SettingsTheme" >
|
android:theme="@style/Theme.SettingsTheme" >
|
||||||
@ -146,7 +148,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="acr.browser.lightning.AdvancedSettingsActivity"
|
android:name=".activity.AdvancedSettingsActivity"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||||
android:label="@string/settings_advanced"
|
android:label="@string/settings_advanced"
|
||||||
android:theme="@style/Theme.SettingsTheme" >
|
android:theme="@style/Theme.SettingsTheme" >
|
||||||
@ -157,7 +159,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="acr.browser.lightning.AboutSettingsActivity"
|
android:name=".activity.AboutSettingsActivity"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||||
android:label="@string/settings_about"
|
android:label="@string/settings_about"
|
||||||
android:theme="@style/Theme.SettingsTheme" >
|
android:theme="@style/Theme.SettingsTheme" >
|
||||||
@ -168,7 +170,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="acr.browser.lightning.IncognitoActivity"
|
android:name=".activity.IncognitoActivity"
|
||||||
android:alwaysRetainTaskState="true"
|
android:alwaysRetainTaskState="true"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
@ -182,7 +184,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="acr.browser.lightning.LicenseActivity"
|
android:name=".activity.LicenseActivity"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||||
android:label="@string/licenses"
|
android:label="@string/licenses"
|
||||||
android:theme="@style/Theme.SettingsTheme" >
|
android:theme="@style/Theme.SettingsTheme" >
|
||||||
@ -193,7 +195,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="acr.browser.lightning.BookmarkActivity"
|
android:name=".activity.BookmarkActivity"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||||
android:label="@string/bookmark_settings"
|
android:label="@string/bookmark_settings"
|
||||||
android:theme="@style/Theme.SettingsTheme" >
|
android:theme="@style/Theme.SettingsTheme" >
|
||||||
@ -204,7 +206,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="acr.browser.lightning.ReadingActivity"
|
android:name=".activity.ReadingActivity"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||||
android:label="@string/reading_mode"
|
android:label="@string/reading_mode"
|
||||||
android:theme="@style/Theme.SettingsTheme" >
|
android:theme="@style/Theme.SettingsTheme" >
|
||||||
|
@ -1,101 +0,0 @@
|
|||||||
package acr.browser.lightning;
|
|
||||||
|
|
||||||
import java.io.FilterInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.Deque;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
|
|
||||||
public class ReplacingInputStream extends FilterInputStream {
|
|
||||||
|
|
||||||
Deque<Integer> inQueue = new LinkedList<Integer>();
|
|
||||||
|
|
||||||
Deque<Integer> outQueue = new LinkedList<Integer>();
|
|
||||||
|
|
||||||
final byte[] search, replacement;
|
|
||||||
|
|
||||||
protected ReplacingInputStream(InputStream in, byte[] search, byte[] replacement) {
|
|
||||||
super(in);
|
|
||||||
this.search = search;
|
|
||||||
this.replacement = replacement;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isMatchFound() {
|
|
||||||
Iterator<Integer> inIter = inQueue.iterator();
|
|
||||||
for (int i = 0; i < search.length; i++) {
|
|
||||||
if (!inIter.hasNext() || search[i] != inIter.next()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void readAhead() throws IOException {
|
|
||||||
// Work up some look-ahead.
|
|
||||||
while (inQueue.size() < search.length) {
|
|
||||||
int next = super.read();
|
|
||||||
inQueue.offer(next);
|
|
||||||
if (next == -1) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int read() throws IOException {
|
|
||||||
|
|
||||||
// Next byte already determined.
|
|
||||||
if (outQueue.isEmpty()) {
|
|
||||||
|
|
||||||
readAhead();
|
|
||||||
|
|
||||||
if (isMatchFound()) {
|
|
||||||
for (int i = 0; i < search.length; i++) {
|
|
||||||
inQueue.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (byte b : replacement) {
|
|
||||||
outQueue.offer((int) b);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
outQueue.add(inQueue.remove());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return outQueue.remove();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns false. REFilterInputStream does not support mark() and reset()
|
|
||||||
* methods.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean markSupported() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reads from the stream into the provided array.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int read(byte[] b, int off, int len) throws IOException {
|
|
||||||
int i;
|
|
||||||
int ok = 0;
|
|
||||||
while (len-- > 0) {
|
|
||||||
i = read();
|
|
||||||
if (i == -1) {
|
|
||||||
return (ok == 0) ? -1 : ok;
|
|
||||||
}
|
|
||||||
b[off++] = (byte) i;
|
|
||||||
ok++;
|
|
||||||
}
|
|
||||||
return ok;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int read(byte[] buffer) throws IOException {
|
|
||||||
|
|
||||||
return read(buffer, 0, buffer.length);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageInfo;
|
import android.content.pm.PackageInfo;
|
||||||
@ -15,6 +15,8 @@ import android.view.View.OnClickListener;
|
|||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
public class AboutSettingsActivity extends ThemableSettingsActivity implements OnClickListener {
|
public class AboutSettingsActivity extends ThemableSettingsActivity implements OnClickListener {
|
||||||
|
|
||||||
private int mEasterEggCounter;
|
private int mEasterEggCounter;
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -18,6 +18,9 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
public class AdvancedSettingsActivity extends ThemableSettingsActivity {
|
public class AdvancedSettingsActivity extends ThemableSettingsActivity {
|
||||||
|
|
||||||
private CheckBox cbAllowPopups, cbAllowCookies, cbAllowIncognitoCookies, cbRestoreTabs;
|
private CheckBox cbAllowPopups, cbAllowCookies, cbAllowIncognitoCookies, cbRestoreTabs;
|
@ -1,4 +1,4 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
@ -17,6 +17,10 @@ import android.view.View.OnClickListener;
|
|||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import acr.browser.lightning.database.BookmarkManager;
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
public class BookmarkActivity extends ThemableSettingsActivity implements OnClickListener {
|
public class BookmarkActivity extends ThemableSettingsActivity implements OnClickListener {
|
||||||
|
|
||||||
private BookmarkManager mBookmarkManager;
|
private BookmarkManager mBookmarkManager;
|
@ -2,7 +2,7 @@
|
|||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.animation.ArgbEvaluator;
|
import android.animation.ArgbEvaluator;
|
||||||
import android.animation.ValueAnimator;
|
import android.animation.ValueAnimator;
|
||||||
@ -18,7 +18,6 @@ import android.database.sqlite.SQLiteException;
|
|||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.Color;
|
|
||||||
import android.graphics.ColorMatrix;
|
import android.graphics.ColorMatrix;
|
||||||
import android.graphics.ColorMatrixColorFilter;
|
import android.graphics.ColorMatrixColorFilter;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
@ -62,6 +61,22 @@ import android.support.v7.graphics.Palette;
|
|||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.widget.AdapterView.OnItemClickListener;
|
import android.widget.AdapterView.OnItemClickListener;
|
||||||
import android.widget.TextView.OnEditorActionListener;
|
import android.widget.TextView.OnEditorActionListener;
|
||||||
|
|
||||||
|
import acr.browser.lightning.view.AnimatedProgressBar;
|
||||||
|
import acr.browser.lightning.database.BookmarkManager;
|
||||||
|
import acr.browser.lightning.constant.BookmarkPage;
|
||||||
|
import acr.browser.lightning.controller.BrowserController;
|
||||||
|
import acr.browser.lightning.object.ClickHandler;
|
||||||
|
import acr.browser.lightning.constant.Constants;
|
||||||
|
import acr.browser.lightning.object.DrawerArrowDrawable;
|
||||||
|
import acr.browser.lightning.database.HistoryDatabase;
|
||||||
|
import acr.browser.lightning.database.HistoryItem;
|
||||||
|
import acr.browser.lightning.constant.HistoryPage;
|
||||||
|
import acr.browser.lightning.view.LightningView;
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.object.SearchAdapter;
|
||||||
|
import acr.browser.lightning.utils.Utils;
|
||||||
import info.guardianproject.onionkit.ui.OrbotHelper;
|
import info.guardianproject.onionkit.ui.OrbotHelper;
|
||||||
import info.guardianproject.onionkit.web.WebkitProxy;
|
import info.guardianproject.onionkit.web.WebkitProxy;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
@ -15,6 +15,9 @@ import android.widget.CompoundButton;
|
|||||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
|
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
public class DisplaySettingsActivity extends ThemableSettingsActivity {
|
public class DisplaySettingsActivity extends ThemableSettingsActivity {
|
||||||
|
|
||||||
// mPreferences variables
|
// mPreferences variables
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
@ -23,6 +23,11 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import acr.browser.lightning.constant.Constants;
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.utils.Utils;
|
||||||
|
|
||||||
public class GeneralSettingsActivity extends ThemableSettingsActivity {
|
public class GeneralSettingsActivity extends ThemableSettingsActivity {
|
||||||
|
|
||||||
// mPreferences variables
|
// mPreferences variables
|
@ -1,4 +1,4 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@ -7,6 +7,9 @@ import android.view.Menu;
|
|||||||
import android.webkit.CookieManager;
|
import android.webkit.CookieManager;
|
||||||
import android.webkit.CookieSyncManager;
|
import android.webkit.CookieSyncManager;
|
||||||
|
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class IncognitoActivity extends BrowserActivity {
|
public class IncognitoActivity extends BrowserActivity {
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@ -10,6 +10,8 @@ import android.support.v7.widget.Toolbar;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*NOTE: This activity must not be removed in order to comply with the Mozilla Public License v. 2.0
|
*NOTE: This activity must not be removed in order to comply with the Mozilla Public License v. 2.0
|
||||||
*under which this code is licensed. Unless you plan on providing other attribution in the app to
|
*under which this code is licensed. Unless you plan on providing other attribution in the app to
|
@ -1,4 +1,4 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@ -7,6 +7,9 @@ import android.view.Menu;
|
|||||||
import android.webkit.CookieManager;
|
import android.webkit.CookieManager;
|
||||||
import android.webkit.CookieSyncManager;
|
import android.webkit.CookieSyncManager;
|
||||||
|
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class MainActivity extends BrowserActivity {
|
public class MainActivity extends BrowserActivity {
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -22,6 +22,11 @@ import android.widget.CompoundButton.OnCheckedChangeListener;
|
|||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import acr.browser.lightning.database.HistoryDatabase;
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.utils.Utils;
|
||||||
|
|
||||||
public class PrivacySettingsActivity extends ThemableSettingsActivity {
|
public class PrivacySettingsActivity extends ThemableSettingsActivity {
|
||||||
|
|
||||||
// mPreferences variables
|
// mPreferences variables
|
@ -1,8 +1,12 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import acr.browser.lightning.constant.Constants;
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.utils.Utils;
|
||||||
import acr.browser.lightning.reading.HtmlFetcher;
|
import acr.browser.lightning.reading.HtmlFetcher;
|
||||||
import acr.browser.lightning.reading.JResult;
|
import acr.browser.lightning.reading.JResult;
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
@ -23,6 +23,11 @@ import android.widget.CompoundButton;
|
|||||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
|
|
||||||
|
import acr.browser.lightning.constant.Constants;
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.utils.Utils;
|
||||||
import info.guardianproject.onionkit.ui.OrbotHelper;
|
import info.guardianproject.onionkit.ui.OrbotHelper;
|
||||||
|
|
||||||
public class SettingsActivity extends ThemableSettingsActivity {
|
public class SettingsActivity extends ThemableSettingsActivity {
|
@ -1,9 +1,12 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
public abstract class ThemableActivity extends ActionBarActivity {
|
public abstract class ThemableActivity extends ActionBarActivity {
|
||||||
|
|
||||||
private boolean mDark;
|
private boolean mDark;
|
@ -1,9 +1,12 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.activity;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.app.ActionBarActivity;
|
import android.support.v7.app.ActionBarActivity;
|
||||||
|
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
public abstract class ThemableSettingsActivity extends ActionBarActivity {
|
public abstract class ThemableSettingsActivity extends ActionBarActivity {
|
||||||
|
|
||||||
private boolean mDark;
|
private boolean mDark;
|
@ -1,7 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.constant;
|
||||||
|
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.activity.BrowserApp;
|
||||||
|
|
||||||
public class BookmarkPage {
|
public class BookmarkPage {
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.constant;
|
||||||
|
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.constant;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
@ -11,6 +11,11 @@ import java.util.List;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
|
import acr.browser.lightning.activity.BrowserApp;
|
||||||
|
import acr.browser.lightning.database.HistoryItem;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.database.HistoryDatabase;
|
||||||
|
|
||||||
public class HistoryPage {
|
public class HistoryPage {
|
||||||
|
|
||||||
private static final String FILENAME = "history.html";
|
private static final String FILENAME = "history.html";
|
@ -1,9 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.constant;
|
||||||
|
|
||||||
public class HomepageVariables {
|
import acr.browser.lightning.activity.BrowserApp;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
|
public class StartPage {
|
||||||
|
|
||||||
public static final String HEAD = "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\">"
|
public static final String HEAD = "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\">"
|
||||||
+ "<head>"
|
+ "<head>"
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.controller;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
@ -1,4 +1,4 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.database;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.BufferedWriter;
|
import java.io.BufferedWriter;
|
||||||
@ -24,6 +24,11 @@ import android.os.Environment;
|
|||||||
import android.provider.Browser;
|
import android.provider.Browser;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.constant.Constants;
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.utils.Utils;
|
||||||
|
|
||||||
public class BookmarkManager {
|
public class BookmarkManager {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.database;
|
||||||
|
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -11,6 +11,8 @@ import android.database.sqlite.SQLiteOpenHelper;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
public class HistoryDatabase extends SQLiteOpenHelper {
|
public class HistoryDatabase extends SQLiteOpenHelper {
|
||||||
|
|
||||||
// All Static variables
|
// All Static variables
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.database;
|
||||||
|
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.download;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
@ -20,6 +20,9 @@ import android.webkit.CookieManager;
|
|||||||
import android.webkit.URLUtil;
|
import android.webkit.URLUtil;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle download requests
|
* Handle download requests
|
||||||
*/
|
*/
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.download;
|
||||||
|
|
||||||
import android.app.DownloadManager;
|
import android.app.DownloadManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -14,6 +14,8 @@ import java.io.IOException;
|
|||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is used to pull down the http headers of a given URL so that we
|
* This class is used to pull down the http headers of a given URL so that we
|
||||||
* can analyse the mimetype and make any correction needed before we give the
|
* can analyse the mimetype and make any correction needed before we give the
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.download;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
@ -10,11 +10,15 @@ import android.util.Log;
|
|||||||
import android.webkit.DownloadListener;
|
import android.webkit.DownloadListener;
|
||||||
import android.webkit.URLUtil;
|
import android.webkit.URLUtil;
|
||||||
|
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.constant.Constants;
|
||||||
|
import acr.browser.lightning.download.DownloadHandler;
|
||||||
|
|
||||||
public class LightningDownloadListener implements DownloadListener {
|
public class LightningDownloadListener implements DownloadListener {
|
||||||
|
|
||||||
private Activity mActivity;
|
private Activity mActivity;
|
||||||
|
|
||||||
LightningDownloadListener(Activity activity) {
|
public LightningDownloadListener(Activity activity) {
|
||||||
mActivity = activity;
|
mActivity = activity;
|
||||||
}
|
}
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.download;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
@ -1,12 +1,14 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.object;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
|
||||||
|
import acr.browser.lightning.controller.BrowserController;
|
||||||
|
|
||||||
public class ClickHandler extends Handler {
|
public class ClickHandler extends Handler {
|
||||||
|
|
||||||
private BrowserController mBrowserController;
|
private BrowserController mBrowserController;
|
@ -1,4 +1,4 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.object;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2014 The Android Open Source Project
|
* Copyright (C) 2014 The Android Open Source Project
|
||||||
@ -30,7 +30,7 @@ import android.support.v7.appcompat.R;
|
|||||||
* A drawable that can draw a "Drawer hamburger" menu or an Arrow and animate
|
* A drawable that can draw a "Drawer hamburger" menu or an Arrow and animate
|
||||||
* between them.
|
* between them.
|
||||||
*/
|
*/
|
||||||
class DrawerArrowDrawable extends Drawable {
|
public class DrawerArrowDrawable extends Drawable {
|
||||||
private final Paint mPaint = new Paint();
|
private final Paint mPaint = new Paint();
|
||||||
// The angle in degress that the arrow head is inclined at.
|
// The angle in degress that the arrow head is inclined at.
|
||||||
private static final float ARROW_HEAD_ANGLE = (float) Math.toRadians(45);
|
private static final float ARROW_HEAD_ANGLE = (float) Math.toRadians(45);
|
||||||
@ -60,7 +60,7 @@ class DrawerArrowDrawable extends Drawable {
|
|||||||
* @param context
|
* @param context
|
||||||
* used to get the configuration for the drawable from
|
* used to get the configuration for the drawable from
|
||||||
*/
|
*/
|
||||||
DrawerArrowDrawable(Context context) {
|
public DrawerArrowDrawable(Context context) {
|
||||||
final TypedArray typedArray = context.getTheme().obtainStyledAttributes(null,
|
final TypedArray typedArray = context.getTheme().obtainStyledAttributes(null,
|
||||||
R.styleable.DrawerArrowToggle, R.attr.drawerArrowStyle,
|
R.styleable.DrawerArrowToggle, R.attr.drawerArrowStyle,
|
||||||
R.style.Base_Widget_AppCompat_DrawerArrowToggle);
|
R.style.Base_Widget_AppCompat_DrawerArrowToggle);
|
@ -1,4 +1,4 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.object;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -36,6 +36,12 @@ import android.widget.Filterable;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.database.BookmarkManager;
|
||||||
|
import acr.browser.lightning.database.HistoryDatabase;
|
||||||
|
import acr.browser.lightning.database.HistoryItem;
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
|
||||||
public class SearchAdapter extends BaseAdapter implements Filterable {
|
public class SearchAdapter extends BaseAdapter implements Filterable {
|
||||||
|
|
||||||
private List<HistoryItem> mHistory;
|
private List<HistoryItem> mHistory;
|
@ -1,8 +1,11 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.preference;
|
||||||
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
|
|
||||||
|
import acr.browser.lightning.activity.BrowserApp;
|
||||||
|
import acr.browser.lightning.constant.Constants;
|
||||||
|
|
||||||
public class PreferenceManager {
|
public class PreferenceManager {
|
||||||
|
|
||||||
private static class Name {
|
private static class Name {
|
@ -20,7 +20,7 @@ import java.net.SocketTimeoutException;
|
|||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import acr.browser.lightning.Constants;
|
import acr.browser.lightning.constant.Constants;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,7 +33,7 @@ import java.util.zip.GZIPInputStream;
|
|||||||
import java.util.zip.Inflater;
|
import java.util.zip.Inflater;
|
||||||
import java.util.zip.InflaterInputStream;
|
import java.util.zip.InflaterInputStream;
|
||||||
|
|
||||||
import acr.browser.lightning.Constants;
|
import acr.browser.lightning.constant.Constants;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.utils;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.AssetManager;
|
import android.content.res.AssetManager;
|
||||||
@ -13,6 +13,9 @@ import java.util.HashSet;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import acr.browser.lightning.constant.Constants;
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
|
||||||
public class AdBlock {
|
public class AdBlock {
|
||||||
|
|
||||||
private static final String TAG = "AdBlock";
|
private static final String TAG = "AdBlock";
|
@ -1,4 +1,4 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.utils;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
@ -15,6 +15,8 @@ import java.util.List;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import acr.browser.lightning.controller.BrowserController;
|
||||||
|
|
||||||
public class IntentUtils {
|
public class IntentUtils {
|
||||||
|
|
||||||
private Activity mActivity;
|
private Activity mActivity;
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.utils;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
@ -28,6 +28,11 @@ import java.util.ArrayList;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import acr.browser.lightning.constant.Constants;
|
||||||
|
import acr.browser.lightning.database.HistoryItem;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.download.DownloadHandler;
|
||||||
|
|
||||||
public final class Utils {
|
public final class Utils {
|
||||||
|
|
||||||
private Utils() {
|
private Utils() {
|
@ -1,4 +1,4 @@
|
|||||||
package acr.browser.lightning;
|
package acr.browser.lightning.view;
|
||||||
|
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@ -15,6 +15,8 @@ import android.view.animation.DecelerateInterpolator;
|
|||||||
import android.view.animation.Transformation;
|
import android.view.animation.Transformation;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright 11/4/2014 Anthony Restaino
|
* Copyright 11/4/2014 Anthony Restaino
|
||||||
* <p/>
|
* <p/>
|
@ -2,7 +2,7 @@
|
|||||||
* Copyright 2014 A.C.R. Development
|
* Copyright 2014 A.C.R. Development
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package acr.browser.lightning;
|
package acr.browser.lightning.view;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -52,6 +52,16 @@ import android.webkit.WebViewClient;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import acr.browser.lightning.controller.BrowserController;
|
||||||
|
import acr.browser.lightning.constant.Constants;
|
||||||
|
import acr.browser.lightning.constant.StartPage;
|
||||||
|
import acr.browser.lightning.download.LightningDownloadListener;
|
||||||
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
import acr.browser.lightning.R;
|
||||||
|
import acr.browser.lightning.utils.AdBlock;
|
||||||
|
import acr.browser.lightning.utils.IntentUtils;
|
||||||
|
import acr.browser.lightning.utils.Utils;
|
||||||
|
|
||||||
public class LightningView {
|
public class LightningView {
|
||||||
|
|
||||||
private Title mTitle;
|
private Title mTitle;
|
||||||
@ -142,7 +152,7 @@ public class LightningView {
|
|||||||
|
|
||||||
public String getHomepage() {
|
public String getHomepage() {
|
||||||
StringBuilder homepageBuilder = new StringBuilder();
|
StringBuilder homepageBuilder = new StringBuilder();
|
||||||
homepageBuilder.append(HomepageVariables.HEAD);
|
homepageBuilder.append(StartPage.HEAD);
|
||||||
String icon;
|
String icon;
|
||||||
String searchUrl;
|
String searchUrl;
|
||||||
switch (mPreferences.getSearchChoice()) {
|
switch (mPreferences.getSearchChoice()) {
|
||||||
@ -218,9 +228,9 @@ public class LightningView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
homepageBuilder.append(icon);
|
homepageBuilder.append(icon);
|
||||||
homepageBuilder.append(HomepageVariables.MIDDLE);
|
homepageBuilder.append(StartPage.MIDDLE);
|
||||||
homepageBuilder.append(searchUrl);
|
homepageBuilder.append(searchUrl);
|
||||||
homepageBuilder.append(HomepageVariables.END);
|
homepageBuilder.append(StartPage.END);
|
||||||
|
|
||||||
File homepage = new File(mActivity.getFilesDir(), "homepage.html");
|
File homepage = new File(mActivity.getFilesDir(), "homepage.html");
|
||||||
try {
|
try {
|
@ -20,7 +20,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="?attr/progressBackgroundColor" >
|
android:background="?attr/progressBackgroundColor" >
|
||||||
|
|
||||||
<acr.browser.lightning.AnimatedProgressBar
|
<acr.browser.lightning.view.AnimatedProgressBar
|
||||||
android:id="@+id/progress_view"
|
android:id="@+id/progress_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="2dp"
|
android:layout_height="2dp"
|
||||||
|
Loading…
Reference in New Issue
Block a user