├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── gradle.xml ├── libraries │ ├── actionbarsherlock_4_4_0.xml │ ├── android_ant.xml │ ├── android_support_v13.xml │ ├── commons_io_2_4.xml │ ├── libspen23_multiwindow.xml │ └── support_v4_18_0_0.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml ├── vcs.xml └── workspace.xml ├── COPYING ├── PathfinderOpenReference1.iml ├── README.md ├── acra-4.8.5 ├── acra-4.8.5.aar └── acra-4.8.5.iml ├── api.md ├── app ├── app.iml ├── build.gradle ├── libs │ ├── android-ant.jar │ ├── commons-io-2.4.jar │ └── libspen23_multiwindow.jar └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── Alchemist.png │ ├── AttacksOfOpportunity.jpg │ ├── Barbarian.png │ ├── Bard.png │ ├── Cavalier.png │ ├── Chases.jpg │ ├── Cleric.png │ ├── Cover.jpg │ ├── Druid.png │ ├── Fighter.png │ ├── Flanking.jpg │ ├── Gunslinger.png │ ├── Inquisitor.png │ ├── Magus.png │ ├── Monk.png │ ├── Ninja.png │ ├── Oracle.png │ ├── Paladin.png │ ├── Ranger.png │ ├── Rogue.png │ ├── Samurai.png │ ├── Sorcerer.png │ ├── SpellAreas.jpg │ ├── Summoner.png │ ├── TacticalMovement.jpg │ ├── Witch.png │ ├── Wizard.png │ ├── application.min.css │ ├── application.min.js │ ├── book-acg.db │ ├── book-apg.db │ ├── book-arg.db │ ├── book-b1.db │ ├── book-b2.db │ ├── book-b3.db │ ├── book-b4.db │ ├── book-cr.db │ ├── book-gmg.db │ ├── book-ma.db │ ├── book-mc.db │ ├── book-npc.db │ ├── book-oa.db │ ├── book-ogl.db │ ├── book-pfu.db │ ├── book-tech.db │ ├── book-uc.db │ ├── book-ucampaign.db │ ├── book-ue.db │ ├── book-um.db │ ├── book_mc.db │ ├── display.css │ ├── display_orig.css │ ├── hq_icon.png │ └── index.db │ ├── java │ └── org │ │ └── evilsoft │ │ └── pathfinder │ │ └── reference │ │ ├── AbstractViewListFragment.java │ │ ├── AsyncTaskResult.java │ │ ├── DetailsActivity.java │ │ ├── DetailsListFragment.java │ │ ├── DetailsViewFragment.java │ │ ├── DetailsWebViewClient.java │ │ ├── DisplayListAdapter.java │ │ ├── ExpandableListFragment.java │ │ ├── HistoryManager.java │ │ ├── HtmlRenderFarm.java │ │ ├── MenuItem.java │ │ ├── PathfinderOpenReferenceActivity.java │ │ ├── PathfinderOpenReferenceApplication.java │ │ ├── SearchProvider.java │ │ ├── SectionExpandableListAdapter.java │ │ ├── SectionListFragment.java │ │ ├── SectionViewActivity.java │ │ ├── SectionViewFragment.java │ │ ├── StartActivity.java │ │ ├── api │ │ ├── AbstractContentProvider.java │ │ ├── CasterContentProvider.java │ │ ├── CreatureContentProvider.java │ │ ├── FeatContentProvider.java │ │ ├── SectionContentProvider.java │ │ ├── SkillContentProvider.java │ │ ├── SpellContentProvider.java │ │ └── contracts │ │ │ ├── CasterContract.java │ │ │ ├── CreatureContract.java │ │ │ ├── FeatContract.java │ │ │ ├── SectionContract.java │ │ │ ├── SkillContract.java │ │ │ └── SpellContract.java │ │ ├── db │ │ ├── BaseDbHelper.java │ │ ├── BookNotFoundException.java │ │ ├── DbWrangler.java │ │ ├── book │ │ │ ├── AbilityAdapter.java │ │ │ ├── AfflictionAdapter.java │ │ │ ├── AnimalCompanionAdapter.java │ │ │ ├── ArmyAdapter.java │ │ │ ├── BookDbAdapter.java │ │ │ ├── BookDbHelper.java │ │ │ ├── ClassAdapter.java │ │ │ ├── CreatureAdapter.java │ │ │ ├── FeatAdapter.java │ │ │ ├── FullSectionAdapter.java │ │ │ ├── HauntAdapter.java │ │ │ ├── ItemAdapter.java │ │ │ ├── KingdomResourceAdapter.java │ │ │ ├── LinkAdapter.java │ │ │ ├── MythicSpellDetailAdapter.java │ │ │ ├── ResourceAdapter.java │ │ │ ├── SectionAdapter.java │ │ │ ├── SectionIndexGroupAdapter.java │ │ │ ├── SettlementAdapter.java │ │ │ ├── SkillAdapter.java │ │ │ ├── SpellComponentAdapter.java │ │ │ ├── SpellDescriptorAdapter.java │ │ │ ├── SpellDetailAdapter.java │ │ │ ├── SpellEffectAdapter.java │ │ │ ├── SpellListAdapter.java │ │ │ ├── SpellSubschoolAdapter.java │ │ │ ├── TalentAdapter.java │ │ │ ├── TrapAdapter.java │ │ │ └── VehicleAdapter.java │ │ ├── index │ │ │ ├── ApiCasterListAdapter.java │ │ │ ├── ApiClassSpellListAdapter.java │ │ │ ├── ApiCreatureListAdapter.java │ │ │ ├── ApiFeatListAdapter.java │ │ │ ├── ApiFilteredClassSpellListAdapter.java │ │ │ ├── ApiFilteredSpellListAdapter.java │ │ │ ├── ApiSectionListAdapter.java │ │ │ ├── ApiSkillListAdapter.java │ │ │ ├── ApiSpellListAdapter.java │ │ │ ├── BooksAdapter.java │ │ │ ├── CountAdapter.java │ │ │ ├── CreatureTypeAdapter.java │ │ │ ├── FeatTypeAdapter.java │ │ │ ├── IndexDbAdapter.java │ │ │ ├── IndexDbHelper.java │ │ │ ├── IndexGroupAdapter.java │ │ │ ├── MenuAdapter.java │ │ │ ├── SearchAdapter.java │ │ │ ├── SpellClassAdapter.java │ │ │ ├── SpellListAdapter.java │ │ │ └── UrlReferenceAdapter.java │ │ └── user │ │ │ ├── CollectionAdapter.java │ │ │ ├── HistoryAdapter.java │ │ │ ├── UserDbAdapter.java │ │ │ └── UserDbHelper.java │ │ ├── list │ │ ├── BaseListItem.java │ │ ├── CollectionItemListAdapter.java │ │ ├── CollectionItemListItem.java │ │ ├── CollectionListAdapter.java │ │ ├── CollectionListItem.java │ │ ├── CreatureListAdapter.java │ │ ├── CreatureListItem.java │ │ ├── DefaultListAdapter.java │ │ ├── FeatListAdapter.java │ │ ├── FeatListItem.java │ │ ├── HistoryListAdapter.java │ │ ├── HistoryListItem.java │ │ ├── NpcListAdapter.java │ │ ├── NpcListItem.java │ │ ├── SearchListAdapter.java │ │ ├── SearchListItem.java │ │ ├── SectionListAdapter.java │ │ ├── SkillListAdapter.java │ │ ├── SkillListItem.java │ │ ├── SpellListAdapter.java │ │ ├── SpellListItem.java │ │ └── UrlListItem.java │ │ ├── preference │ │ ├── FilterPreferenceManager.java │ │ ├── PathfinderPreferenceActivity.java │ │ └── StockPreferenceFragment.java │ │ ├── render │ │ ├── html │ │ │ ├── AbilityRenderer.java │ │ │ ├── AfflictionRenderer.java │ │ │ ├── AnimalCompanionRenderer.java │ │ │ ├── ArmyRenderer.java │ │ │ ├── ClassRenderer.java │ │ │ ├── CreatureRenderer.java │ │ │ ├── EmbedRenderer.java │ │ │ ├── FeatRenderer.java │ │ │ ├── HauntRenderer.java │ │ │ ├── HtmlRenderer.java │ │ │ ├── ItemRenderer.java │ │ │ ├── KingdomResourceRenderer.java │ │ │ ├── LinkRenderer.java │ │ │ ├── MythicSpellRenderer.java │ │ │ ├── RaceRenderer.java │ │ │ ├── ResourceRenderer.java │ │ │ ├── SectionRenderer.java │ │ │ ├── SettlementRenderer.java │ │ │ ├── SkillRenderer.java │ │ │ ├── SpellRenderer.java │ │ │ ├── StatBlockRenderer.java │ │ │ ├── TableRenderer.java │ │ │ ├── TalentRenderer.java │ │ │ ├── TrapRenderer.java │ │ │ └── VehicleRenderer.java │ │ └── json │ │ │ ├── AbilityRenderer.java │ │ │ ├── AfflictionRenderer.java │ │ │ ├── AnimalCompanionRenderer.java │ │ │ ├── ArmyRenderer.java │ │ │ ├── ClassRenderer.java │ │ │ ├── CreatureRenderer.java │ │ │ ├── FeatRenderer.java │ │ │ ├── HauntRenderer.java │ │ │ ├── ItemRenderer.java │ │ │ ├── JsonRenderer.java │ │ │ ├── KingdomResourceRenderer.java │ │ │ ├── LinkRenderer.java │ │ │ ├── MythicSpellRenderer.java │ │ │ ├── NoOpRenderer.java │ │ │ ├── ResourceRenderer.java │ │ │ ├── SectionRenderer.java │ │ │ ├── SettlementRenderer.java │ │ │ ├── SkillRenderer.java │ │ │ ├── SpellRenderer.java │ │ │ ├── TalentRenderer.java │ │ │ ├── TrapRenderer.java │ │ │ └── VehicleRenderer.java │ │ └── utils │ │ ├── AvailableSpaceHandler.java │ │ ├── LimitedSpaceException.java │ │ └── UrlAliaser.java │ └── res │ ├── drawable-hdpi │ ├── app_icon.png │ ├── btn_star_big_off.png │ ├── btn_star_big_on.png │ ├── dropdown_ic_arrow_normal_holo_dark.png │ ├── dropdown_ic_arrow_pressed_holo_dark.png │ ├── ic_btn_find_prev.png │ ├── ic_dropdown_menu.png │ ├── ic_menu.png │ ├── ic_menu_sort_by_size.png │ ├── ic_search.png │ ├── ic_search_api_holo_light.png │ └── ic_search_category_default.png │ ├── drawable-ldpi │ ├── app_icon.png │ ├── btn_star_big_off.png │ ├── btn_star_big_on.png │ ├── ic_menu_sort_by_size.png │ └── ic_search_category_default.png │ ├── drawable-mdpi │ ├── app_icon.png │ ├── btn_star_big_off.png │ ├── btn_star_big_on.png │ ├── dropdown_ic_arrow_normal_holo_dark.png │ ├── dropdown_ic_arrow_pressed_holo_dark.png │ ├── ic_btn_find_prev.png │ ├── ic_dropdown_menu.png │ ├── ic_menu.png │ ├── ic_menu_sort_by_size.png │ ├── ic_search.png │ ├── ic_search_api_holo_light.png │ └── ic_search_category_default.png │ ├── drawable-xhdpi │ └── app_icon.png │ ├── layout │ ├── actionbar_spinner.xml │ ├── character_list_item.xml │ ├── child_row.xml │ ├── class_list_item.xml │ ├── default_list_item.xml │ ├── details.xml │ ├── details_phone.xml │ ├── details_phone_list.xml │ ├── details_view.xml │ ├── feat_list_item.xml │ ├── feat_main_list_item.xml │ ├── group_row.xml │ ├── list_item.xml │ ├── main.xml │ ├── main_phone.xml │ ├── monster_list_item.xml │ ├── monster_main_list_item.xml │ ├── rule_list_item.xml │ ├── search_list_item.xml │ ├── section_view.xml │ ├── skill_list_item.xml │ ├── skill_main_list_item.xml │ ├── spell_list_item.xml │ ├── spell_main_list_item.xml │ └── startup.xml │ ├── menu │ ├── display_menu.xml │ └── main_menu.xml │ ├── values │ ├── arrays.xml │ ├── dimens.xml │ └── strings.xml │ └── xml │ ├── preference_headers.xml │ ├── searchable.xml │ └── source_filter.xml ├── build.gradle ├── build.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties ├── settings.gradle └── tools ├── code_cleanup.xml ├── formatter.xml ├── pfor-contracts.jar ├── split.sh ├── supportedurllist.txt └── urllist.txt /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | gen 3 | *.swp 4 | app/build 5 | build/ 6 | .gradle 7 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | PathfinderOpenReference -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/libraries/actionbarsherlock_4_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/android_ant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/android_support_v13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/commons_io_2_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/libspen23_multiwindow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/support_v4_18_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /PathfinderOpenReference1.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pathfinder Open Reference 2 | This program is an android app for displaying rules from the [Paizo Pathfinder Open Reference Document](http://paizo.com/pathfinderRPG/prd/). It uses the data generated by the [PSRD-Parser](https://github.com/devonjones/PSRD-Parser) project. 3 | 4 | ## Dependencies 5 | In order to build this project, you will need to have [ActionBarSherlock](http://actionbarsherlock.com/) configured according to the ActionBarSherlock site. 6 | 7 | ## Download 8 | You can download the current [development version](http://bit.ly/GYdanb), or get it from [Google Play](https://play.google.com/store/apps/details?id=org.evilsoft.pathfinder.reference). 9 | 10 | ## License 11 | Pathfinder Open Reference is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 12 | 13 | Pathfinder Open Reference is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along with Pathfinder Open Reference. If not, see . 16 | 17 | ## API 18 | Pathfinder Open Reference has an API you can use in your gaming application. Check out the [documentation](https://github.com/devonjones/PathfinderOpenReference/blob/master/api.md). 19 | -------------------------------------------------------------------------------- /acra-4.8.5/acra-4.8.5.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/acra-4.8.5/acra-4.8.5.aar -------------------------------------------------------------------------------- /acra-4.8.5/acra-4.8.5.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 15 5 | buildToolsVersion "22.0.1" 6 | 7 | defaultConfig { 8 | applicationId "org.evilsoft.pathfinder.reference" 9 | minSdkVersion 10 10 | targetSdkVersion 17 11 | } 12 | 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 17 | } 18 | } 19 | } 20 | 21 | repositories { 22 | flatDir { 23 | dirs 'libs' 24 | } 25 | } 26 | 27 | dependencies { 28 | compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' 29 | compile 'com.android.support:support-v4:18.0.0' 30 | compile files('libs/android-ant.jar') 31 | compile files('libs/android-support-v13.jar') 32 | compile files('libs/commons-io-2.4.jar') 33 | compile files('libs/libspen23_multiwindow.jar') 34 | } 35 | -------------------------------------------------------------------------------- /app/libs/android-ant.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/libs/android-ant.jar -------------------------------------------------------------------------------- /app/libs/commons-io-2.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/libs/commons-io-2.4.jar -------------------------------------------------------------------------------- /app/libs/libspen23_multiwindow.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/libs/libspen23_multiwindow.jar -------------------------------------------------------------------------------- /app/src/main/assets/Alchemist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Alchemist.png -------------------------------------------------------------------------------- /app/src/main/assets/AttacksOfOpportunity.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/AttacksOfOpportunity.jpg -------------------------------------------------------------------------------- /app/src/main/assets/Barbarian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Barbarian.png -------------------------------------------------------------------------------- /app/src/main/assets/Bard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Bard.png -------------------------------------------------------------------------------- /app/src/main/assets/Cavalier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Cavalier.png -------------------------------------------------------------------------------- /app/src/main/assets/Chases.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Chases.jpg -------------------------------------------------------------------------------- /app/src/main/assets/Cleric.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Cleric.png -------------------------------------------------------------------------------- /app/src/main/assets/Cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Cover.jpg -------------------------------------------------------------------------------- /app/src/main/assets/Druid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Druid.png -------------------------------------------------------------------------------- /app/src/main/assets/Fighter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Fighter.png -------------------------------------------------------------------------------- /app/src/main/assets/Flanking.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Flanking.jpg -------------------------------------------------------------------------------- /app/src/main/assets/Gunslinger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Gunslinger.png -------------------------------------------------------------------------------- /app/src/main/assets/Inquisitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Inquisitor.png -------------------------------------------------------------------------------- /app/src/main/assets/Magus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Magus.png -------------------------------------------------------------------------------- /app/src/main/assets/Monk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Monk.png -------------------------------------------------------------------------------- /app/src/main/assets/Ninja.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Ninja.png -------------------------------------------------------------------------------- /app/src/main/assets/Oracle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Oracle.png -------------------------------------------------------------------------------- /app/src/main/assets/Paladin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Paladin.png -------------------------------------------------------------------------------- /app/src/main/assets/Ranger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Ranger.png -------------------------------------------------------------------------------- /app/src/main/assets/Rogue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Rogue.png -------------------------------------------------------------------------------- /app/src/main/assets/Samurai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Samurai.png -------------------------------------------------------------------------------- /app/src/main/assets/Sorcerer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Sorcerer.png -------------------------------------------------------------------------------- /app/src/main/assets/SpellAreas.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/SpellAreas.jpg -------------------------------------------------------------------------------- /app/src/main/assets/Summoner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Summoner.png -------------------------------------------------------------------------------- /app/src/main/assets/TacticalMovement.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/TacticalMovement.jpg -------------------------------------------------------------------------------- /app/src/main/assets/Witch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Witch.png -------------------------------------------------------------------------------- /app/src/main/assets/Wizard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/Wizard.png -------------------------------------------------------------------------------- /app/src/main/assets/book-acg.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-acg.db -------------------------------------------------------------------------------- /app/src/main/assets/book-apg.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-apg.db -------------------------------------------------------------------------------- /app/src/main/assets/book-arg.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-arg.db -------------------------------------------------------------------------------- /app/src/main/assets/book-b1.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-b1.db -------------------------------------------------------------------------------- /app/src/main/assets/book-b2.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-b2.db -------------------------------------------------------------------------------- /app/src/main/assets/book-b3.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-b3.db -------------------------------------------------------------------------------- /app/src/main/assets/book-b4.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-b4.db -------------------------------------------------------------------------------- /app/src/main/assets/book-cr.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-cr.db -------------------------------------------------------------------------------- /app/src/main/assets/book-gmg.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-gmg.db -------------------------------------------------------------------------------- /app/src/main/assets/book-ma.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-ma.db -------------------------------------------------------------------------------- /app/src/main/assets/book-mc.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-mc.db -------------------------------------------------------------------------------- /app/src/main/assets/book-npc.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-npc.db -------------------------------------------------------------------------------- /app/src/main/assets/book-oa.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-oa.db -------------------------------------------------------------------------------- /app/src/main/assets/book-ogl.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-ogl.db -------------------------------------------------------------------------------- /app/src/main/assets/book-pfu.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-pfu.db -------------------------------------------------------------------------------- /app/src/main/assets/book-tech.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-tech.db -------------------------------------------------------------------------------- /app/src/main/assets/book-uc.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-uc.db -------------------------------------------------------------------------------- /app/src/main/assets/book-ucampaign.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-ucampaign.db -------------------------------------------------------------------------------- /app/src/main/assets/book-ue.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-ue.db -------------------------------------------------------------------------------- /app/src/main/assets/book-um.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book-um.db -------------------------------------------------------------------------------- /app/src/main/assets/book_mc.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/book_mc.db -------------------------------------------------------------------------------- /app/src/main/assets/hq_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/hq_icon.png -------------------------------------------------------------------------------- /app/src/main/assets/index.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/assets/index.db -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/AsyncTaskResult.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference; 2 | 3 | public class AsyncTaskResult { 4 | private T result; 5 | private Exception error; 6 | 7 | public T getResult() { 8 | return result; 9 | } 10 | 11 | public Exception getError() { 12 | return error; 13 | } 14 | 15 | public AsyncTaskResult(T result) { 16 | super(); 17 | this.result = result; 18 | } 19 | 20 | public AsyncTaskResult(Exception error) { 21 | super(); 22 | this.error = error; 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/DetailsListFragment.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference; 2 | 3 | import org.evilsoft.pathfinder.reference.list.UrlListItem; 4 | 5 | import android.content.Intent; 6 | import android.net.Uri; 7 | import android.util.Log; 8 | import android.view.View; 9 | import android.widget.AdapterView; 10 | 11 | public class DetailsListFragment extends AbstractViewListFragment { 12 | private static final String TAG = "DetailsListFragment"; 13 | 14 | public DetailsListFragment() { 15 | super(); 16 | super.thin = true; 17 | } 18 | 19 | @Override 20 | public void onItemClick(AdapterView parent, View view, int position, 21 | long id) { 22 | if (empty) { 23 | return; 24 | } 25 | String uri = getNextUrl(position); 26 | if (uri != null) { 27 | Log.d(TAG, uri); 28 | if (PathfinderOpenReferenceActivity.isTabletLayout(getActivity())) { 29 | DetailsViewFragment viewer = (DetailsViewFragment) this 30 | .getActivity().getSupportFragmentManager() 31 | .findFragmentById(R.id.details_view_fragment); 32 | viewer.updateUrl(uri, currentUrl); 33 | DetailsActivity da = (DetailsActivity) getActivity(); 34 | da.historyManager.refreshDrawer(); 35 | } else { 36 | Intent showContent = new Intent(this.getActivity() 37 | .getApplicationContext(), DetailsActivity.class); 38 | showContent.setData(Uri.parse(uri)); 39 | startActivity(showContent); 40 | } 41 | } 42 | } 43 | 44 | private String getNextUrl(Integer position) { 45 | UrlListItem item = (UrlListItem) currentListAdapter.getItem(position); 46 | return item.getUrl(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/DisplayListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference; 2 | 3 | import android.content.Context; 4 | import android.database.Cursor; 5 | import android.widget.BaseAdapter; 6 | 7 | public abstract class DisplayListAdapter extends BaseAdapter { 8 | protected Cursor c; 9 | protected Context context; 10 | 11 | public DisplayListAdapter(Context context, Cursor c) { 12 | this.c = c; 13 | this.context = context; 14 | } 15 | 16 | @Override 17 | public int getCount() { 18 | return c.getCount(); 19 | } 20 | 21 | @Override 22 | public Object getItem(int index) { 23 | moveCursor(index); 24 | return buildItem(c); 25 | } 26 | 27 | @Override 28 | public long getItemId(int index) { 29 | c.moveToFirst(); 30 | c.move(index); 31 | return c.getInt(0); 32 | } 33 | 34 | public void moveCursor(int index) { 35 | c.moveToPosition(index); 36 | } 37 | 38 | public void swapCursor(Cursor curs) { 39 | c = curs; 40 | } 41 | 42 | public abstract Object buildItem(Cursor c); 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/MenuItem.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference; 2 | 3 | public class MenuItem { 4 | private Integer id; 5 | private String name; 6 | private String url; 7 | 8 | public Integer getId() { 9 | return id; 10 | } 11 | 12 | public void setId(Integer id) { 13 | this.id = id; 14 | } 15 | 16 | public String getName() { 17 | return name; 18 | } 19 | 20 | public void setName(String name) { 21 | this.name = name; 22 | } 23 | 24 | public String getUrl() { 25 | return url; 26 | } 27 | 28 | public void setUrl(String url) { 29 | this.url = url; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/PathfinderOpenReferenceApplication.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference; 2 | 3 | import android.app.Application; 4 | 5 | public class PathfinderOpenReferenceApplication extends Application { 6 | @Override 7 | public void onCreate() { 8 | super.onCreate(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/SectionViewFragment.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.SectionAdapter; 4 | import org.evilsoft.pathfinder.reference.db.user.CollectionAdapter; 5 | import org.evilsoft.pathfinder.reference.list.BaseListItem; 6 | 7 | import android.content.Intent; 8 | import android.database.Cursor; 9 | import android.net.Uri; 10 | import android.util.Log; 11 | import android.view.View; 12 | import android.widget.AdapterView; 13 | 14 | public class SectionViewFragment extends AbstractViewListFragment { 15 | private static final String TAG = "SectionViewFragment"; 16 | 17 | @Override 18 | public void onItemClick(AdapterView parent, View view, int position, 19 | long id) { 20 | if (empty) { 21 | return; 22 | } 23 | Intent showContent = new Intent(getActivity().getApplicationContext(), 24 | DetailsActivity.class); 25 | String uri = getNextUrl(id, position); 26 | Log.d(TAG, uri); 27 | showContent.setData(Uri.parse(uri)); 28 | showContent.putExtra("context", currentUrl); 29 | startActivity(showContent); 30 | } 31 | 32 | private String getNextUrl(Long id, int position) { 33 | String uri = null; 34 | if ("Bookmarks".equals(currentType)) { 35 | CollectionAdapter ca = new CollectionAdapter( 36 | dbWrangler.getUserDbAdapter()); 37 | Cursor curs = ca.fetchCollectionValue(id.toString()); 38 | try { 39 | boolean has_next = curs.moveToNext(); 40 | if (has_next) { 41 | uri = curs.getString(2); 42 | } 43 | } finally { 44 | curs.close(); 45 | } 46 | return uri; 47 | } else { 48 | BaseListItem item = (BaseListItem) currentListAdapter 49 | .getItem(position); 50 | String url = item.getUrl(); 51 | if (url == null) { 52 | SectionAdapter sa = dbWrangler.getBookDbAdapter( 53 | item.getDatabase()).getSectionAdapter(); 54 | Cursor cursor = sa.fetchParentBySectionId(item.getSectionId()); 55 | try { 56 | if (cursor.moveToFirst()) { 57 | return SectionAdapter.SectionUtils.getUrl(cursor); 58 | } 59 | } finally { 60 | cursor.close(); 61 | } 62 | } 63 | return item.getUrl(); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/api/CasterContentProvider.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.api; 2 | 3 | import org.evilsoft.pathfinder.reference.api.contracts.CasterContract; 4 | 5 | import android.database.Cursor; 6 | import android.database.MatrixCursor; 7 | import android.net.Uri; 8 | 9 | public class CasterContentProvider extends AbstractContentProvider { 10 | public CasterContentProvider() { 11 | uriMatcher.addURI(CasterContract.AUTHORITY, "/casters", 1); 12 | } 13 | 14 | public Cursor getCasterList(String[] projection, String selection, 15 | String[] selectionArgs, String sortOrder) { 16 | return dbWrangler.getIndexDbAdapter().getApiCasterListAdapter() 17 | .getCasters(projection, selection, selectionArgs, sortOrder); 18 | } 19 | 20 | @Override 21 | public Cursor query(Uri uri, String[] projection, String selection, 22 | String[] selectionArgs, String sortOrder) { 23 | if (initializeDatabase()) { 24 | switch (uriMatcher.match(stripExtension(uri))) { 25 | case 1: 26 | return getCasterList(projection, selection, selectionArgs, 27 | sortOrder); 28 | default: 29 | throw new IllegalArgumentException("URI " + uri.toString() 30 | + " Not supported"); 31 | } 32 | } 33 | return new MatrixCursor(selectionArgs, 0); 34 | } 35 | 36 | @Override 37 | public String getType(Uri uri) { 38 | switch (uriMatcher.match(stripExtension(uri))) { 39 | case 1: 40 | return CasterContract.CASTER_LIST_CONTENT_TYPE; 41 | 42 | default: 43 | return null; 44 | } 45 | } 46 | 47 | @Override 48 | public String getFileId(Uri uri) { 49 | return "-1"; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/api/CreatureContentProvider.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.api; 2 | 3 | import org.evilsoft.pathfinder.reference.api.contracts.CreatureContract; 4 | 5 | import android.database.Cursor; 6 | import android.database.MatrixCursor; 7 | import android.net.Uri; 8 | 9 | public class CreatureContentProvider extends AbstractContentProvider { 10 | public CreatureContentProvider() { 11 | uriMatcher.addURI(CreatureContract.AUTHORITY, "creatures", 1); 12 | uriMatcher.addURI(CreatureContract.AUTHORITY, "creatures/#", 1000); 13 | } 14 | 15 | public Cursor getCreatureList(String[] projection, String selection, 16 | String[] selectionArgs, String sortOrder) { 17 | return dbWrangler.getIndexDbAdapter().getApiCreatureListAdapter() 18 | .getCreatures(projection, selection, selectionArgs, sortOrder); 19 | } 20 | 21 | @Override 22 | public Cursor query(Uri uri, String[] projection, String selection, 23 | String[] selectionArgs, String sortOrder) { 24 | if (initializeDatabase()) { 25 | switch (uriMatcher.match(stripExtension(uri))) { 26 | case 1: 27 | return getCreatureList(projection, selection, selectionArgs, 28 | sortOrder); 29 | 30 | case 1000: 31 | throw new IllegalArgumentException("URI " + uri.toString() 32 | + " can only be opened as a file"); 33 | 34 | default: 35 | throw new IllegalArgumentException("URI " + uri.toString() 36 | + " Not supported"); 37 | } 38 | } 39 | return new MatrixCursor(selectionArgs, 0); 40 | } 41 | 42 | @Override 43 | public String getType(Uri uri) { 44 | switch (uriMatcher.match(stripExtension(uri))) { 45 | case 1: 46 | return CreatureContract.CREATURE_LIST_CONTENT_TYPE; 47 | case 1000: 48 | if (uri.getLastPathSegment().endsWith(".html")) { 49 | return "text/html"; 50 | } else if (uri.getLastPathSegment().endsWith(".json")) { 51 | return "application/json"; 52 | } 53 | default: 54 | return null; 55 | } 56 | } 57 | 58 | @Override 59 | public String getFileId(Uri uri) { 60 | if (uriMatcher.match(stripExtension(uri)) >= 1000) { 61 | String last = uri.getLastPathSegment(); 62 | return last.substring(0, last.indexOf(".")); 63 | } 64 | return "-1"; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/api/FeatContentProvider.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.api; 2 | 3 | import org.evilsoft.pathfinder.reference.api.contracts.FeatContract; 4 | 5 | import android.database.Cursor; 6 | import android.database.MatrixCursor; 7 | import android.net.Uri; 8 | 9 | public class FeatContentProvider extends AbstractContentProvider { 10 | public FeatContentProvider() { 11 | uriMatcher.addURI(FeatContract.AUTHORITY, "feats", 1); 12 | uriMatcher.addURI(FeatContract.AUTHORITY, "feats/#", 1000); 13 | } 14 | 15 | public Cursor getFeatList(String[] projection, String selection, 16 | String[] selectionArgs, String sortOrder) { 17 | return dbWrangler.getIndexDbAdapter().getApiFeatListAdapter() 18 | .getFeats(projection, selection, selectionArgs, sortOrder); 19 | } 20 | 21 | @Override 22 | public Cursor query(Uri uri, String[] projection, String selection, 23 | String[] selectionArgs, String sortOrder) { 24 | if (initializeDatabase()) { 25 | switch (uriMatcher.match(stripExtension(uri))) { 26 | case 1: 27 | return getFeatList(projection, selection, selectionArgs, 28 | sortOrder); 29 | 30 | case 1000: 31 | throw new IllegalArgumentException("URI " + uri.toString() 32 | + " can only be opened as a file"); 33 | 34 | default: 35 | throw new IllegalArgumentException("URI " + uri.toString() 36 | + " Not supported"); 37 | } 38 | } 39 | return new MatrixCursor(selectionArgs, 0); 40 | } 41 | 42 | @Override 43 | public String getType(Uri uri) { 44 | switch (uriMatcher.match(stripExtension(uri))) { 45 | case 1: 46 | return FeatContract.FEAT_LIST_CONTENT_TYPE; 47 | case 1000: 48 | if (uri.getLastPathSegment().endsWith(".html")) { 49 | return "text/html"; 50 | } else if (uri.getLastPathSegment().endsWith(".json")) { 51 | return "application/json"; 52 | } 53 | default: 54 | return null; 55 | } 56 | } 57 | 58 | @Override 59 | public String getFileId(Uri uri) { 60 | if (uriMatcher.match(stripExtension(uri)) >= 1000) { 61 | String last = uri.getLastPathSegment(); 62 | return last.substring(0, last.indexOf(".")); 63 | } 64 | return "-1"; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/api/SectionContentProvider.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.api; 2 | 3 | import org.evilsoft.pathfinder.reference.api.contracts.SectionContract; 4 | 5 | import android.database.Cursor; 6 | import android.database.MatrixCursor; 7 | import android.net.Uri; 8 | 9 | public class SectionContentProvider extends AbstractContentProvider { 10 | public SectionContentProvider() { 11 | uriMatcher.addURI(SectionContract.AUTHORITY, "sections", 1); 12 | uriMatcher.addURI(SectionContract.AUTHORITY, "sections/#", 1000); 13 | } 14 | 15 | public Cursor getSectionList(String[] projection, String selection, 16 | String[] selectionArgs, String sortOrder) { 17 | return dbWrangler.getIndexDbAdapter().getApiClassListAdapter() 18 | .getClasses(projection, selection, selectionArgs, sortOrder); 19 | } 20 | 21 | @Override 22 | public Cursor query(Uri uri, String[] projection, String selection, 23 | String[] selectionArgs, String sortOrder) { 24 | if (initializeDatabase()) { 25 | switch (uriMatcher.match(stripExtension(uri))) { 26 | case 1: 27 | return getSectionList(projection, selection, selectionArgs, 28 | sortOrder); 29 | 30 | case 1000: 31 | throw new IllegalArgumentException("URI " + uri.toString() 32 | + " can only be opened as a file"); 33 | 34 | default: 35 | throw new IllegalArgumentException("URI " + uri.toString() 36 | + " Not supported"); 37 | } 38 | } 39 | return new MatrixCursor(selectionArgs, 0); 40 | } 41 | 42 | @Override 43 | public String getType(Uri uri) { 44 | switch (uriMatcher.match(stripExtension(uri))) { 45 | case 1: 46 | return SectionContract.SECTION_LIST_CONTENT_TYPE; 47 | case 1000: 48 | if (uri.getLastPathSegment().endsWith(".html")) { 49 | return "text/html"; 50 | } else if (uri.getLastPathSegment().endsWith(".json")) { 51 | return "application/json"; 52 | } 53 | default: 54 | return null; 55 | } 56 | } 57 | 58 | @Override 59 | public String getFileId(Uri uri) { 60 | if (uriMatcher.match(stripExtension(uri)) >= 1000) { 61 | String last = uri.getLastPathSegment(); 62 | return last.substring(0, last.indexOf(".")); 63 | } 64 | return "-1"; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/api/SkillContentProvider.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.api; 2 | 3 | import org.evilsoft.pathfinder.reference.api.contracts.SkillContract; 4 | 5 | import android.database.Cursor; 6 | import android.database.MatrixCursor; 7 | import android.net.Uri; 8 | 9 | public class SkillContentProvider extends AbstractContentProvider { 10 | public SkillContentProvider() { 11 | uriMatcher.addURI(SkillContract.AUTHORITY, "skills", 1); 12 | uriMatcher.addURI(SkillContract.AUTHORITY, "skills/#", 1000); 13 | } 14 | 15 | public Cursor getSkillList(String[] projection, String selection, 16 | String[] selectionArgs, String sortOrder) { 17 | return dbWrangler.getIndexDbAdapter().getApiSkillListAdapter() 18 | .getSkills(projection, selection, selectionArgs, sortOrder); 19 | } 20 | 21 | @Override 22 | public Cursor query(Uri uri, String[] projection, String selection, 23 | String[] selectionArgs, String sortOrder) { 24 | if (initializeDatabase()) { 25 | switch (uriMatcher.match(stripExtension(uri))) { 26 | case 1: 27 | return getSkillList(projection, selection, selectionArgs, 28 | sortOrder); 29 | 30 | case 1000: 31 | throw new IllegalArgumentException("URI " + uri.toString() 32 | + " can only be opened as a file"); 33 | 34 | default: 35 | throw new IllegalArgumentException("URI " + uri.toString() 36 | + " Not supported"); 37 | } 38 | } 39 | return new MatrixCursor(selectionArgs, 0); 40 | } 41 | 42 | @Override 43 | public String getType(Uri uri) { 44 | switch (uriMatcher.match(stripExtension(uri))) { 45 | case 1: 46 | return SkillContract.SKILL_LIST_CONTENT_TYPE; 47 | case 1000: 48 | if (uri.getLastPathSegment().endsWith(".html")) { 49 | return "text/html"; 50 | } else if (uri.getLastPathSegment().endsWith(".json")) { 51 | return "application/json"; 52 | } 53 | default: 54 | return null; 55 | } 56 | } 57 | 58 | @Override 59 | public String getFileId(Uri uri) { 60 | if (uriMatcher.match(stripExtension(uri)) >= 1000) { 61 | String last = uri.getLastPathSegment(); 62 | return last.substring(0, last.indexOf(".")); 63 | } 64 | return "-1"; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/BookNotFoundException.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db; 2 | 3 | public class BookNotFoundException extends Exception { 4 | private static final long serialVersionUID = 4238742662526288644L; 5 | 6 | public BookNotFoundException() { 7 | } 8 | 9 | public BookNotFoundException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/AbilityAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class AbilityAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public AbilityAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor getAbilityTypes(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT ability_type"); 25 | sb.append(" FROM ability_types"); 26 | sb.append(" WHERE section_id = ?"); 27 | String sql = sb.toString(); 28 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 29 | } 30 | 31 | public static class AbilityUtils { 32 | private AbilityUtils() { 33 | } 34 | 35 | public static String getAbilityType(Cursor cursor) { 36 | return cursor.getString(0); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/AfflictionAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class AfflictionAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public AfflictionAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor getAfflictionDetails(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT contracted, addiction, save, onset, frequency, effect, initial_effect, "); 25 | sb.append(" secondary_effect, damage, cure, cost"); 26 | sb.append(" FROM affliction_details"); 27 | sb.append(" WHERE section_id = ?"); 28 | String sql = sb.toString(); 29 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 30 | } 31 | 32 | public static class AfflictionUtils { 33 | private AfflictionUtils() { 34 | } 35 | 36 | public static String getContracted(Cursor cursor) { return cursor.getString(0); } 37 | public static String getAddiction(Cursor cursor) { return cursor.getString(1); } 38 | public static String getSave(Cursor cursor) { return cursor.getString(2); } 39 | public static String getOnset(Cursor cursor) { 40 | return cursor.getString(3); 41 | } 42 | public static String getFrequency(Cursor cursor) { 43 | return cursor.getString(4); 44 | } 45 | public static String getEffect(Cursor cursor) { return cursor.getString(5); } 46 | public static String getInitialEffect(Cursor cursor) { 47 | return cursor.getString(6); 48 | } 49 | public static String getSecondaryEffect(Cursor cursor) { 50 | return cursor.getString(7); 51 | } 52 | public static String getDamage(Cursor cursor) { 53 | return cursor.getString(8); 54 | } 55 | public static String getCure(Cursor cursor) { 56 | return cursor.getString(9); 57 | } 58 | public static String getCost(Cursor cursor) { 59 | return cursor.getString(10); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/BookDbHelper.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 4 | 5 | import android.content.Context; 6 | import android.database.Cursor; 7 | import android.database.sqlite.SQLiteDatabase; 8 | 9 | public class BookDbHelper extends BaseDbHelper { 10 | 11 | public BookDbHelper(Context context, String db_name) { 12 | super(context, db_name); 13 | } 14 | 15 | public boolean testDb(SQLiteDatabase database) { 16 | StringBuilder sb = new StringBuilder(); 17 | sb.append("SELECT count(*)"); 18 | sb.append(" FROM section_index"); 19 | String sql = sb.toString(); 20 | Cursor curs = database.rawQuery(sql, new String[0]); 21 | try { 22 | curs.moveToFirst(); 23 | curs.getInt(0); 24 | } finally { 25 | curs.close(); 26 | } 27 | return true; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/ClassAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class ClassAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public ClassAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor fetchClassDetails(Integer section_id) { 21 | List args = new ArrayList(); 22 | args.add(section_id.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT alignment, hit_die"); 25 | sb.append(" FROM class_details"); 26 | sb.append(" WHERE section_id = ?"); 27 | String sql = sb.toString(); 28 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 29 | } 30 | 31 | public static class ClassUtils { 32 | private ClassUtils() { 33 | } 34 | 35 | public static String getAlignment(Cursor cursor) { 36 | return cursor.getString(0); 37 | } 38 | public static String getHitDie(Cursor cursor) { 39 | return cursor.getString(1); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/FeatAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class FeatAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public FeatAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor fetchFeatTypeDescriptionForSection(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT feat_type_description"); 25 | sb.append(" FROM feat_type_descriptions"); 26 | sb.append(" WHERE section_id = ?"); 27 | sb.append(" ORDER BY feat_type_description"); 28 | String sql = sb.toString(); 29 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 30 | } 31 | 32 | public String renderFeatTypeDescription(Integer sectionId) { 33 | Cursor curs = fetchFeatTypeDescriptionForSection(sectionId); 34 | try { 35 | StringBuilder sb = new StringBuilder(); 36 | boolean has_next = curs.moveToFirst(); 37 | while (has_next) { 38 | sb.append(curs.getString(0)); 39 | has_next = curs.moveToNext(); 40 | } 41 | return sb.toString(); 42 | } finally { 43 | curs.close(); 44 | } 45 | } 46 | 47 | public Cursor getFeatTypes(Integer sectionId) { 48 | List args = new ArrayList(); 49 | args.add(sectionId.toString()); 50 | StringBuilder sb = new StringBuilder(); 51 | sb.append("SELECT feat_type"); 52 | sb.append(" FROM feat_types"); 53 | sb.append(" WHERE section_id = ?"); 54 | sb.append(" ORDER BY feat_type"); 55 | String sql = sb.toString(); 56 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 57 | } 58 | 59 | public static class FeatTypeUtils { 60 | private FeatTypeUtils() { 61 | } 62 | 63 | public static String getFeatType(Cursor cursor) { 64 | return cursor.getString(0); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/HauntAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class HauntAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public HauntAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor getHauntDetails(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT cr, xp, haunt_type, notice, area, hp, destruction, alignment, caster_level, effect, trigger, reset"); 25 | sb.append(" FROM haunt_details"); 26 | sb.append(" WHERE section_id = ?"); 27 | String sql = sb.toString(); 28 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 29 | } 30 | 31 | public static class HauntUtils { 32 | private HauntUtils() { 33 | } 34 | 35 | public static String getCr(Cursor cursor) { 36 | return cursor.getString(0); 37 | } 38 | public static String getXp(Cursor cursor) { 39 | return cursor.getString(1); 40 | } 41 | public static String getHauntType(Cursor cursor) { 42 | return cursor.getString(2); 43 | } 44 | public static String getNotice(Cursor cursor) { 45 | return cursor.getString(3); 46 | } 47 | public static String getArea(Cursor cursor) { 48 | return cursor.getString(4); 49 | } 50 | public static String getHp(Cursor cursor) { 51 | return cursor.getString(5); 52 | } 53 | public static String getDestruction(Cursor cursor) { 54 | return cursor.getString(6); 55 | } 56 | public static String getAlignment(Cursor cursor) { 57 | return cursor.getString(7); 58 | } 59 | public static String getCasterLevel(Cursor cursor) { 60 | return cursor.getString(8); 61 | } 62 | public static String getEffect(Cursor cursor) { 63 | return cursor.getString(9); 64 | } 65 | public static String getTrigger(Cursor cursor) { 66 | return cursor.getString(10); 67 | } 68 | public static String getReset(Cursor cursor) { 69 | return cursor.getString(11); 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/KingdomResourceAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class KingdomResourceAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public KingdomResourceAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor getKingdomResourceDetails(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT bp, lot, kingdom, discount, magic_items,"); 25 | sb.append(" settlement, special, resource_limit, upgrade_from,"); 26 | sb.append(" upgrade_to"); 27 | sb.append(" FROM kingdom_resource_details"); 28 | sb.append(" WHERE section_id = ?"); 29 | String sql = sb.toString(); 30 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 31 | } 32 | 33 | public static class KingdomResourceUtils { 34 | private KingdomResourceUtils() { 35 | } 36 | 37 | public static String getBp(Cursor cursor) { 38 | return cursor.getString(0); 39 | } 40 | 41 | public static String getLot(Cursor cursor) { 42 | return cursor.getString(1); 43 | } 44 | 45 | public static String getKingdom(Cursor cursor) { 46 | return cursor.getString(2); 47 | } 48 | 49 | public static String getDiscount(Cursor cursor) { 50 | return cursor.getString(3); 51 | } 52 | 53 | public static String getMagicItems(Cursor cursor) { 54 | return cursor.getString(4); 55 | } 56 | 57 | public static String getSettlement(Cursor cursor) { 58 | return cursor.getString(5); 59 | } 60 | 61 | public static String getSpecial(Cursor cursor) { 62 | return cursor.getString(6); 63 | } 64 | 65 | public static String getLimit(Cursor cursor) { 66 | return cursor.getString(7); 67 | } 68 | 69 | public static String getUpgradeFrom(Cursor cursor) { 70 | return cursor.getString(8); 71 | } 72 | 73 | public static String getUpgradeTo(Cursor cursor) { 74 | return cursor.getString(9); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/LinkAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class LinkAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public LinkAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor getLinkDetails(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT section_id, url, display"); 25 | sb.append(" FROM link_details"); 26 | sb.append(" WHERE section_id = ?"); 27 | sb.append(" LIMIT 1"); 28 | String sql = sb.toString(); 29 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 30 | } 31 | 32 | public static class LinkUtils { 33 | private LinkUtils() { 34 | } 35 | 36 | public static Integer getSectionId(Cursor cursor) { 37 | return cursor.getInt(0); 38 | } 39 | public static String getUrl(Cursor cursor) { 40 | return cursor.getString(1); 41 | } 42 | public static Integer getDisplay(Cursor cursor) { 43 | return cursor.getInt(2); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/MythicSpellDetailAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class MythicSpellDetailAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public MythicSpellDetailAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor fetchMythicSpellDetails(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT section_id, spell_source"); 25 | sb.append(" FROM mythic_spell_details"); 26 | sb.append(" WHERE section_id = ?"); 27 | String sql = sb.toString(); 28 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 29 | } 30 | 31 | public Cursor fetchMythicSpellDetailsByName(String spellName) { 32 | List args = new ArrayList(); 33 | args.add(spellName); 34 | StringBuilder sb = new StringBuilder(); 35 | sb.append("SELECT section_id, spell_source"); 36 | sb.append(" FROM mythic_spell_details"); 37 | sb.append(" WHERE spell_source = ?"); 38 | String sql = sb.toString(); 39 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 40 | } 41 | 42 | public static class MythicSpellDetailUtils { 43 | private MythicSpellDetailUtils() { 44 | } 45 | 46 | public static Integer getSectionId(Cursor cursor) { 47 | return cursor.getInt(0); 48 | } 49 | 50 | public static String getSpellSource(Cursor cursor) { 51 | return cursor.getString(1); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/ResourceAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class ResourceAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public ResourceAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor getResourceDetails(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT benefit, resource_create, earnings, rooms, size, "); 25 | sb.append(" skills, teams, time, upgrade_from, upgrade_to, wage"); 26 | sb.append(" FROM resource_details"); 27 | sb.append(" WHERE section_id = ?"); 28 | String sql = sb.toString(); 29 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 30 | } 31 | 32 | public static class ResourceUtils { 33 | private ResourceUtils() { 34 | } 35 | 36 | public static String getBenefit(Cursor cursor) { 37 | return cursor.getString(0); 38 | } 39 | 40 | public static String getCreate(Cursor cursor) { 41 | return cursor.getString(1); 42 | } 43 | 44 | public static String getEarnings(Cursor cursor) { 45 | return cursor.getString(2); 46 | } 47 | 48 | public static String getRooms(Cursor cursor) { 49 | return cursor.getString(3); 50 | } 51 | 52 | public static String getSize(Cursor cursor) { 53 | return cursor.getString(4); 54 | } 55 | 56 | public static String getSkills(Cursor cursor) { 57 | return cursor.getString(5); 58 | } 59 | 60 | public static String getTeams(Cursor cursor) { 61 | return cursor.getString(6); 62 | } 63 | 64 | public static String getTime(Cursor cursor) { 65 | return cursor.getString(7); 66 | } 67 | 68 | public static String getUpgradeFrom(Cursor cursor) { 69 | return cursor.getString(8); 70 | } 71 | 72 | public static String getUpgradeTo(Cursor cursor) { 73 | return cursor.getString(9); 74 | } 75 | 76 | public static String getWage(Cursor cursor) { 77 | return cursor.getString(10); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/SectionIndexGroupAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class SectionIndexGroupAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public SectionIndexGroupAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor fetchSectionByParentUrl(String parentUrl) { 21 | List args = new ArrayList(); 22 | args.add(parentUrl); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT s.section_id, '" + dbName + "' as database, "); 25 | sb.append(" s.name, s.parent_id, p.name as parent_name, s.source,"); 26 | sb.append(" s.type, s.subtype, s.description, s.url"); 27 | sb.append(" FROM sections s"); 28 | sb.append(" INNER JOIN sections p"); 29 | sb.append(" ON s.parent_id = p.section_id"); 30 | sb.append(" WHERE p.url = ?"); 31 | String sql = sb.toString(); 32 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 33 | } 34 | 35 | public static class SectionGroupIndexUtils { 36 | private SectionGroupIndexUtils() { 37 | } 38 | 39 | public static Integer getSectionId(Cursor cursor) { 40 | return cursor.getInt(0); 41 | } 42 | 43 | public static String getDatabase(Cursor cursor) { 44 | return cursor.getString(1); 45 | } 46 | 47 | public static String getName(Cursor cursor) { 48 | return cursor.getString(2); 49 | } 50 | 51 | public static Integer getParentId(Cursor cursor) { 52 | return cursor.getInt(3); 53 | } 54 | 55 | public static String getParentName(Cursor cursor) { 56 | return cursor.getString(4); 57 | } 58 | 59 | public static String getSource(Cursor cursor) { 60 | return cursor.getString(5); 61 | } 62 | 63 | public static String getType(Cursor cursor) { 64 | return cursor.getString(6); 65 | } 66 | 67 | public static String getSubtype(Cursor cursor) { 68 | return cursor.getString(7); 69 | } 70 | 71 | public static String getDescription(Cursor cursor) { 72 | return cursor.getString(8); 73 | } 74 | 75 | public static String getUrl(Cursor cursor) { 76 | return cursor.getString(9); 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/SkillAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class SkillAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public SkillAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor fetchSkillAttr(Integer section_id) { 21 | List args = new ArrayList(); 22 | args.add(section_id.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT attribute, armor_check_penalty, trained_only"); 25 | sb.append(" FROM skill_attributes"); 26 | sb.append(" WHERE section_id = ?"); 27 | String sql = sb.toString(); 28 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 29 | } 30 | 31 | public static class SkillUtils { 32 | private SkillUtils() { 33 | } 34 | 35 | public static String getAttribute(Cursor cursor) { 36 | return cursor.getString(0); 37 | } 38 | public static Integer getArmorCheckPenalty(Cursor cursor) { 39 | return cursor.getInt(1); 40 | } 41 | public static Integer getTrainedOnly(Cursor cursor) { 42 | return cursor.getInt(2); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/SpellComponentAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class SpellComponentAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public SpellComponentAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor fetchSpellComponents(Integer section_id) { 21 | List args = new ArrayList(); 22 | args.add(section_id.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT component_type, description"); 25 | sb.append(" FROM spell_components"); 26 | sb.append(" WHERE section_id = ?"); 27 | String sql = sb.toString(); 28 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 29 | } 30 | 31 | public static class SpellComponentUtils { 32 | private SpellComponentUtils() { 33 | } 34 | 35 | public static String getComponentType(Cursor cursor) { 36 | return cursor.getString(0); 37 | } 38 | public static String getDescription(Cursor cursor) { 39 | return cursor.getString(1); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/SpellDescriptorAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class SpellDescriptorAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public SpellDescriptorAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor getSpellDescriptors(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT descriptor"); 25 | sb.append(" FROM spell_descriptors"); 26 | sb.append(" WHERE section_id = ?"); 27 | String sql = sb.toString(); 28 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 29 | } 30 | 31 | public static class SpellDescriptorUtils { 32 | private SpellDescriptorUtils() { 33 | } 34 | 35 | public static String getDescriptor(Cursor cursor) { 36 | return cursor.getString(0); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/SpellEffectAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class SpellEffectAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public SpellEffectAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor fetchSpellEffects(Integer section_id) { 21 | List args = new ArrayList(); 22 | args.add(section_id.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT name, description"); 25 | sb.append(" FROM spell_effects"); 26 | sb.append(" WHERE section_id = ?"); 27 | String sql = sb.toString(); 28 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 29 | } 30 | 31 | public static class SpellEffectUtils { 32 | private SpellEffectUtils() { 33 | } 34 | 35 | public static String getName(Cursor cursor) { 36 | return cursor.getString(0); 37 | } 38 | public static String getDescription(Cursor cursor) { 39 | return cursor.getString(1); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/SpellListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class SpellListAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public SpellListAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor getSpellLists(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT level, type, name, notes, magic_type"); 25 | sb.append(" FROM spell_lists"); 26 | sb.append(" WHERE section_id = ?"); 27 | String sql = sb.toString(); 28 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 29 | } 30 | 31 | public static class SpellListUtils { 32 | private SpellListUtils() { 33 | } 34 | 35 | public static Integer getLevel(Cursor cursor) { 36 | return cursor.getInt(0); 37 | } 38 | 39 | public static String getType(Cursor cursor) { 40 | return cursor.getString(1); 41 | } 42 | 43 | public static String getName(Cursor cursor) { 44 | return cursor.getString(2); 45 | } 46 | 47 | public static String getNotes(Cursor cursor) { 48 | return cursor.getString(3); 49 | } 50 | 51 | public static String getMagicType(Cursor cursor) { 52 | return cursor.getString(4); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/SpellSubschoolAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class SpellSubschoolAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public SpellSubschoolAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor getSpellSubschools(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT subschool"); 25 | sb.append(" FROM spell_subschools"); 26 | sb.append(" WHERE section_id = ?"); 27 | String sql = sb.toString(); 28 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 29 | } 30 | 31 | public static class SpellSubschoolUtils { 32 | private SpellSubschoolUtils() { 33 | } 34 | 35 | public static String getSubschool(Cursor cursor) { 36 | return cursor.getString(0); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/TalentAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import android.database.Cursor; 4 | import android.database.sqlite.SQLiteDatabase; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | public class TalentAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public TalentAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor getTalentDetails(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT element, talent_type, blast_type, level, burn, damage, prerequisite, "); 25 | sb.append(" associated_blasts, saving_throw, spell_resistance"); 26 | sb.append(" FROM talent_details"); 27 | sb.append(" WHERE section_id = ?"); 28 | String sql = sb.toString(); 29 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 30 | } 31 | 32 | public static class TalentUtils { 33 | private TalentUtils() { 34 | } 35 | 36 | public static String getElement(Cursor cursor) { return cursor.getString(0); } 37 | public static String getTalentType(Cursor cursor) { return cursor.getString(1); } 38 | public static String getBlastType(Cursor cursor) { return cursor.getString(2); } 39 | public static String getLevel(Cursor cursor) { return cursor.getString(3); } 40 | public static String getBurn(Cursor cursor) { return cursor.getString(4); } 41 | public static String getDamage(Cursor cursor) { 42 | return cursor.getString(5); 43 | } 44 | public static String getPrerequisite(Cursor cursor) { return cursor.getString(6); } 45 | public static String getAssociatedBlasts(Cursor cursor) { 46 | return cursor.getString(7); 47 | } 48 | public static String getSavingThrow(Cursor cursor) { return cursor.getString(8); } 49 | public static String getSpellResistance(Cursor cursor) { return cursor.getString(9); } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/book/TrapAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.book; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | 8 | import android.database.Cursor; 9 | import android.database.sqlite.SQLiteDatabase; 10 | 11 | public class TrapAdapter { 12 | public SQLiteDatabase database; 13 | public String dbName; 14 | 15 | public TrapAdapter(SQLiteDatabase database, String dbName) { 16 | this.database = database; 17 | this.dbName = dbName; 18 | } 19 | 20 | public Cursor getTrapDetails(Integer sectionId) { 21 | List args = new ArrayList(); 22 | args.add(sectionId.toString()); 23 | StringBuilder sb = new StringBuilder(); 24 | sb.append("SELECT cr, trap_type, perception, disable_device, duration, effect, trigger, reset"); 25 | sb.append(" FROM trap_details"); 26 | sb.append(" WHERE section_id = ?"); 27 | String sql = sb.toString(); 28 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 29 | } 30 | 31 | public static class TrapUtils { 32 | private TrapUtils() { 33 | } 34 | 35 | public static String getCr(Cursor cursor) { 36 | return cursor.getString(0); 37 | } 38 | public static String getTrapType(Cursor cursor) { 39 | return cursor.getString(1); 40 | } 41 | public static String getPerception(Cursor cursor) { 42 | return cursor.getString(2); 43 | } 44 | public static String getDisableDevice(Cursor cursor) { 45 | return cursor.getString(3); 46 | } 47 | public static String getDuration(Cursor cursor) { 48 | return cursor.getString(4); 49 | } 50 | public static String getEffect(Cursor cursor) { 51 | return cursor.getString(5); 52 | } 53 | public static String getTrigger(Cursor cursor) { 54 | return cursor.getString(6); 55 | } 56 | public static String getReset(Cursor cursor) { 57 | return cursor.getString(7); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/ApiCasterListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 9 | 10 | import android.content.Context; 11 | import android.database.Cursor; 12 | import android.database.sqlite.SQLiteDatabase; 13 | import android.util.Log; 14 | 15 | public class ApiCasterListAdapter { 16 | public SQLiteDatabase database; 17 | public Context context; 18 | private static final String TAG = "ApiCasterListAdapter"; 19 | 20 | public ApiCasterListAdapter(SQLiteDatabase database, Context context) { 21 | this.database = database; 22 | this.context = context; 23 | } 24 | 25 | protected static List columns = new ArrayList(); 26 | protected static Map translation = new HashMap(); 27 | 28 | static { 29 | columns.add("_id"); 30 | columns.add("class"); 31 | columns.add("level"); 32 | columns.add("magic_type"); 33 | translation.put("_id", "i.index_id as _id"); 34 | } 35 | 36 | public Cursor getCasters(String[] projection, String selection, 37 | String[] selectionArgs, String sortOrder) { 38 | StringBuilder sb = new StringBuilder(); 39 | sb.append("SELECT "); 40 | sb.append(BaseDbHelper.implementProjection(columns, projection, 41 | translation)); 42 | sb.append(" FROM spell_list_index AS sli"); 43 | sb.append(" INNER JOIN central_index AS i"); 44 | sb.append(" ON i.name = sli.name"); 45 | sb.append(" AND i.type = 'class'"); 46 | if (selection != null) { 47 | sb.append(" WHERE"); 48 | sb.append(selection); 49 | } 50 | sb.append(" GROUP BY name, level"); 51 | if (sortOrder != null) { 52 | sb.append(" ORDER BY "); 53 | sb.append(sortOrder); 54 | } else { 55 | sb.append(" ORDER BY name, level"); 56 | } 57 | String sql = sb.toString(); 58 | Log.d(TAG, database == null ? "null" : database.toString()); 59 | return database.rawQuery(sql, selectionArgs); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/ApiCreatureListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 9 | 10 | import android.content.Context; 11 | import android.database.Cursor; 12 | import android.database.sqlite.SQLiteDatabase; 13 | 14 | public class ApiCreatureListAdapter { 15 | public SQLiteDatabase database; 16 | public Context context; 17 | 18 | public ApiCreatureListAdapter(SQLiteDatabase database, Context context) { 19 | this.database = database; 20 | this.context = context; 21 | } 22 | 23 | protected static List columns = new ArrayList(); 24 | protected static Map translation = new HashMap(); 25 | 26 | static { 27 | columns.add("_id"); 28 | columns.add("source"); 29 | columns.add("type"); 30 | columns.add("subtype"); 31 | columns.add("name"); 32 | columns.add("description"); 33 | columns.add("content_url"); 34 | columns.add("creature_type"); 35 | columns.add("creature_subtype"); 36 | columns.add("super_race"); 37 | columns.add("cr"); 38 | columns.add("xp"); 39 | columns.add("size"); 40 | columns.add("alignment"); 41 | translation.put("_id", "index_id as _id"); 42 | translation.put("content_url", "url as content_url"); 43 | translation.put("skill_attribute", "attribute as skill_attribute"); 44 | translation.put("super_race", "super_race as creature_super_race"); 45 | translation.put("cr", "cr as creature_cr"); 46 | translation.put("xp", "xp as creature_xp"); 47 | translation.put("size", "size as creature_size"); 48 | translation.put("alignment", "alignment as creature_alignment"); 49 | } 50 | 51 | public Cursor getCreatures(String[] projection, String selection, 52 | String[] selectionArgs, String sortOrder) { 53 | StringBuilder sb = new StringBuilder(); 54 | sb.append("SELECT "); 55 | sb.append(BaseDbHelper.implementProjection(columns, projection, 56 | translation)); 57 | sb.append(" FROM central_index"); 58 | sb.append(" WHERE type = 'skill'"); 59 | if (selection != null) { 60 | sb.append(" AND "); 61 | sb.append(selection); 62 | } 63 | if (sortOrder != null) { 64 | sb.append(" ORDER BY "); 65 | sb.append(sortOrder); 66 | } else { 67 | sb.append(" ORDER BY name"); 68 | } 69 | String sql = sb.toString(); 70 | return database.rawQuery(sql, selectionArgs); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/ApiFeatListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 9 | 10 | import android.content.Context; 11 | import android.database.Cursor; 12 | import android.database.sqlite.SQLiteDatabase; 13 | 14 | public class ApiFeatListAdapter { 15 | public SQLiteDatabase database; 16 | public Context context; 17 | 18 | public ApiFeatListAdapter(SQLiteDatabase database, Context context) { 19 | this.database = database; 20 | this.context = context; 21 | } 22 | 23 | protected static List columns = new ArrayList(); 24 | protected static Map translation = new HashMap(); 25 | 26 | static { 27 | columns.add("_id"); 28 | columns.add("source"); 29 | columns.add("type"); 30 | columns.add("subtype"); 31 | columns.add("name"); 32 | columns.add("description"); 33 | columns.add("content_url"); 34 | columns.add("feat_types"); 35 | columns.add("prerequisites"); 36 | translation.put("_id", "index_id as _id"); 37 | translation.put("content_url", "url as content_url"); 38 | translation.put("prerequisites", "prerequisites as feat_prerequisites"); 39 | } 40 | 41 | public Cursor getFeats(String[] projection, String selection, 42 | String[] selectionArgs, String sortOrder) { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append("SELECT "); 45 | sb.append(BaseDbHelper.implementProjection(columns, projection, 46 | translation)); 47 | sb.append(" FROM central_index"); 48 | sb.append(" WHERE type = 'feat'"); 49 | if (selection != null) { 50 | sb.append(" AND "); 51 | sb.append(selection); 52 | } 53 | if (sortOrder != null) { 54 | sb.append(" ORDER BY "); 55 | sb.append(sortOrder); 56 | } else { 57 | sb.append(" ORDER BY name"); 58 | } 59 | String sql = sb.toString(); 60 | return database.rawQuery(sql, selectionArgs); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/ApiSectionListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 9 | 10 | import android.content.Context; 11 | import android.database.Cursor; 12 | import android.database.sqlite.SQLiteDatabase; 13 | 14 | public class ApiSectionListAdapter { 15 | public SQLiteDatabase database; 16 | public Context context; 17 | 18 | public ApiSectionListAdapter(SQLiteDatabase database, Context context) { 19 | this.database = database; 20 | this.context = context; 21 | } 22 | 23 | protected static List columns = new ArrayList(); 24 | protected static Map translation = new HashMap(); 25 | 26 | static { 27 | columns.add("_id"); 28 | columns.add("source"); 29 | columns.add("type"); 30 | columns.add("subtype"); 31 | columns.add("name"); 32 | columns.add("description"); 33 | columns.add("content_url"); 34 | translation.put("_id", "index_id as _id"); 35 | translation.put("content_url", "url as content_url"); 36 | } 37 | 38 | public Cursor getClasses(String[] projection, String selection, 39 | String[] selectionArgs, String sortOrder) { 40 | StringBuilder sb = new StringBuilder(); 41 | sb.append("SELECT "); 42 | sb.append(BaseDbHelper.implementProjection(columns, projection, 43 | translation)); 44 | sb.append(" FROM central_index"); 45 | sb.append(" WHERE type = 'class'"); 46 | if (selection != null) { 47 | sb.append(" AND "); 48 | sb.append(selection); 49 | } 50 | if (sortOrder != null) { 51 | sb.append(" ORDER BY "); 52 | sb.append(sortOrder); 53 | } else { 54 | sb.append(" ORDER BY name"); 55 | } 56 | String sql = sb.toString(); 57 | return database.rawQuery(sql, selectionArgs); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/ApiSkillListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 9 | 10 | import android.content.Context; 11 | import android.database.Cursor; 12 | import android.database.sqlite.SQLiteDatabase; 13 | 14 | public class ApiSkillListAdapter { 15 | public SQLiteDatabase database; 16 | public Context context; 17 | 18 | public ApiSkillListAdapter(SQLiteDatabase database, Context context) { 19 | this.database = database; 20 | this.context = context; 21 | } 22 | 23 | protected static List columns = new ArrayList(); 24 | protected static Map translation = new HashMap(); 25 | 26 | static { 27 | columns.add("_id"); 28 | columns.add("source"); 29 | columns.add("type"); 30 | columns.add("subtype"); 31 | columns.add("name"); 32 | columns.add("description"); 33 | columns.add("content_url"); 34 | columns.add("attribute"); 35 | columns.add("armor_check_penalty"); 36 | columns.add("trained_only"); 37 | translation.put("_id", "index_id as _id"); 38 | translation.put("content_url", "url as content_url"); 39 | translation.put("attribute", "attribute as skill_attribute"); 40 | translation.put("armor_check_penalty", 41 | "armor_check_penalty as skill_armor_check_penalty"); 42 | translation.put("trained_only", "trained_only as skill_trained_only"); 43 | } 44 | 45 | public Cursor getSkills(String[] projection, String selection, 46 | String[] selectionArgs, String sortOrder) { 47 | StringBuilder sb = new StringBuilder(); 48 | sb.append("SELECT "); 49 | sb.append(BaseDbHelper.implementProjection(columns, projection, 50 | translation)); 51 | sb.append(" FROM central_index"); 52 | sb.append(" WHERE type = 'skill'"); 53 | if (selection != null) { 54 | sb.append(" AND "); 55 | sb.append(selection); 56 | } 57 | if (sortOrder != null) { 58 | sb.append(" ORDER BY "); 59 | sb.append(sortOrder); 60 | } else { 61 | sb.append(" ORDER BY name"); 62 | } 63 | String sql = sb.toString(); 64 | return database.rawQuery(sql, selectionArgs); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/ApiSpellListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 9 | 10 | import android.content.Context; 11 | import android.database.Cursor; 12 | import android.database.sqlite.SQLiteDatabase; 13 | 14 | public class ApiSpellListAdapter { 15 | public SQLiteDatabase database; 16 | public Context context; 17 | 18 | public ApiSpellListAdapter(SQLiteDatabase database, Context context) { 19 | this.database = database; 20 | this.context = context; 21 | } 22 | 23 | protected static List columns = new ArrayList(); 24 | protected static Map translation = new HashMap(); 25 | 26 | static { 27 | columns.add("_id"); 28 | columns.add("source"); 29 | columns.add("type"); 30 | columns.add("subtype"); 31 | columns.add("name"); 32 | columns.add("description"); 33 | columns.add("content_url"); 34 | columns.add("school"); 35 | columns.add("subschool"); 36 | columns.add("descriptor"); 37 | columns.add("classes"); 38 | columns.add("components"); 39 | translation.put("_id", "index_id as _id"); 40 | translation.put("content_url", "url as content_url"); 41 | translation.put("school", "spell_school as school"); 42 | translation.put("subschool", "spell_subschool_text as subschool"); 43 | translation.put("descriptor", "spell_descriptor_text as descriptor"); 44 | translation.put("classes", "spell_list_text as classes"); 45 | translation.put("components", "spell_component_text as components"); 46 | } 47 | 48 | public Cursor getSpells(String[] projection, String selection, 49 | String[] selectionArgs, String sortOrder) { 50 | StringBuilder sb = new StringBuilder(); 51 | sb.append("SELECT "); 52 | sb.append(BaseDbHelper.implementProjection(columns, projection, 53 | translation)); 54 | sb.append(" FROM central_index"); 55 | sb.append(" WHERE type = 'spell'"); 56 | if (selection != null) { 57 | sb.append(" AND "); 58 | sb.append(selection); 59 | } 60 | if (sortOrder != null) { 61 | sb.append(" ORDER BY "); 62 | sb.append(sortOrder); 63 | } else { 64 | sb.append(" ORDER BY name"); 65 | } 66 | String sql = sb.toString(); 67 | return database.rawQuery(sql, selectionArgs); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/BooksAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | import org.evilsoft.pathfinder.reference.preference.FilterPreferenceManager; 8 | 9 | import android.content.Context; 10 | import android.database.Cursor; 11 | import android.database.sqlite.SQLiteDatabase; 12 | 13 | public class BooksAdapter { 14 | public SQLiteDatabase database; 15 | public Context context; 16 | 17 | public BooksAdapter(SQLiteDatabase database, Context context) { 18 | this.database = database; 19 | this.context = context; 20 | } 21 | 22 | public Cursor fetchBook(String source) { 23 | List args = new ArrayList(); 24 | StringBuilder sb = new StringBuilder(); 25 | sb.append("SELECT book_id, source, db"); 26 | sb.append(" FROM books"); 27 | sb.append(" WHERE source = ?"); 28 | args.add(source); 29 | sb.append(FilterPreferenceManager.getSourceFilter(context, args, "AND")); 30 | sb.append(" LIMIT 1"); 31 | String sql = sb.toString(); 32 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 33 | } 34 | 35 | public static class BookUtils { 36 | private BookUtils() { 37 | } 38 | 39 | public static String getBookDb(Cursor cursor) { 40 | boolean hasnext = cursor.moveToFirst(); 41 | if(hasnext) { 42 | return getDb(cursor); 43 | } 44 | return null; 45 | } 46 | 47 | public static Integer getBookId(Cursor cursor) { 48 | return cursor.getInt(0); 49 | } 50 | 51 | public static String getSource(Cursor cursor) { 52 | return cursor.getString(1); 53 | } 54 | 55 | public static String getDb(Cursor cursor) { 56 | return cursor.getString(2); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/CountAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | import org.evilsoft.pathfinder.reference.preference.FilterPreferenceManager; 8 | 9 | import android.content.Context; 10 | import android.database.Cursor; 11 | import android.database.sqlite.SQLiteDatabase; 12 | 13 | public class CountAdapter { 14 | public SQLiteDatabase database; 15 | public Context context; 16 | 17 | public CountAdapter(SQLiteDatabase database, Context context) { 18 | this.database = database; 19 | this.context = context; 20 | } 21 | 22 | public Cursor countByType(String type, String subtype) { 23 | if(type == null || type.equals("*")) { 24 | type = null; 25 | } 26 | List args = new ArrayList(); 27 | StringBuilder sb = new StringBuilder(); 28 | sb.append("SELECT count(*) AS cnt"); 29 | sb.append(" FROM central_index i"); 30 | String where = "WHERE"; 31 | if (type != null) { 32 | sb.append(" " + where + " i.type = ?"); 33 | where = "AND"; 34 | args.add(type); 35 | } 36 | if (subtype != null) { 37 | sb.append(" " + where + " i.subtype = ?"); 38 | where = "AND"; 39 | args.add(subtype); 40 | } 41 | sb.append(FilterPreferenceManager.getSourceFilter(context, args, where, "i")); 42 | sb.append(" ORDER BY i.name"); 43 | String sql = sb.toString(); 44 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 45 | } 46 | 47 | public Cursor fetchByUrl(String url) { 48 | List args = new ArrayList(); 49 | StringBuilder sb = new StringBuilder(); 50 | sb.append("SELECT count(*) AS cnt"); 51 | sb.append(" FROM central_index i"); 52 | sb.append(" WHERE i.url = ?"); 53 | args.add(url); 54 | sb.append(FilterPreferenceManager.getSourceFilter(context, args, "AND", "i")); 55 | sb.append(" ORDER BY i.name"); 56 | String sql = sb.toString(); 57 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 58 | } 59 | 60 | public static class CountUtils { 61 | private CountUtils() { 62 | } 63 | 64 | public static Integer getCount(Cursor cursor) { 65 | return cursor.getInt(0); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/CreatureTypeAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | import org.evilsoft.pathfinder.reference.preference.FilterPreferenceManager; 8 | 9 | import android.content.Context; 10 | import android.database.Cursor; 11 | import android.database.sqlite.SQLiteDatabase; 12 | 13 | public class CreatureTypeAdapter { 14 | public SQLiteDatabase database; 15 | public Context context; 16 | 17 | public CreatureTypeAdapter(SQLiteDatabase database, Context context) { 18 | this.database = database; 19 | this.context = context; 20 | } 21 | 22 | public Cursor fetchCreatureTypes() { 23 | List args = new ArrayList(); 24 | StringBuilder sb = new StringBuilder(); 25 | sb.append("SELECT DISTINCT creature_type"); 26 | sb.append(" FROM central_index"); 27 | sb.append(" WHERE creature_type IS NOT NULL"); 28 | sb.append(FilterPreferenceManager.getSourceFilter(context, args, "AND")); 29 | sb.append(" ORDER BY creature_type"); 30 | String sql = sb.toString(); 31 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 32 | } 33 | 34 | public static class CreatureTypeUtils { 35 | private CreatureTypeUtils() { 36 | } 37 | 38 | public static String getCreatureType(Cursor cursor) { 39 | return cursor.getString(0); 40 | } 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/FeatTypeAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | import org.evilsoft.pathfinder.reference.preference.FilterPreferenceManager; 8 | 9 | import android.content.Context; 10 | import android.database.Cursor; 11 | import android.database.sqlite.SQLiteDatabase; 12 | 13 | public class FeatTypeAdapter { 14 | public SQLiteDatabase database; 15 | public Context context; 16 | 17 | public FeatTypeAdapter(SQLiteDatabase database, Context context) { 18 | this.database = database; 19 | this.context = context; 20 | } 21 | 22 | public Cursor fetchFeatTypes() { 23 | List args = new ArrayList(); 24 | StringBuilder sb = new StringBuilder(); 25 | sb.append("SELECT DISTINCT ft.feat_type"); 26 | sb.append(" FROM feat_type_index ft"); 27 | sb.append(" INNER JOIN central_index ci"); 28 | sb.append(" ON ft.index_id = ci.index_id"); 29 | sb.append(FilterPreferenceManager.getSourceFilter(context, args, "WHERE", "ci")); 30 | sb.append(" ORDER BY ft.feat_type"); 31 | String sql = sb.toString(); 32 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 33 | } 34 | 35 | public static class FeatTypeUtils { 36 | private FeatTypeUtils() { 37 | } 38 | 39 | public static String getFeatType(Cursor cursor) { 40 | return cursor.getString(0); 41 | } 42 | } 43 | } 44 | 45 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/IndexDbHelper.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 4 | 5 | import android.content.Context; 6 | import android.database.Cursor; 7 | import android.database.sqlite.SQLiteDatabase; 8 | 9 | public class IndexDbHelper extends BaseDbHelper { 10 | private static String DB_NAME = "index.db"; 11 | 12 | public IndexDbHelper(Context context) { 13 | super(context, DB_NAME); 14 | } 15 | 16 | public boolean testDb(SQLiteDatabase database) { 17 | StringBuilder sb = new StringBuilder(); 18 | sb.append("SELECT count(*)"); 19 | sb.append(" FROM central_index"); 20 | String sql = sb.toString(); 21 | Cursor curs = database.rawQuery(sql, new String[0]); 22 | try { 23 | curs.moveToFirst(); 24 | curs.getInt(0); 25 | } finally { 26 | curs.close(); 27 | } 28 | return true; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/SpellClassAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | import org.evilsoft.pathfinder.reference.preference.FilterPreferenceManager; 8 | 9 | import android.content.Context; 10 | import android.database.Cursor; 11 | import android.database.sqlite.SQLiteDatabase; 12 | 13 | public class SpellClassAdapter { 14 | public SQLiteDatabase database; 15 | public Context context; 16 | 17 | public SpellClassAdapter(SQLiteDatabase database, Context context) { 18 | this.database = database; 19 | this.context = context; 20 | } 21 | 22 | public Cursor fetchSpellClasses() { 23 | List args = new ArrayList(); 24 | StringBuilder sb = new StringBuilder(); 25 | sb.append("SELECT DISTINCT sli.name"); 26 | sb.append(" FROM spell_list_index sli"); 27 | sb.append(" INNER JOIN central_index ci"); 28 | sb.append(" ON sli.index_id = ci.index_id"); 29 | sb.append(" WHERE sli.type = 'class'"); 30 | sb.append(FilterPreferenceManager.getSourceFilter(context, args, "AND", "ci")); 31 | sb.append(" ORDER BY sli.name"); 32 | String sql = sb.toString(); 33 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 34 | } 35 | 36 | public static class SpellListUtils { 37 | private SpellListUtils() { 38 | } 39 | 40 | public static String getName(Cursor cursor) { 41 | return cursor.getString(0); 42 | } 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/db/index/SpellListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.db.index; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.evilsoft.pathfinder.reference.db.BaseDbHelper; 7 | import org.evilsoft.pathfinder.reference.preference.FilterPreferenceManager; 8 | 9 | import android.content.Context; 10 | import android.database.Cursor; 11 | import android.database.sqlite.SQLiteDatabase; 12 | 13 | public class SpellListAdapter { 14 | public SQLiteDatabase database; 15 | public Context context; 16 | 17 | public SpellListAdapter(SQLiteDatabase database, Context context) { 18 | this.database = database; 19 | this.context = context; 20 | } 21 | 22 | public Cursor fetchClassSpells(String class_name) { 23 | List args = new ArrayList(); 24 | args.add(class_name); 25 | StringBuilder sb = new StringBuilder(); 26 | sb.append("SELECT i.name, i.url, sl.name, sl.level"); 27 | sb.append(" FROM spell_list_index sl"); 28 | sb.append(" INNER JOIN central_index i"); 29 | sb.append(" ON sl.index_id = i.index_id"); 30 | sb.append(" WHERE sl.name = ?"); 31 | sb.append(FilterPreferenceManager.getSourceFilter(context, args, "AND")); 32 | sb.append(" ORDER BY sl.level, i.name"); 33 | String sql = sb.toString(); 34 | return database.rawQuery(sql, BaseDbHelper.toStringArray(args)); 35 | } 36 | 37 | public static class SpellListUtils { 38 | private SpellListUtils() { 39 | } 40 | 41 | public static String getSpellName(Cursor cursor) { 42 | return cursor.getString(0); 43 | } 44 | 45 | public static String getUrl(Cursor cursor) { 46 | return cursor.getString(1); 47 | } 48 | 49 | public static String getSpellClass(Cursor cursor) { 50 | return cursor.getString(2); 51 | } 52 | 53 | public static Integer getSpellLevel(Cursor cursor) { 54 | return cursor.getInt(3); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/BaseListItem.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | public class BaseListItem implements UrlListItem { 4 | private int sectionId; 5 | private String database; 6 | private String name; 7 | private String url; 8 | 9 | public int getSectionId() { 10 | return sectionId; 11 | } 12 | 13 | public void setSectionId(int sectionId) { 14 | this.sectionId = sectionId; 15 | } 16 | 17 | public String getDatabase() { 18 | return database; 19 | } 20 | 21 | public void setDatabase(String database) { 22 | this.database = database; 23 | } 24 | 25 | public String getUrl() { 26 | return url; 27 | } 28 | 29 | public void setUrl(String url) { 30 | this.url = url; 31 | } 32 | 33 | public String getName() { 34 | return name; 35 | } 36 | 37 | public void setName(String name) { 38 | this.name = name; 39 | } 40 | 41 | public String toString() { 42 | return name; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/CollectionItemListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | import org.evilsoft.pathfinder.reference.DisplayListAdapter; 4 | import org.evilsoft.pathfinder.reference.R; 5 | 6 | import android.content.Context; 7 | import android.database.Cursor; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.ViewGroup; 11 | import android.widget.TextView; 12 | 13 | public class CollectionItemListAdapter extends DisplayListAdapter { 14 | 15 | public CollectionItemListAdapter(Context context, Cursor c) { 16 | super(context, c); 17 | } 18 | 19 | @Override 20 | public View getView(int position, View convertView, ViewGroup parent) { 21 | moveCursor(position); 22 | View V = convertView; 23 | 24 | if (V == null) { 25 | LayoutInflater vi = (LayoutInflater) context 26 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 27 | V = vi.inflate(R.layout.character_list_item, null); 28 | } 29 | 30 | TextView title = (TextView) V.findViewById(R.id.character_list_name); 31 | title.setText(c.getString(1)); 32 | return V; 33 | } 34 | 35 | @Override 36 | public Object buildItem(Cursor c) { 37 | CollectionItemListItem cla = new CollectionItemListItem(); 38 | cla.setCollectionValueId(c.getString(0)); 39 | cla.setName(c.getString(1)); 40 | cla.setUrl(c.getString(2)); 41 | return cla; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/CollectionItemListItem.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | public class CollectionItemListItem implements UrlListItem { 4 | private String name; 5 | private String collectionValueId; 6 | private String url; 7 | 8 | public String getName() { 9 | return name; 10 | } 11 | 12 | public void setName(String name) { 13 | this.name = name; 14 | } 15 | 16 | public void setCollectionValueId(String collectionValueId) { 17 | this.collectionValueId = collectionValueId; 18 | } 19 | 20 | public String getCollectionValueId() { 21 | return collectionValueId; 22 | } 23 | 24 | public String getUrl() { 25 | return url; 26 | } 27 | 28 | public void setUrl(String url) { 29 | this.url = url; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/CollectionListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | import org.evilsoft.pathfinder.reference.DisplayListAdapter; 4 | import org.evilsoft.pathfinder.reference.R; 5 | import android.content.Context; 6 | import android.database.Cursor; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.TextView; 11 | 12 | public class CollectionListAdapter extends DisplayListAdapter { 13 | 14 | public CollectionListAdapter(Context context, Cursor c) { 15 | super(context, c); 16 | } 17 | 18 | @Override 19 | public View getView(int position, View convertView, ViewGroup parent) { 20 | moveCursor(position); 21 | View V = convertView; 22 | 23 | if (V == null) { 24 | LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 25 | V = vi.inflate(R.layout.character_list_item, null); 26 | } 27 | 28 | TextView title = (TextView) V.findViewById(R.id.character_list_name); 29 | title.setText(c.getString(3)); 30 | return V; 31 | } 32 | 33 | @Override 34 | public Object buildItem(Cursor c) { 35 | CollectionListItem cla = new CollectionListItem(); 36 | cla.setCharacterId(c.getString(1)); 37 | cla.setName(c.getString(3)); 38 | cla.setUrl(c.getString(4)); 39 | return cla; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/CollectionListItem.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | public class CollectionListItem { 4 | private String name; 5 | private String description; 6 | private String url; 7 | private String characterId; 8 | 9 | public String getName() { 10 | return name; 11 | } 12 | 13 | public void setName(String name) { 14 | this.name = name; 15 | } 16 | 17 | public String getDescription() { 18 | return description; 19 | } 20 | 21 | public void setDescription(String description) { 22 | this.description = description; 23 | } 24 | 25 | public void setUrl(String url) { 26 | this.url = url; 27 | } 28 | 29 | public String getUrl() { 30 | return url; 31 | } 32 | 33 | public void setCharacterId(String characterId) { 34 | this.characterId = characterId; 35 | } 36 | 37 | public String getCharacterId() { 38 | return characterId; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/CreatureListItem.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | public class CreatureListItem extends BaseListItem { 4 | private String description; 5 | private String creatureType; 6 | private String creatureSubtype; 7 | private String cr; 8 | private String xp; 9 | private String size; 10 | private String alignment; 11 | 12 | public String getDescription() { 13 | return description; 14 | } 15 | 16 | public void setDescription(String description) { 17 | this.description = description; 18 | } 19 | 20 | public String getCreatureType() { 21 | return creatureType; 22 | } 23 | 24 | public void setCreatureType(String creatureType) { 25 | this.creatureType = creatureType; 26 | } 27 | 28 | public String getCreatureSubtype() { 29 | return creatureSubtype; 30 | } 31 | 32 | public void setCreatureSubtype(String creatureSubtype) { 33 | this.creatureSubtype = creatureSubtype; 34 | } 35 | 36 | public String getCr() { 37 | return cr; 38 | } 39 | 40 | public void setCr(String cr) { 41 | this.cr = cr; 42 | } 43 | 44 | public String getXp() { 45 | return xp; 46 | } 47 | 48 | public void setXp(String xp) { 49 | this.xp = xp; 50 | } 51 | 52 | public String getSize() { 53 | return size; 54 | } 55 | 56 | public void setSize(String size) { 57 | this.size = size; 58 | } 59 | 60 | public String getAlignment() { 61 | return alignment; 62 | } 63 | 64 | public void setAlignment(String alignment) { 65 | this.alignment = alignment; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/DefaultListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | import org.evilsoft.pathfinder.reference.DisplayListAdapter; 4 | import org.evilsoft.pathfinder.reference.R; 5 | import org.evilsoft.pathfinder.reference.db.index.IndexGroupAdapter; 6 | 7 | import android.content.Context; 8 | import android.database.Cursor; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.widget.TextView; 13 | 14 | public class DefaultListAdapter extends DisplayListAdapter { 15 | 16 | public DefaultListAdapter(Context context, Cursor c) { 17 | super(context, c); 18 | } 19 | 20 | @Override 21 | public View getView(int index, View convertView, ViewGroup parent) { 22 | moveCursor(index); 23 | View V = convertView; 24 | 25 | if (V == null) { 26 | LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 27 | V = vi.inflate(R.layout.default_list_item, null); 28 | } 29 | 30 | TextView title = (TextView) V.findViewById(R.id.default_list_name); 31 | title.setText(IndexGroupAdapter.IndexGroupUtils.getName(c)); 32 | return V; 33 | } 34 | 35 | public Object buildItem(Cursor c) { 36 | Integer sectionId = IndexGroupAdapter.IndexGroupUtils.getSectionId(c); 37 | String database = IndexGroupAdapter.IndexGroupUtils.getDatabase(c); 38 | String name = IndexGroupAdapter.IndexGroupUtils.getName(c); 39 | String url = IndexGroupAdapter.IndexGroupUtils.getUrl(c); 40 | return buildBaseListItem(sectionId, database, name, url); 41 | } 42 | 43 | public BaseListItem buildBaseListItem(Integer sectionId, String database, 44 | String name, String url) { 45 | BaseListItem bla = new BaseListItem(); 46 | bla.setSectionId(sectionId); 47 | bla.setDatabase(database); 48 | bla.setName(name); 49 | bla.setUrl(url); 50 | return bla; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/FeatListItem.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | public class FeatListItem extends BaseListItem { 4 | private String description; 5 | private String prereqs; 6 | private String featTypes; 7 | 8 | public String getDescription() { 9 | return description; 10 | } 11 | 12 | public void setDescription(String description) { 13 | this.description = description; 14 | } 15 | 16 | public String getFeatTypes() { 17 | return featTypes; 18 | } 19 | 20 | public void setFeatTypes(String featTypes) { 21 | this.featTypes = featTypes; 22 | } 23 | 24 | public String getPrereqs() { 25 | return prereqs; 26 | } 27 | 28 | public void setPrereqs(String prereqs) { 29 | this.prereqs = prereqs; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/HistoryListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | import org.evilsoft.pathfinder.reference.DisplayListAdapter; 4 | import org.evilsoft.pathfinder.reference.R; 5 | import org.evilsoft.pathfinder.reference.db.user.HistoryAdapter; 6 | 7 | import android.content.Context; 8 | import android.database.Cursor; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.widget.TextView; 13 | 14 | public class HistoryListAdapter extends DisplayListAdapter { 15 | 16 | public HistoryListAdapter(Context context, Cursor c) { 17 | super(context, c); 18 | } 19 | 20 | @Override 21 | public View getView(int index, View convertView, ViewGroup parent) { 22 | moveCursor(index); 23 | View V = convertView; 24 | 25 | int layout = R.layout.default_list_item; 26 | if (V == null) { 27 | LayoutInflater vi = (LayoutInflater) context 28 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 29 | V = vi.inflate(layout, null); 30 | } 31 | 32 | TextView title = (TextView) V.findViewById(R.id.default_list_name); 33 | title.setText(HistoryAdapter.HistoryUtils.getName(c)); 34 | return V; 35 | } 36 | 37 | @Override 38 | public Object buildItem(Cursor c) { 39 | Integer historyId = HistoryAdapter.HistoryUtils.getHistoryId(c); 40 | String name = HistoryAdapter.HistoryUtils.getName(c); 41 | String url = HistoryAdapter.HistoryUtils.getUrl(c); 42 | return buildHistory(historyId, name, url); 43 | } 44 | 45 | public HistoryListItem buildHistory(Integer historyId, String name, 46 | String url) { 47 | HistoryListItem hla = new HistoryListItem(); 48 | hla.setHistoryId(historyId); 49 | hla.setName(name); 50 | hla.setUrl(url); 51 | return hla; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/HistoryListItem.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | public class HistoryListItem { 4 | private int historyId; 5 | private String name; 6 | private String url; 7 | 8 | public int getHistoryId() { 9 | return historyId; 10 | } 11 | 12 | public void setHistoryId(int historyId) { 13 | this.historyId = historyId; 14 | } 15 | 16 | public String getUrl() { 17 | return url; 18 | } 19 | 20 | public void setUrl(String url) { 21 | this.url = url; 22 | } 23 | 24 | public String getName() { 25 | return name; 26 | } 27 | 28 | public void setName(String name) { 29 | this.name = name; 30 | } 31 | 32 | public String toString() { 33 | return name; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/NpcListItem.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | public class NpcListItem extends BaseListItem { 4 | private String description; 5 | private String superRace; 6 | private String size; 7 | private String alignment; 8 | 9 | public String getDescription() { 10 | return description; 11 | } 12 | 13 | public void setDescription(String description) { 14 | this.description = description; 15 | } 16 | 17 | public String getSuperRace() { 18 | return superRace; 19 | } 20 | 21 | public void setSuperRace(String creatureType) { 22 | this.superRace = creatureType; 23 | } 24 | 25 | public String getSize() { 26 | return size; 27 | } 28 | 29 | public void setSize(String size) { 30 | this.size = size; 31 | } 32 | 33 | public String getAlignment() { 34 | return alignment; 35 | } 36 | 37 | public void setAlignment(String alignment) { 38 | this.alignment = alignment; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/SearchListItem.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | public class SearchListItem extends BaseListItem { 4 | private String sectionType; 5 | private String sectionSubtype; 6 | private String parent; 7 | 8 | public String getSectionType() { 9 | return sectionType; 10 | } 11 | 12 | public void setSectionType(String sectionType) { 13 | this.sectionType = sectionType; 14 | } 15 | 16 | public String getSectionSubtype() { 17 | return sectionSubtype; 18 | } 19 | 20 | public void setSectionSubtype(String sectionSubtype) { 21 | this.sectionSubtype = sectionSubtype; 22 | } 23 | 24 | public String getParent() { 25 | return parent; 26 | } 27 | 28 | public void setParent(String parent) { 29 | this.parent = parent; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/SectionListAdapter.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | import org.evilsoft.pathfinder.reference.DisplayListAdapter; 4 | import org.evilsoft.pathfinder.reference.R; 5 | import org.evilsoft.pathfinder.reference.db.book.SectionIndexGroupAdapter; 6 | 7 | import android.content.Context; 8 | import android.database.Cursor; 9 | import android.view.LayoutInflater; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | import android.widget.TextView; 13 | 14 | public class SectionListAdapter extends DisplayListAdapter { 15 | 16 | public SectionListAdapter(Context context, Cursor c) { 17 | super(context, c); 18 | } 19 | 20 | @Override 21 | public View getView(int index, View convertView, ViewGroup parent) { 22 | moveCursor(index); 23 | View V = convertView; 24 | 25 | if (V == null) { 26 | LayoutInflater vi = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 27 | V = vi.inflate(R.layout.default_list_item, null); 28 | } 29 | 30 | TextView title = (TextView) V.findViewById(R.id.default_list_name); 31 | title.setText(SectionIndexGroupAdapter.SectionGroupIndexUtils.getName(c)); 32 | return V; 33 | } 34 | 35 | public Object buildItem(Cursor c) { 36 | Integer sectionId = SectionIndexGroupAdapter.SectionGroupIndexUtils.getSectionId(c); 37 | String database = SectionIndexGroupAdapter.SectionGroupIndexUtils.getDatabase(c); 38 | String name = SectionIndexGroupAdapter.SectionGroupIndexUtils.getName(c); 39 | String url = SectionIndexGroupAdapter.SectionGroupIndexUtils.getUrl(c); 40 | return buildBaseListItem(sectionId, database, name, url); 41 | } 42 | 43 | public BaseListItem buildBaseListItem(Integer sectionId, String database, 44 | String name, String url) { 45 | BaseListItem bla = new BaseListItem(); 46 | bla.setSectionId(sectionId); 47 | bla.setDatabase(database); 48 | bla.setName(name); 49 | bla.setUrl(url); 50 | return bla; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/SkillListItem.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | public class SkillListItem extends BaseListItem { 4 | private String description; 5 | private String attribute; 6 | private boolean armorCheckPenalty; 7 | private boolean trainedOnly; 8 | 9 | public String getDescription() { 10 | return description; 11 | } 12 | 13 | public void setDescription(String description) { 14 | this.description = description; 15 | } 16 | 17 | public String getAttribute() { 18 | return attribute; 19 | } 20 | 21 | public void setAttribute(String attribute) { 22 | this.attribute = attribute; 23 | } 24 | 25 | public boolean isArmorCheckPenalty() { 26 | return armorCheckPenalty; 27 | } 28 | 29 | public void setArmorCheckPenalty(boolean armorCheckPenalty) { 30 | this.armorCheckPenalty = armorCheckPenalty; 31 | } 32 | 33 | public boolean isTrainedOnly() { 34 | return trainedOnly; 35 | } 36 | 37 | public void setTrainedOnly(boolean trainedOnly) { 38 | this.trainedOnly = trainedOnly; 39 | } 40 | 41 | public String getQualities() { 42 | return SkillListItem.buildQualitiesDisplay(this.armorCheckPenalty, this.trainedOnly); 43 | } 44 | 45 | public static String buildQualitiesDisplay(boolean armorCheckPenalty, boolean trainedOnly) { 46 | StringBuilder sb = new StringBuilder(); 47 | String spacer = " ("; 48 | String end = ""; 49 | if (armorCheckPenalty) { 50 | sb.append(spacer); 51 | sb.append("Armor Check Penalty"); 52 | spacer = "; "; 53 | end = ")"; 54 | } 55 | if (trainedOnly) { 56 | sb.append(spacer); 57 | sb.append("Trained Only"); 58 | end = ")"; 59 | } 60 | sb.append(end); 61 | return sb.toString(); 62 | } 63 | 64 | public static String shortDescription(String desc) { 65 | String[] parts = desc.split("\\."); 66 | return parts[0] + "."; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/SpellListItem.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | public class SpellListItem extends BaseListItem { 4 | private String description; 5 | private String school; 6 | private String subschool; 7 | private String descriptor; 8 | private int level; 9 | private String classes; 10 | 11 | public String getDescription() { 12 | return description; 13 | } 14 | 15 | public void setDescription(String description) { 16 | this.description = description; 17 | } 18 | 19 | public String getSchool() { 20 | return school; 21 | } 22 | public String getClasses() { 23 | return classes; 24 | } 25 | 26 | public void setClasses(String classes) { 27 | this.classes = classes; 28 | } 29 | public void setSchool(String school) { 30 | this.school = school; 31 | } 32 | 33 | public String getSubschool() { 34 | return subschool; 35 | } 36 | 37 | public void setSubschool(String subschool) { 38 | this.subschool = subschool; 39 | } 40 | 41 | public String getDescriptor() { 42 | return descriptor; 43 | } 44 | 45 | public void setDescriptor(String descriptor) { 46 | this.descriptor = descriptor; 47 | } 48 | 49 | public int getLevel() { 50 | return level; 51 | } 52 | 53 | public void setLevel(int level) { 54 | this.level = level; 55 | } 56 | 57 | public static String buildSchoolLine(String school, String subschool, String descriptor) { 58 | StringBuilder sb = new StringBuilder(); 59 | sb.append(school); 60 | if (subschool != null) { 61 | sb.append(" ("); 62 | sb.append(subschool); 63 | sb.append(")"); 64 | } 65 | if (descriptor != null) { 66 | sb.append(" ["); 67 | sb.append(descriptor); 68 | sb.append("]"); 69 | } 70 | return sb.toString(); 71 | } 72 | 73 | public static String shortDescription(String desc) { 74 | if (desc != null) { 75 | return desc; 76 | } 77 | return ""; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/list/UrlListItem.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.list; 2 | 3 | public interface UrlListItem { 4 | public String getUrl(); 5 | 6 | public void setUrl(String url); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/preference/PathfinderPreferenceActivity.java: -------------------------------------------------------------------------------- 1 | /*** 2 | Copyright (c) 2008-2012 CommonsWare, LLC 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required 6 | by applicable law or agreed to in writing, software distributed under the 7 | License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 8 | OF ANY KIND, either express or implied. See the License for the specific 9 | language governing permissions and limitations under the License. 10 | 11 | From _The Busy Coder's Guide to Android Development_ 12 | http://commonsware.com/Android 13 | */ 14 | 15 | package org.evilsoft.pathfinder.reference.preference; 16 | 17 | import java.util.List; 18 | 19 | import org.evilsoft.pathfinder.reference.R; 20 | 21 | import android.os.Build; 22 | import android.os.Bundle; 23 | import android.widget.CheckBox; 24 | 25 | import com.actionbarsherlock.app.SherlockPreferenceActivity; 26 | 27 | public class PathfinderPreferenceActivity extends SherlockPreferenceActivity { 28 | 29 | CheckBox prefCheckBox; 30 | 31 | @SuppressWarnings("deprecation") 32 | @Override 33 | public void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | 36 | // If the device is pre-Honeycomb, just add each of the sets of 37 | // preferences to the single preference page in turn 38 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { 39 | addPreferencesFromResource(R.xml.source_filter); 40 | } 41 | 42 | } 43 | 44 | @Override 45 | public void onBuildHeaders(List
target) { 46 | // If the device is Honeycomb or higher, this method will be called, 47 | // which will load the preference headers, which will in turn load the 48 | // preferences 49 | loadHeadersFromResource(R.xml.preference_headers, target); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/preference/StockPreferenceFragment.java: -------------------------------------------------------------------------------- 1 | /*** 2 | Copyright (c) 2008-2012 CommonsWare, LLC 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | use this file except in compliance with the License. You may obtain a copy 5 | of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required 6 | by applicable law or agreed to in writing, software distributed under the 7 | License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 8 | OF ANY KIND, either express or implied. See the License for the specific 9 | language governing permissions and limitations under the License. 10 | 11 | From _The Busy Coder's Guide to Android Development_ 12 | http://commonsware.com/Android 13 | */ 14 | 15 | package org.evilsoft.pathfinder.reference.preference; 16 | 17 | import android.os.Bundle; 18 | import android.preference.PreferenceFragment; 19 | 20 | public class StockPreferenceFragment extends PreferenceFragment { 21 | @Override 22 | public void onCreate(Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | 25 | int res = getActivity().getResources().getIdentifier( 26 | getArguments().getString("resource"), "xml", 27 | getActivity().getPackageName()); 28 | 29 | addPreferencesFromResource(res); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/html/AbilityRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.html; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.AbilityAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 5 | 6 | import android.database.Cursor; 7 | 8 | public class AbilityRenderer extends HtmlRenderer { 9 | private BookDbAdapter bookDbAdapter; 10 | 11 | public AbilityRenderer(BookDbAdapter bookDbAdapter) { 12 | this.bookDbAdapter = bookDbAdapter; 13 | } 14 | 15 | @Override 16 | public String renderTitle() { 17 | return renderTitle(abilityName(name, sectionId), abbrev, newUri, depth, top); 18 | } 19 | 20 | @Override 21 | public String renderDetails() { 22 | return ""; 23 | } 24 | 25 | public String abilityName(String name, Integer sectionId) { 26 | Cursor cursor = bookDbAdapter.getAbilityAdapter().getAbilityTypes(sectionId); 27 | try { 28 | StringBuilder sb = new StringBuilder(); 29 | sb.append(name); 30 | boolean fields = false; 31 | boolean has_next = cursor.moveToFirst(); 32 | String comma = ""; 33 | while (has_next) { 34 | sb.append(comma); 35 | if (fields != true) { 36 | sb.append(" ("); 37 | comma = ", "; 38 | fields = true; 39 | } 40 | String type = AbilityAdapter.AbilityUtils.getAbilityType(cursor); 41 | if (type.equals("Extraordinary")) { 42 | sb.append("Ex"); 43 | } else if (type.equals("Supernatural")) { 44 | sb.append("Su"); 45 | } else if (type.equals("Spell-Like")) { 46 | sb.append("Sp"); 47 | } 48 | has_next = cursor.moveToNext(); 49 | } 50 | if (fields) { 51 | sb.append(")"); 52 | } 53 | return sb.toString(); 54 | } finally { 55 | cursor.close(); 56 | } 57 | } 58 | 59 | @Override 60 | public String renderFooter() { 61 | return ""; 62 | } 63 | 64 | @Override 65 | public String renderHeader() { 66 | return ""; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/html/ClassRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.html; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.ClassAdapter; 5 | 6 | import android.database.Cursor; 7 | 8 | public class ClassRenderer extends HtmlRenderer { 9 | private BookDbAdapter bookDbAdapter; 10 | 11 | public ClassRenderer(BookDbAdapter bookDbAdapter) { 12 | this.bookDbAdapter = bookDbAdapter; 13 | } 14 | 15 | @Override 16 | public String renderTitle() { 17 | return renderTitle(name, abbrev, newUri, depth, top); 18 | } 19 | 20 | @Override 21 | public String renderFooter() { 22 | StringBuilder sb = new StringBuilder(); 23 | Cursor cursor = bookDbAdapter.getClassAdapter().fetchClassDetails(sectionId); 24 | try { 25 | sb.append("Source: "); 26 | sb.append(source); 27 | sb.append("
"); 28 | boolean has_next = cursor.moveToFirst(); 29 | if (has_next) { 30 | String align = ClassAdapter.ClassUtils.getAlignment(cursor); 31 | if (align != null) { 32 | sb.append("Alignment: "); 33 | sb.append(align); 34 | sb.append("
\n"); 35 | } 36 | String hd = ClassAdapter.ClassUtils.getHitDie(cursor); 37 | if (hd != null) { 38 | sb.append("Hit Die: "); 39 | sb.append(hd); 40 | sb.append("
\n"); 41 | } 42 | } 43 | } finally { 44 | cursor.close(); 45 | } 46 | return sb.toString(); 47 | } 48 | 49 | @Override 50 | public String renderHeader() { 51 | return ""; 52 | } 53 | 54 | @Override 55 | public String renderDetails() { 56 | return ""; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/html/FeatRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.html; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 4 | 5 | public class FeatRenderer extends HtmlRenderer { 6 | private BookDbAdapter bookDbAdapter; 7 | 8 | public FeatRenderer(BookDbAdapter bookDbAdapter) { 9 | this.bookDbAdapter = bookDbAdapter; 10 | } 11 | 12 | @Override 13 | public String renderTitle() { 14 | return renderTitle(name, abbrev, newUri, 0, top); 15 | } 16 | 17 | @Override 18 | public String renderDetails() { 19 | StringBuilder sb = new StringBuilder(); 20 | sb.append(""); 21 | sb.append(bookDbAdapter.getFeatAdapter().renderFeatTypeDescription(sectionId)); 22 | sb.append("
\n"); 23 | sb.append("Source: "); 24 | sb.append(source); 25 | sb.append("
"); 26 | return sb.toString(); 27 | } 28 | 29 | @Override 30 | public String renderFooter() { 31 | return ""; 32 | } 33 | 34 | @Override 35 | public String renderHeader() { 36 | return ""; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/html/RaceRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.html; 2 | 3 | public class RaceRenderer extends HtmlRenderer { 4 | public RaceRenderer() { 5 | } 6 | 7 | @Override 8 | public String renderTitle() { 9 | String title = name; 10 | if (!top) { 11 | title = title + " Characters"; 12 | } 13 | return renderTitle(title, abbrev, newUri, depth, top); 14 | } 15 | 16 | @Override 17 | public String renderDetails() { 18 | return ""; 19 | } 20 | 21 | @Override 22 | public String renderFooter() { 23 | return ""; 24 | } 25 | 26 | @Override 27 | public String renderHeader() { 28 | return ""; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/html/SectionRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.html; 2 | 3 | public class SectionRenderer extends HtmlRenderer { 4 | public SectionRenderer() { 5 | } 6 | 7 | @Override 8 | public String renderTitle() { 9 | return renderTitle(name, abbrev, newUri, depth, top); 10 | } 11 | 12 | @Override 13 | public String renderDetails() { 14 | return ""; 15 | } 16 | 17 | @Override 18 | public String renderFooter() { 19 | return ""; 20 | } 21 | 22 | @Override 23 | public String renderHeader() { 24 | return ""; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/html/SkillRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.html; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.SkillAdapter; 5 | 6 | import android.database.Cursor; 7 | 8 | public class SkillRenderer extends HtmlRenderer { 9 | private BookDbAdapter bookDbAdapter; 10 | 11 | public SkillRenderer(BookDbAdapter bookDbAdapter) { 12 | this.bookDbAdapter = bookDbAdapter; 13 | } 14 | 15 | @Override 16 | public String renderTitle() { 17 | return renderTitle(name, abbrev, newUri, 0, top); 18 | } 19 | 20 | @Override 21 | public String renderDetails() { 22 | StringBuilder sb = new StringBuilder(); 23 | sb.append(renderSkillDetails(sectionId)); 24 | sb.append("Source: "); 25 | sb.append(source); 26 | sb.append("
"); 27 | return sb.toString(); 28 | } 29 | 30 | public String renderSkillDetails(Integer sectionId) { 31 | Cursor cursor = bookDbAdapter.getSkillAdapter().fetchSkillAttr(sectionId); 32 | try { 33 | StringBuilder sb = new StringBuilder(); 34 | boolean has_next = cursor.moveToFirst(); 35 | if (has_next) { 36 | sb.append("

("); 37 | sb.append(SkillAdapter.SkillUtils.getAttribute(cursor)); 38 | boolean armorCheckPenalty = SkillAdapter.SkillUtils.getArmorCheckPenalty(cursor) != 0; 39 | if (armorCheckPenalty) { 40 | sb.append("; Armor Check Penalty"); 41 | } 42 | boolean trainedOnly = SkillAdapter.SkillUtils.getTrainedOnly(cursor) != 0; 43 | if (trainedOnly) { 44 | sb.append("; Trained Only"); 45 | } 46 | sb.append(")

\n"); 47 | } 48 | return sb.toString(); 49 | } finally { 50 | cursor.close(); 51 | } 52 | } 53 | 54 | @Override 55 | public String renderFooter() { 56 | return ""; 57 | } 58 | 59 | @Override 60 | public String renderHeader() { 61 | return ""; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/html/StatBlockRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.html; 2 | 3 | public abstract class StatBlockRenderer extends HtmlRenderer { 4 | public String renderStatBlockTitle(String title, String newUri, boolean top) { 5 | if (top) { 6 | return ""; 7 | } 8 | 9 | StringBuilder sb = new StringBuilder(); 10 | if (title != null) { 11 | sb.append("\n

"); 14 | sb.append(title); 15 | sb.append("

\n"); 16 | } 17 | return sb.toString(); 18 | } 19 | 20 | public String renderStatBlockBreaker(String title) { 21 | StringBuilder sb = new StringBuilder(); 22 | if (title != null) { 23 | sb.append("\n

"); 24 | sb.append(title); 25 | sb.append("

\n"); 26 | } 27 | return sb.toString(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/html/TableRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.html; 2 | 3 | public class TableRenderer extends HtmlRenderer { 4 | public TableRenderer() { 5 | } 6 | 7 | @Override 8 | public String renderTitle() { 9 | return ""; 10 | } 11 | 12 | @Override 13 | public String renderDetails() { 14 | return ""; 15 | } 16 | 17 | @Override 18 | public String renderFooter() { 19 | return ""; 20 | } 21 | 22 | @Override 23 | public String renderHeader() { 24 | return ""; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/html/TalentRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.html; 2 | 3 | import android.database.Cursor; 4 | 5 | import org.evilsoft.pathfinder.reference.db.book.TalentAdapter; 6 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 7 | 8 | public class TalentRenderer extends StatBlockRenderer { 9 | private BookDbAdapter bookDbAdapter; 10 | 11 | public TalentRenderer(BookDbAdapter bookDbAdapter) { 12 | this.bookDbAdapter = bookDbAdapter; 13 | } 14 | 15 | @Override 16 | public String renderTitle() { 17 | return renderStatBlockTitle(name, newUri, top); 18 | } 19 | 20 | @Override 21 | public String renderDetails() { 22 | Cursor cursor = bookDbAdapter.getTalentAdapter().getTalentDetails(sectionId); 23 | try { 24 | StringBuilder sb = new StringBuilder(); 25 | boolean has_next = cursor.moveToFirst(); 26 | if (has_next) { 27 | sb.append(addField("Element", TalentAdapter.TalentUtils.getElement(cursor), false)); 28 | sb.append(addField("Type", TalentAdapter.TalentUtils.getTalentType(cursor), false)); 29 | sb.append(addField("Level", TalentAdapter.TalentUtils.getLevel(cursor), false)); 30 | sb.append(addField("Burn", TalentAdapter.TalentUtils.getBurn(cursor))); 31 | sb.append(addField("Prerequisites", TalentAdapter.TalentUtils.getPrerequisite(cursor))); 32 | sb.append(addField("Blast Type", TalentAdapter.TalentUtils.getBlastType(cursor), false)); 33 | sb.append(addField("Damage", TalentAdapter.TalentUtils.getDamage(cursor))); 34 | sb.append(addField("Associated Blasts", TalentAdapter.TalentUtils.getAssociatedBlasts(cursor))); 35 | sb.append(addField("Saving Throw", TalentAdapter.TalentUtils.getSavingThrow(cursor), false)); 36 | sb.append(addField("Spell Resistance", TalentAdapter.TalentUtils.getSpellResistance(cursor))); 37 | } 38 | return sb.toString(); 39 | } finally { 40 | cursor.close(); 41 | } 42 | } 43 | 44 | @Override 45 | public String renderFooter() { 46 | return ""; 47 | } 48 | 49 | @Override 50 | public String renderHeader() { 51 | return ""; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/AbilityRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.AbilityAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 5 | import org.json.JSONArray; 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.database.Cursor; 10 | 11 | public class AbilityRenderer extends JsonRenderer { 12 | private BookDbAdapter bookDbAdapter; 13 | 14 | public AbilityRenderer(BookDbAdapter bookDbAdapter) { 15 | this.bookDbAdapter = bookDbAdapter; 16 | } 17 | 18 | public JSONObject render(JSONObject section, Integer sectionId) 19 | throws JSONException { 20 | Cursor cursor = bookDbAdapter.getAbilityAdapter().getAbilityTypes( 21 | sectionId); 22 | try { 23 | boolean has_next = cursor.moveToFirst(); 24 | JSONArray ja = new JSONArray(); 25 | while (has_next) { 26 | ja.put(AbilityAdapter.AbilityUtils.getAbilityType(cursor)); 27 | has_next = cursor.moveToNext(); 28 | } 29 | if (ja.length() > 0) { 30 | section.put("ability_types", ja); 31 | } 32 | } finally { 33 | cursor.close(); 34 | } 35 | return section; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/AfflictionRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.AfflictionAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import android.database.Cursor; 9 | 10 | public class AfflictionRenderer extends JsonRenderer { 11 | private BookDbAdapter bookDbAdapter; 12 | 13 | public AfflictionRenderer(BookDbAdapter bookDbAdapter) { 14 | this.bookDbAdapter = bookDbAdapter; 15 | } 16 | 17 | public JSONObject render(JSONObject section, Integer sectionId) 18 | throws JSONException { 19 | Cursor cursor = bookDbAdapter.getAfflictionAdapter() 20 | .getAfflictionDetails(sectionId); 21 | try { 22 | boolean has_next = cursor.moveToFirst(); 23 | if (has_next) { 24 | addField(section, "contracted", 25 | AfflictionAdapter.AfflictionUtils.getContracted(cursor)); 26 | addField(section, "addiction", 27 | AfflictionAdapter.AfflictionUtils.getAddiction(cursor)); 28 | addField(section, "save", 29 | AfflictionAdapter.AfflictionUtils.getSave(cursor)); 30 | addField(section, "onset", 31 | AfflictionAdapter.AfflictionUtils.getOnset(cursor)); 32 | addField(section, "frequency", 33 | AfflictionAdapter.AfflictionUtils.getFrequency(cursor)); 34 | addField(section, "effect", 35 | AfflictionAdapter.AfflictionUtils.getEffect(cursor)); 36 | addField(section, "initial_effect", 37 | AfflictionAdapter.AfflictionUtils 38 | .getInitialEffect(cursor)); 39 | addField(section, "secondary_effect", 40 | AfflictionAdapter.AfflictionUtils 41 | .getSecondaryEffect(cursor)); 42 | addField(section, "damage", AfflictionAdapter.AfflictionUtils.getDamage(cursor)); 43 | addField(section, "cure", 44 | AfflictionAdapter.AfflictionUtils.getCure(cursor)); 45 | addField(section, "cost", 46 | AfflictionAdapter.AfflictionUtils.getCost(cursor)); 47 | } 48 | } finally { 49 | cursor.close(); 50 | } 51 | return section; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/AnimalCompanionRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.AnimalCompanionAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import android.database.Cursor; 9 | 10 | public class AnimalCompanionRenderer extends JsonRenderer { 11 | private BookDbAdapter bookDbAdapter; 12 | 13 | public AnimalCompanionRenderer(BookDbAdapter bookDbAdapter) { 14 | this.bookDbAdapter = bookDbAdapter; 15 | } 16 | 17 | public JSONObject render(JSONObject section, Integer sectionId) 18 | throws JSONException { 19 | Cursor cursor = bookDbAdapter.getAnimalCompanionAdapter() 20 | .getAnimalCompanionDetails(sectionId); 21 | try { 22 | boolean has_next = cursor.moveToFirst(); 23 | if (has_next) { 24 | addField(section, "ability_scores", 25 | AnimalCompanionAdapter.AnimalCompanionUtils 26 | .getAbilityScores(cursor)); 27 | addField(section, "ac", 28 | AnimalCompanionAdapter.AnimalCompanionUtils 29 | .getAc(cursor)); 30 | addField(section, "attack", 31 | AnimalCompanionAdapter.AnimalCompanionUtils 32 | .getAttack(cursor)); 33 | addField(section, "cmd", 34 | AnimalCompanionAdapter.AnimalCompanionUtils 35 | .getCmd(cursor)); 36 | addField(section, "level", 37 | AnimalCompanionAdapter.AnimalCompanionUtils 38 | .getLevel(cursor)); 39 | addField(section, "size", 40 | AnimalCompanionAdapter.AnimalCompanionUtils 41 | .getSize(cursor)); 42 | addField(section, "special_attacks", 43 | AnimalCompanionAdapter.AnimalCompanionUtils 44 | .getSpecialAttacks(cursor)); 45 | addField(section, "special_abilities", 46 | AnimalCompanionAdapter.AnimalCompanionUtils 47 | .getSpecialAbilities(cursor)); 48 | addField(section, "special_qualities", 49 | AnimalCompanionAdapter.AnimalCompanionUtils 50 | .getSpecialQualities(cursor)); 51 | addField(section, "speed", 52 | AnimalCompanionAdapter.AnimalCompanionUtils 53 | .getSpeed(cursor)); 54 | addField(section, "bonus_feat", 55 | AnimalCompanionAdapter.AnimalCompanionUtils 56 | .getBonusFeat(cursor)); 57 | } 58 | } finally { 59 | cursor.close(); 60 | } 61 | return section; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/ArmyRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.ArmyAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import android.database.Cursor; 9 | 10 | public class ArmyRenderer extends JsonRenderer { 11 | private BookDbAdapter bookDbAdapter; 12 | 13 | public ArmyRenderer(BookDbAdapter bookDbAdapter) { 14 | this.bookDbAdapter = bookDbAdapter; 15 | } 16 | 17 | public JSONObject render(JSONObject section, Integer sectionId) 18 | throws JSONException { 19 | Cursor cursor = bookDbAdapter.getArmyAdapter() 20 | .getArmyDetails(sectionId); 21 | try { 22 | boolean has_next = cursor.moveToFirst(); 23 | if (has_next) { 24 | addField(section, "acr", ArmyAdapter.ArmyUtils.getAcr(cursor)); 25 | addField(section, "alignment", 26 | ArmyAdapter.ArmyUtils.getAlignment(cursor)); 27 | addField(section, "consumption", 28 | ArmyAdapter.ArmyUtils.getConsumption(cursor)); 29 | addField(section, "creature_type", 30 | ArmyAdapter.ArmyUtils.getCreatureType(cursor)); 31 | addField(section, "dv", ArmyAdapter.ArmyUtils.getDv(cursor)); 32 | addField(section, "hp", ArmyAdapter.ArmyUtils.getHp(cursor)); 33 | addField(section, "note", ArmyAdapter.ArmyUtils.getNote(cursor)); 34 | addField(section, "om", ArmyAdapter.ArmyUtils.getOm(cursor)); 35 | addField(section, "resources", 36 | ArmyAdapter.ArmyUtils.getResources(cursor)); 37 | addField(section, "size", ArmyAdapter.ArmyUtils.getSize(cursor)); 38 | addField(section, "special", 39 | ArmyAdapter.ArmyUtils.getSpecial(cursor)); 40 | addField(section, "speed", 41 | ArmyAdapter.ArmyUtils.getSpeed(cursor)); 42 | addField(section, "tactics", 43 | ArmyAdapter.ArmyUtils.getTactics(cursor)); 44 | addField(section, "xp", ArmyAdapter.ArmyUtils.getXp(cursor)); 45 | } 46 | } finally { 47 | cursor.close(); 48 | } 49 | return section; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/ClassRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.ClassAdapter; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import android.database.Cursor; 9 | 10 | public class ClassRenderer extends JsonRenderer { 11 | private BookDbAdapter bookDbAdapter; 12 | 13 | public ClassRenderer(BookDbAdapter bookDbAdapter) { 14 | this.bookDbAdapter = bookDbAdapter; 15 | } 16 | 17 | public JSONObject render(JSONObject section, Integer sectionId) 18 | throws JSONException { 19 | Cursor cursor = bookDbAdapter.getClassAdapter().fetchClassDetails( 20 | sectionId); 21 | try { 22 | boolean has_next = cursor.moveToFirst(); 23 | if (has_next) { 24 | addField(section, "alignment", 25 | ClassAdapter.ClassUtils.getAlignment(cursor)); 26 | addField(section, "hit_die", 27 | ClassAdapter.ClassUtils.getHitDie(cursor)); 28 | } 29 | } finally { 30 | cursor.close(); 31 | } 32 | return section; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/FeatRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.AbilityAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 5 | import org.evilsoft.pathfinder.reference.db.book.FeatAdapter; 6 | import org.json.JSONArray; 7 | import org.json.JSONException; 8 | import org.json.JSONObject; 9 | 10 | import android.database.Cursor; 11 | 12 | public class FeatRenderer extends JsonRenderer { 13 | private BookDbAdapter bookDbAdapter; 14 | 15 | public FeatRenderer(BookDbAdapter bookDbAdapter) { 16 | this.bookDbAdapter = bookDbAdapter; 17 | } 18 | 19 | public JSONObject render(JSONObject section, Integer sectionId) 20 | throws JSONException { 21 | Cursor cursor = bookDbAdapter.getFeatAdapter().getFeatTypes(sectionId); 22 | try { 23 | boolean has_next = cursor.moveToFirst(); 24 | JSONArray ft = new JSONArray(); 25 | while (has_next) { 26 | addField(section, "acr", 27 | FeatAdapter.FeatTypeUtils.getFeatType(cursor)); 28 | ft.put(AbilityAdapter.AbilityUtils.getAbilityType(cursor)); 29 | has_next = cursor.moveToNext(); 30 | } 31 | if (ft.length() > 0) { 32 | section.put("feat_types", ft); 33 | } 34 | } finally { 35 | cursor.close(); 36 | } 37 | return section; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/HauntRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.HauntAdapter; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import android.database.Cursor; 9 | 10 | public class HauntRenderer extends JsonRenderer { 11 | private BookDbAdapter bookDbAdapter; 12 | 13 | public HauntRenderer(BookDbAdapter bookDbAdapter) { 14 | this.bookDbAdapter = bookDbAdapter; 15 | } 16 | 17 | public JSONObject render(JSONObject section, Integer sectionId) 18 | throws JSONException { 19 | Cursor cursor = bookDbAdapter.getHauntAdapter().getHauntDetails( 20 | sectionId); 21 | try { 22 | boolean has_next = cursor.moveToFirst(); 23 | if (has_next) { 24 | addField(section, "alignment", 25 | HauntAdapter.HauntUtils.getAlignment(cursor)); 26 | addField(section, "area", 27 | HauntAdapter.HauntUtils.getArea(cursor)); 28 | addField(section, "caster_level", 29 | HauntAdapter.HauntUtils.getCasterLevel(cursor)); 30 | addField(section, "cr", HauntAdapter.HauntUtils.getCr(cursor)); 31 | addField(section, "destruction", 32 | HauntAdapter.HauntUtils.getDestruction(cursor)); 33 | addField(section, "effect", 34 | HauntAdapter.HauntUtils.getEffect(cursor)); 35 | addField(section, "haunt_type", 36 | HauntAdapter.HauntUtils.getHauntType(cursor)); 37 | addField(section, "hp", HauntAdapter.HauntUtils.getHp(cursor)); 38 | addField(section, "notice", 39 | HauntAdapter.HauntUtils.getNotice(cursor)); 40 | addField(section, "reset", 41 | HauntAdapter.HauntUtils.getReset(cursor)); 42 | addField(section, "trigger", 43 | HauntAdapter.HauntUtils.getTrigger(cursor)); 44 | addField(section, "xp", HauntAdapter.HauntUtils.getXp(cursor)); 45 | } 46 | } finally { 47 | cursor.close(); 48 | } 49 | return section; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/ItemRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.ItemAdapter; 5 | import org.json.JSONArray; 6 | import org.json.JSONException; 7 | import org.json.JSONObject; 8 | 9 | import android.database.Cursor; 10 | 11 | public class ItemRenderer extends JsonRenderer { 12 | private BookDbAdapter bookDbAdapter; 13 | 14 | public ItemRenderer(BookDbAdapter bookDbAdapter) { 15 | this.bookDbAdapter = bookDbAdapter; 16 | } 17 | 18 | public JSONObject render(JSONObject section, Integer sectionId) 19 | throws JSONException { 20 | Cursor cursor = bookDbAdapter.getItemAdapter() 21 | .getItemDetails(sectionId); 22 | try { 23 | boolean has_next = cursor.moveToFirst(); 24 | if (has_next) { 25 | addField(section, "aura", ItemAdapter.ItemUtils.getAura(cursor)); 26 | addField(section, "cl", ItemAdapter.ItemUtils.getCl(cursor)); 27 | addField(section, "price", 28 | ItemAdapter.ItemUtils.getPrice(cursor)); 29 | addField(section, "slot", ItemAdapter.ItemUtils.getSlot(cursor)); 30 | addField(section, "weight", 31 | ItemAdapter.ItemUtils.getWeight(cursor)); 32 | renderItemMisc(section, sectionId); 33 | } 34 | } finally { 35 | cursor.close(); 36 | } 37 | return section; 38 | } 39 | 40 | private void renderItemMisc(JSONObject section, Integer sectionId) 41 | throws JSONException { 42 | Cursor cursor = bookDbAdapter.getItemAdapter().getItemMisc(sectionId); 43 | try { 44 | boolean has_next = cursor.moveToFirst(); 45 | JSONArray misc = new JSONArray(); 46 | while (has_next) { 47 | JSONObject m = new JSONObject(); 48 | addField(m, "field", ItemAdapter.ItemMiscUtils.getField(cursor)); 49 | addField(m, "subsection", 50 | ItemAdapter.ItemMiscUtils.getSubsection(cursor)); 51 | addField(m, "value", ItemAdapter.ItemMiscUtils.getValue(cursor)); 52 | misc.put(m); 53 | has_next = cursor.moveToNext(); 54 | } 55 | if (misc.length() > 0) { 56 | section.put("misc", misc); 57 | } 58 | } finally { 59 | cursor.close(); 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/JsonRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public abstract class JsonRenderer { 7 | public abstract JSONObject render(JSONObject section, Integer sectionId) 8 | throws JSONException; 9 | 10 | public void addField(JSONObject section, String name, Object value) 11 | throws JSONException { 12 | if (value != null) { 13 | section.put(name, value); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/KingdomResourceRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.KingdomResourceAdapter; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import android.database.Cursor; 9 | 10 | public class KingdomResourceRenderer extends JsonRenderer { 11 | private BookDbAdapter bookDbAdapter; 12 | 13 | public KingdomResourceRenderer(BookDbAdapter bookDbAdapter) { 14 | this.bookDbAdapter = bookDbAdapter; 15 | } 16 | 17 | public JSONObject render(JSONObject section, Integer sectionId) 18 | throws JSONException { 19 | Cursor cursor = bookDbAdapter.getKingdomResourceAdapter() 20 | .getKingdomResourceDetails(sectionId); 21 | try { 22 | boolean has_next = cursor.moveToFirst(); 23 | if (has_next) { 24 | addField(section, "bp", 25 | KingdomResourceAdapter.KingdomResourceUtils 26 | .getBp(cursor)); 27 | addField(section, "discount", 28 | KingdomResourceAdapter.KingdomResourceUtils 29 | .getDiscount(cursor)); 30 | addField(section, "kingdom", 31 | KingdomResourceAdapter.KingdomResourceUtils 32 | .getKingdom(cursor)); 33 | addField(section, "limit", 34 | KingdomResourceAdapter.KingdomResourceUtils 35 | .getLimit(cursor)); 36 | addField(section, "lot", 37 | KingdomResourceAdapter.KingdomResourceUtils 38 | .getLot(cursor)); 39 | addField(section, "magic_items", 40 | KingdomResourceAdapter.KingdomResourceUtils 41 | .getMagicItems(cursor)); 42 | addField(section, "settlement", 43 | KingdomResourceAdapter.KingdomResourceUtils 44 | .getSettlement(cursor)); 45 | addField(section, "special", 46 | KingdomResourceAdapter.KingdomResourceUtils 47 | .getSpecial(cursor)); 48 | addField(section, "upgrade_from", 49 | KingdomResourceAdapter.KingdomResourceUtils 50 | .getUpgradeFrom(cursor)); 51 | addField(section, "upgrade_to", 52 | KingdomResourceAdapter.KingdomResourceUtils 53 | .getUpgradeTo(cursor)); 54 | } 55 | } finally { 56 | cursor.close(); 57 | } 58 | return section; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/LinkRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.LinkAdapter; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import android.database.Cursor; 9 | 10 | public class LinkRenderer extends JsonRenderer { 11 | private BookDbAdapter bookDbAdapter; 12 | 13 | public LinkRenderer(BookDbAdapter bookDbAdapter) { 14 | this.bookDbAdapter = bookDbAdapter; 15 | } 16 | 17 | public JSONObject render(JSONObject section, Integer sectionId) 18 | throws JSONException { 19 | Cursor cursor = bookDbAdapter.getLinkAdapter() 20 | .getLinkDetails(sectionId); 21 | try { 22 | boolean has_next = cursor.moveToFirst(); 23 | if (has_next) { 24 | addField(section, "display", 25 | LinkAdapter.LinkUtils.getDisplay(cursor)); 26 | addField(section, "link_url", 27 | LinkAdapter.LinkUtils.getUrl(cursor)); 28 | } 29 | } finally { 30 | cursor.close(); 31 | } 32 | return section; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/MythicSpellRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.MythicSpellDetailAdapter; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import android.database.Cursor; 9 | 10 | public class MythicSpellRenderer extends JsonRenderer { 11 | private BookDbAdapter bookDbAdapter; 12 | 13 | public MythicSpellRenderer(BookDbAdapter bookDbAdapter) { 14 | this.bookDbAdapter = bookDbAdapter; 15 | } 16 | 17 | public JSONObject render(JSONObject section, Integer sectionId) 18 | throws JSONException { 19 | Cursor cursor = bookDbAdapter.getMythicSpellDetailAdapter() 20 | .fetchMythicSpellDetails(sectionId); 21 | try { 22 | boolean has_next = cursor.moveToFirst(); 23 | if (has_next) { 24 | addField(section, "spell_source", 25 | MythicSpellDetailAdapter.MythicSpellDetailUtils 26 | .getSpellSource(cursor)); 27 | } 28 | } finally { 29 | cursor.close(); 30 | } 31 | return section; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/NoOpRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.json.JSONException; 4 | import org.json.JSONObject; 5 | 6 | public class NoOpRenderer extends JsonRenderer { 7 | 8 | @Override 9 | public JSONObject render(JSONObject section, Integer sectionId) 10 | throws JSONException { 11 | return section; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/ResourceRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.ResourceAdapter; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import android.database.Cursor; 9 | 10 | public class ResourceRenderer extends JsonRenderer { 11 | private BookDbAdapter bookDbAdapter; 12 | 13 | public ResourceRenderer(BookDbAdapter bookDbAdapter) { 14 | this.bookDbAdapter = bookDbAdapter; 15 | } 16 | 17 | public JSONObject render(JSONObject section, Integer sectionId) 18 | throws JSONException { 19 | Cursor cursor = bookDbAdapter.getResourceAdapter().getResourceDetails( 20 | sectionId); 21 | try { 22 | boolean has_next = cursor.moveToFirst(); 23 | if (has_next) { 24 | addField(section, "bebefit", 25 | ResourceAdapter.ResourceUtils.getBenefit(cursor)); 26 | addField(section, "create", 27 | ResourceAdapter.ResourceUtils.getCreate(cursor)); 28 | addField(section, "earnings", 29 | ResourceAdapter.ResourceUtils.getEarnings(cursor)); 30 | addField(section, "rooms", 31 | ResourceAdapter.ResourceUtils.getRooms(cursor)); 32 | addField(section, "size", 33 | ResourceAdapter.ResourceUtils.getSize(cursor)); 34 | addField(section, "skills", 35 | ResourceAdapter.ResourceUtils.getSkills(cursor)); 36 | addField(section, "teams", 37 | ResourceAdapter.ResourceUtils.getTeams(cursor)); 38 | addField(section, "time", 39 | ResourceAdapter.ResourceUtils.getTime(cursor)); 40 | addField(section, "upgrade_from", 41 | ResourceAdapter.ResourceUtils.getUpgradeFrom(cursor)); 42 | addField(section, "upgrade_to", 43 | ResourceAdapter.ResourceUtils.getUpgradeTo(cursor)); 44 | addField(section, "wage", 45 | ResourceAdapter.ResourceUtils.getWage(cursor)); 46 | } 47 | } finally { 48 | cursor.close(); 49 | } 50 | return section; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/SkillRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.SkillAdapter; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import android.database.Cursor; 9 | 10 | public class SkillRenderer extends JsonRenderer { 11 | private BookDbAdapter bookDbAdapter; 12 | 13 | public SkillRenderer(BookDbAdapter bookDbAdapter) { 14 | this.bookDbAdapter = bookDbAdapter; 15 | } 16 | 17 | public JSONObject render(JSONObject section, Integer sectionId) 18 | throws JSONException { 19 | Cursor cursor = bookDbAdapter.getSkillAdapter().fetchSkillAttr( 20 | sectionId); 21 | try { 22 | boolean has_next = cursor.moveToFirst(); 23 | if (has_next) { 24 | addField(section, "armor_check_penalty", 25 | SkillAdapter.SkillUtils.getArmorCheckPenalty(cursor)); 26 | addField(section, "attribute", 27 | SkillAdapter.SkillUtils.getAttribute(cursor)); 28 | addField(section, "trained_only", 29 | SkillAdapter.SkillUtils.getTrainedOnly(cursor)); 30 | } 31 | } finally { 32 | cursor.close(); 33 | } 34 | return section; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/TalentRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import android.database.Cursor; 4 | 5 | import org.evilsoft.pathfinder.reference.db.book.TalentAdapter; 6 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 7 | import org.json.JSONException; 8 | import org.json.JSONObject; 9 | 10 | public class TalentRenderer extends JsonRenderer { 11 | private BookDbAdapter bookDbAdapter; 12 | 13 | public TalentRenderer(BookDbAdapter bookDbAdapter) { 14 | this.bookDbAdapter = bookDbAdapter; 15 | } 16 | 17 | public JSONObject render(JSONObject section, Integer sectionId) 18 | throws JSONException { 19 | Cursor cursor = bookDbAdapter.getTalentAdapter() 20 | .getTalentDetails(sectionId); 21 | try { 22 | boolean has_next = cursor.moveToFirst(); 23 | if (has_next) { 24 | addField(section, "element", 25 | TalentAdapter.TalentUtils.getElement(cursor)); 26 | addField(section, "talent_type", 27 | TalentAdapter.TalentUtils.getTalentType(cursor)); 28 | addField(section, "blast_type", 29 | TalentAdapter.TalentUtils.getBlastType(cursor)); 30 | addField(section, "level", 31 | TalentAdapter.TalentUtils.getLevel(cursor)); 32 | addField(section, "burn", 33 | TalentAdapter.TalentUtils.getBurn(cursor)); 34 | addField(section, "damage", 35 | TalentAdapter.TalentUtils.getDamage(cursor)); 36 | addField(section, "prerequisite", 37 | TalentAdapter.TalentUtils.getPrerequisite(cursor)); 38 | addField(section, "associated_blasts", 39 | TalentAdapter.TalentUtils.getAssociatedBlasts(cursor)); 40 | addField(section, "saving_throw", 41 | TalentAdapter.TalentUtils.getSavingThrow(cursor)); 42 | addField(section, "spell_resistance", 43 | TalentAdapter.TalentUtils.getSpellResistance(cursor)); 44 | } 45 | } finally { 46 | cursor.close(); 47 | } 48 | return section; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/render/json/TrapRenderer.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.render.json; 2 | 3 | import org.evilsoft.pathfinder.reference.db.book.BookDbAdapter; 4 | import org.evilsoft.pathfinder.reference.db.book.TrapAdapter; 5 | import org.json.JSONException; 6 | import org.json.JSONObject; 7 | 8 | import android.database.Cursor; 9 | 10 | public class TrapRenderer extends JsonRenderer { 11 | private BookDbAdapter bookDbAdapter; 12 | 13 | public TrapRenderer(BookDbAdapter bookDbAdapter) { 14 | this.bookDbAdapter = bookDbAdapter; 15 | } 16 | 17 | public JSONObject render(JSONObject section, Integer sectionId) 18 | throws JSONException { 19 | Cursor cursor = bookDbAdapter.getTrapAdapter() 20 | .getTrapDetails(sectionId); 21 | try { 22 | boolean has_next = cursor.moveToFirst(); 23 | if (has_next) { 24 | addField(section, "cr", TrapAdapter.TrapUtils.getCr(cursor)); 25 | addField(section, "disable_device", 26 | TrapAdapter.TrapUtils.getDisableDevice(cursor)); 27 | addField(section, "duration", 28 | TrapAdapter.TrapUtils.getDuration(cursor)); 29 | addField(section, "effect", 30 | TrapAdapter.TrapUtils.getEffect(cursor)); 31 | addField(section, "perception", 32 | TrapAdapter.TrapUtils.getPerception(cursor)); 33 | addField(section, "reset", 34 | TrapAdapter.TrapUtils.getReset(cursor)); 35 | addField(section, "trap_type", 36 | TrapAdapter.TrapUtils.getTrapType(cursor)); 37 | addField(section, "trigger", 38 | TrapAdapter.TrapUtils.getTrigger(cursor)); 39 | } 40 | } finally { 41 | cursor.close(); 42 | } 43 | return section; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/org/evilsoft/pathfinder/reference/utils/LimitedSpaceException.java: -------------------------------------------------------------------------------- 1 | package org.evilsoft.pathfinder.reference.utils; 2 | 3 | public class LimitedSpaceException extends Exception { 4 | private static final long serialVersionUID = 3175084446853389252L; 5 | private long size; 6 | public LimitedSpaceException(String message, long size) { 7 | super(message); 8 | this.setSize(size); 9 | } 10 | 11 | public long getSize() { 12 | return size; 13 | } 14 | 15 | public void setSize(long size) { 16 | this.size = size; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-hdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/btn_star_big_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-hdpi/btn_star_big_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/btn_star_big_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-hdpi/btn_star_big_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/dropdown_ic_arrow_normal_holo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-hdpi/dropdown_ic_arrow_normal_holo_dark.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/dropdown_ic_arrow_pressed_holo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-hdpi/dropdown_ic_arrow_pressed_holo_dark.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_btn_find_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-hdpi/ic_btn_find_prev.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_dropdown_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-hdpi/ic_dropdown_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-hdpi/ic_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu_sort_by_size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-hdpi/ic_menu_sort_by_size.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-hdpi/ic_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_search_api_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-hdpi/ic_search_api_holo_light.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_search_category_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-hdpi/ic_search_category_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-ldpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/btn_star_big_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-ldpi/btn_star_big_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/btn_star_big_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-ldpi/btn_star_big_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/ic_menu_sort_by_size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-ldpi/ic_menu_sort_by_size.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-ldpi/ic_search_category_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-ldpi/ic_search_category_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-mdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/btn_star_big_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-mdpi/btn_star_big_off.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/btn_star_big_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-mdpi/btn_star_big_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/dropdown_ic_arrow_normal_holo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-mdpi/dropdown_ic_arrow_normal_holo_dark.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/dropdown_ic_arrow_pressed_holo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-mdpi/dropdown_ic_arrow_pressed_holo_dark.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_btn_find_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-mdpi/ic_btn_find_prev.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_dropdown_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-mdpi/ic_dropdown_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-mdpi/ic_menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_menu_sort_by_size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-mdpi/ic_menu_sort_by_size.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-mdpi/ic_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_search_api_holo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-mdpi/ic_search_api_holo_light.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_search_category_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-mdpi/ic_search_category_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/app/src/main/res/drawable-xhdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/layout/actionbar_spinner.xml: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/character_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 19 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/child_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/class_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 19 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/default_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 19 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/details_phone.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 14 | 20 | 21 | 28 | 29 | 38 | 49 | 54 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/layout/details_phone_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 14 | 19 | 20 | 27 | 28 | 37 | 48 | 53 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /app/src/main/res/layout/details_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 14 | 25 | 35 | 36 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/feat_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 18 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/group_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main_phone.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 14 | 19 | 20 | 27 | 28 | 37 | 48 | 53 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /app/src/main/res/layout/monster_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 18 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/monster_main_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 15 | 25 | 34 | 35 | 42 | 48 | 56 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/res/layout/rule_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 19 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/search_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 19 | 28 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/layout/section_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 14 | 23 | 34 | 39 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/res/layout/skill_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 19 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/spell_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 19 | 25 | 34 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/spell_main_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 22 | 31 | 40 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/layout/startup.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | 14 | 21 | 22 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/menu/display_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 11 | 13 | 15 | 17 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 11 | 13 | 15 | 17 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 632.0dip 4 | 598.0dip 5 | 632.0dip 6 | 598.0dip 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Masterwork Tools: Pathfinder Open Reference 4 | Search for article name 5 | Search 6 | OGL 7 | Community Use License 8 | Preferences 9 | History 10 | Google+ Community 11 | Toggle Find/ToC 12 | #FFFFFF 13 | #000000 14 | #CCCCCC 15 | #BBBBBB 16 | 19 | 23 | 24 | Add new collection… 25 | New Collection 26 | What\'s the name of your new collection/character? 27 | Added new collection. 28 | Couldn\'t add collection! 29 | 30 | Remove collection… 31 | Remove Collection 32 | Select collection to remove. 33 | Removed collection. 34 | Couldn\'t remove collection! 35 | Masterwork Tools: Pathfinder Open Reference 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preference_headers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |
7 | 10 |
11 | 12 |
-------------------------------------------------------------------------------- /app/src/main/res/xml/searchable.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | jcenter() 5 | } 6 | dependencies { 7 | classpath 'com.android.tools.build:gradle:1.2.3' 8 | } 9 | } 10 | 11 | allprojects { 12 | repositories { 13 | jcenter() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Compiles and packages Pathfinder Open Reference Api Contracts package 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip 7 | -------------------------------------------------------------------------------- /local.properties: -------------------------------------------------------------------------------- 1 | ## This file is automatically generated by Android Studio. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must *NOT* be checked into Version Control Systems, 5 | # as it contains information specific to your local configuration. 6 | # 7 | # Location of the SDK. This is only used by Gradle. 8 | # For customization when using a Version Control System, please read the 9 | # header note. 10 | #Sat Mar 19 19:13:18 MDT 2016 11 | sdk.dir=/home/devon/Android/Sdk 12 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':acra-4.8.5' 2 | -------------------------------------------------------------------------------- /tools/pfor-contracts.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devonjones/PathfinderOpenReference/ec252bf9e6fdd2571297934eb38643e8c77de87c/tools/pfor-contracts.jar -------------------------------------------------------------------------------- /tools/split.sh: -------------------------------------------------------------------------------- 1 | split --numeric-suffixes --bytes=1048576 psrd.db ../assets/psrd.db. 2 | --------------------------------------------------------------------------------