https://github.com/norbert515/dropdownwarning
Drop down message
https://github.com/norbert515/dropdownwarning
Last synced: about 1 year ago
JSON representation
Drop down message
- Host: GitHub
- URL: https://github.com/norbert515/dropdownwarning
- Owner: Norbert515
- License: mit
- Created: 2016-09-05T09:02:33.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-29T07:17:35.000Z (about 9 years ago)
- Last Synced: 2024-10-30T00:37:03.424Z (over 1 year ago)
- Language: Java
- Size: 372 KB
- Stars: 249
- Watchers: 11
- Forks: 40
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# DropDownWarning
Easy to implemente drop down warning/ message

# Installation
[Download the .aar file](https://github.com/Brudigem/DropDownWarning/raw/master/dropdownwarninglibrary-release.aar)
Go to *File* -> *New* -> *New Module* -> *Import .Jar/.AAR Package*
Add this to your dependecies
```
dependecies{
compile project (":dropdownwarninglibrary-release")
}
```
Or simply include
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
in your project gradle and then:
```
dependencies {
compile 'com.github.Norbert515:DropDownWarning:-SNAPSHOT'
}
```
# Code
First you need the top level Layout (most of the times it's a relative layout), you will need to give it an id in the XML.
```
RelativeLayout rootView = (RelativeLayout) findViewById(R.id.rootView);
```
Next you need to create a DropDownWarning.Builder
###Builder
```
DropDownWarning dropDownWarning = new DropDownWarning.Builder(Context context, ViewGroup parent)
.interpolatorIn(Interpolator interpolator) //Intepolator used for the "show" animation
.interpolatorOut(Interpolator interpolator) //Interpolator used for the "hide" animation
.animationLength(int length) //Lenght of the animation in ms
.textHeight(int height) //Height of the text view
.message(String message) //Message to display
.foregroundColor(int color) //Color of the text in argb
.backgroundColor(int color) //Color of the background in argb
.build() //return DropDownWarning
```
To display the warning you need to call:
```
dropDownWarning.show()
```
and to hide it:
```
dropDownWarning.hide()
```
#License
```
MIT License
Copyright (c) 2016 Norbert Kozsir
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.
```