Code Monkey home page Code Monkey logo

th-progressbutton's Introduction

TH-ProgressButton

Circular progress View button inspired by FFCircularProgressView

alt text

alt text

alt text

alt text

alt text

##How to use:

  1. Deployment target should be Api level 13 or above.

  2. Add com.thbs.progressbutton.MasterLayout.java and com.thbs.progressbutton.CusImage.java to your project.

  3. ##Layout:

     <com.thbs.progressbutton.MasterLayout
         android:id="@+id/MasterLayout01"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_centerHorizontal="true"
         android:layout_centerVertical="true"
         android:clickable="true" >
     </com.thbs.progressbutton.MasterLayout>
    
  4. ##Activity

     static MasterLayout masterLayout;   //Should be static
     
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         
         masterLayout = (MasterLayout) findViewById(R.id.MasterLayout01);
         
         //Onclick listener of the progress button
         masterLayout.setOnClickListener(new OnClickListener() {
     	
     	@Override
     	public void onClick(View v) {
     		// TODO Auto-generated method stub
    
     		masterLayout.animation();   //Need to call this method for animation and progression
             
     		switch (masterLayout.flg_frmwrk_mode) {
             
     		case 1:
     				//Start state. Call your method
     				break;
     		case 2:
     			
     				//Running state. Call your method
     				break;
     			
     		case 3:
     			
     			    //End state. Call your method
     				break;
     		}	
     	}
     });
    

    }

  5. ##Updating the progress

    Send the progress to MasterLayout's "cusview.setupprogress()" method from AsyncTask's "onProgressUpdate()".

      @Override
     protected void onProgressUpdate(Integer... progress) 
     {
    
     	//publishing progress to progress arc
     	masterLayout.cusview.setupprogress(progress[0]);
    
     }
    
  6. ##Customization

    • Basic customization can be done in "com.thbs.progressbutton.MasterLayout.java".

      Circle related customization:

            stroke_color.setColor(Color.rgb(0, 161, 234));  // Edit this to change the circle color
      
            fill_color.setColor(Color.rgb(0, 161, 234));   // Edit this to change the circle fill color
      

      Icon related customization:

            icon_color.setStyle(Paint.Style.FILL_AND_STROKE);  // Edit this to change the icon color
       
       
            final_icon_color.setColor(Color.WHITE);   // Edit this to change the final icon color
      

    Create new icons using path or use the existing icons in method "iconCreate()"

    • Progress arc color can be changed from "com.thbs.progressbutton.CusImage.java" using:

      myPaint.setColor(Color.rgb(0, 161, 234));

##Are you using this framework?

  • If you are using this framework please feel free to add your app to the wiki.

##Demo Please download and run the project to view demo.

##License ProgressButton is licensed under the terms of the MIT License. Please see the License file for full details.

th-progressbutton's People

Contributors

vyshakh-k 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  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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.