Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
928e922a8f | ||
|
3fc7cc242d | ||
|
645acfc014 | ||
|
f548c4e596 | ||
|
b9fd322d32 |
17
.idea/deploymentTargetDropDown.xml
generated
Normal file
17
.idea/deploymentTargetDropDown.xml
generated
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<targetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="QUICK_BOOT_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="VIRTUAL_DEVICE_PATH" />
|
||||
<value value="$USER_HOME$/.android/avd/Pixel_5_API_26.avd" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2022-04-24T09:01:51.756259Z" />
|
||||
</component>
|
||||
</project>
|
@@ -1,8 +1,11 @@
|
||||
# Bookwyrm-android
|
||||
An Android application for Bookwyrm. Basically, it is just bookwyrm put into a 'webview' element.
|
||||
What it does? It enables you to use BookWyrm on your Android phone without having to use a browser to go to it every time.
|
||||
It can also open links to userpages of Bookwyrm users.
|
||||
It can also open links to userpages of Bookwyrm users and it can scan ISBN codes.
|
||||
|
||||
This application works on: Android 6 and above.
|
||||
|
||||
And if you want to know, I am `@StoryDragon@wyrms.de` on BookWyrm.
|
||||
|
||||
For the ISBN-scanning I use the library zxing-android-embedded.
|
||||
The barcode icon that is added for instances that do not have ISBN-scanning by default comes from the Remix Icon project.
|
||||
|
@@ -9,8 +9,8 @@ android {
|
||||
applicationId "nl.privacydragon.bookwyrm"
|
||||
minSdk 23
|
||||
targetSdk 31
|
||||
versionCode 7
|
||||
versionName "1.3.0"
|
||||
versionCode 8
|
||||
versionName "1.3.1"
|
||||
|
||||
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
||||
}
|
||||
|
Binary file not shown.
BIN
app/release/Bookwyrm-v1.3.1.apk
Normal file
BIN
app/release/Bookwyrm-v1.3.1.apk
Normal file
Binary file not shown.
@@ -11,8 +11,8 @@
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 7,
|
||||
"versionName": "1.3.0",
|
||||
"versionCode": 8,
|
||||
"versionName": "1.3.1",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
|
@@ -242,6 +242,94 @@
|
||||
android:pathPrefix="/user/"
|
||||
android:scheme="https" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="bookwyrm.lond.com.br"
|
||||
android:pathPrefix="/user/" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="good.franv.site"
|
||||
android:pathPrefix="/user/" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="books.solarpunkanarchism.org"
|
||||
android:pathPrefix="/user/" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="shoko.one"
|
||||
android:pathPrefix="/user/" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="bookwyrm.mennisch.net"
|
||||
android:pathPrefix="/user/" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="library.southfox.me"
|
||||
android:pathPrefix="/user/" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="bookrastinating.com"
|
||||
android:pathPrefix="/user/" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="library.cybre.city"
|
||||
android:pathPrefix="/user/" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".StartActivity"
|
||||
|
@@ -75,9 +75,11 @@ public class HandlerActivity extends AppCompatActivity {
|
||||
myWebView.addJavascriptInterface(new Object()
|
||||
{
|
||||
@JavascriptInterface // For API 17+
|
||||
public void performClick()
|
||||
public void performClick(String what)
|
||||
{
|
||||
ScanBarCode();
|
||||
if (!what.contains("[object Window]")) { //For some reason the function has to be called when the event listener is attached to the button. So, by adding in 'this', it is possible to make sure to only act when the thing that called the function is NOT the window, but the button.
|
||||
ScanBarCode();
|
||||
}
|
||||
|
||||
}
|
||||
}, "scan");
|
||||
@@ -179,20 +181,34 @@ public class HandlerActivity extends AppCompatActivity {
|
||||
view.loadUrl("javascript:(function() { document.getElementById('id_localname').value = '" + name + "'; ;})()");
|
||||
view.loadUrl("javascript:(function() { if (window.location.href == '" + finalToGoServer + "' && !/(review|generatednote|quotation|comment)/i.test(window.location.href)) { document.getElementsByName(\"login\")[0].submit();} ;})()");
|
||||
view.loadUrl("javascript:(function() { if (window.location.href == 'https://" + server + "') { document.getElementsByName(\"login\")[0].submit();} ;})()");
|
||||
view.loadUrl("javascript:(function() { if (/(review|generatednote|quotation|comment)/i.test(window.location.href)) { document.getElementsByClassName(\"block\")[0].innerHTML = ` <a href=\"https://"+ server +"\" class=\"button\" data-back=\"\">\n" +
|
||||
" <span class=\"icon icon-arrow-left\" aria-hidden=\"true\"></span>\n" +
|
||||
" <span><b>Back to homeserver</b></span>\n" +
|
||||
" </a>`;} ;})()");
|
||||
view.loadUrl("javascript:(function() { if (/(review|generatednote|quotation|comment)/i.test(window.location.href)) {" +
|
||||
"blocks = document.getElementsByClassName('block');" +
|
||||
"for (let element of blocks){" +
|
||||
"if (element.localName == 'header') { " +
|
||||
"element.innerHTML = ` <a href=\"https://"+ server +"\" class=\"button\" data-back=\"\">\n" +
|
||||
"<span class=\"icon icon-arrow-left\" aria-hidden=\"true\"></span>\n" +
|
||||
"<span><b>Back to homeserver</b></span>\n" +
|
||||
"</a>`;" +
|
||||
"break;" +
|
||||
"}" +
|
||||
"}" +
|
||||
"} ;})()");
|
||||
view.loadUrl("javascript:(function() { " +
|
||||
"const ISBN = document.createElement(\"p\");" +
|
||||
"ISBN.innerHTML = '<br/>Click to scan ISBN';" +
|
||||
"ISBN.addEventListener('click', () => {" +
|
||||
" scan.performClick();" +
|
||||
"});" +
|
||||
"const NewCenter = document.createElement(\"center\");" +
|
||||
"NewCenter.append(ISBN);" +
|
||||
"nav = document.body;" +
|
||||
"nav.insertBefore(NewCenter, nav.children[0]);" +
|
||||
"if (document.querySelectorAll(\"[data-modal-open]\")[0]) {" +
|
||||
"let ISBN_Button = document.querySelectorAll(\"[data-modal-open]\")[0];" +
|
||||
"ISBN_Button.replaceWith(ISBN_Button.cloneNode(true));" +
|
||||
"document.querySelectorAll(\"[data-modal-open]\")[0].addEventListener('click', () => {" +
|
||||
"scan.performClick(this);" +
|
||||
"});" +
|
||||
"} else {" +
|
||||
"let ISBN = document.createElement(\"div\");" +
|
||||
"ISBN.class = 'control';" +
|
||||
//"ISBN.class = 'button';" +
|
||||
//"ISBN.type = 'button';" +
|
||||
"ISBN.innerHTML = '<button class=\"button\" type=\"button\" onclick=\"scan.performClick(this)\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" aria-hidden=\"true\"><path fill=\"none\" d=\"M0 0h24v24H0z\"/><path d=\"M4 5v14h16V5H4zM3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm3 4h3v10H6V7zm4 0h2v10h-2V7zm3 0h1v10h-1V7zm2 0h3v10h-3V7z\"/></svg><span class=\"is-sr-only\">Search</span></button>';" +
|
||||
"nav = document.getElementsByClassName(\"field has-addons\")[0];" +
|
||||
"nav.appendChild(ISBN);" +
|
||||
"}" +
|
||||
";})()");
|
||||
}
|
||||
});
|
||||
@@ -232,7 +248,7 @@ public class HandlerActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
IntentIntegrator intentIntegrator = new IntentIntegrator(HandlerActivity.this);
|
||||
intentIntegrator.setDesiredBarcodeFormats(intentIntegrator.ALL_CODE_TYPES);
|
||||
intentIntegrator.setDesiredBarcodeFormats(intentIntegrator.EAN_13);
|
||||
intentIntegrator.setBeepEnabled(true);
|
||||
intentIntegrator.setCameraId(0);
|
||||
intentIntegrator.setPrompt("SCAN");
|
||||
|
@@ -58,9 +58,11 @@ public class StartActivity extends AppCompatActivity {
|
||||
myWebView.addJavascriptInterface(new Object()
|
||||
{
|
||||
@JavascriptInterface // For API 17+
|
||||
public void performClick()
|
||||
public void performClick(String what)
|
||||
{
|
||||
ScanBarCode();
|
||||
if (!what.contains("[object Window]")) { //For some reason the function has to be called when the event listener is attached to the button. So, by adding in 'this', it is possible to make sure to only act when the thing that called the function is NOT the window, but the button.
|
||||
ScanBarCode();
|
||||
}
|
||||
|
||||
}
|
||||
}, "scan");
|
||||
@@ -141,16 +143,22 @@ public class StartActivity extends AppCompatActivity {
|
||||
view.loadUrl("javascript:(function() { document.getElementById('id_localname_confirm').value = '" + name + "'; ;})()");
|
||||
view.loadUrl("javascript:(function() { if (window.location.href == 'https://" + server + "/login') { document.getElementsByName(\"login-confirm\")[0].submit();} ;})()");
|
||||
view.loadUrl("javascript:(function() { " +
|
||||
"const ISBN = document.createElement(\"p\");" +
|
||||
"ISBN.innerHTML = '<br/>Click to scan ISBN';" +
|
||||
"ISBN.addEventListener('click', () => {" +
|
||||
" scan.performClick();" +
|
||||
"});" +
|
||||
"const NewCenter = document.createElement(\"center\");" +
|
||||
"NewCenter.append(ISBN);" +
|
||||
"nav = document.body;" +
|
||||
"nav.insertBefore(NewCenter, nav.children[0]);" +
|
||||
";})()");
|
||||
"if (document.querySelectorAll(\"[data-modal-open]\")[0]) {" +
|
||||
"let ISBN_Button = document.querySelectorAll(\"[data-modal-open]\")[0];" +
|
||||
"ISBN_Button.replaceWith(ISBN_Button.cloneNode(true));" +
|
||||
"document.querySelectorAll(\"[data-modal-open]\")[0].addEventListener('click', () => {" +
|
||||
"scan.performClick(this);" +
|
||||
"});" +
|
||||
"} else {" +
|
||||
"let ISBN = document.createElement(\"div\");" +
|
||||
"ISBN.class = 'control';" +
|
||||
//"ISBN.class = 'button';" +
|
||||
//"ISBN.type = 'button';" +
|
||||
"ISBN.innerHTML = '<button class=\"button\" type=\"button\" onclick=\"scan.performClick(this)\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" aria-hidden=\"true\"><path fill=\"none\" d=\"M0 0h24v24H0z\"/><path d=\"M4 5v14h16V5H4zM3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm3 4h3v10H6V7zm4 0h2v10h-2V7zm3 0h1v10h-1V7zm2 0h3v10h-3V7z\"/></svg><span class=\"is-sr-only\">Search</span></button>';" +
|
||||
"nav = document.getElementsByClassName(\"field has-addons\")[0];" +
|
||||
"nav.appendChild(ISBN);" +
|
||||
"}" +
|
||||
";})()"); //This lines replace the ISBN-scan button event listener with one that points to the on-device scanning implementation, if it is available on the instance. If not, the button is added.
|
||||
|
||||
}
|
||||
});
|
||||
@@ -167,7 +175,7 @@ public class StartActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
IntentIntegrator intentIntegrator = new IntentIntegrator(StartActivity.this);
|
||||
intentIntegrator.setDesiredBarcodeFormats(intentIntegrator.ALL_CODE_TYPES);
|
||||
intentIntegrator.setDesiredBarcodeFormats(intentIntegrator.EAN_13);
|
||||
intentIntegrator.setBeepEnabled(false);
|
||||
intentIntegrator.setCameraId(0);
|
||||
intentIntegrator.setPrompt("SCAN ISBN");
|
||||
|
@@ -14,6 +14,7 @@
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar3"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:indeterminate="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="715dp"
|
||||
|
6
fastlane/metadata/android/en-US/changelogs/8.txt
Normal file
6
fastlane/metadata/android/en-US/changelogs/8.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
* Improved the loading bar.
|
||||
* The ISBN-scanning feature now works by simply clicking the ISBN button that is used by the instances that have scanning already available.
|
||||
* For instances that do not support the scanning server-side, there is now instead of the text a button for ISBN-scanning, similar to the standard one.
|
||||
* More bookwyrm instances added to the ones that can be opened in the app.
|
||||
* Small bug-fix, so now only ISBN-codes (And other EAN-13 codes) will be scanned.
|
||||
* Another bug-fix. The modified back button works again.
|
@@ -6,3 +6,5 @@ This is an Android client for BookWyrm – a federated social network for tracki
|
||||
* You can also search for books by scanning the ISBN, no matter what instance of Bookwyrm you use.
|
||||
|
||||
<b>This application is <u>not</u> an official client!</b> (An official client does not exist yet, as far as I know)
|
||||
|
||||
The ISBN scanning feature is created with the zxing-android-embedded library.
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 329 KiB After Width: | Height: | Size: 318 KiB |
Binary file not shown.
Before Width: | Height: | Size: 205 KiB After Width: | Height: | Size: 203 KiB |
Binary file not shown.
Reference in New Issue
Block a user