FireworkyPullToRefresh


Source link: https://github.com/Cleveroad/FireworkyPullToRefresh

#FireworkyPullToRefresh

Meet Fireworky Pull To Refresh for Android

It’s time to add some creativity to good old pull to refresh view. You can now literally launch your feed content or search results like a firework! Entertain your app users while they are waiting for refreshment — it’s easy with Fireworky Pull To Refresh library for Android apps.

#####Check out the animation on the Fireworky Pull To Refresh for Android on YouTube in HD quality.

What will you receive by using the Fireworky Pull To Refresh component in your app? The answer is pretty obvious: original and inspiring design element to generate well-disposed users. So, here you go!

Setup and usage

Installation

by Gradle:

 compile 'com.cleveroad:fireworkypulltorefresh:1.0.3'

or just download zip and import module "fireworky-pull-to-refresh" to be able to modify the sources.

Supported Views

  • RecyclerView
  • ListView
  • ScrollView
  • NestedScrollView

How do I get set up?

Just wrap your view:

<com.cleveroad.pulltorefresh.firework.FireworkyPullToRefreshLayout

android:id="@+id/pullToRefresh"

android:layout_width="match_parent"

android:layout_height="match_parent">

 <android.support.v7.widget.RecyclerView

 android:id="@+id/recyclerView"

 android:layout_width="match_parent"

 android:layout_height="match_parent"/>  </com.cleveroad.ptr.FireworkyPullToRefreshLayout>

Configuration

Via XML

<com.cleveroad.pulltorefresh.firework.FireworkyPullToRefreshLayout

xmlns:app="http://schemas.android.com/apk/res-auto"

...

app:ptr_fireworkColors="@array/fireworkColors"

app:ptr_background="@drawable/background"

app:ptr_rocketAnimDuration="1000">
attribute name description
ptr_fireworkColors An array of colors which will be used for firework animation
ptr_background Background drawable
ptr_backgroundColor Background color
ptr_rocketAnimDuration Rocket flight duration
ptr_fireworkStyle Fireworks animation style - classic (by default) or modern

Via Java code

//use .config() methods:  mPullToRefresh.getConfig().setBackground(backgroundDrawable);
 mPullToRefresh.getConfig().setBackground(backgroundBitmap);
 mPullToRefresh.getConfig().setBackground(R.drawable.background);
 mPullToRefresh.getConfig().setBackgroundColor(Color.BLACK);
 mPullToRefresh.getConfig().setBackgroundColorFromResources(R.color.background);
  mPullToRefresh.getConfig().setFireworkColors(colorsIntArray);
 mPullToRefresh.getConfig().setFireworkColors(R.array.fireworkColors);
  mPullRefreshView.getConfig().setFireworkStyle(Configuration.FireworkStyle.MODERN);
  mPullToRefresh.getConfig().setRocketAnimDuration(1000L);
 

Animation

Refreshing callback

Just implement PullToRefreshView.OnRefreshListener:

mPullToRefresh.setOnRefreshListener(new PullToRefreshView.OnRefreshListener() {

  @Override
  public void onRefresh() {

//refresh your data here

  
  
}
 
}
);

###To start or stop animation:###

mPullRefreshView.setRefreshing(isRefreshing);

Using custom views

For using custom views just implement FireworkyPullToRefreshLayout.OnChildScrollUpCallback:

mPullToRefresh.setOnChildScrollUpCallback(new FireworkyPullToRefreshLayout.OnChildScrollUpCallback() {

  @Override
  public boolean canChildScrollUp(@NonNull FireworkyPullToRefreshLayout parent, @Nullable View child) {

//put your implementation here
  
}
 
}
);

Support

If you have any questions regarding the use of this tutorial, please contact us for support at [email protected] (email subject: «FireworkyPullToRefresh for Android. Support request.»)
or
Use our contacts:
Cleveroad.com
Facebook account
Twitter account
Google+ account

License


 The MIT License (MIT)

Copyright (c) 2015-2016 Cleveroad

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. 

Resources

Circle timer on Android platform.

SVGMapView allows to display SVG on Android platform.

Nice seekbar for Android platform.

Easy way to add TextView above other views.

LoadingButton is a custom view that shows and hide progressBar with text animation. You can specify the text animation direction.

A project which showcases usage of Dagger, RxJava and Retrolambda among other open source libraries.

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