From fa25f18453c05e1907b425b11edf4802a6448754 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 20 Apr 2020 19:32:03 +0300 Subject: initial --- .../org/fox/epube/ExampleInstrumentedTest.java | 27 +++++++ org.fox.epube/src/main/AndroidManifest.xml | 25 +++++++ org.fox.epube/src/main/ic_launcher-web.png | Bin 0 -> 33271 bytes .../src/main/java/org/fox/epube/MainActivity.java | 80 +++++++++++++++++++++ .../src/main/res/layout/activity_main.xml | 22 ++++++ .../src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 5 ++ .../res/mipmap-anydpi-v26/ic_launcher_round.xml | 5 ++ .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3097 bytes .../res/mipmap-hdpi/ic_launcher_background.png | Bin 0 -> 2635 bytes .../res/mipmap-hdpi/ic_launcher_foreground.png | Bin 0 -> 2723 bytes .../src/main/res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 4721 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2039 bytes .../res/mipmap-mdpi/ic_launcher_background.png | Bin 0 -> 1613 bytes .../res/mipmap-mdpi/ic_launcher_foreground.png | Bin 0 -> 1787 bytes .../src/main/res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2982 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4280 bytes .../res/mipmap-xhdpi/ic_launcher_background.png | Bin 0 -> 4089 bytes .../res/mipmap-xhdpi/ic_launcher_foreground.png | Bin 0 -> 3725 bytes .../main/res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 6535 bytes .../src/main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 6504 bytes .../res/mipmap-xxhdpi/ic_launcher_background.png | Bin 0 -> 7790 bytes .../res/mipmap-xxhdpi/ic_launcher_foreground.png | Bin 0 -> 6090 bytes .../main/res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10415 bytes .../src/main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9115 bytes .../res/mipmap-xxxhdpi/ic_launcher_background.png | Bin 0 -> 12783 bytes .../res/mipmap-xxxhdpi/ic_launcher_foreground.png | Bin 0 -> 9089 bytes .../main/res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 14892 bytes org.fox.epube/src/main/res/values/colors.xml | 6 ++ org.fox.epube/src/main/res/values/strings.xml | 3 + org.fox.epube/src/main/res/values/styles.xml | 12 ++++ .../test/java/org/fox/epube/ExampleUnitTest.java | 17 +++++ 31 files changed, 202 insertions(+) create mode 100644 org.fox.epube/src/androidTest/java/org/fox/epube/ExampleInstrumentedTest.java create mode 100644 org.fox.epube/src/main/AndroidManifest.xml create mode 100644 org.fox.epube/src/main/ic_launcher-web.png create mode 100644 org.fox.epube/src/main/java/org/fox/epube/MainActivity.java create mode 100644 org.fox.epube/src/main/res/layout/activity_main.xml create mode 100644 org.fox.epube/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 org.fox.epube/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_background.png create mode 100644 org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_foreground.png create mode 100644 org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_background.png create mode 100644 org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_foreground.png create mode 100644 org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_background.png create mode 100644 org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png create mode 100644 org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_background.png create mode 100644 org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png create mode 100644 org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png create mode 100644 org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png create mode 100644 org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 org.fox.epube/src/main/res/values/colors.xml create mode 100644 org.fox.epube/src/main/res/values/strings.xml create mode 100644 org.fox.epube/src/main/res/values/styles.xml create mode 100644 org.fox.epube/src/test/java/org/fox/epube/ExampleUnitTest.java (limited to 'org.fox.epube/src') diff --git a/org.fox.epube/src/androidTest/java/org/fox/epube/ExampleInstrumentedTest.java b/org.fox.epube/src/androidTest/java/org/fox/epube/ExampleInstrumentedTest.java new file mode 100644 index 0000000..170d665 --- /dev/null +++ b/org.fox.epube/src/androidTest/java/org/fox/epube/ExampleInstrumentedTest.java @@ -0,0 +1,27 @@ +package org.fox.epube; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + + assertEquals("org.fox.epube", appContext.getPackageName()); + } +} 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 @@ + + + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000..b1531e0 Binary files /dev/null and b/org.fox.epube/src/main/ic_launcher-web.png differ 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 @@ + + + + + + + + + \ 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 @@ + + + + + \ 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 @@ + + + + + \ 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 new file mode 100644 index 0000000..06c608e Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher.png differ 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 new file mode 100644 index 0000000..5d8c59e Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_background.png differ 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 new file mode 100644 index 0000000..4d33db4 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ 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 new file mode 100644 index 0000000..ed08f44 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-hdpi/ic_launcher_round.png differ 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 new file mode 100644 index 0000000..0d3ec11 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher.png differ 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 new file mode 100644 index 0000000..e964272 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_background.png differ 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 new file mode 100644 index 0000000..05e12d0 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ 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 new file mode 100644 index 0000000..a50cd5e Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-mdpi/ic_launcher_round.png differ 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 new file mode 100644 index 0000000..a325d02 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher.png differ 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 new file mode 100644 index 0000000..c7d1590 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_background.png differ 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 new file mode 100644 index 0000000..6ca2bc0 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ 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 new file mode 100644 index 0000000..baf5f27 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ 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 new file mode 100644 index 0000000..88ce4f7 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher.png differ 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 new file mode 100644 index 0000000..ce94cf7 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_background.png differ 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 new file mode 100644 index 0000000..7dd2d47 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ 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 new file mode 100644 index 0000000..815bba8 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ 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 new file mode 100644 index 0000000..9a44ca1 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ 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 new file mode 100644 index 0000000..9c2ea57 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_background.png differ 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 new file mode 100644 index 0000000..f5df761 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ 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 new file mode 100644 index 0000000..366f8f6 Binary files /dev/null and b/org.fox.epube/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ 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 @@ + + + #008577 + #00574B + #D81B60 + 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 @@ + + The Epube + 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 @@ + + + + + + diff --git a/org.fox.epube/src/test/java/org/fox/epube/ExampleUnitTest.java b/org.fox.epube/src/test/java/org/fox/epube/ExampleUnitTest.java new file mode 100644 index 0000000..afc44bd --- /dev/null +++ b/org.fox.epube/src/test/java/org/fox/epube/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package org.fox.epube; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file -- cgit v1.2.3