Git Product home page Git Product logo

fillprogresslayout's Introduction

FillProgressLayout

πŸ”₯A simple and flexible Fill Progress Layout written in KotlinπŸ”₯



Netflix button animation using FillProgressLayout


GitHub license Android Arsenal GitHub code size in bytes

Support Library alternative is available here


Installation

  1. Add it in your root build.gradle at the end of repositories:
	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
  1. Add the dependency in app gradle
	dependencies {
	        implementation 'com.github.JDevZone:FillProgressLayout:{latest_version}'
	}

Basic usage

As FillProgressLayout is direct child of LinearLayout you can replace LinearLayout with it as follows

<com.devzone.fillprogresslayout.FillProgressLayout
            android:id="@+id/fillL"
            android:layout_margin="30dp"
            app:fpl_backgroundColor="@color/colorRedTrans"
            app:fpl_progressColor="@color/colorGreenTrans"
            app:fpl_isRounded="false"
            app:fpl_progress="0"
            app:fpl_progressDuration="3000"
            app:fpl_progressDirection="left_to_right"
            app:fpl_shouldRestart="false"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
        <--childviews-->
    </com.devzone.fillprogresslayout.FillProgressLayout>

Alternatively

You can use FillProgressLayout as background for other layouts.

<RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
  
        <--as background for AppCompatTextView-->
        <com.devzone.fillprogresslayout.FillProgressLayout
                android:layout_alignBottom="@+id/tv"
                android:layout_alignParentTop="true"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

        <androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/tv"
                android:text="@string/app_name"
                android:gravity="center"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>
    </RelativeLayout>

Samples

Fill Direction Demo

Left To Right

Right To Left

Top To Bottom

Bottom To Top

Additional

Rounded Corners sample

Gradient Progress sample

Customisation

Here are the attributes you can specify through XML or related setters programatically:

  • fpl_backgroundColor - Set background color.
  • fpl_progressColor - Set progress color.
  • fpl_isRounded - Set true if you need rounded corners.
  • fpl_roundedCornerRadius - Set radius for round corners.
  • fpl_progress - Set current progress.
  • fpl_progressDuration - Set fill duration.
  • fpl_shouldRestart - Set if progress filling should restart from 0.
  • fpl_progressDirection - Set fill direction. i.e. left_to_right,right_to_left,top_to_bottom or bottom_to_top
  • fpl_gradientColors - Set array of gradient colors i.e. @array/gradientColors
  • fpl_gradientMovement - Set true for gradient movement with progress and false for static filling
  • fpl_gradientDirection - Set Gradient direction. i.e. left_to_right,right_to_left,top_to_bottom , bottom_to_top,top_left_to_bottom_right,top_right_to_bottom_left,bottom_right_to_top_left orbottom_left_to_top_right

πŸ“„ License

FillProgressLayout is released under the MIT license. See LICENSE for details.

fillprogresslayout's People

Contributors

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