TOBE CONTINUED WHEN FREE
- Add the repositories is root(build.gradle):
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency in app(build.gradle):
dependencies {
implementation 'com.github.Mohammad-Tabbara:TrailedSheet:1.0'
}
<com.tabbara.mohammad.trailedsheet.TrailedSheet
android:id="@+id/trailed_sheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF0000">
...
</com.tabbara.mohammad.trailedsheet.TrailedSheet>
Fling Up or down to trigger an EventInterface.
Drag Up or Down If The Drag exceeds half its hieght it will Trigger an EventInterface.
trailedSheet.lock(); //Disables TouchEvents(Parent and Children)
trailedSheet.unlock(); //Enables TouchEvents(Parent and Children)
trailedSheet.unlocked(); //Check Lock Status
trailedSheet.moveUp(); // animates moveup and triggers eventListener Up
trailedSheet.moveDown(); // animates movedown and triggers eventListener down
*ID is the id of the view
-
interface EventListener
void onExitUp(int id)
void onExitDown(int id)
-
DragListener:
void onDrag(int id)
-
ReleaseListener:
void onUp(int id)
-
WhileAnimatingListener:
void whileAnimatingUp(int id)
void whileAnimatingDown(int id)
Drag Orientation. In Xml Attributes.