Skip to content
A lightweight "about screen" library to allow quick but customizable attribution in Android apps.
Java
Branch: master
Clone or download
Latest commit 7319441 Jul 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
app update dependencies / minor fixes Nov 9, 2018
attribouter update version nums Nov 9, 2018
gradle/wrapper Migrate to AndroidX Sep 18, 2018
.travis.yml remove useless things from travis config Jan 6, 2019
LICENSE Update LICENSE Mar 7, 2018
README.md Update README.md Jul 8, 2019
build.gradle update dependencies / minor fixes Nov 9, 2018
gradle.properties Migrate to AndroidX Sep 18, 2018
gradlew add gradlew to git Jan 6, 2019
gradlew.bat add gradlew to git Jan 6, 2019
settings.gradle removed obsolete cli - #36 Aug 8, 2018

README.md

Attribouter Build Status Codacy Badge Discord Liberapay

Attribouter is a lightweight "about screen" for Android apps, built to allow developers to easily give credit to a project's contributors and open source libraries, while matching the style of their app and saving the largest amount of time and effort possible. It is meant to use GitHub's REST API to fetch and display information about open source projects and contributors, but it allows you to define some or all of its data in its configuration file in your app as well.

Screenshots

This is just sample data. It is not real. Though Jahir is lazy, so that part is (joking).

Contributors Contributor Licenses License
img img img img

APK

For demonstration and experimentation, an apk of the sample project can be downloaded here.

Usage

This project is published on JitPack, which you can add to your project by copying the following to your root build.gradle at the end of "repositories".

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

To add the dependency, copy this line into your app module's build.gradle file.

implementation 'me.jfenn:Attribouter:0.1.5'
Support Libraries

The Android support libraries have been refactored from android.support.* to androidx.* as detailed here. As such, Attribouter only uses the new dependencies. If your project still uses the older support libraries for some reason, you may either compile your own version of Attribouter or use the last version to use the old support libraries, 0.1.2.

Starting an Activity

This is pretty simple.

Attribouter.from(context).show();

Creating a Fragment

This is also pretty simple.

Fragment fragment = Attribouter.from(context).toFragment();

Things to Note

Request Limits

This library does not use an auth key for the GitHub API by default. It does cache data for up to 10 days to avoid crossing GitHub's rate limits, but if your project has more than a few contributors and libraries or you want it to have access to a private repository, you will need to provide an auth token by calling .withGitHubToken(token) on your instance of Attribouter.

Configuration

By default, Attribouter will use the configuration file at res/xml/attribouter.xml. You can either name your configuration file "attribouter.xml" to override the resource, or name it differently and call .withFile(R.xml.[name]) on your instance of Attribouter instead.

The configuration file consists of a single root element, <about>, with many child elements that can be placed any amount of times in any order, the same as views in a layout file. These elements, called "wedges" in this library for no apparent reason, are created by Attribouter and added to the page in the order and heirarchy that they are defined in. To create your configuration file, you can either use the file from the sample project as a template or use the documentation to write your own.

Proguard

This library uses GSON, which does not behave nicely with proguard as it uses reflection to instantiate classes and initialize variables based on their names. It is recommended to use the example configuration in GSON's repo to prevent these issues.

Used in

If you're using Attribouter in your project, feel free to reach out / make a PR to add it to this list!

Contributing

See CONTRIBUTING.md for information on how to contribute to this project.

You can’t perform that action at this time.