This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # The MIT License (MIT) | |
| # Copyright (c) 2014 Debjeet Biswas | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <declare-styleable name="CircularProgressView"> | |
| <attr name="cpv__backgroundColor" format="color" /> | |
| <attr name="cpv__backgroundColorPressed" format="color" /> | |
| <attr name="cpv__animationTime" format="float" /> | |
| <attr name="cpv__insideRadius" format="dimension" /> | |
| <attr name="cpv__progressWidth" format="dimension" /> | |
| </declare-styleable> | |
| </resources> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.doomonafireball.samples.android.widget; | |
| import com.doomonafireball.samples.android.R; | |
| import android.content.Context; | |
| import android.content.res.Resources; | |
| import android.content.res.TypedArray; | |
| import android.graphics.Canvas; | |
| import android.graphics.Color; | |
| import android.graphics.Paint; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file. | |
| set the background of a view to card, | |
| as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view | |
| ``` xml | |
| <View | |
| android:layout_width="fill_parent" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.Context; | |
| import android.graphics.Canvas; | |
| import android.graphics.Color; | |
| import android.graphics.Paint; | |
| import android.graphics.Path; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| import android.view.animation.AccelerateDecelerateInterpolator; | |
| import android.view.animation.Interpolator; |