Drag Dialog to either Top or Bottom to close
Extend DragDialogFragment
and override the abstract methods View getContentView()
and int getLayoutResId()
.
getContentView()
should return the View that will be dragged, usually the first child of your dialog layout.
getLayoutResId()
should return the layout id of your dialog.
Override getCloseDirection()
if you wish to control in which direction the Dialog needs to be dragged to close.
Possible values are TOP
, BOTTOM
. Defaults to BOTH
Check the Samples for possible implementations.
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
compile 'com.github.wengelef:DragToCloseDialog:0.3.0'
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.wengelef</groupId>
<artifactId>DragToCloseDialog</artifactId>
<version>0.3.0</version>
</dependency>
Copyright 2017 Florian Wengelewski
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 at
http://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.