Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonathanmerritt/androidscabbard
A set of base dagger classes for common android components.
https://github.com/jonathanmerritt/androidscabbard
android android-library dagger dagger-android dagger-android-support dagger2 dagger2-android dagger2-android-support
Last synced: 8 days ago
JSON representation
A set of base dagger classes for common android components.
- Host: GitHub
- URL: https://github.com/jonathanmerritt/androidscabbard
- Owner: JonathanMerritt
- License: apache-2.0
- Created: 2018-02-03T21:11:35.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-28T07:18:18.000Z (almost 7 years ago)
- Last Synced: 2024-03-20T19:30:28.329Z (11 months ago)
- Topics: android, android-library, dagger, dagger-android, dagger-android-support, dagger2, dagger2-android, dagger2-android-support
- Language: Java
- Homepage:
- Size: 283 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Android Scabbard
[![BINTRAY][BINTRAY-SVG]][BINTRAY]
[![MAVEN-CENTRAL][MAVEN-CENTRAL-SVG]][MAVEN-CENTRAL]
[![TRAVIS-CI][TRAVIS-CI-SVG]][TRAVIS-CI]**A set of base dagger classes for common android components.**
#
The main reason for creating the library, was to avoid having to copy over the same base dagger classes for
every new project.I intended for it to be just the `annotations` library, which contains `@Scope`'s and `@Qualifier`'s, however
I decided to add the `core` library, which contains `@Module`'s.Each one has a `-support` library equivalent, to 'somewhat' match daggers' structure.
_Any help or contribution is welcome._
## Download
#### Gradle
```groovy
repositories {
jcenter()
//OR
mavenCentral()
}
dependencies {
implementation "com.github.jonathanmerritt.androidscabbard:annotations OR* core:x.y.z"
//AND OR**
implementation "com.github.jonathanmerritt.androidscabbard:annotations-support OR* core-support:x.y.z"
}
```#### Maven
```xml
com.github.jonathanmerritt.androidscabbard
annotations OR* core
annotations-support OR* core-support
x.y.z
pom
```
*`core` libraries will include their equivalent `annotations` library automatically.
**`-support` variants will NOT include their equivalents.
## Usage
This small example simply `Provides` an `ActivityScoped ActivityQualified String`._Check the sample apps for more detailed examples._
#### Annotations
```java
@Module public interface SomeActivityModule {
@ActivityScoped @ActivityQualified @Provides static String provideActivityTag(SomeActivity someActivity) {
return activity.getClass().getSimpleName();
}
}
```#### Core
```java
@Module(includes = HasActivityModule.class) public interface SomeActivityModule extends IsActivityModule {
@ActivityScoped @ActivityQualified @Provides static String provideActivityTag(@ActivityQualified Class> activityClass) {
return activityClass.getSimpleName();
}
}
```## TODO
- Improve sample apps.
- Add overview of classes to README.
- Quadruple check stuff.
- Bump to 1.0.0.
- ...## License
[Apache-2.0][LICENSE]Copyright 2018 Jonathan Merritt [email protected]
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 athttp://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.[BINTRAY-SVG]:https://img.shields.io/bintray/v/jonathanmerritt/AndroidScabbard/annotations.svg?style=flat-square&colorB=067EC4&label=Bintray
[BINTRAY]:https://bintray.com/jonathanmerritt/AndroidScabbard/annotations/_latestVersion
[MAVEN-CENTRAL-SVG]: https://img.shields.io/maven-central/v/com.github.jonathanmerritt.androidscabbard/annotations.svg?style=flat-square&colorB=067EC4&label=MavenCentral
[MAVEN-CENTRAL]: http://repo1.maven.org/maven2/com/github/jonathanmerritt/androidscabbard/annotations
[TRAVIS-CI-SVG]: https://img.shields.io/travis/JonathanMerritt/AndroidScabbard.svg?style=flat-square&colorB=067EC4&label=TravisCI
[TRAVIS-CI]: https://travis-ci.org/JonathanMerritt/AndroidScabbard[RELEASES]: https://github.com/JonathanMerritt/AndroidScabbard/releases
[LICENSE]: https://github.com/JonathanMerritt/AndroidScabbard/blob/master/LICENSE.txt