GithubHelp home page GithubHelp logo

viewsofandroidingithub / progressedview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yayaa/progressedview

0.0 2.0 0.0 388 KB

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... Ladda kind progress for Android.

Java 100.00%

progressedview's Introduction

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.

Get it on Google Play

Inspired by ['Ladda' project] 3

License 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.

progressedview's People

Contributors

yayaa avatar

Watchers

James Cloos avatar hss01248 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.