Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #213 from readium/develop
Browse files Browse the repository at this point in the history
V2.0.0-beta.6
  • Loading branch information
aferditamuriqi committed Jun 20, 2019
2 parents b41a796 + a2a2251 commit acfbaea
Show file tree
Hide file tree
Showing 48 changed files with 1,275 additions and 761 deletions.
5 changes: 2 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.11'
ext.support_version = '27.1.1'
ext.kotlin_version = '1.3.31'
ext.r2branch = 'develop'

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.parallel=true
org.gradle.configureondemand=true
android.useAndroidX=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
79 changes: 33 additions & 46 deletions r2-testapp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ group='com.github.readium'
int major = 2
int minor = 0
int patch = 2
int build = 2
int build = 12
String type = ""

def version = "$major.$minor.$patch"
Expand All @@ -37,7 +37,7 @@ project.ext.versionCode = 1_000_000 * major + 10_000 * minor + 100 * patch + bui
android {
flavorDimensions "testapp"

compileSdkVersion 27
compileSdkVersion 28
signingConfigs {
release {
keyAlias 'EDRLab'
Expand All @@ -49,11 +49,11 @@ android {
defaultConfig {
applicationId "org.readium.r2reader"
minSdkVersion 21
targetSdkVersion 27
targetSdkVersion 28
versionCode project.ext.versionCode
versionName project.ext.versionName
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}
buildTypes {
release {
Expand Down Expand Up @@ -108,36 +108,30 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'com.jakewharton.timber:timber:4.7.1'
if (findProject(':r2-shared')) {
implementation project(':r2-shared')
} else {
implementation "com.github.readium:r2-shared-kotlin:1.0.10"
}
if (findProject(':r2-navigator')) {
devTestappImplementation project(':r2-navigator')
devTestappWithLcpImplementation project(':r2-navigator')
implementation project(':r2-navigator')
} else {
implementation "com.github.readium:r2-navigator-kotlin:1.0.10"
}
if (findProject(':r2-streamer')) {
devTestappImplementation project(':r2-streamer')
devTestappWithLcpImplementation project(':r2-streamer')
}
if (findProject(':r2-shared')) {
devTestappImplementation project(':r2-shared')
devTestappWithLcpImplementation project(':r2-shared')
implementation project(':r2-streamer')
} else {
implementation "com.github.readium:r2-streamer-kotlin:1.0.10"
}
if (findProject(':r2-opds')) {
devTestappImplementation project(':r2-opds')
devTestappWithLcpImplementation project(':r2-opds')
implementation project(':r2-opds')
} else {
implementation "com.github.readium:r2-opds-kotlin:1.0.9"
}
if (findProject(':r2-lcp')) {
devTestappWithLcpImplementation project(':r2-lcp')
intTestappWithLcpImplementation project(':r2-lcp')
implementation project(':r2-lcp')
}

intTestappImplementation "com.github.readium:r2-shared-kotlin:$r2branch-SNAPSHOT"
intTestappImplementation "com.github.readium:r2-streamer-kotlin:$r2branch-SNAPSHOT"
intTestappImplementation "com.github.readium:r2-navigator-kotlin:$r2branch-SNAPSHOT"
intTestappImplementation "com.github.readium:r2-opds-kotlin:$r2branch-SNAPSHOT"

intTestappWithLcpImplementation "com.github.readium:r2-shared-kotlin:$r2branch-SNAPSHOT"
intTestappWithLcpImplementation "com.github.readium:r2-streamer-kotlin:$r2branch-SNAPSHOT"
intTestappWithLcpImplementation "com.github.readium:r2-navigator-kotlin:$r2branch-SNAPSHOT"
intTestappWithLcpImplementation "com.github.readium:r2-opds-kotlin:$r2branch-SNAPSHOT"

implementation('com.mcxiaoke.koi:core:0.5.5') {
exclude module: 'support-v4'
Expand All @@ -146,29 +140,28 @@ dependencies {
exclude module: 'support-v4'
}

// implementation 'androidx.core:core-ktx:0.3'
implementation "com.android.support:appcompat-v7:$support_version"
implementation "com.android.support:recyclerview-v7:$support_version"
implementation "com.android.support:cardview-v7:$support_version"
implementation "com.android.support:design:$support_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "androidx.appcompat:appcompat:1.1.0-beta01"
implementation "androidx.recyclerview:recyclerview:1.1.0-alpha06"
implementation "androidx.cardview:cardview:1.0.0"
implementation "com.google.android.material:material:1.1.0-alpha07"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'org.nanohttpd:nanohttpd:2.3.2-SNAPSHOT'
implementation 'org.nanohttpd:nanohttpd-nanolets:2.3.2-SNAPSHOT'

implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.8'
implementation 'org.jetbrains.anko:anko-design:0.10.5'
implementation 'org.jetbrains.anko:anko-design:0.10.8'

// For SnackBars
implementation 'org.jetbrains.anko:anko-commons:0.10.8'

// Anko Layouts
implementation 'org.jetbrains.anko:anko-sdk25:0.10.5'
implementation 'org.jetbrains.anko:anko-sdk25:0.10.8'

// sdk15, sdk19, sdk21, sdk23 are also available
implementation 'org.jetbrains.anko:anko-appcompat-v7:0.10.5'
implementation 'org.jetbrains.anko:anko-recyclerview-v7:0.10.5'
implementation 'org.jetbrains.anko:anko-appcompat-v7:0.10.8'
implementation 'org.jetbrains.anko:anko-recyclerview-v7:0.10.8'

// Coroutine listeners for Anko Layouts
implementation 'org.jetbrains.anko:anko-sdk25-coroutines:0.10.8'
Expand All @@ -181,13 +174,6 @@ dependencies {
//for JVM
implementation 'com.github.kittinunf.fuel:fuel-android:1.16.0'

//for Android
// implementation 'com.github.kittinunf.fuel:fuel-livedata:1.12.1' //for LiveData support
// implementation 'com.github.kittinunf.fuel:fuel-rxjava:1.12.1' //for RxJava support
// implementation 'com.github.kittinunf.fuel:fuel-gson:1.12.1' //for Gson support
// implementation 'com.github.kittinunf.fuel:fuel-jackson:1.12.1' //for Jackson support
// implementation 'com.github.kittinunf.fuel:fuel-moshi:1.12.1' //for Moshi support

// async functions (only ~70k)
final KOVENANT_VERSION = '3.3.0'
implementation "nl.komponents.kovenant:kovenant:$KOVENANT_VERSION"
Expand All @@ -201,14 +187,15 @@ dependencies {
implementation 'joda-time:joda-time:2.9.9'
implementation 'org.slf4j:slf4j-nop:1.7.25'

// implementation 'net.theluckycoder.materialchooser:materialchooser:1.1.4'
implementation 'com.duolingo.open:rtl-viewpager:1.0.3'
implementation 'androidx.viewpager2:viewpager2:1.0.0-alpha05'

implementation 'com.commonsware.cwac:merge:1.1.2'
implementation 'com.github.abacritt:sectionedmergeadapter:0.2'
implementation 'org.jsoup:jsoup:1.11.2'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
}
4 changes: 3 additions & 1 deletion r2-testapp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:allowBackup">
tools:replace="android:allowBackup"
android:usesCleartextTraffic="true"
tools:targetApi="m">
<activity android:name=".CatalogActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
18 changes: 9 additions & 9 deletions r2-testapp/src/main/assets/ReadiumCSS/touchHandling.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var singleTouchGesture = false;
var startX = 0;
var startY = 0;
var maxScreenX = window.screen.availWidth;
var maxScreenY = window.screen.availHeight;
var availWidth = window.screen.availWidth;
var availHeight = window.screen.availHeight;


window.addEventListener("load", function(){ // on page load
Expand Down Expand Up @@ -32,8 +32,8 @@ var handleTouchStart = function(event) {

var touch = event.changedTouches[0];

startX = touch.screenX % maxScreenX;
startY = touch.screenY % maxScreenY;
startX = touch.screenX % availWidth;
startY = touch.screenY % availHeight;

};

Expand All @@ -45,16 +45,16 @@ var handleTouchEnd = function(event) {

var touch = event.changedTouches[0];

var relativeDistanceX = Math.abs(((touch.screenX % maxScreenX) - startX) / maxScreenX);
var relativeDistanceY = Math.abs(((touch.screenY % maxScreenY) - startY) / maxScreenY);
var relativeDistanceX = Math.abs(((touch.screenX % availWidth) - startX) / availWidth);
var relativeDistanceY = Math.abs(((touch.screenY % availHeight) - startY) / availHeight);
var touchDistance = Math.max(relativeDistanceX, relativeDistanceY);

var scrollWidth = document.scrollWidth;
var screenWidth = maxScreenX;
var tapAreaWidth = maxScreenX * 0.2;
var screenWidth = availWidth;
var tapAreaWidth = availWidth * 0.2;

if(touchDistance < 0.01) {
var position = (touch.screenX % maxScreenX) / maxScreenX;
var position = (touch.screenX % availWidth) / availWidth;
if (position <= 0.2) {
console.log("LeftTapped");
Android.scrollLeft();
Expand Down
Loading

0 comments on commit acfbaea

Please sign in to comment.