ProgressedView


Source link: https://github.com/yayaa/ProgressedView

ProgressedView

ProgressedView provides you to show progress when user clicks to any view, and then you're done with the task reverse it back to view again. This view extends RelativeLayout, so it is easy to implement in xml or by code.

ProgressedView can host only one child. Becuase it adds another view, which contains progressbar and seekbar, just with exact layoutparams with source view.

Implementation

<com.yayandroid.progressedview.ProgressedView

android:id="@+id/progressed"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_centerInParent="true"

app:animationTime="1000"

app:animationType="swipe_top_to_bottom"

app:bringTargetFront="false"

app:interpolation="bounce"

app:defaultBackgroundColor="#0072C3"

app:progressType="just_indeterminate"

app:remainSteady="false"

app:reversingAnimationType="swipe_top_to_bottom" >

 <Button

 android:layout_width="wrap_content"

 android:layout_height="wrap_content"

 android:layout_centerInParent="true"

 android:padding="10dp"

 android:text="@string/button_text" />
  </com.yayandroid.progressedview.ProgressedView>

You can specify almost everything in xml, and because it extends from RelativeLayout you can put your view inside it as easy as it is Relative. You don't have to give any of these specifications, but otherwise library will be using default variables. All variables have setter methods, so you can modify them in code.

There are two important flags:

1- remainSteady, if you set this true then your source view will not move when progress view comes. This is pretty if you're using one of swipe animations, otherwise it doesn't even seem any different.

2- bringTargetFront, if this is set true that means whichever view will come, it will come to front. So if you set remainSteady flag true and check out one of swipe animation you will not be able to see reversing animation becuase progress view is top on your source view, setting this true solve that issue.

Animation Types

public enum AnimationType {

 SWIPE_LEFT_TO_RIGHT, SWIPE_RIGHT_TO_LEFT, SWIPE_TOP_TO_BOTTOM, SWIPE_BOTTOM_TO_TOP,

SCALE_IN, SCALE_OUT, ALPHA 
}

You can easily set animation types for changing view to progress, and reversing back to view. The animations don't have to be same, you can choose them seperately. And if you choose, only view to progress animation then library will decide what reversing animation should be.

Progress Style

And also possible to change progress style, which is more limited for now:

public enum ProgressType {

 JUST_INDETERMINATE, JUST_SEEK, SEEK_AND_INDETERMINATE 
}

You can choose whether you need to display progress with seekbar or just with indeterminated progress bar. To display seek bar, you can check out examples; for default seekbar, for custom seekbar

Interpolations

You can also specify interpolations which they are defined as attributes so you can simply implement them from xml, or you can set them from code as well. Used interpolations:

AccelerateInterpolator,  DecelerateInterpolator,  AccelerateDecelerateInterpolator,  AnticipateInterpolator,  OvershootInterpolator,  AnticipateOvershootInterpolator,  BounceInterpolator,  LinearInterpolator, // As default  CycleInterpolator // Not so effective for this library

Customization

You can customize all parts of this view, and even just from xml.

You can change background color of default progress view. Or background and progress colors of default seek bar.

If you want to show a custom progressbar, or custom seekbar, or anything else. Just create a layout and point it to progressedView. It will switch your custom view with the animations you choose.

app:progressLayout="@layout/custom_progress_layout"

Link

You can download sample project below from Google Play Store.

Inspired by 'Ladda' project

License

Copyright 2013 yayandroid  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 TextView that supports highlighting parts or all of the text contained in it.

It is a custom implementation of nested timeline view using RecyclerView.

A drop-in custom layout manager for Android RecyclerViews to layout a grid of photos while respecting their aspect ratios.

A simple material design app intro with cool animations and a simple API.

An Android Library for common network operations with a fluent and easy to use API.

An Android library for cycling through views using animations. The library provides 2 animations as built in animations: a flip animation and a fade animation.

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