├── settings.gradle ├── fastlane └── metadata │ └── android │ ├── eo │ ├── short_description.txt │ ├── changelogs │ │ ├── 25.txt │ │ ├── 26.txt │ │ └── 27.txt │ ├── images │ │ ├── icon.png │ │ └── phoneScreenshots │ │ │ ├── screenshot-0.png │ │ │ ├── screenshot-1.png │ │ │ └── screenshot-2.png │ └── full_description.txt │ ├── en-US │ ├── short_description.txt │ ├── changelogs │ │ ├── 25.txt │ │ ├── 26.txt │ │ └── 27.txt │ ├── images │ │ ├── icon.png │ │ └── phoneScreenshots │ │ │ ├── screenshot-0.png │ │ │ ├── screenshot-1.png │ │ │ └── screenshot-2.png │ └── full_description.txt │ └── pl │ ├── short_description.txt │ └── full_description.txt ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── app ├── src │ └── main │ │ ├── res │ │ ├── drawable-hdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-ldpi │ │ │ └── ic_launcher.png │ │ ├── drawable-mdpi │ │ │ └── ic_launcher.png │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher.png │ │ ├── drawable │ │ │ └── clear_button.xml │ │ ├── values │ │ │ ├── styles.xml │ │ │ └── strings.xml │ │ ├── layout │ │ │ ├── definition.xml │ │ │ ├── search_note.xml │ │ │ ├── section_header.xml │ │ │ ├── about_view.xml │ │ │ ├── no_flashcard_view.xml │ │ │ ├── languages.xml │ │ │ ├── preferences.xml │ │ │ ├── article.xml │ │ │ └── search.xml │ │ └── menu │ │ │ ├── main_menu.xml │ │ │ ├── definition_menu.xml │ │ │ ├── search_menu.xml │ │ │ └── article_menu.xml │ │ ├── java │ │ └── uk │ │ │ └── co │ │ │ └── busydoingnothing │ │ │ └── prevo │ │ │ ├── LanguagesActivity.java │ │ │ ├── Language.java │ │ │ ├── SearchResult.java │ │ │ ├── SpannedCopy.java │ │ │ ├── ReferenceSpan.java │ │ │ ├── StartActivity.java │ │ │ ├── DelayedScrollView.java │ │ │ ├── DefinitionView.java │ │ │ ├── Hats.java │ │ │ ├── TrieCache.java │ │ │ ├── SelectedLanguages.java │ │ │ ├── BinaryReader.java │ │ │ ├── LanguageDatabaseHelper.java │ │ │ ├── PreferenceAdapter.java │ │ │ ├── LanguageList.java │ │ │ ├── SelectLanguageActivity.java │ │ │ ├── PreferenceActivity.java │ │ │ ├── MenuHelper.java │ │ │ ├── SearchAdapter.java │ │ │ ├── LanguagesAdapter.java │ │ │ ├── SearchActivity.java │ │ │ ├── Trie.java │ │ │ └── ArticleActivity.java │ │ └── AndroidManifest.xml └── build.gradle ├── .gitignore ├── scripts └── generate-dictionary.sh ├── .gitmodules ├── TODO ├── README.md ├── gradlew.bat ├── gradlew └── COPYING /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/eo/short_description.txt: -------------------------------------------------------------------------------- 1 | Esperanta vortaro 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/short_description.txt: -------------------------------------------------------------------------------- 1 | Esperanto dictionary 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/25.txt: -------------------------------------------------------------------------------- 1 | - Update the ReVo data to 2024-04-08 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/26.txt: -------------------------------------------------------------------------------- 1 | - Update the ReVo data to 2024-04-08 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/pl/short_description.txt: -------------------------------------------------------------------------------- 1 | Słownik Esperanto i esperancko-polski 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/eo/changelogs/25.txt: -------------------------------------------------------------------------------- 1 | - Ĝisdatigi la datumojn de ReVo al 2024-04-08 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/eo/changelogs/26.txt: -------------------------------------------------------------------------------- 1 | - Ĝisdatigi la datumojn de ReVo al 2024-04-08 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/27.txt: -------------------------------------------------------------------------------- 1 | - Update the ReVo data to 2025-01-09 2 | - Add a button to clear the search text 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/eo/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/fastlane/metadata/android/eo/images/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/app/src/main/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/fastlane/metadata/android/en-US/images/icon.png -------------------------------------------------------------------------------- /fastlane/metadata/android/eo/changelogs/27.txt: -------------------------------------------------------------------------------- 1 | - Ĝisdatigi la datumojn de ReVo al 2025-01-09 2 | - Aldoni butonon por forigi la serĉtekston 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/eo/images/phoneScreenshots/screenshot-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/fastlane/metadata/android/eo/images/phoneScreenshots/screenshot-0.png -------------------------------------------------------------------------------- /fastlane/metadata/android/eo/images/phoneScreenshots/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/fastlane/metadata/android/eo/images/phoneScreenshots/screenshot-1.png -------------------------------------------------------------------------------- /fastlane/metadata/android/eo/images/phoneScreenshots/screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/fastlane/metadata/android/eo/images/phoneScreenshots/screenshot-2.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-0.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-1.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bpeel/prevo/HEAD/fastlane/metadata/android/en-US/images/phoneScreenshots/screenshot-2.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/full_description.txt: -------------------------------------------------------------------------------- 1 | PReVo is a portable version of Reta Vortaro (the free and libre Esperanto dictionary) for Android. It’s usable without Internet access and is quickly searched with the keyboard. 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle/ 3 | build/ 4 | local.properties 5 | .idea 6 | .DS_Store 7 | .externalNativeBuild 8 | /prevodb-build 9 | 10 | /app/src/main/assets/articles/article-*.bin 11 | /app/src/main/assets/indices/index-*.bin 12 | /app/src/main/res/xml/languages.xml 13 | -------------------------------------------------------------------------------- /scripts/generate-dictionary.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | cd "$(dirname "$0")"/.. 6 | 7 | mkdir -p prevodb-build 8 | cd prevodb-build 9 | 10 | ../extern/prevodb/autogen.sh 11 | make -j$(nproc) 12 | 13 | ./src/prevodb \ 14 | -i ../extern/revo-fonto \ 15 | -i ../extern/voko-grundo \ 16 | -o ../app/src/main 17 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "extern/voko-grundo"] 2 | path = extern/voko-grundo 3 | url = https://github.com/revuloj/voko-grundo.git 4 | [submodule "extern/revo-fonto"] 5 | path = extern/revo-fonto 6 | url = https://github.com/revuloj/revo-fonto.git 7 | [submodule "extern/prevodb"] 8 | path = extern/prevodb 9 | url = https://github.com/bpeel/prevodb 10 | -------------------------------------------------------------------------------- /fastlane/metadata/android/eo/full_description.txt: -------------------------------------------------------------------------------- 1 | PReVo estas portebla versio de Reta Vortaro (la libera interreta esperanta vortaro) por Android. Ĝi estas uzebla sen retkonekto kaj ĝi estas rapide serĉebla per la klavaro. Aldone al difinoj de vortoj en Esperanto, la vortaro ankaŭ liveras tradukojn al diversaj aliaj lingvoj. 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/pl/full_description.txt: -------------------------------------------------------------------------------- 1 | PreVo jest przenośną wersją Reta Vortaro (bezpłatnego i wolnego słownika międzynarodowego języka Esperanto) na system Android. Działa bez połączenia z siecią, pozwala na szybkie wyszukiwanie za pomocą klawiatury. Oprócz definicji w języku Esperanto, baza zawiera tłumaczenia na inne języki (w tym polski). 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/clear_button.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | • Ebligi ligilojn al specifaj lingvoj. 2 | 3 | • Pli bone traktu la etikedon 'uzo' 4 | 5 | • Ebligi ĝisdatigi la datumon pli ofte ol ĝisdatigi la pakaĵon. Eble 6 | oni povus instali la datumon aparte ĉe SD-karto kaj havi funkcion ĉe 7 | la menuo por ĝisdatigi ĝin. 8 | 9 | • Ebligi agordi la kolorojn 10 | 11 | • Rapide forviŝu la serĉtekston. Eble kiam la serĉilo unue montriĝas 12 | ĝi elektu la tutan tekston por rapide forigi ĝin. 13 | 14 | • Akceptu la h-sistemon 15 | 16 | - Eble tio nur bonus se ĝi traktus la literoj h kaj kiel ĉapelo kaj 17 | kiel normala litero. Ekzemple, 'flughaveno' trovus kaj na 18 | flughaveno kaj na fluĝaveno. 19 | 20 | - Tio povus uziĝi en ĝenerala sistemo por pli fleksa serĉo. 21 | Ekzemple, tajpi na “cafe” trovu ankaŭ na “café”. 22 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/definition.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/search_note.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/section_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/about_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/uk/co/busydoingnothing/prevo/LanguagesActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * PReVo - A portable version of ReVo for Android 3 | * Copyright (C) 2013 Neil Roberts 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; version 2 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package uk.co.busydoingnothing.prevo; 19 | 20 | /* This is a dummy subclass so that we don't have to change the name 21 | * of the original initial activity that is launched at startup. 22 | * Apparently changing the name of that activity can break user's 23 | * shortcuts */ 24 | 25 | public class LanguagesActivity extends StartActivity 26 | { 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/no_flashcard_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/languages.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/preferences.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/article.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 24 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 22 | 26 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/java/uk/co/busydoingnothing/prevo/Language.java: -------------------------------------------------------------------------------- 1 | /* 2 | * PReVo - A portable version of ReVo for Android 3 | * Copyright (C) 2012 Neil Roberts 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; version 2 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package uk.co.busydoingnothing.prevo; 19 | 20 | public class Language 21 | { 22 | private String name; 23 | private String code; 24 | 25 | public Language (String name, 26 | String code) 27 | { 28 | this.name = name; 29 | this.code = code; 30 | } 31 | 32 | public String getName () 33 | { 34 | return name; 35 | } 36 | 37 | public String getCode () 38 | { 39 | return code; 40 | } 41 | 42 | @Override 43 | public String toString () 44 | { 45 | return name; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/res/menu/definition_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 21 | 23 | 25 | 27 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/menu/search_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 22 | 24 | 28 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/java/uk/co/busydoingnothing/prevo/SearchResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * PReVo - A portable version of ReVo for Android 3 | * Copyright (C) 2012 Neil Roberts 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; version 2 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package uk.co.busydoingnothing.prevo; 19 | 20 | public class SearchResult 21 | { 22 | String word; 23 | int article; 24 | int mark; 25 | 26 | public SearchResult (String word, 27 | int article, 28 | int mark) 29 | { 30 | this.word = word; 31 | this.article = article; 32 | this.mark = mark; 33 | } 34 | 35 | public String getWord () 36 | { 37 | return word; 38 | } 39 | 40 | public int getArticle () 41 | { 42 | return article; 43 | } 44 | 45 | public int getMark () 46 | { 47 | return mark; 48 | } 49 | 50 | @Override 51 | public String toString () 52 | { 53 | return word; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | namespace "uk.co.busydoingnothing.prevo" 5 | 6 | compileSdkVersion 28 7 | 8 | defaultConfig { 9 | applicationId "uk.co.busydoingnothing.prevo" 10 | minSdkVersion 16 11 | targetSdkVersion 34 12 | versionCode 27 13 | versionName "0.27" 14 | } 15 | 16 | signingConfigs { 17 | release { 18 | storeFile file(RELEASE_STORE_FILE) 19 | storePassword RELEASE_STORE_PASSWORD 20 | keyAlias RELEASE_KEY_ALIAS 21 | keyPassword RELEASE_KEY_PASSWORD 22 | } 23 | } 24 | 25 | buildTypes { 26 | release { 27 | signingConfig signingConfigs.release 28 | minifyEnabled false 29 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 30 | } 31 | } 32 | 33 | applicationVariants.configureEach { 34 | tasks["merge${name.capitalize()}Resources"].dependsOn(buildDictionary) 35 | tasks["merge${name.capitalize()}Assets"].dependsOn(buildDictionary) 36 | } 37 | } 38 | 39 | dependencies { 40 | implementation 'com.android.support:appcompat-v7:28.0.0' 41 | } 42 | 43 | task buildDictionary { 44 | outputs.dir 'src/main/assets/articles' 45 | outputs.dir 'src/main/assets/indices' 46 | outputs.file 'src/main/res/xml/languages.xml' 47 | 48 | doLast { 49 | exec { 50 | executable '../scripts/generate-dictionary.sh' 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/res/menu/article_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 22 | 24 | 28 | 31 | 35 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/java/uk/co/busydoingnothing/prevo/SpannedCopy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * PReVo - A portable version of ReVo for Android 3 | * Copyright (C) 2012 Neil Roberts 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; version 2 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package uk.co.busydoingnothing.prevo; 19 | 20 | import android.util.Log; 21 | import android.content.ClipData; 22 | import android.content.Context; 23 | import android.content.ClipboardManager; 24 | import android.text.Html; 25 | import android.text.Spanned; 26 | 27 | public abstract class SpannedCopy 28 | { 29 | public static final String TAG = "prevoclip"; 30 | 31 | public static void copyText (Context context, 32 | CharSequence label, 33 | CharSequence text) 34 | { 35 | ClipboardManager clipboard = 36 | (ClipboardManager) context.getSystemService (Context.CLIPBOARD_SERVICE); 37 | 38 | ClipData clipData; 39 | 40 | if (text instanceof Spanned) 41 | { 42 | String htmlText = Html.toHtml ((Spanned) text); 43 | 44 | clipData = ClipData.newHtmlText (label, text, htmlText); 45 | } 46 | else 47 | clipData = ClipData.newPlainText (label, text); 48 | 49 | clipboard.setPrimaryClip (clipData); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/uk/co/busydoingnothing/prevo/ReferenceSpan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * PReVo - A portable version of ReVo for Android 3 | * Copyright (C) 2012 Neil Roberts 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; version 2 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package uk.co.busydoingnothing.prevo; 19 | 20 | import android.content.Intent; 21 | import android.text.style.ClickableSpan; 22 | import android.util.Log; 23 | import android.view.View; 24 | 25 | public class ReferenceSpan extends ClickableSpan 26 | { 27 | private int articleNumber; 28 | private int sectionNumber; 29 | 30 | private static String TAG = "PrevoReference"; 31 | 32 | public ReferenceSpan (int articleNumber, 33 | int sectionNumber) 34 | { 35 | this.articleNumber = articleNumber; 36 | this.sectionNumber = sectionNumber; 37 | } 38 | 39 | @Override 40 | public void onClick (View view) 41 | { 42 | Log.i (TAG, 43 | "Jumping to article (" + articleNumber + "," + sectionNumber + ")"); 44 | 45 | Intent intent = new Intent (view.getContext (), 46 | ArticleActivity.class); 47 | intent.putExtra (ArticleActivity.EXTRA_ARTICLE_NUMBER, 48 | articleNumber); 49 | intent.putExtra (ArticleActivity.EXTRA_MARK_NUMBER, 50 | sectionNumber); 51 | view.getContext ().startActivity (intent); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/uk/co/busydoingnothing/prevo/StartActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * PReVo - A portable version of ReVo for Android 3 | * Copyright (C) 2013 Neil Roberts 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; version 2 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package uk.co.busydoingnothing.prevo; 19 | 20 | import android.app.Activity; 21 | import android.content.SharedPreferences; 22 | import android.os.Bundle; 23 | import android.support.v7.app.AppCompatActivity; 24 | 25 | /* This activity is just like a landing page to select the right 26 | * initial activity. If the user has already previously selected a 27 | * language then we'll default to searching in that language again, 28 | * otherwise we show the language select page */ 29 | 30 | public class StartActivity extends AppCompatActivity 31 | { 32 | @Override 33 | public void onCreate (Bundle savedInstanceState) 34 | { 35 | String lastLanguage; 36 | 37 | super.onCreate (savedInstanceState); 38 | 39 | SharedPreferences prefs = 40 | getSharedPreferences (MenuHelper.PREVO_PREFERENCES, 41 | Activity.MODE_PRIVATE); 42 | 43 | lastLanguage = prefs.getString (MenuHelper.PREF_LAST_LANGUAGE, null); 44 | 45 | if (lastLanguage == null) 46 | MenuHelper.goChooseLanguage (this); 47 | else 48 | MenuHelper.goSearch (this); 49 | 50 | /* Finish this activity to get it out of the call stack */ 51 | finish (); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 22 | 23 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 38 | 39 | 41 | 42 | 45 | 46 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | PReVo 2 | ===== 3 | 4 | PReVo is an android application containing a portable version of the 5 | Reta Vortaro which is an open source dictionary for Esperanto. It 6 | contains all of the dictionary data in the package so the application 7 | does not need to access the internet. 8 | 9 | The official website for the program is here: 10 | 11 | http://www.busydoingnothing.co.uk/prevo/ 12 | 13 | It is also available in the Google play store here: 14 | 15 | https://play.google.com/store/apps/details?id=uk.co.busydoingnothing.prevo 16 | 17 | or with F-Droid here: 18 | 19 | https://f-droid.org/en/packages/uk.co.busydoingnothing.prevo/ 20 | 21 | Building 22 | -------- 23 | 24 | This git repo does not include the assets containing the dictionary 25 | data. Instead they are built from the ReVo data and the prevodb 26 | program which are in git submodules. In order to get these modules, be 27 | sure to run the following git command: 28 | 29 | ```bash 30 | git submodule update --init 31 | ``` 32 | 33 | The prevodb program will be built as part of the app build in order to 34 | generate the dictionary data, so you need to make sure you have a 35 | compiler for the host machine installed. It will also need the 36 | developer packages for expat and glib. 37 | 38 | Assuming you have the Android SDK installed correctly, you can build 39 | the app either with Android Studio or the command line as follows. 40 | 41 | Debug mode: 42 | 43 | cd $HOME/prevo 44 | ./gradlew assembleDebug 45 | 46 | Release mode: 47 | 48 | cd $HOME/prevo 49 | ./gradlew assembleRelease 50 | 51 | You should then have the final package in either 52 | `app/build/outputs/apk/debug/` or `app/build/outputs/apk/release/` 53 | depending on the build type. 54 | 55 | Building a specific release 56 | --------------------------- 57 | 58 | The releases are all tagged and signed in the git repo using the 59 | following public key: 60 | 61 | http://www.busydoingnothing.co.uk/neilroberts.asc 62 | 63 | The git submodules were added in version 0.25 so the signed tag 64 | contains the commit hash of the dependencies used as well. For older 65 | versions, the message for each tag contains the git hashes used for 66 | the ReVo sources and the prevodb program. This information can be used 67 | to build a copy of a release using exactly the same data. You can see 68 | this information for example with: 69 | 70 | git show 0.12 71 | -------------------------------------------------------------------------------- /app/src/main/java/uk/co/busydoingnothing/prevo/DelayedScrollView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * PReVo - A portable version of ReVo for Android 3 | * Copyright (C) 2012 Neil Roberts 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; version 2 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package uk.co.busydoingnothing.prevo; 19 | 20 | import android.content.Context; 21 | import android.util.AttributeSet; 22 | import android.view.View; 23 | import android.widget.ScrollView; 24 | 25 | /* This is the same as a ScrollView except that it can set a scrollTo 26 | * to occur after a layout has occured. If you don't wait until after 27 | * the layout has occured then the views won't have the right 28 | * position */ 29 | 30 | public class DelayedScrollView extends ScrollView 31 | { 32 | private boolean hadLayout = false; 33 | private View delayedView = null; 34 | 35 | public DelayedScrollView (Context context) 36 | { 37 | super (context); 38 | } 39 | 40 | public DelayedScrollView (Context context, AttributeSet attrs) 41 | { 42 | super (context, attrs); 43 | } 44 | 45 | public DelayedScrollView (Context context, AttributeSet attrs, int defStyle) 46 | { 47 | super (context, attrs, defStyle); 48 | } 49 | 50 | public void delayedScrollTo (View view) 51 | { 52 | if (hadLayout) 53 | { 54 | scrollTo (0, view.getTop ()); 55 | delayedView = null; 56 | } 57 | else 58 | delayedView = view; 59 | } 60 | 61 | @Override 62 | protected void onLayout (boolean changed, 63 | int left, 64 | int top, 65 | int right, 66 | int bottom) 67 | { 68 | super.onLayout (changed, left, top, right, bottom); 69 | 70 | hadLayout = true; 71 | 72 | if (delayedView != null) 73 | delayedScrollTo (delayedView); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /app/src/main/java/uk/co/busydoingnothing/prevo/DefinitionView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * PReVo - A portable version of ReVo for Android 3 | * Copyright (C) 2012 Neil Roberts 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; version 2 of the License. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | package uk.co.busydoingnothing.prevo; 19 | 20 | import android.util.AttributeSet; 21 | import android.widget.TextView; 22 | import android.content.Context; 23 | import android.view.ContextMenu.ContextMenuInfo; 24 | import android.support.v7.widget.AppCompatTextView; 25 | 26 | public class DefinitionView extends AppCompatTextView 27 | { 28 | private CharSequence word; 29 | private CharSequence definition; 30 | 31 | public class DefinitionContextMenuInfo implements ContextMenuInfo 32 | { 33 | public CharSequence word; 34 | public CharSequence definition; 35 | } 36 | 37 | private DefinitionContextMenuInfo contextMenuInfo; 38 | 39 | public DefinitionView (Context context) 40 | { 41 | super (context); 42 | } 43 | 44 | public DefinitionView (Context context, AttributeSet attrs) 45 | { 46 | super (context, attrs); 47 | } 48 | 49 | public DefinitionView (Context context, AttributeSet attrs, int defStyle) 50 | { 51 | super (context, attrs, defStyle); 52 | } 53 | 54 | public DefinitionView (Context context, 55 | CharSequence word, 56 | CharSequence definition) 57 | { 58 | super (context); 59 | setWord (word, definition); 60 | } 61 | 62 | public void setWord (CharSequence word, CharSequence definition) 63 | { 64 | this.word = word; 65 | this.definition = definition; 66 | contextMenuInfo = null; 67 | } 68 | 69 | public ContextMenuInfo getContextMenuInfo () 70 | { 71 | if (contextMenuInfo == null) 72 | { 73 | contextMenuInfo = new DefinitionContextMenuInfo (); 74 | contextMenuInfo.word = this.word; 75 | contextMenuInfo.definition = this.definition; 76 | } 77 | 78 | return contextMenuInfo; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/res/layout/search.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 23 | 32 |