Android library to display libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dc7ia 3b6b0b8f19 Translate to Norwegian Bokmål 1 month ago
app Translate to Norwegian Bokmål 1 month ago
demo Better dark theme support 1 month ago
gradle/wrapper Upgrade gradle and android plugin version 1 month ago
.gitignore Add gradle properties file 1 month ago
LICENSE License under CC0 6 months ago
README.md Link to weblate 1 month ago
build.gradle Upgrade gradle and android plugin version 1 month ago
gradle.properties Add gradle properties file 1 month ago
gradlew Add gradle wrapper (maybe?) 6 months ago
screenshot.png Update README 1 month ago
settings.gradle Add demo app module 1 month ago

README.md

librariesDirect

A library to view cedits to libraries included in an Android app.

minSdkVersion 14
targetSdkVersion 28

Including in your project

Please use Jitpack to download compiled AAR packages. See how here.

Usage

Getting an Intent

To call AboutLibrariesActivity, you have to use the builder class AboutLibrariesActivity.IntentBuilder like seen here:

new AboutLibrariesActivity.IntentBuilder(context)
    .setLibraries(…)
    .build();

These are the calls that you can use to configure the builder class:

setLibraries(Library[])

Pass an array of libraries. Here’s how a library is constructed:

new Library(String name, License license, @Nullable String foreword, String author, String url)
  • name: Name of the library
  • license: A license object. The License class has a small selection of licenses already hardcoded for you, including MIT and Apache 2.0, but you can construct your own license using new License(String name, String licenseText) as well.
  • foreword: Some people put one line or two of copyright statement above their paste of e.g. the MIT license. Use the foreword string in that case, or pass null.
  • author: Should fit into this sentence: “author is distributing this library.”
  • plural (optional): Whether author is a word that needs to be referred to in plural
  • url: The website that the library can be found at. May be null, in that case the “open externally” button will be hidden.

For example, if you wanted to credit librariesDirect, add this line to your Library array:

new Library("librariesDirect", License.CC0_LICENSE, null, "Fynn Godau", "https://codeberg.org/fynngodau/librariesDirect"),

setHeaderText(String)

The default header text is as follows. Pass a String if you wish to change it.

The following libraries are in use to make this application work.

librariesDirect only has very few strings, but you can still help translate them (beginning new translations is possible).

setConsumer(ContextConsumer)

Pass an implementation of the ContextConsumer interface in case there is something you need to do after the activity has launched, like setting style dynamically.

Therefore, the activities Context is provided to you in the interface’s accept(Context) method immediately before the layout is inflated.

Note that the ContextConsumer interface extends the Serializable interface. As such, all fields that your implementation has must also be Serializable.

build()

Once you are done, call build() on the builder class to receive an Intent which you can start using startActivity(…).

License

Because I think it would have been annoying to have to credit a library that is used to credit libraries, this library is licensed under CC0; no credits are required, even though they are welcome.

Screenshot

Screenshot