ElasticDragDismissLayout


Source link: https://github.com/Commit451/ElasticDragDismissLayout

ElasticDragDismissLayout

Standard ViewGroups which responds to nested scrolls to create drag-dismissable layouts. Original code taken from Plaid and made backwards compatible.

Gradle Dependency

Add this in your root build.gradle file ( not your module build.gradle file):

allprojects {
  repositories {

...
maven {
 url "https://jitpack.io" 
}
  
}
 
}

Then, add the library to your project build.gradle

dependencies {

  compile 'com.github.Commit451:ElasticDragDismissLayout:1.0.4' 
}

Usage

See the sample project for a full example. Within XML:

<com.commit451.elasticdragdismisslayout.ElasticDragDismissLinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/draggable_frame"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  app:dragDismissDistance="112dp"
  app:dragDismissScale="0.95">

<android.support.v7.widget.Toolbar

android:id="@+id/toolbar"

android:layout_width="match_parent"

android:layout_height="?attr/actionBarSize"

android:background="#993F51B5" />

<android.support.v7.widget.RecyclerView

android:id="@+id/recyclerview"

android:layout_width="match_parent"

android:layout_height="wrap_content" />  </com.commit451.elasticdragdismisslayout.ElasticDragDismissLinearLayout>

In addition, you will probably want to have your new activity have a theme that allows for transparency. See styles.xml for an example.

To allow for dismiss:

mDraggableFrame.addListener(new ElasticDragDismissListener() {

@Override

public void onDrag(float elasticOffset, float elasticOffsetPixels, float rawOffset, float rawOffsetPixels) {

}

 @Override

public void onDragDismissed() {

 //if you are targeting 21+ you might want to finish after transition

 finish();

}

  
}
);

Supported ScrollViews

  • ScrollView (if 21+ and android:nestedScrollingEnabled="true")
  • RecyclerView
  • NestedScrollView (from support v4 library)

Currently Created Elastic Views

  • ElasticDragDismissFrameLayout
  • ElasticDragDismissLinearLayout
  • ElasticDragDismissRelativeLayout

You can create your own by using the ElasticDragDismissDelegate and using one of the created views as a reference.

License

Copyright 2015 Google, Inc. Copyright 2016 Commit 451  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. 

Resources

An android api client based on Retrofit2 and RxJava2.

ProWebView is another WebView for Android with more functionality and without the hell of the WebClient and the WebChromeClient. With ProWebView you don't have to worry about asking permissions, file download, file upload, JS alerts and dialogs, links without protocols, cache managing and/or cookies managing.

It is an Android Library to customise toasts.

Generate a better rating for your Android app!

It is easy to present your users with a dialog begging for a 5-star rating, but it takes a bit more attention to do it right. This small library takes away the boiler plate and makes it easy to ask for a rating the friendly way.

PlayTabLayout is a tab layout very similar to Google Play tab layout. The main feature is that ripple shows in a particular place where user taps.

Use the LitToast to get lit and show your users a proper toast.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes