diff --git a/README.md b/README.md index a73d8bb..a800898 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -28,8 +38,23 @@ The configuration file consists of a single root element, ``, with severa #### `` 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`.| + #### `` -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.| #### `` Shows a list of the contributors of a project on github, merged with a list of child `` 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. @@ -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.| @@ -62,3 +88,34 @@ A list of the open source licenses used by the project. Child elements are `