https://github.com/mfori/swipetohidelayout
Simple android library for hiding views by dragging them out
https://github.com/mfori/swipetohidelayout
android animation drag draggable hide-show layout swipe view
Last synced: 8 months ago
JSON representation
Simple android library for hiding views by dragging them out
- Host: GitHub
- URL: https://github.com/mfori/swipetohidelayout
- Owner: MFori
- License: mit
- Created: 2018-02-08T15:58:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-09T22:09:01.000Z (over 8 years ago)
- Last Synced: 2025-07-01T08:11:22.826Z (12 months ago)
- Topics: android, animation, drag, draggable, hide-show, layout, swipe, view
- Language: Java
- Homepage:
- Size: 188 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwipeToHideLayout
Simple android lib for hiding out views by draging them out of screen in the set direction.
Also provides methods for hiding and showing them manually.
### Importing the library
Simply add the following dependency to your build.gradle file:
```
compile 'cz.martinforejt:swipetohidelayout:1.0.4'
```
### Usage
Work with SwipeToHideLayout like with android FrameLayout.
Direction must be set (xml or ```setDirection(int)```) or exception will be thrown!
The layout must be aligned to side that is defined by direction. The width/height can not be ```MATCH_PARENT``` in sliding direction.
```
```
```
final SwipeToHideLayout top = findViewById(R.id.layout_top);
top.setOnSwipeChangeListener(new OnSwipeChangeListener() {
@Override
public void onSwipeChange(boolean visible, SwipeHideable swipeHideable) {
// catch swipe
}
});
```
### XML attributes
```
direction - drag direction (left, top, right, bottom)
enabled - is dragging enabled (true, false)
```
### Methods
public methods from
SwipeHideable.java
### Javadoc
https://mfori.github.io/SwipeToHideLayout/


