Giter Club home page Giter Club logo

aic-mobile-android's Introduction

Art Institute of Chicago

CircleCI

Art Institute of Chicago Official Mobile App

A digital guide to the Art Institute of Chicago. Built with Kotlin 1.x for Android.

Please see this page for the iOS counterpart.

The Art Institute of Chicago app is your personal, pocket-sized guide to our collection. The mobile experience offers high-quality audio storytelling, letting the art speak to you. The Art Institute offers nearly a million square feet to explore—the Official Mobile App will be your guide.

Note that the codebase is young, and under heavy development. It might change significantly before the first official release. Nevertheless, we welcome suggestions and contributions from outside parties.

License

This codebase is licensed under the GNU Affero General Public License v3 as defined in the top-level LICENSE file. We make heavy use of the Android support libraries and the Kotlin programming language - our modifications to those, if any, are also licensed under the AGPL, unless otherwise indicated.

The following modules use proprietary APIs:

  • The map module includes Google's "GoogleMap" and "LatLng" classes.
  • The analytics module connects to Google Analytics

Project architecture

The source code is organized into multiple Gradle modules, each of which is contained within a top-level directory. A full list of such modules can be found in the settings.gradle config file.

The project maintains an overview of the more interesting modules in MODULES.md.

How to Build

This project should build perfectly as is using the standard build commands, but is unlikely to function properly without key attributes defined in the build process.

Details below:

In .circleci/ you will find a config.yml which controls our circle ci build process.

./gradlew assembleDebug assembleRelease

Environment Variables

There is one hidden aspect of the build process not available for public consumption which is the keystore and keys used in the app. Due to infrastructure difference between our public build server and release of the app we handle injecting these variables into our build process by using the method envVariable(key, isRelease) within the gradle files.

This function loads all the appropriate values for the keys from one of three places depending on where you define them. You can see the full set of values needed in env.sample.

These values are loaded from one of the following sources, listed here in decreasing order of priority:

  • release.env or debug.env (Deployments use this model)
  • local.properties (Development uses this model primarily)
  • environment variables (Circle CI, uses this model)

Sample (added for reference as well)

blob_url=
default_buy_url=
member_validation_url=
member_validation_token=
fb_project_id=
fb_application_id=
fb_api_key=
fb_storage_bucket=
ga_tracking_id=
gcm_sender_id=
google_maps_api_key=
keystore=
keystore_password=
keystore_alias=
keystore_alias_password=

Bundling App Data as JSON (debug builds only)

As a special case, if blob_url is not defined or is not a string starting with https://, the app can run in a reduced capacity. This feature is intended for debug configurations only and thus does nothing in release builds.

If a JSON file

  1. was present in either db/src/main/assets/ or db/src/debug/assets/ at build time
  2. had the name app-data-v3.json and
  3. conforms to the expected format of ArticAppData

then the content of that JSON file will overwrite whatever content is currently in the database.

aic-mobile-android's People

Contributors

agrosner avatar caguilar187 avatar cliabhach avatar nuudles avatar raigex avatar sam33rdhakal avatar surreal8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aic-mobile-android's Issues

Reduce code duplication surrounding the `:welcome` module

The issue

As it stands at v1.0, there are some significant quantities of code duplication between

  • WelcomeTourCellViewModel and AllToursCellViewModel
  • WelcomeEventCellViewModel and AllEventsCellViewModel
  • WelcomeExhibitionCellViewModel and AllExhibitionsCellViewModel
  • AllEventsFragment, AllToursFragment, and AllExhibitionsFragment
  • the layout files used by above classes
  • the navigation paradigms used by above classes
  • the RecyclerView adapters used by the above classes.

This causes no small amount of overhead when editing related visual elements (c.f. PRs #220, #230, #240, #260, #268, #289, etc).

Where it came from

I harbor no ill will towards the existing structure of these elements. Earlier understandings of the desired screens had less commonality and the development team thus took an apprehensive stance towards consolidation. At this stage in the application development process, though, we can be assured that the degree of deviation is much less than then-anticipated.

Resolution plan

By combining the related files into one module, it should be easier to detect inadvertent inconsistencies and share logic to the greatest extent permissible. The new module's name should represent the shared goal of the files aligned with AllEvents, AllExhibitions and AllTours. Name suggestions are welcome, of course, but I will start work with the working title :content_listing for now.

`DropdownTextView` does not always function correctly

This corresponds to the problems we saw in #358 and #357 , under ticket AIC-646.

Put simply, if we define

<edu.artic.view.DropdownTextView
    android:id="@+id/whatever"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:visibility="gone"
    />

then RxJava2 calls such as this one sometimes fail to trigger. While we have not been able to calculate a precise incidence rate the Samsung Galaxy S8+ is particularly susceptible. Our current logic inverts the logic (that is, show the views by default and only hide them if derived text is empty), and this seems to work.

@agrosner do you have any thoughts? Perhaps the show binding is being set up too late or disposed of too early?

Correct some ConstraintLayout usage

We disabled the MissingConstraints Lint check a while ago, and just today I merged in #363 to disable NotSibling as well. These sorts of issues can (and do) break the build, so the sooner we ensure compliance the better.

Perhaps updating ConstraintLayout will help? Or can we just make simple fixes to the affected layouts? Feel free to add suggestions.

Audit code before end of 2018

This codebase has changed a lot since the first commit. @sam33rdhakal and myself will undertake a basic audit, looking for the following things:

  • Code we don't understand
  • Duplicated code
  • Unused code
  • Over-complicated code

We'll create PRs for these as we see them, and link them back to this issue. Note that we are not looking to make any significant changes to business logic; if they do get proposed, such changes will be highlighted.

You can follow along with our progress in the branch code_audit; I'm adding comments and questions in the branch pc-identify-codebase-problems-2018.

Add Custom Floor Adapter for Moshi Parsing.

We can parse the floor out of the gallery directly.
Objects have a gallery location which has floor in it.
Adding floor var with Int.MIN_VALUE might lead to confusion/bug if the floor is not assigned before it is accessed.

We could add the moshi adapter to convert floor string into the int in ArticGallery.
You could use it in ArticGallery.

/**
 * Parses floor as an integer. We default to [Int.MIN_VALUE] as 0 is a valid floor.
 */
class FloorAdapter {

    @ToJson
    fun toText(@Floor floor: Int): String = floor.toString()

    @FromJson
    @Floor
    fun fromText(text: String?): Int {
        return if (text != null) {
            try {
                return text.toInt()
            } catch (e: NumberFormatException) {
                if (text == "LL") {
                    0
                } else {
                    INVALID_FLOOR
                }
            }
        } else {
            INVALID_FLOOR
        }

    }
}

@Retention(AnnotationRetention.RUNTIME)
@JsonQualifier
annotation class Floor
then annotate the floor field in data class

        @Floor @Json(name = "audio_transcript")  val floor: Int

[Enhancement] Add BaseAdapterConverter for `Spinner` implementations.

  1. BaseAdapterBinder handles conversions.
  2. BaseRecyclerViewAdapter needs to be updated to support dropdown view handling to support Spinner dropdown methods. Or decide on utilizing a valid subclass or wrapper implementation.
  3. Update @Cliabhach code for LanguageAdapter to use this implementation and update the code to be more RX-like.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.