Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
fennifith committed Mar 14, 2018
2 parents 539be31 + 0712166 commit 527e802
Showing 1 changed file with 58 additions and 1 deletion.
59 changes: 58 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
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.

## Screenshots

|Contributors|Contributor|Licenses|License|
|-----|-----|-----|-----|
|![img](https://jfenn.me/images/screenshots/Attribouter-Main.png)|![img](https://jfenn.me/images/screenshots/Attribouter-Contributor.png)|![img](https://jfenn.me/images/screenshots/Attribouter-Licenses.png)|![img](https://jfenn.me/images/screenshots/Attribouter-License.png)|

## Usage

### Setup
Expand All @@ -20,6 +26,10 @@ This is also pretty simple.
Fragment fragment = Attribouter.from(context).toFragment();
```

### 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](https://developer.github.com/v3/rate_limit/), but if your project has more than 10 contributors or 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](https://github.com/TheAndroidMaster/Attribouter/blob/master/attribouter/src/main/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.

Expand All @@ -28,8 +38,23 @@ The configuration file consists of a single root element, `<about>`, with severa
#### `<appInfo>`
Displays the app icon, name, version, and links to the project on github and its website if available.

|Attribute|Type|Description|
|-----|-----|-----|
|repo|String (name/repository)|The github repository to fetch data from.|
|icon|String (URL) / Drawable Resource|The app icon to display.|
|description|String / String Resource|A short description of the app/project.|
|playStoreUrl|String / String Resource (URL)|The URL of the app on the Play Store (generated from the package name by default).|
|showPlayStoreUrl|Boolean|Whether to display the "rate" button (defaults to true).|
|websiteUrl|String / String Resource (URL)| The website of the project.|
|gitHubUrl|String / String Resource (URL)|The URL for the open source GitHub project. You do not need to define this if it is the same as `repo`.|

#### `<text>`
A block of text. Has two possible attributes, `text` (a string or string resource, can be formatted in html (links work too)) which defines the text to display, and `centered` (a boolean) which either centers the text (it is left aligned by default).
A block of text.

|Attribute|Type|Description|
|-----|-----|-----|
|text|String / String Resource (HTML)|A string or string resource, can be formatted in html (links work too) that defines the text to display.|
|centered|Boolean|Whether the text should be centered.|

#### `<contributors>`
Shows a list of the contributors of a project on github, merged with a list of child `<contributor>` elements defined in the configuration file. For example, if a user with the login "TheAndroidMaster" is both in GitHub and the configuration file, its attributes will be merged so that any attributes beginning with a "^" character will override the information from GitHub, and any attributes not beginning with a "^" character will be used while the GitHub information is loading, or if the information from GitHub is not present or unavailable.
Expand All @@ -38,6 +63,7 @@ Shows a list of the contributors of a project on github, merged with a list of c

|Attribute|Type|Description|
|-----|-----|-----|
|repo|String (name/repository)|The GitHub repository to fetch contributors from.|
|login|String|The GitHub username/login of the contributor (especially useful for overriding specific attributes of certian contributors.|
|name|String / String Resource|The name of the contributor.|
|avatar|String (URL) / Drawable Resource|The "profile picture" of the contributor.|
Expand All @@ -62,3 +88,34 @@ A list of the open source licenses used by the project. Child elements are `<pro
|licenseName|String / String Resource|The name of the license.|
|licenseBody|String / String Resource|The content of the license.|
|licenseUrl|String / String Resource|The URL of the license.|

### Things You Can Override

Couple strings, drawables, themes, etc. If you make any translations, feel free to make a PR because I like PRs. PRs are nice.

|The thing|What the thing is|What the thing's supposed to do|
|-----|-----|-----|
|@style/AttribouterTheme|Extension of `Theme.AppCompat.Light.NoActionBar`|Defines colors and stuff.|
|@string/title_attribouter_about|"About"|Toolbar title.|
|@string/title_attribouter_version|"Version %1$s"|The app version thing name thing.|
|@string/title_attribouter_contributors|"Contributors"|Header of the contributors section.|
|@string/title_attribouter_licenses|"Open Source Licenses"|Header of the licenses section.|
|@string/title_attribouter_license|"License"|I can't remember, but this probably does something somewhere.|
|@string/title_attribouter_license_permissions|"Permissions"|Title of the 'permissions' section of the license dialog.|
|@string/title_attribouter_license_conditions|"Conditions"|Title of the 'conditions' section of the license dialog.|
|@string/title_attribouter_license_limitations|"Limitations"|Title of the 'limitations' section of the license dialog.|
|@string/title_attribouter_more_info|"More Info"|Title of the 'more info' button at the bottom of the license dialog.|
|@string/title_attribouter_email|"Email"|Title of the "email" button in the contributor dialog.|
|@string/title_attribouter_website|"Website"|Title of the website buttons on... yeah just about everything.|
|@string/title_attribouter_github|"GitHub"|Title of the GitHub buttons on... also just about everything.|
|@string/title_attribouter_rate|"Rate"|Title of the Rate button.|
|@color/attribouter_licensePermissionsColor|#00C853|Color of the 'permissions' header in the license dialog.|
|@color/attribouter_licenseConditionsColor|#0091EA|Color of the 'conditions' header in the license dialog.|
|@color/attribouter_licenseLimitationsColor|#EF5350|Color of the 'limitations' header in the license dialog.|
|@drawable/ic_attribouter_arrow_back|--|Back arrow used in the dialog.|
|@drawable/ic_attribouter_copyright|--|Copyright icon. Buttons.|
|@drawable/ic_attribouter_email|--|Email icon. Buttons.|
|@drawable/ic_attribouter_github|--|GitHub icon. Buttons.|
|@drawable/ic_attribouter_link|--|Link icon. Buttons.|
|@drawable/ic_attribouter_rate|--|Rate/star icon. Buttons.|
|@drawable/bg_attribouter_emphasized|--|Rounded & slightly darkened background for the license names / text (in dialogs).|

0 comments on commit 527e802

Please sign in to comment.