Giter Site home page Giter Site logo

percentbarview's Introduction

Android Arsenal

PercentBar

Show result in Percent Bar with animation.

How to Use

        List<BarImageModel> mList = new ArrayList<>();
        mList.add(new BarImageModel("https://s-media-cache-ak0.pinimg.com/564x/2b/74/04/2b74046c2e2e488fe1f2be60680671dd.jpg", "Abc", PercentBarView.BarField.LEFT));
        mList.add(new BarImageModel("https://s-media-cache-ak0.pinimg.com/564x/65/01/b5/6501b5ae42a0c1aa863b1ae33a746ce2.jpg", "Def", PercentBarView.BarField.RIGHT));
        mList.add(new BarImageModel("https://s-media-cache-ak0.pinimg.com/564x/5a/e9/50/5ae9501fc3b49810db7901873f77d6f7.jpg", "Lorem", PercentBarView.BarField.RIGHT));
        mList.add(new BarImageModel("https://s-media-cache-ak0.pinimg.com/564x/9d/1c/86/9d1c861252a4d0067def3f567467b175.jpg", "Qwerty", PercentBarView.BarField.LEFT));
        mList.add(new BarImageModel("https://s-media-cache-ak0.pinimg.com/564x/5e/bd/17/5ebd1769bf115773ad83803b29ea4bac.jpg", "WWW", PercentBarView.BarField.LEFT));
        mList.add(new BarImageModel("https://s-media-cache-ak0.pinimg.com/564x/67/51/c3/6751c3d814fdda7db7e4844c3007db7c.jpg", "Aykut", PercentBarView.BarField.LEFT));
        
        View alphaView = findViewById(R.id.ImageViewSoruImage);
        percentBarView = (PercentBarView) findViewById(R.id.PercentBarView);
        percentBarView.addAlphaView(alphaView);
        percentBarView.setRightBarValue(70);
        percentBarView.setLeftBarValue(30);
        percentBarView.setImages(mList);
        percentBarView.setImagesListTitle("X List");
        percentBarView.setRightBarColor(Color.MAGENTA);        

and

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <com.aykuttasil.percentbarapp.util.AutoFitTextView
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:ellipsize="none"
                        android:gravity="center"
                        android:maxLines="5"
                        android:padding="5dp"
                        android:text="X"
                        android:textSize="100sp" />

                    <com.aykuttasil.percentbar.PercentBarView
                        android:id="@+id/PercentBarView"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_alignParentBottom="true"
                        android:layout_centerHorizontal="true"
                        custom:barLeftColor="@color/colorAccent"
                        custom:barRightColor="@color/colorPrimary" />

                </RelativeLayout>           

All Feature

        View alphaView = findViewById(R.id.ImageViewSoruImage);
        PercentBarView percentBarView = (PercentBarView) findViewById(R.id.PercentBarView);
        
        percentBarView.setRightBarValue(70);
        percentBarView.setLeftBarValue(1);
        
        percentBarView.setImages(mList);
        percentBarView.setImagesListTitle("X List");
        percentBarView.setImageListItemSize(50)
        
        percentBarView.setLeftBarColor(Color.GREEN);
        percentBarView.setRightBarColor(Color.MAGENTA);

        percentBarView.addAlphaView(alphaView);
        percentBarView.setAlphaViewValue(0.5f); // alpha value
        percentBarView.setAnimAlphaViewDuration(3000);
        percentBarView.setAnimBarDuration(2000);
        
        percentBarView.setLeftBarWidth(60);
        percentBarView.setRightBarWidth(40);
        
        percentBarView.setAutoShow(true); // show bar when start app

Installation

Gradle

Add it as a dependency in your app's build.gradle file

compile 'com.aykuttasil:percentbar:3.0.3'

License

Copyright 2016 aykuttasil - Aykut Asil

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.

percentbarview's People

Contributors

aykuttasil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

percentbarview's Issues

Add more value

First at all thanks for this library, but web added just 2 value? Value A and Value B ?!
please add unlimited value

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.