diff options
Diffstat (limited to 'org.fox.epube/src/main')
29 files changed, 158 insertions, 0 deletions
diff --git a/org.fox.epube/src/main/AndroidManifest.xml b/org.fox.epube/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c2fe4db --- /dev/null +++ b/org.fox.epube/src/main/AndroidManifest.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="org.fox.epube">
+
+ <uses-permission android:name="android.permission.INTERNET"/>
+ <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+ <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
+
+ <application
+ android:allowBackup="true"
+ android:icon="@mipmap/ic_launcher"
+ android:label="@string/app_name"
+ android:roundIcon="@mipmap/ic_launcher_round"
+ android:supportsRtl="true"
+ android:theme="@style/AppTheme">
+ <activity android:name=".MainActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
\ No newline at end of file diff --git a/org.fox.epube/src/main/ic_launcher-web.png b/org.fox.epube/src/main/ic_launcher-web.png Binary files differnew file mode 100644 index 0000000..b1531e0 --- /dev/null +++ b/org.fox.epube/src/main/ic_launcher-web.png diff --git a/org.fox.epube/src/main/java/org/fox/epube/MainActivity.java b/org.fox.epube/src/main/java/org/fox/epube/MainActivity.java new file mode 100644 index 0000000..0db9de5 --- /dev/null +++ b/org.fox.epube/src/main/java/org/fox/epube/MainActivity.java @@ -0,0 +1,80 @@ +package org.fox.epube;
+
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.graphics.Bitmap;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.webkit.CookieManager;
+import android.webkit.ServiceWorkerClient;
+import android.webkit.ServiceWorkerController;
+import android.webkit.WebResourceRequest;
+import android.webkit.WebResourceResponse;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+import android.widget.ProgressBar;
+
+public class MainActivity extends AppCompatActivity {
+
+ private final String TAG = this.getClass().getSimpleName();
+ private ProgressBar m_loadingBar;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ getSupportActionBar().hide();
+
+ WebView web = findViewById(R.id.webview_main);
+
+ WebSettings settings = web.getSettings();
+
+ settings.setJavaScriptEnabled(true);
+ settings.setDomStorageEnabled(true);
+ settings.setCacheMode(WebSettings.LOAD_DEFAULT);
+ settings.setDatabaseEnabled(true);
+ settings.setAppCachePath(getCacheDir().getAbsolutePath());
+ settings.setAppCacheEnabled(true);
+
+ m_loadingBar = findViewById(R.id.loading_progress);
+ m_loadingBar.setIndeterminate(true);
+ m_loadingBar.setVisibility(View.VISIBLE);
+
+ web.setWebViewClient(new WebViewClient() {
+
+ @Override
+ public boolean shouldOverrideUrlLoading(WebView view, String url) {
+ view.loadUrl(url);
+ return true;
+ }
+
+ @Override
+ public void onPageStarted(WebView view, String url, Bitmap favicon) {
+ m_loadingBar.setVisibility(View.VISIBLE);
+ }
+
+ @Override
+ public void onPageFinished(WebView view, String url) {
+ Log.i(TAG, "Finished loading URL: " +url);
+
+ CookieManager.getInstance().setAcceptCookie(true);
+ CookieManager.getInstance().acceptCookie();
+ CookieManager.getInstance().flush();
+
+ m_loadingBar.setVisibility(View.GONE);
+ }
+
+ @Override
+ public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
+ Log.e(TAG, "Error: " + description);
+ }
+ });
+
+ web.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
+ web.loadUrl("https://fakecake.org/books/index.php?wrapper=1");
+ }
+}
diff --git a/org.fox.epube/src/main/res/layout/activity_main.xml b/org.fox.epube/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..4b67b75 --- /dev/null +++ b/org.fox.epube/src/main/res/layout/activity_main.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context=".MainActivity">
+
+ <WebView
+ android:id="@+id/webview_main"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+ </WebView>
+
+ <ProgressBar
+ android:id="@+id/loading_progress"
+ style="@style/Widget.AppCompat.ProgressBar.Horizontal"
+ android:layout_width="match_parent"
+ android:visibility="gone"
+ android:layout_height="wrap_content" />
+
+</FrameLayout>
\ No newline at end of file diff --git a/org.fox.epube/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/org.fox.epube/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..83b52fc --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@mipmap/ic_launcher_background"/>
+ <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
+</adaptive-icon>
\ No newline at end of file diff --git a/org.fox.epube/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/org.fox.epube/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..83b52fc --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@mipmap/ic_launcher_background"/>
+ <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
+</adaptive-icon>
\ No newline at end of file diff --git a/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher.png b/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..06c608e --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_background.png b/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_background.png Binary files differnew file mode 100644 index 0000000..5d8c59e --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_background.png diff --git a/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 0000000..4d33db4 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_foreground.png diff --git a/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_round.png b/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 0000000..ed08f44 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher.png b/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..0d3ec11 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_background.png b/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_background.png Binary files differnew file mode 100644 index 0000000..e964272 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_background.png diff --git a/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 0000000..05e12d0 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_foreground.png diff --git a/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_round.png b/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 0000000..a50cd5e --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher.png b/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..a325d02 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_background.png b/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_background.png Binary files differnew file mode 100644 index 0000000..c7d1590 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_background.png diff --git a/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 0000000..6ca2bc0 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png diff --git a/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 0000000..baf5f27 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher.png b/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..88ce4f7 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_background.png b/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_background.png Binary files differnew file mode 100644 index 0000000..ce94cf7 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_background.png diff --git a/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 0000000..7dd2d47 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png diff --git a/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 0000000..815bba8 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher.png Binary files differnew file mode 100644 index 0000000..9a44ca1 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png b/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png Binary files differnew file mode 100644 index 0000000..9c2ea57 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png diff --git a/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 0000000..f5df761 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png diff --git a/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png Binary files differnew file mode 100644 index 0000000..366f8f6 --- /dev/null +++ b/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/org.fox.epube/src/main/res/values/colors.xml b/org.fox.epube/src/main/res/values/colors.xml new file mode 100644 index 0000000..6b3f6ab --- /dev/null +++ b/org.fox.epube/src/main/res/values/colors.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <color name="colorPrimary">#008577</color>
+ <color name="colorPrimaryDark">#00574B</color>
+ <color name="colorAccent">#D81B60</color>
+</resources>
diff --git a/org.fox.epube/src/main/res/values/strings.xml b/org.fox.epube/src/main/res/values/strings.xml new file mode 100644 index 0000000..622a909 --- /dev/null +++ b/org.fox.epube/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ +<resources>
+ <string name="app_name">The Epube</string>
+</resources>
diff --git a/org.fox.epube/src/main/res/values/styles.xml b/org.fox.epube/src/main/res/values/styles.xml new file mode 100644 index 0000000..05674a6 --- /dev/null +++ b/org.fox.epube/src/main/res/values/styles.xml @@ -0,0 +1,12 @@ +<resources>
+
+ <!-- Base application theme. -->
+ <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+ <!-- Customize your theme here. -->
+ <item name="colorPrimary">@color/colorPrimary</item>
+ <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+ <item name="colorAccent">@color/colorAccent</item>
+ <item name="android:navigationBarColor">@android:color/black</item>
+ </style>
+
+</resources>
|