Crossword library for Android

Overview

Build Status Sonatype Nexus (Releases) License

Ararat

Ararat is a crossword library for Android, written for and used by alphacross. It includes:

For a demonstration, see the included demo app.

Screenshot

The sample crossword included in the app is Double-A's by Ben Tausig.

Quick Start

Add dependency to app/build.gradle (check to make sure you're using the latest version):

dependencies {
    implementation 'com.github.0xe1f:ararat:1.0.15'
}

Add view to your layout:

<org.akop.ararat.view.CrosswordView
    android:id="@+id/crossword"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

Initialize the view in OnCreate():

val crosswordView = findViewById<CrosswordView>(R.id.crossword)
crosswordView.crossword = readPuzzle()

Existing puzzles are usually read from a stream, e.g.:

fun readPuzzle(): Crossword = resources.openRawResource(R.raw.puzzle).use { s ->
    buildCrossword { PuzFormatter().read(this, s) }
}

For the activity to respond to soft keyboard changes, set android:windowSoftInputMode to adjustResize in the manifest:

<activity android:name=".MainActivity"
          android:windowSoftInputMode="adjustResize" />

Keyboard Support

CrosswordView was designed to work with the Android soft keyboard. Unfortunately, with the exception of maybe Google and the AOSP codebase, virtually no one follows the rules of Android IME, including many third-party manufacturers and authors of soft keyboards. They will often mistakenly assume that any view has full support of things like autocorrect and swiping - concepts that don't work in the limited scope of input needed for crosswords, and will ignore any attempts to disable those features.

If you're serious about your own crossword app, your best long term bet is to use your own KeyboardView and have it provide the input instead.

License

Copyright (c) 2014-2019 Akop Karapetyan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Comments
  • Not able to import some .puz files

    Not able to import some .puz files

    http://www.private-eye.co.uk/pictures/crossword/download/?O=D

    Attempting to import a few of the puzzles from the top of the above URL into Alphacross 1.80 results in some failures. I presume they are Across Lite compliant.

    Works: 586 590

    Doesn't: (Import failed - format not recognised) 585 587 588 591

    bug 
    opened by markclowes 3
  • Fix .puz parsing bug

    Fix .puz parsing bug

    Hi, I saw on your Twitter feed that you were having trouble keeping up with maintenance on Alphacross, so I figured I'd send you a PR instead of only reporting this bug.

    In PuzFormatter.kt the Across parsing logic uses <= but the Down parsing logic uses < for some reason, and this breaks puzzles that have a two-letter-long Down clue at the bottom of the grid:

    |Across Lite|Alphacross| |-|-| |acrosslite|alphacross|

    You can go here to download the puz file in the screenshots if you want to see the repro yourself and confirm the fix.

    Thanks for Alphacross, I use it every single day!

    opened by rileynull 2
  • How can I compare the user inserted data with solution

    How can I compare the user inserted data with solution

    After a user completes the crossword I want to compare the user submitted answer with the solution. I want to check how many of his answers were right/wrong. How to do that ??

    opened by abhay222 2
  • Alphacross

    Alphacross "notes" panel not scrollable

    I'm not sure if this is the right place, considering this is merely a repo for the library under alphacross, and not alphacross itself, but I think this is worth a shot.

    Is the "notes" section of a crossword (the one you get by pulling the bottom bar up) not scrollable, or is this an issue on my end? There are some crosswords (mostly imported ones) that have more text there than fits on screen, and I don't see a way to access those contents elsewhere in the app either.

    If it's not an issue on my end, could it be made scrollable?

    opened by MIC132 1
  • Switch from accross to down and vice-versa

    Switch from accross to down and vice-versa

    After all, thanks for this great/usefull work.

    I wanna know how to shitch from accross to down words and vice-versa when the user click on a button.

    Thanks

    opened by levilliard 1
  • [question: alphacross] how to import .puz files?

    [question: alphacross] how to import .puz files?

    Hi. Sorry to bother you. I just installed alphacross v1.96. So far, it looks perfect.. exactly what I wanted. I do have one question though. The description says that it can import external puzzles in .puz (Across Lite) file format.. but I don't see any UI that would allow me to do so. I was hoping that you would be so kind as to quickly explain how to do so.

    ex:

    • Should they be added to one of the directories under: /data/data/org.akop.crosswords/?
    • Is there a way to read them directly off of an external SD card?

    Much thanks!

    invalid 
    opened by warren-bank 1
  • Add unicode support to PuzFormatter

    Add unicode support to PuzFormatter

    Litsoft seems to have switched to using UTF-8 for text fields since version 2.0 of their format.

    AFAICT, major publishers (vz. NYT, LAT, Universal) all still use(d) version 1.3, so this doesn't come up too often, but Crosshare does use the 2.x era format for their puz exports. Their import logic checks whether the version field is at least version 2 in order to interpret the file as UTF-8. I'm not sure where that info came from (@mdirolf ???) but I don't think it's just a Crosshare idiosyncrasy. E.g. there's this tweet from the official Litsoft account.

    Trying to parse these UTF-8 -encoded puzzles as ISO-8859-1 results in a garbled mess. A handful of the puzzles I've seen are borderline unplayable, with clues made up entirely of emojis for example. But here's a relatively straightforward example of the fix:

    screenshots

    Some notes on code minutiae:

    1. I don't think the old verRev line made sense. version.length could never not be 4 - Java counts nulls as part of the string. In any case it was unused so I deleted it.
    2. As soon as we open an InputStreamReader, it's going to suck the whole file into its character decoding buffer. At that point it's too late to open another reader with a charset different from the default. And you can't change the charset of an open reader. So when do we open the reader? It seemed easiest to just wait until we've gotten to the point of reading the version, but that did require duplicating the ensureSkip extension method so that we can skip directly on the InputStream.
    3. I have no idea whether the 2.0 format is supposed to support UTF-8 grids or just clues/titles/descriptions/authors. This code assumes that the grid itself is also UTF-8, but if that's incorrect then this might break things for weird puzzles with special characters in the grid. In particular, I don't think scrambled files would auto-descramble correctly in the presence of special characters in the grid.
    opened by rileynull 0
  • PuzFormatter doesn't account for non-alpha characters

    PuzFormatter doesn't account for non-alpha characters

    PuzFormatter doesn't detect non-alpha characters during solution-reading phase, which prevents entry of non-alpha characters (effectively rendering the puzzle unsolvable).

    Sample puzzle: http://herbach.dnsalias.com/Jonesin/jz170715.puz

    jz170715.puz.zip

    bug 
    opened by 0xe1f 0
  • LA Times 03-03-2017

    LA Times 03-03-2017

    LAT puzzle for March 3 is being read/written incorrectly: http://cdn.games.arkadiumhosted.com/latimes/assets/DailyCrossword/la170303.xml

    Specifically, numbers are often zero, and cell selection is broken.

    bug 
    opened by 0xe1f 0
  • PzzlFormatter fails to parse horizontal-only words

    PzzlFormatter fails to parse horizontal-only words

    PzzlFormatter errors out when parsing cells that start an "across," but not "down" and vice versa, e.g.: http://nytsyn.pzzl.com/nytsyn-crossword/nytsyncrossword?date=160904

    bug 
    opened by 0xe1f 0
Owner
Akop Karapetyan
I write software; usually Android, sometimes macOS. Fan of classic computing/videogames, especially MSX
Akop Karapetyan
Nucleus is an Android library, which utilizes the Model-View-Presenter pattern to properly connect background tasks with visual parts of an application.

Nucleus Deprecation notice Nucleus is not under develpment anymore. It turns out that Redux architecture scales way better than MVP/MVI/MVVM/MVxxx and

Konstantin Mikheev 2k Nov 18, 2022
Moxy is MVP library for Android

Moxy This Moxy repository is deprecated and no longer supported. Please migrate to the actual version of the Moxy framework at Moxy communuty repo. De

Arello Mobile 1.6k Dec 28, 2022
Minimal UI library for Android inspired by React

Anvil - reactive views for Android Anvil is a small Java library for creating reactive user interfaces. Originally inspired by React, it suits well as

null 1.4k Dec 23, 2022
a MVP library for Android favoring a stateful Presenter

DEPRECATED - no longer actively maintained ThirtyInch - a MVP library for Android This library adds Presenters to Activities and Fragments. It favors

HCI @ gcx 1k Dec 15, 2022
A Mosby based VIPER library for Android

Moviper A Mosby based VIPER library for Android Why Moviper? You got tired because of fact that your Activities and Fragments were becoming god classe

Mateusz Koślacz 78 Nov 29, 2022
Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information about Marvel's vast library of comics. :zap:

Villains & Heroes Android app built with MVP architectural approach and uses Marvel Comics API that allows developers everywhere to access information

André Mion 53 Jul 13, 2022
The most complete and powerful data-binding library and persistence infra for Kotlin 1.3, Android & Splitties Views DSL, JavaFX & TornadoFX, JSON, JDBC & SQLite, SharedPreferences.

Lychee (ex. reactive-properties) Lychee is a library to rule all the data. ToC Approach to declaring data Properties Other data-binding libraries Prop

Mike 112 Dec 9, 2022
A lightweight, good expandability Android library used for displaying different pages like loading, error, empty, timeout or even your custom page when you load a page

中文 | English LoadSir ?? ?? LoadSir是一个高效易用,低碳环保,扩展性良好的加载反馈页管理框架,在加载网络或其他数据时候,根据需求切换状态页面, 可添加自定义状态页面,如加载中,加载失败,无数据,网络超时,如占位图,登录失效等常用页面。可配合网络加载框架,结合返回 状态

KingJA 3.3k Dec 21, 2022
Android part of the Android Studio(IntellijIDEA) OkHttp Profiler plugin

OkHttpProfiler Android Library Created by LocaleBro.com - Android Localization Platform The OkHttp Profiler plugin can show requests from the OkHttp l

Ievgenii 261 Dec 8, 2022
Android common lib, include ImageCache, HttpCache, DropDownListView, DownloadManager, Utils and so on

android-common-lib 关于我,欢迎关注 微博:Trinea 主页:trinea.cn 邮箱:trinea.cn#gmail.com 微信:codek2 主要包括:缓存(图片缓存、预取缓存、网络缓存)、公共View(下拉及底部加载更多ListView、底部加载更多ScrollView、

Trinea 5k Dec 30, 2022
dexposed enable 'god' mode for single android application.

What is it? Dexposed is a powerful yet non-invasive runtime AOP (Aspect-oriented Programming) framework for Android app development, based on the work

Alibaba 4.5k Dec 28, 2022
A small, yet full-featured framework that allows building View-based Android applications

Conductor A small, yet full-featured framework that allows building View-based Android applications. Conductor provides a light-weight wrapper around

BlueLine Labs 3.9k Jan 6, 2023
A Job Queue specifically written for Android to easily schedule jobs (tasks) that run in the background, improving UX and application stability.

This Project is Deprecated! Thanks to everybody who've used Android Priority JobQueue. It was designed in a world where there was no JobScheduler, RxJ

Yigit Boyar 3.4k Dec 31, 2022
A plugin system that runs like a browser, but instead of load web pages, it load apk plugins which runs natively on Android system.

Android Dynamic Loader Android Dynamic Loader is a plugin system. The host application is like a browser, but instead of load web pages, it load plugi

Tu Yimin 1.4k Dec 28, 2022
LiteOrm is a fast, small, powerful ORM framework for Android. LiteOrm makes you do CRUD operarions on SQLite database with a sigle line of code efficiently.

#LiteOrm:Android高性能数据库框架 A fast, small, powerful ORM framework for Android. LiteOrm makes you do CRUD operarions on SQLite database with a sigle line

马天宇 1.5k Nov 19, 2022
🚀Plugin for Android Studio And IntelliJ Idea to generate Kotlin data class code from JSON text ( Json to Kotlin )

JsonToKotlinClass Hi, Welcome! This is a plugin to generate Kotlin data class from JSON string, in another word, a plugin that converts JSON string to

Seal 2.8k Jan 3, 2023
Kick-starts Android application development.

Synopsis If you've made it here, chances are you are not quite as satisfied with the Android application framework as you could be. Same for us, that'

Matthias Käppler 1.3k Dec 4, 2022
Rosie is an Android framework to create applications following the principles of Clean Architecture.

Rosie The only way to make the deadline—the only way to go fast—is to keep the code as clean as possible at all times. — Robert C. Martin in Clean Cod

Karumi 1.8k Dec 28, 2022
Create kotlin android project with one line of command.

README This is an android application template project built with kotlin language and some useful libraries. It provides a creator script to quickly c

nekocode 1.6k Dec 20, 2022