This repository has been archived by the owner on Nov 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from AULFA/offline-demo-version
Add a new offline demo version.
- Loading branch information
Showing
38 changed files
with
394 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
def buildVersion() { | ||
def propsFile = file("version.properties") | ||
def Properties props = new Properties() | ||
def code | ||
if (propsFile.canRead()) { | ||
props.load(new FileInputStream(propsFile)) | ||
code = props["VERSION_CODE"].toInteger() | ||
} else { | ||
throw new FileNotFoundException("Could not read ${propsFile}") | ||
} | ||
|
||
props["VERSION_CODE"] = (code + 1).toString() | ||
props.store(new FileOutputStream(propsFile), "") | ||
logger.info("incrementing build version ${code} -> ${code + 1}") | ||
return code | ||
} | ||
|
||
android { | ||
buildToolsVersion androidBuildToolsVersion | ||
|
||
packagingOptions { | ||
exclude "META-INF/LICENSE" | ||
|
||
doNotStrip "*/armeabi-v7a/*.so" | ||
doNotStrip "*/arm64-v8a/*.so" | ||
|
||
exclude ("/lib/mips/**") | ||
exclude ("/lib/mips64/**") | ||
exclude ("/lib/x86_64/**") | ||
exclude ("/lib/x86/**") | ||
|
||
// The PDF library and Readium both provide this shared library. This will | ||
// cause the build to fail because Gradle doesn"t know which one to pick. | ||
pickFirst "lib/arm64-v8a/libc++_shared.so" | ||
pickFirst "lib/armeabi-v7a/libc++_shared.so" | ||
} | ||
|
||
defaultConfig { | ||
versionName = VERSION_NAME | ||
versionCode = buildVersion() | ||
setProperty("archivesBaseName", "${POM_NAME}-${VERSION_NAME}-${versionCode}") | ||
} | ||
|
||
signingConfigs { | ||
debug { | ||
keyAlias findProperty("au.org.libraryforall.keyAlias") | ||
keyPassword findProperty("au.org.libraryforall.keyPassword") | ||
storeFile file("${project.rootDir}/lfa-keystore.jks") | ||
storePassword findProperty("au.org.libraryforall.storePassword") | ||
} | ||
release { | ||
keyAlias findProperty("au.org.libraryforall.keyAlias") | ||
keyPassword findProperty("au.org.libraryforall.keyPassword") | ||
storeFile file("${project.rootDir}/lfa-keystore.jks") | ||
storePassword findProperty("au.org.libraryforall.storePassword") | ||
} | ||
} | ||
|
||
buildTypes { | ||
debug { | ||
signingConfig signingConfigs.debug | ||
} | ||
release { | ||
signingConfig signingConfigs.release | ||
} | ||
} | ||
|
||
lintOptions { | ||
checkReleaseBuilds false | ||
} | ||
} | ||
|
||
dependencies { | ||
api project(":one.lfa.android.analytics") | ||
api project(":one.lfa.android.services") | ||
|
||
implementation libraries.simplified_main | ||
implementation libraries.simplified_accounts_source_file | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
POM_ARTIFACT_ID=one.lfa.android.app.demo | ||
POM_DESCRIPTION=LFA Android (Demo offline application) | ||
POM_NAME=one.lfa.android.app.demo | ||
POM_PACKAGING=apk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="one.lfa.android.app.demo"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
|
||
<queries> | ||
<package android:name="au.org.libraryforall.updater.app" /> | ||
<package android:name="au.org.libraryforall.updater.inclusiv" /> | ||
<package android:name="org.libraryforall.lfastudentdashboard" /> | ||
<package android:name="org.libraryforall.lfastudentdashboard.myanmar" /> | ||
<package android:name="org.libraryforall.lfastudentdashboard.vietnam" /> | ||
<provider android:authorities="au.org.libraryforall" /> | ||
<provider android:authorities="org.libraryforall.analytics.AnalyticsProvider" /> | ||
</queries> | ||
|
||
<application | ||
android:name="org.nypl.simplified.main.MainApplication" | ||
tools:replace="android:allowBackup" | ||
android:allowBackup="true" | ||
android:contentDescription="Library For All" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="Library For All" | ||
android:networkSecurityConfig="@xml/network_security_config" | ||
android:theme="@style/LFA_NoActionBar" | ||
android:usesCleartextTraffic="true"> | ||
|
||
<!-- Main entry point for the application. --> | ||
<activity | ||
android:name="org.nypl.simplified.main.MainActivity" | ||
android:contentDescription="Library For All" | ||
android:exported="true" | ||
android:launchMode="singleTop" | ||
android:label="Library For All"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</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="simplified-vanilla-oauth" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<!-- A file provider that exposes everything in the app. --> | ||
<!-- The purpose of this is for sending error reports. --> | ||
<provider | ||
android:name="androidx.core.content.FileProvider" | ||
android:authorities="${applicationId}.fileProvider" | ||
android:exported="false" | ||
android:grantUriPermissions="true"> | ||
<meta-data | ||
android:name="android.support.FILE_PROVIDER_PATHS" | ||
android:resource="@xml/provider_paths" /> | ||
</provider> | ||
|
||
<uses-library | ||
android:name="org.apache.http.legacy" | ||
android:required="false" /> | ||
|
||
<activity | ||
android:name="org.nypl.simplified.viewer.epub.readium1.ReaderActivity" | ||
android:exported="false" /> | ||
|
||
<activity | ||
android:name="org.nypl.simplified.viewer.epub.readium2.ReaderActivity" | ||
android:configChanges="orientation|keyboardHidden" | ||
android:exported="false" | ||
android:parentActivityName="org.nypl.simplified.main.MainActivity" | ||
android:screenOrientation="portrait" | ||
android:theme="@style/LFA_ActionBar" /> | ||
|
||
<activity | ||
android:name="org.nypl.simplified.viewer.epub.readium1.toc.ReaderTOCActivity" | ||
android:exported="false" /> | ||
|
||
<activity | ||
android:name="org.nypl.simplified.viewer.pdf.PdfReaderActivity" | ||
android:exported="false" /> | ||
|
||
<activity | ||
android:name="org.nypl.simplified.viewer.audiobook.AudioBookPlayerActivity" | ||
android:exported="false" /> | ||
|
||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
[ | ||
{ | ||
"@version": "20190708", | ||
"idUUID": "urn:uuid:3cd65800-4d21-4c56-8506-5843565a3b75", | ||
"displayName": "Global English", | ||
"subtitle": "", | ||
"logo": "simplified-asset:logos/globe.png", | ||
"supportsSimplyESync": false, | ||
"supportsBarcodeScanner": false, | ||
"supportsBarcodeDisplay": false, | ||
"supportsReservations": false, | ||
"supportsCardCreator": false, | ||
"supportsHelpCenter": false, | ||
"addAutomatically": true, | ||
"catalogURI": "content://au.org.libraryforall/3cd65800-4d21-4c56-8506-5843565a3b75/feeds/E388214F46F3111E4D7FE547930C2915E5D44DE3734C7FBFE4BD34D02124977E.atom", | ||
"mainColor": "#ec1c24" | ||
}, | ||
{ | ||
"@version": "20190708", | ||
"idUUID": "urn:uuid:58f0fb4b-0f60-4939-a4cf-1b2b74d6c587", | ||
"displayName": "Somalia", | ||
"subtitle": "", | ||
"logo": "simplified-asset:logos/somalia.png", | ||
"supportsSimplyESync": false, | ||
"supportsBarcodeScanner": false, | ||
"supportsBarcodeDisplay": false, | ||
"supportsReservations": false, | ||
"supportsCardCreator": false, | ||
"supportsHelpCenter": false, | ||
"addAutomatically": true, | ||
"catalogURI": "content://au.org.libraryforall/58f0fb4b-0f60-4939-a4cf-1b2b74d6c587/feeds/A3F5F15BA1946CB9268F3BBBED376135F0638A375532F18033F6482CBD1B1075.atom", | ||
"mainColor": "#ec1c24" | ||
}, | ||
|
||
{ | ||
"@version": "20190708", | ||
"idUUID": "urn:uuid:0c41f814-fd53-431f-8d18-2d861544d26a", | ||
"displayName": "Vietnam", | ||
"subtitle": "", | ||
"logo": "simplified-asset:logos/vietnam.png", | ||
"supportsSimplyESync": false, | ||
"supportsBarcodeScanner": false, | ||
"supportsBarcodeDisplay": false, | ||
"supportsReservations": false, | ||
"supportsCardCreator": false, | ||
"supportsHelpCenter": false, | ||
"addAutomatically": true, | ||
"catalogURI": "content://au.org.libraryforall/0c41f814-fd53-431f-8d18-2d861544d26a/feeds/07A1BEDCC41D0B7C9B1194CA395AC20C0155188951511B7B0C8F2E9BA8DCCA31.atom", | ||
"mainColor": "#ec1c24" | ||
}, | ||
|
||
{ | ||
"@version": "20190708", | ||
"idUUID": "urn:uuid:f5b1f8d9-43ad-42ea-9b96-a291e7ce8fb5", | ||
"displayName": "ປະເທດລາວ (Laos)", | ||
"subtitle": "", | ||
"logo": "simplified-asset:logos/laos.png", | ||
"supportsSimplyESync": false, | ||
"supportsBarcodeScanner": false, | ||
"supportsBarcodeDisplay": false, | ||
"supportsReservations": false, | ||
"supportsCardCreator": false, | ||
"supportsHelpCenter": false, | ||
"addAutomatically": true, | ||
"catalogURI": "content://au.org.libraryforall/f5b1f8d9-43ad-42ea-9b96-a291e7ce8fb5/feeds/DAE5313E5E65D49C7AFF7388819E7A42A93B0614523BE11C278489FC536670AE.atom", | ||
"mainColor": "#ec1c24" | ||
}, | ||
|
||
{ | ||
"@version": "20190708", | ||
"idUUID": "urn:uuid:ad3b1341-22b9-4022-ab81-8d7f93c72cdd", | ||
"displayName": "Myanmar", | ||
"subtitle": "", | ||
"logo": "simplified-asset:logos/myanmar.png", | ||
"supportsSimplyESync": false, | ||
"supportsBarcodeScanner": false, | ||
"supportsBarcodeDisplay": false, | ||
"supportsReservations": false, | ||
"supportsCardCreator": false, | ||
"supportsHelpCenter": false, | ||
"addAutomatically": true, | ||
"catalogURI": "content://au.org.libraryforall/ad3b1341-22b9-4022-ab81-8d7f93c72cdd/feeds/6F90E501B459F8D9404930EF705A297FFCEF7389D8F5D5D70019A0A2E6112894.atom", | ||
"mainColor": "#ec1c24" | ||
}, | ||
|
||
{ | ||
"@version": "20190708", | ||
"idUUID": "urn:uuid:f07ef516-ea25-498f-ba23-80ff2904e6e6", | ||
"displayName": "Timor Leste", | ||
"subtitle": "", | ||
"logo": "simplified-asset:logos/timor.png", | ||
"supportsSimplyESync": false, | ||
"supportsBarcodeScanner": false, | ||
"supportsBarcodeDisplay": false, | ||
"supportsReservations": false, | ||
"supportsCardCreator": false, | ||
"supportsHelpCenter": false, | ||
"addAutomatically": true, | ||
"catalogURI": "content://au.org.libraryforall/f07ef516-ea25-498f-ba23-80ff2904e6e6/feeds/B3CB1505FEF3ADA2894675D1077D8D41CC55A5D4858611ECC9712BABE77A8B4D.atom", | ||
"mainColor": "#ec1c24" | ||
} | ||
] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions
36
one.lfa.android.app.demo/src/main/java/one/lfa/android/app/demo/LFADemoAccountsFallback.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package one.lfa.android.app.demo | ||
|
||
import org.joda.time.DateTime | ||
import org.nypl.simplified.accounts.api.AccountProviderFallbackType | ||
import org.nypl.simplified.accounts.api.AccountProvider | ||
import org.nypl.simplified.accounts.api.AccountProviderAuthenticationDescription | ||
import org.nypl.simplified.accounts.api.AccountProviderType | ||
import java.net.URI | ||
|
||
class LFADemoAccountsFallback : AccountProviderFallbackType { | ||
override fun get(): AccountProviderType = | ||
AccountProvider( | ||
addAutomatically = true, | ||
annotationsURI = null, | ||
authentication = AccountProviderAuthenticationDescription.Anonymous, | ||
authenticationAlternatives = listOf(), | ||
authenticationDocumentURI = null, | ||
catalogURI = URI.create("content://au.org.libraryforall/e5d0c561-aa74-4f19-a043-c084f8346212/feeds/7A0A560E3AF8DDDD996E01FD43C618413A8A2B6CC118933F950C3618939EE1CD.atom"), | ||
cardCreatorURI = null, | ||
displayName = "Papua New Guinea", | ||
eula = null, | ||
id = URI.create("urn:provider:com.cantookstation.lfa.bundled"), | ||
idNumeric = -1, | ||
isProduction = true, | ||
license = null, | ||
loansURI = null, | ||
logo = URI.create("simplified-asset:bundled.png"), | ||
mainColor = "#ec1c24", | ||
patronSettingsURI = null, | ||
privacyPolicy = null, | ||
subtitle = "", | ||
supportEmail = null, | ||
supportsReservations = false, | ||
updated = DateTime.now() | ||
) | ||
} |
21 changes: 21 additions & 0 deletions
21
one.lfa.android.app.demo/src/main/java/one/lfa/android/app/demo/LFADemoSplashService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package one.lfa.android.app.demo | ||
|
||
import org.nypl.simplified.ui.branding.BrandingSplashServiceType | ||
|
||
/** | ||
* A splash service for the app. | ||
*/ | ||
|
||
class LFADemoSplashService : BrandingSplashServiceType { | ||
|
||
override val shouldShowLibrarySelectionScreen: Boolean = | ||
true | ||
|
||
override fun splashImageResource(): Int { | ||
return R.drawable.splash | ||
} | ||
|
||
override fun splashImageTitleResource(): Int { | ||
return R.drawable.splash | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
one.lfa.android.app.demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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="@color/ic_launcher_background"/> | ||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> | ||
</adaptive-icon> |
5 changes: 5 additions & 0 deletions
5
one.lfa.android.app.demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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="@color/ic_launcher_background"/> | ||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> | ||
</adaptive-icon> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.82 KB
one.lfa.android.app.demo/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.76 KB
one.lfa.android.app.demo/src/main/res/mipmap-hdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.8 KB
one.lfa.android.app.demo/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.35 KB
one.lfa.android.app.demo/src/main/res/mipmap-mdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.92 KB
one.lfa.android.app.demo/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.42 KB
one.lfa.android.app.demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.74 KB
one.lfa.android.app.demo/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.43 KB
one.lfa.android.app.demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.94 KB
one.lfa.android.app.demo/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12 KB
one.lfa.android.app.demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
one.lfa.android.app.demo/src/main/res/values/ic_launcher_background.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="ic_launcher_background">#EC1C24</color> | ||
</resources> |
Oops, something went wrong.