LicenseAdapter


Source link: https://github.com/yshrsmz/LicenseAdapter

LicenseAdapter

Adapter library for RecyclerView to display your app's OSS dependencies.

This library fetch license text from GitHub(and your custom location), so technically this library is capable of displaying any license.

Installation

LicenseAdapter is distributed via jCenter.

dependencies {

compile 'net.yslibrary.licenseadapter:licenseadapter:LATEST_LIBRARY_VERSION' 
}

Usage

Don't forget to add android.permission.INTERNET permission to your AndroidManifest.

// create list of licenses List<LicenseEntry> dataset = new ArrayList<>();
  // library that is not hosted on GitHub dataset.add(Licenses.noContent("Android SDK", "Google Inc.", "https://developer.android.com/sdk/terms.html"));
  // library that does not have their license online dataset.add(Licenses.noLink("Google Play Services", "Google Inc.", GoogleApiAvailability.getInstance().getOpenSourceSoftwareLicenseInfo(getContext())));
  // library that is hosted on GitHub, but does not provide license text dataset.add(Licenses.fromGitHub("gabrielemariotti/changeloglib", Licenses.LICENSE_APACHE_V2));
  // Apache v2 library that is hosted on GitHub dataset.add(Licenses.fromGitHubApacheV2("realm/realm-java"));
 dataset.add(Licenses.fromGitHubApacheV2("square/retrofit"));
  // BSD library that is hosted on GitHub dataset.add(Licenses.fromGitHubBSD("bumptech/glide"));
  // MIT library that is hosted on GitHub dataset.add(Licenses.fromGitHubMIT("jhy/jsoup"));
  // these 2 licenses have different branch name dataset.add(new GitHubLicenseEntry(Licenses.NAME_APACHE_V2, "ReactiveX/RxAndroid", "2.x/", null, Licenses.FILE_AUTO));
 dataset.add(new GitHubLicenseEntry(Licenses.NAME_APACHE_V2, "ReactiveX/RxJava", "2.x/", null, Licenses.FILE_AUTO));
  // create adapter LicenseAdapter adapter = new LicenseAdapter(dataset);
 RecyclerView list = (RecyclerView) findViewById(R.id.list);
 list.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
 list.setAdapter(adapter);
  // finally load license text from Web Licenses.load(dataset);

Predefined License name strings

License name Actual variable
Apache License V2.0 Licenses#NAME_APACHE_V2
MIT LICENSE Licenses#NAME_MIT
BSD LICENSE Licenses#NAME_BSD

Predefined License file name

License file name Actual variable
Automatically find the license file from the predefined set below Licenses#FILE_AUTO
LICENSE Licenses#FILE_NO_EXTENSION
LICENSE.txt Licenses#FILE_TXT
LICENSE.md Licenses#FILE_MD

Apps using LicenseAdapter

Send PR if you want your app to be included here ;)

License

Copyright 2016-2017 Shimizu Yasuhiro (yshrsmz)  Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License. You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

Resources

An Android module that makes WebRTC signaling easy!

A Java-language API for doing compile time or runtime code generation targeting the Dalvik VM. Unlike cglib or ASM, this library creates Dalvik .dex files instead of Java .class files.

A region under finger becomes transparent and shows the bottom part of the image layout area.

Hardware accelerated transcoder for Android, written in pure Java.

Satellite is a simple (for those who are familiar with RxJava) Android library, which allows to properly connect background tasks with visual parts of an application.

RxT4A - RxJava Toolbox for Android (a fork of RxAndroid).

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes