...
 
Commits (2)
local.properties
.externalNativeBuild/
libs/
This diff is collapsed.
# FBReader
FBReader library based on original FBReader repo + light source code modification most makes method public.
* https://github.com/geometer/FBReaderJ
\ No newline at end of file
repositories {
jcenter()
mavenLocal()
google()
}
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.github.dcendents.android-maven' // 'gradle install' task
android {
compileSdkVersion 11
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 3
targetSdkVersion 3
versionCode 1
versionName "0.0.5"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
// http://central.sonatype.org/pages/gradle.html
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(project.android.getBootClasspath().join(File.pathSeparator))
options.addStringOption('Xdoclint:none', '-quiet')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
group = "com.github.axet.fbreader"
archivesBaseName = "ambilwarna"
version = android.defaultConfig.versionName
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Android FBReader Library'
packaging 'jar'
description 'Clone of https://code.google.com/p/android-color-picker/'
url 'https://gitlab.com/axet/android-fbreader-library'
scm {
connection 'scm:git:https://gitlab.com/axet/android-fbreader-library'
developerConnection 'scm:git:https://gitlab.com/axet/android-fbreader-library'
url 'https://gitlab.com/axet/android-fbreader-library'
}
licenses {
license {
name 'Apache License Version 2.0, January 2004'
url 'http://www.apache.org/licenses/LICENSE-2.0'
}
}
developers {
developer {
id 'axet'
name 'Alexey Kuznetsov'
email 'axet@me.com'
}
}
}
}
}
}
repositories {
jcenter()
mavenLocal()
google()
}
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.github.dcendents.android-maven' // 'gradle install' task
android {
compileSdkVersion 14
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 4
targetSdkVersion 16
versionCode 1
versionName "0.0.5"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
}
}
}
// http://central.sonatype.org/pages/gradle.html
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(project.android.getBootClasspath().join(File.pathSeparator))
options.addStringOption('Xdoclint:none', '-quiet')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
group = "com.github.axet.fbreader"
archivesBaseName = "androidfilechooser"
version = android.defaultConfig.versionName
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Android FBReader Library'
packaging 'jar'
description 'FBReader base classes.'
url 'https://gitlab.com/axet/android-fbreader-library'
scm {
connection 'scm:git:https://gitlab.com/axet/android-fbreader-library'
developerConnection 'scm:git:https://gitlab.com/axet/android-fbreader-library'
url 'https://gitlab.com/axet/android-fbreader-library'
}
licenses {
license {
name 'GNU GENERAL PUBLIC LICENSE 3.0'
url 'https://www.gnu.org/licenses/gpl-3.0.en.html'
}
}
developers {
developer {
id 'axet'
name 'Alexey Kuznetsov'
email 'axet@me.com'
}
}
}
}
}
}
dependencies {
api 'com.github.axet.fbreader:util:0.0.1' // compile project(':util')
}
buildscript {
repositories {
jcenter()
mavenLocal()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
repositories {
jcenter()
mavenLocal()
google()
}
task wrapper(type: Wrapper) {
gradleVersion = '4.6'
}
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.github.dcendents.android-maven' // 'gradle install' task
android {
compileSdkVersion 21
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 9
targetSdkVersion 21
versionCode 1
versionName "0.1.9"
ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
}
lintOptions {
disable 'WrongViewCast'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
}
}
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}
}
}
// http://central.sonatype.org/pages/gradle.html
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(project.android.getBootClasspath().join(File.pathSeparator))
options.addStringOption('Xdoclint:none', '-quiet')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
group = "com.github.axet.fbreader"
archivesBaseName = "library"
version = android.defaultConfig.versionName
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Android FBReader Library'
packaging 'jar'
description 'FBReader base classes.'
url 'https://gitlab.com/axet/android-fbreader-library'
scm {
connection 'scm:git:https://gitlab.com/axet/android-fbreader-library'
developerConnection 'scm:git:https://gitlab.com/axet/android-fbreader-library'
url 'https://gitlab.com/axet/android-fbreader-library'
}
licenses {
license {
name 'custom open-source'
url 'https://gitlab.com/axet/android-fbreader-library/blob/master/androidFileChooser/LICENSE'
}
}
developers {
developer {
id 'axet'
name 'Alexey Kuznetsov'
email 'axet@me.com'
}
}
}
}
}
}
dependencies {
implementation 'com.android.support:support-v4:21.0.3'
api 'com.github.axet.fbreader:androidfilechooser:0.0.5' // compile project(':androidFileChooser')
api 'com.github.axet.fbreader:dragsortlistview:0.0.5' // compile project(':dragSortListview')
api 'com.github.axet.fbreader:ambilwarna:0.0.5' // compile project(':ambilWarna')
api 'com.github.axet.fbreader:supertoasts:0.0.5' // compile project(':superToasts')
api 'com.github.axet:pdfparse-lib:1.0'
api('com.googlecode.json-simple:json-simple:1.1.1') {
exclude group: 'junit'
}
api 'org.apache.httpcomponents:httpmime:4.2.5'
api 'com.nanohttpd:nanohttpd:2.1.0'
}
repositories {
jcenter()
mavenLocal()
google()
}
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.github.dcendents.android-maven' // 'gradle install' task
android {
compileSdkVersion 14
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 5
targetSdkVersion 7
versionCode 1
versionName "0.0.5"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
// http://central.sonatype.org/pages/gradle.html
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(project.android.getBootClasspath().join(File.pathSeparator))
options.addStringOption('Xdoclint:none', '-quiet')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
group = "com.github.axet.fbreader"
archivesBaseName = "dragsortlistview"
version = android.defaultConfig.versionName
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Android FBReader Library'
packaging 'jar'
description 'Clone of https://github.com/JohnPersano/SuperToasts'
url 'https://gitlab.com/axet/android-fbreader-library'
scm {
connection 'scm:git:https://gitlab.com/axet/android-fbreader-library'
developerConnection 'scm:git:https://gitlab.com/axet/android-fbreader-library'
url 'https://gitlab.com/axet/android-fbreader-library'
}
licenses {
license {
name 'Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0'
}
}
developers {
developer {
id 'axet'
name 'Alexey Kuznetsov'
email 'axet@me.com'
}
}
}
}
}
}
dependencies {
implementation 'com.android.support:support-v4:19.1.0'
}
include ':util'
include ':dragSortListview'
include ':ambilWarna'
include ':superToasts'
include ':androidFileChooser'
......@@ -33,6 +33,7 @@ public class ZLTextPage {
private int myColumnWidth;
private int myHeight;
private boolean myTwoColumnView;
public int topMargin;
void setSize(int columnWidth, int height, boolean twoColumnView, boolean keepEndNotStart) {
if (myColumnWidth == columnWidth && myHeight == height && myColumnWidth == columnWidth) {
......
......@@ -506,7 +506,7 @@ public abstract class ZLTextView extends ZLTextViewBase {
final ArrayList<ZLTextLineInfo> lineInfos = page.LineInfos;
final int[] labels = new int[lineInfos.size() + 1];
int x = (rtlMode ? ((page.twoColumnView() ? page.getTextWidth() * 2 + getSpaceBetweenColumns() : page.getTextWidth()) + getLeftMargin()) : getLeftMargin());
int y = getTopMargin();
int y = getTopMargin() + page.topMargin;
int index = 0;
int columnIndex = 0;
ZLTextLineInfo previousInfo = null;
......@@ -518,7 +518,7 @@ public abstract class ZLTextView extends ZLTextViewBase {
y += info.Height + info.Descent + info.VSpaceAfter;
labels[++index] = page.TextElementMap.size();
if (index == page.Column0Height) {
y = getTopMargin();
y = getTopMargin() + page.topMargin;
x += (page.getTextWidth() + getSpaceBetweenColumns()) * (rtlMode ? -1 : 1);
columnIndex = 1;
}
......@@ -528,14 +528,14 @@ public abstract class ZLTextView extends ZLTextViewBase {
final List<ZLTextHighlighting> hilites = findHilites(page);
x = rtlMode ? ((page.twoColumnView() ? page.getTextWidth() * 2 + getSpaceBetweenColumns() : page.getTextWidth()) + getLeftMargin()) : getLeftMargin();
y = getTopMargin();
y = getTopMargin() + page.topMargin;
index = 0;
for (ZLTextLineInfo info : lineInfos) {
drawTextLine(page, hilites, info, labels[index], labels[index + 1]);
y += info.Height + info.Descent + info.VSpaceAfter;
++index;
if (index == page.Column0Height) {
y = getTopMargin();
y = getTopMargin() + page.topMargin;
x += (page.getTextWidth() + getSpaceBetweenColumns()) * (rtlMode ? -1 : 1);
}
}
......@@ -968,6 +968,7 @@ public abstract class ZLTextView extends ZLTextViewBase {
}
private void buildInfos(ZLTextPage page, ZLTextWordCursor start, ZLTextWordCursor result) {
ZLTextFixedPosition end = (result.isNull() || result.samePositionAs(start)) ? null : new ZLTextFixedPosition(result);
result.setCursor(start);
int textAreaHeight = page.getTextHeight();
page.LineInfos.clear();
......@@ -995,6 +996,9 @@ public abstract class ZLTextView extends ZLTextViewBase {
}
}
textAreaHeight -= info.VSpaceAfter;
if (end != null && result.compareTo(end) >= 0) {
break;
}
result.moveTo(info.EndElementIndex, info.EndCharIndex);
page.LineInfos.add(info);
if (textAreaHeight < 0) {
......@@ -1017,6 +1021,23 @@ public abstract class ZLTextView extends ZLTextViewBase {
(!result.getParagraphCursor().isEndOfSection() ||
page.LineInfos.size() == page.Column0Height)
);
if (end != null && result.compareTo(end) >= 0) {
if ((info.EndElementIndex != info.ParagraphCursorLength || nextParagraph) && textAreaHeight >= 0 && (!result.getParagraphCursor().isEndOfSection() || page.LineInfos.size() == page.Column0Height))
page.topMargin = textAreaHeight;
else
page.topMargin = 0;
int last = page.LineInfos.size() - 1;
if (last > 0) {
info = page.LineInfos.get(last);
if (end.compareTo(new ZLTextFixedPosition(info.ParagraphCursor.Index, info.EndElementIndex, info.EndCharIndex)) < 0) {
info.EndElementIndex = end.ElementIndex;
info.EndCharIndex = end.CharIndex;
}
}
result.moveTo(end);
} else {
page.topMargin = 0;
}
resetTextStyle();
}
......@@ -1288,7 +1309,7 @@ public abstract class ZLTextView extends ZLTextViewBase {
}
private void prepareTextLine(ZLTextPage page, ZLTextLineInfo info, int x, int y, int columnIndex) {
y = Math.min(y + info.Height, getTopMargin() + page.getTextHeight() - 1);
y = Math.min(y + info.Height, getTopMargin() + page.getTextHeight() + page.topMargin - 1);
final ZLPaintContext context = getContext();
final ZLTextParagraphCursor paragraphCursor = info.ParagraphCursor;
......@@ -1439,6 +1460,19 @@ public abstract class ZLTextView extends ZLTextViewBase {
}
}
public final synchronized void gotoPosition(ZLTextPosition start, ZLTextPosition end) {
Application.getViewWidget().reset();
myCurrentPage.StartCursor.moveTo(start);
if(end == null)
myCurrentPage.EndCursor.reset();
else
myCurrentPage.EndCursor.moveTo(end);
myCurrentPage.PaintState = PaintStateEnum.START_IS_KNOWN;
myPreviousPage.reset();
myNextPage.reset();
preparePaintInfo(myCurrentPage);
}
protected synchronized void preparePaintInfo() {
myPreviousPage.reset();
myNextPage.reset();
......
repositories {
jcenter()
mavenLocal()
google()
}
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.github.dcendents.android-maven' // 'gradle install' task
android {
compileSdkVersion 19
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 1
versionName "0.0.5"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
// http://central.sonatype.org/pages/gradle.html
task javadoc(type: Javadoc) {
// source = android.sourceSets.main.java.srcDirs
// classpath += project.files(project.android.getBootClasspath().join(File.pathSeparator))
options.addStringOption('Xdoclint:none', '-quiet')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
group = "com.github.axet.fbreader"
archivesBaseName = "supertoasts"
version = android.defaultConfig.versionName
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Android FBReader Library'
packaging 'jar'
description 'Clone of https://github.com/JohnPersano/SuperToasts'
url 'https://gitlab.com/axet/android-fbreader-library'
scm {
connection 'scm:git:https://gitlab.com/axet/android-fbreader-library'
developerConnection 'scm:git:https://gitlab.com/axet/android-fbreader-library'
url 'https://gitlab.com/axet/android-fbreader-library'
}
licenses {
license {
name 'Apache License Version 2.0, January 2004'
url 'http://www.apache.org/licenses/'
}
}
developers {
developer {
id 'axet'
name 'Alexey Kuznetsov'
email 'axet@me.com'
}
}
}
}
}
}
#!/bin/bash
set -e
git checkout -b update $(git rev-list --max-parents=0 HEAD)
./update.sh
#!/bin/bash
set -e
uuu() {
local FROM="$1"
local TO="$2"
local COUNT=${FROM%/}
local COUNT=`echo "${COUNT//\//$'\n'}" | wc -l`
if [[ "$FROM" == */ ]]; then
local COUNT=$((COUNT))
else
local COUNT=$((COUNT-1))
fi
echo "$FROM --> $TO"
mkdir -p "$TO"
git archive a/master -- "$FROM" | tar x --strip-components=$COUNT -C "$TO"
}
mmm() {
local FROM="$1"
local TO="$2"
mkdir -p "$TO"
rsync -av --remove-source-files "$FROM" "$TO"
}
git remote get-url a 2> /dev/null || git remote add a https://github.com/geometer/FBReaderJ
git fetch a
uuu proguard.cfg ./
uuu assets src/main/
uuu jni src/main/
uuu res src/main/
uuu fbreader/app/src/main/java src/main/
(
cd src/main/java/
for F in $( find . -name *.aidl ); do
TO="../aidl/$F"
echo "$F --> $TO"
mkdir -p $(dirname $TO)
mv "$F" "$TO"
done
)
mmm src/main/java/org/fbreader/util util/src/main/java/org/fbreader/
uuu third-party/AmbilWarna/AndroidManifest.xml ambilWarna/src/main/
uuu third-party/AmbilWarna/res ambilWarna/src/main/
uuu third-party/AmbilWarna/src/ ambilWarna/src/main/java
uuu third-party/SuperToasts/AndroidManifest.xml superToasts/src/main/
uuu third-party/SuperToasts/res superToasts/src/main/
uuu third-party/SuperToasts/src/ superToasts/src/main/java/
uuu third-party/android-filechooser/code/AndroidManifest.xml androidFileChooser/src/main/
uuu third-party/android-filechooser/LICENSE androidFileChooser/
uuu third-party/android-filechooser/NOTICE androidFileChooser/
uuu third-party/android-filechooser/code/proguard.cfg androidFileChooser
uuu third-party/android-filechooser/code/res androidFileChooser/src/main/
uuu third-party/android-filechooser/code/src/ androidFileChooser/src/main/java/
uuu third-party/drag-sort-listview/library/AndroidManifest.xml dragSortListview/src/main/
uuu third-party/drag-sort-listview/README.md dragSortListview/
uuu third-party/drag-sort-listview/library/res dragSortListview/src/main/
uuu third-party/drag-sort-listview/library/src/ dragSortListview/src/main/java/
repositories {
jcenter()
mavenLocal()
google()
}
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.github.dcendents.android-maven' // 'gradle install' task
android {
compileSdkVersion 14
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 4
targetSdkVersion 16
versionCode 1
versionName "0.0.5"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
// http://central.sonatype.org/pages/gradle.html
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(project.android.getBootClasspath().join(File.pathSeparator))
options.addStringOption('Xdoclint:none', '-quiet')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives javadocJar, sourcesJar
}
signing {
sign configurations.archives
}
group = "com.github.axet.fbreader"
archivesBaseName = "util"
version = android.defaultConfig.versionName
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'Android FBReader Library'
packaging 'jar'
description 'FBReader base classes.'
url 'https://gitlab.com/axet/android-fbreader-library'
scm {
connection 'scm:git:https://gitlab.com/axet/android-fbreader-library'
developerConnection 'scm:git:https://gitlab.com/axet/android-fbreader-library'
url 'https://gitlab.com/axet/android-fbreader-library'
}
licenses {
license {
name 'GNU GENERAL PUBLIC LICENSE 2.0+'
url 'https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html'
}
}
developers {
developer {
id 'axet'
name 'Alexey Kuznetsov'
email 'axet@me.com'
}
}
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.geometerplus.zlibrary.ui.android.util">
</manifest>