https://github.com/omega-r/omegatypes
https://github.com/omega-r/omegatypes
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/omega-r/omegatypes
- Owner: Omega-R
- Created: 2018-06-26T10:31:13.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-08-08T15:41:07.000Z (almost 2 years ago)
- Last Synced: 2025-03-30T07:41:24.949Z (about 1 year ago)
- Language: Kotlin
- Size: 732 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://jitpack.io/#Omega-R/OmegaTypes)
[](https://opensource.org/licenses/MIT)
# OmegaTypes
OmegaTypes it's cover for:
1) String and @StringRes.
You can create Text class inside your presenter or somewhere else, and set it in activity. Activity doesn't need to know what type
of resource you use.
2) Drawable, Bitmap, @DrawableRes. Class Image has the similar idea with Text class.
# Installation
To get a Git project into your build:
**Step 1.** Add the JitPack repository to your build file
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
**Step 2.** Add the dependency
```
dependencies {
implementation 'com.github.Omega-R.OmegaTypes:omegatypes:1.0.0'
// implementation 'com.github.Omega-R.OmegaTypes:picasso:1.0.0' // for load url
}
```
# Usage
```
val text = Text.from(R.string.hello_world)
text.applyTo(exampleTextView) // or textView.setText(text)
val image = Image.from(R.mipmap.ic_launcher)
image.applyTo(imageView) // or imageView.setImage(image)
```
# License
```
The MIT License
Copyright 2018 Omega-R
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```