<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
- <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.0/jars" />
- <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/22.2.0/jars" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/jars" />
+ <excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
- <orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
+ <orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" exported="" name="support-annotations-22.2.0" level="project" />
- <orderEntry type="library" exported="" name="support-v4-22.2.0" level="project" />
- <orderEntry type="library" exported="" name="appcompat-v7-22.2.0" level="project" />
+ <orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
+ <orderEntry type="library" exported="" name="appcompat-v7-23.0.1" level="project" />
+ <orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
</component>
</module>
\ No newline at end of file
apply plugin: 'com.android.application'
android {
- compileSdkVersion 22
- buildToolsVersion "22.0.1"
+ compileSdkVersion 23
+ buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.stoutner.privacybrowser"
minSdkVersion 8
- targetSdkVersion 22
+ targetSdkVersion 23
versionCode 1
versionName "1.0"
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
- compile 'com.android.support:appcompat-v7:22.2.0'
+ compile 'com.android.support:appcompat-v7:23.0.1'
}
<uses-permission android:name="android.permission.INTERNET" />
<application
- android:allowBackup="true"
+ android:allowBackup="false"
+ android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/privacy_browser"
android:theme="@style/AppTheme" >
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
-import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
+import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
+import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.EditText;
+import android.widget.ProgressBar;
import java.net.URL;
-public class Webview extends ActionBarActivity {
+public class Webview extends AppCompatActivity {
static String formattedUrlString;
static WebView mainWebView;
+ static ProgressBar progressBar;
static final String homepage = "https://www.duckduckgo.com";
@Override
final EditText urlTextBox = (EditText) findViewById(R.id.urlTextBox);
mainWebView = (WebView) findViewById(R.id.mainWebView);
+ progressBar = (ProgressBar) findViewById(R.id.progressBar);
// setWebViewClient makes this WebView the default handler for URLs inside the app, so that links are not kicked out to other apps.
mainWebView.setWebViewClient(new WebViewClient());
+ // Update the progress bar when a page is loading.
+ mainWebView.setWebChromeClient(new WebChromeClient() {
+ public void onProgressChanged(WebView view, int progress) {
+ if (progress < 100) {
+ progressBar.setVisibility(View.VISIBLE);
+ } else {
+ progressBar.setVisibility(View.GONE);
+ }
+ progressBar.setProgress(progress);
+ }
+ });
+
// Allow pinch to zoom.
mainWebView.getSettings().setBuiltInZoomControls(true);
<EditText
android:id="@+id/urlTextBox"
- android:layout_width="wrap_content"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
android:inputType="textUri"
android:imeOptions="actionGo"
android:layout_height="wrap_content" />
</LinearLayout>
- <WebView
- android:id="@+id/mainWebView"
+ <FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/topBarLayout"
- android:focusable="true"
- android:focusableInTouchMode="true" />
+ tools:context=".MainActivity"
+ android:id="@+id/relativeLayout">
+
+ <WebView
+ android:id="@+id/mainWebView"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:focusable="true"
+ android:focusableInTouchMode="true" />
+
+ <ProgressBar
+ android:id="@+id/progressBar"
+ style="?android:attr/progressBarStyleHorizontal"
+ android:layout_width="fill_parent"
+ android:layout_height="7dp"
+ android:max="100"
+ android:progressTint="#FF29A8FF"
+ android:progressBackgroundTint="#FFFFFFFF"
+ android:visibility="gone" />
+ </FrameLayout>
+
</RelativeLayout>
xmlns:tools="http://schemas.android.com/tools"
tools:context=".Webview">
+
<item
android:id="@+id/back"
android:title="@string/back"
<resources>
<!-- Base application theme. -->
- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+ <style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
</style>