[
  {
    "path": ".gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n/gradle/\n/.idea/\n/gradle/wrapper/gradle-wrapper.jar\n/gradle/wrapper/gradle-wrapper.properties\n"
  },
  {
    "path": "README.md",
    "content": "# CircleTextProgressbar\n\n严振杰的主页: http://www.yanzhenjie.com  \n严振杰的博客: http://blog.csdn.net/yanzhenjie1003\n\n----\n# 效果预览\n<image src=\"./image/demo.gif\" width=\"350px\"/>\n\n#简介与使用\n本质是一个TextView，所以TextView的基本属性它都有。\n\n`CircleTextProgressbar`支持自动倒计时，自动减少进度，自动增加进度等。\n\n如果需要自动走进度的话，设置完你自定义的属性后调用`start()`方法就可以自动倒计时了，如果想走完后再走一遍自动进度调用一下`reStart()`就OK了。\n\n如果不想自动走进度，你可以通过`setProgress()`来像系统的progress一样修改进度值。\n\n```java\n// 和系统普通进度条一样，0-100。\nprogressBar.setProgressType(CircleTextProgressbar.ProgressType.COUNT);\n\n// 改变进度条。\nprogressBar.setProgressLineWidth(30);// 进度条宽度。\n\n// 设置倒计时时间毫秒，默认3000毫秒。\nprogressBar.setTimeMillis(3500);\n\n// 改变进度条颜色。\nprogressBar.setProgressColor(Color.RED);\n\n// 改变外部边框颜色。\nprogressBar.setOutLineColor(Color.RED);\n\n// 改变圆心颜色。\nprogressBar.setInCircleColor(Color.RED);\n\n// 如果需要自动倒计时，就会自动走进度。\nprogressBar.start();\n\n// 如果想自己设置进度，比如100。\nprogressBar.setProgress(100);\n```\n\n进度监听\n```java\n// 监听进度。\nprogressBar1.setCountdownProgressListener(1, progressListener);\nprogressBar2.setCountdownProgressListener(2, progressListener);\n\nOnCountdownProgressListener progressListener = new OnCountdownProgressListener() {\n    @Override\n    public void onProgress(int what, int progress) {\n        if (what == 1) {\n            progressBar1.setText(progress + \"%\");\n        } else if (what == 2) {\n            progressBar2.setText(progress + \"%\");\n        }\n        // 比如在首页，这里可以判断进度，进度到了100或者0的时候，你可以做跳过操作。\n    }\n};\n```\n\n## 目前已知的兼容问题修复\n目前`CircleTextProgressbar`在`ReletiveLayot`中高度会变大，导致进度条会有一点点扁。修复方法如下：\n如果你要在`ReletiveLayot`中使用`CircleTextProgressbar`，就不要重写`onMeasure()`方法，然后在xml中指定`CircleTextProgressbar`的宽高就好，比如都指定为`50dp`，然后就没有问题啦。\n\n# License\n```\nCopyright 2016 Yan Zhenjie\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n[0]: [http://www.yanzhenjie.com]\n[0]: [http://blog.csdn.net/yanzhenjie1003]\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 23\n    buildToolsVersion \"23.0.3\"\n\n    defaultConfig {\n        applicationId \"com.yanzhenjie.countdownprogress\"\n        minSdkVersion 15\n        targetSdkVersion 23\n        versionCode 1\n        versionName \"1.0\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    compile 'com.android.support:appcompat-v7:23.4.0'\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in D:\\Develope\\android-sdk-windows/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.yanzhenjie.countdownprogress\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\".MainActivity\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "app/src/main/java/com/yanzhenjie/countdownprogress/CircleTextProgressbar.java",
    "content": "/*\n * Copyright 2016 Yan Zhenjie\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.yanzhenjie.countdownprogress;\n\nimport android.annotation.TargetApi;\nimport android.content.Context;\nimport android.content.res.ColorStateList;\nimport android.content.res.TypedArray;\nimport android.graphics.Canvas;\nimport android.graphics.Color;\nimport android.graphics.Paint;\nimport android.graphics.Rect;\nimport android.graphics.RectF;\nimport android.os.Build;\nimport android.support.annotation.ColorInt;\nimport android.util.AttributeSet;\nimport android.widget.TextView;\n\n/**\n * Created on 2016/7/12.\n *\n * @author Yan Zhenjie.\n */\npublic class CircleTextProgressbar extends TextView {\n\n    /**\n     * 外部轮廓的颜色。\n     */\n    private int outLineColor = Color.BLACK;\n\n    /**\n     * 外部轮廓的宽度。\n     */\n    private int outLineWidth = 2;\n\n    /**\n     * 内部圆的颜色。\n     */\n    private ColorStateList inCircleColors = ColorStateList.valueOf(Color.TRANSPARENT);\n    /**\n     * 中心圆的颜色。\n     */\n    private int circleColor;\n\n    /**\n     * 进度条的颜色。\n     */\n    private int progressLineColor = Color.BLUE;\n\n    /**\n     * 进度条的宽度。\n     */\n    private int progressLineWidth = 8;\n\n    /**\n     * 画笔。\n     */\n    private Paint mPaint = new Paint();\n\n    /**\n     * 进度条的矩形区域。\n     */\n    private RectF mArcRect = new RectF();\n\n    /**\n     * 进度。\n     */\n    private int progress = 100;\n    /**\n     * 进度条类型。\n     */\n    private ProgressType mProgressType = ProgressType.COUNT_BACK;\n    /**\n     * 进度倒计时时间。\n     */\n    private long timeMillis = 3000;\n\n    /**\n     * View的显示区域。\n     */\n    final Rect bounds = new Rect();\n    /**\n     * 进度条通知。\n     */\n    private OnCountdownProgressListener mCountdownProgressListener;\n    /**\n     * Listener what。\n     */\n    private int listenerWhat = 0;\n\n    public CircleTextProgressbar(Context context) {\n        this(context, null);\n    }\n\n    public CircleTextProgressbar(Context context, AttributeSet attrs) {\n        this(context, attrs, 0);\n    }\n\n    public CircleTextProgressbar(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n        initialize(context, attrs);\n    }\n\n    @TargetApi(Build.VERSION_CODES.LOLLIPOP)\n    public CircleTextProgressbar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {\n        super(context, attrs, defStyleAttr, defStyleRes);\n        initialize(context, attrs);\n    }\n\n    /**\n     * 初始化。\n     *\n     * @param context      上下文。\n     * @param attributeSet 属性。\n     */\n    private void initialize(Context context, AttributeSet attributeSet) {\n        mPaint.setAntiAlias(true);\n        TypedArray typedArray = context.obtainStyledAttributes(attributeSet, R.styleable.CircleTextProgressbar);\n        if (typedArray.hasValue(R.styleable.CircleTextProgressbar_in_circle_color))\n            inCircleColors = typedArray.getColorStateList(R.styleable.CircleTextProgressbar_in_circle_color);\n        else\n            inCircleColors = ColorStateList.valueOf(Color.TRANSPARENT);\n        circleColor = inCircleColors.getColorForState(getDrawableState(), Color.TRANSPARENT);\n        typedArray.recycle();\n    }\n\n    /**\n     * 设置外部轮廓的颜色。\n     *\n     * @param outLineColor 颜色值。\n     */\n    public void setOutLineColor(@ColorInt int outLineColor) {\n        this.outLineColor = outLineColor;\n        invalidate();\n    }\n\n    /**\n     * 设置外部轮廓的颜色。\n     *\n     * @param outLineWidth 颜色值。\n     */\n    public void setOutLineWidth(@ColorInt int outLineWidth) {\n        this.outLineWidth = outLineWidth;\n        invalidate();\n    }\n\n    /**\n     * 设置圆形的填充颜色。\n     *\n     * @param inCircleColor 颜色值。\n     */\n    public void setInCircleColor(@ColorInt int inCircleColor) {\n        this.inCircleColors = ColorStateList.valueOf(inCircleColor);\n        invalidate();\n    }\n\n    /**\n     * 是否需要更新圆的颜色。\n     */\n    private void validateCircleColor() {\n        int circleColorTemp = inCircleColors.getColorForState(getDrawableState(), Color.TRANSPARENT);\n        if (circleColor != circleColorTemp) {\n            circleColor = circleColorTemp;\n            invalidate();\n        }\n    }\n\n    /**\n     * 设置进度条颜色。\n     *\n     * @param progressLineColor 颜色值。\n     */\n    public void setProgressColor(@ColorInt int progressLineColor) {\n        this.progressLineColor = progressLineColor;\n        invalidate();\n    }\n\n    /**\n     * 设置进度条线的宽度。\n     *\n     * @param progressLineWidth 宽度值。\n     */\n    public void setProgressLineWidth(int progressLineWidth) {\n        this.progressLineWidth = progressLineWidth;\n        invalidate();\n    }\n\n    /**\n     * 设置进度。\n     *\n     * @param progress 进度。\n     */\n    public void setProgress(int progress) {\n        this.progress = validateProgress(progress);\n        invalidate();\n    }\n\n    /**\n     * 验证进度。\n     *\n     * @param progress 你要验证的进度值。\n     * @return 返回真正的进度值。\n     */\n    private int validateProgress(int progress) {\n        if (progress > 100)\n            progress = 100;\n        else if (progress < 0)\n            progress = 0;\n        return progress;\n    }\n\n    /**\n     * 拿到此时的进度。\n     *\n     * @return 进度值，最大100，最小0。\n     */\n    public int getProgress() {\n        return progress;\n    }\n\n    /**\n     * 设置倒计时总时间。\n     *\n     * @param timeMillis 毫秒。\n     */\n    public void setTimeMillis(long timeMillis) {\n        this.timeMillis = timeMillis;\n        invalidate();\n    }\n\n    /**\n     * 拿到进度条计时时间。\n     *\n     * @return 毫秒。\n     */\n    public long getTimeMillis() {\n        return this.timeMillis;\n    }\n\n    /**\n     * 设置进度条类型。\n     *\n     * @param progressType {@link ProgressType}.\n     */\n    public void setProgressType(ProgressType progressType) {\n        this.mProgressType = progressType;\n        resetProgress();\n        invalidate();\n    }\n\n    /**\n     * 重置进度。\n     */\n    private void resetProgress() {\n        switch (mProgressType) {\n            case COUNT:\n                progress = 0;\n                break;\n            case COUNT_BACK:\n                progress = 100;\n                break;\n        }\n    }\n\n    /**\n     * 拿到进度条类型。\n     *\n     * @return\n     */\n    public ProgressType getProgressType() {\n        return mProgressType;\n    }\n\n    /**\n     * 设置进度监听。\n     *\n     * @param mCountdownProgressListener 监听器。\n     */\n    public void setCountdownProgressListener(int what, OnCountdownProgressListener mCountdownProgressListener) {\n        this.listenerWhat = what;\n        this.mCountdownProgressListener = mCountdownProgressListener;\n    }\n\n    /**\n     * 开始。\n     */\n    public void start() {\n        stop();\n        post(progressChangeTask);\n    }\n\n    /**\n     * 重新开始。\n     */\n    public void reStart() {\n        resetProgress();\n        start();\n    }\n\n    /**\n     * 停止。\n     */\n    public void stop() {\n        removeCallbacks(progressChangeTask);\n    }\n\n    @Override\n    protected void onDraw(Canvas canvas) {\n        //获取view的边界\n        getDrawingRect(bounds);\n\n        int size = bounds.height() > bounds.width() ? bounds.width() : bounds.height();\n        float outerRadius = size / 2;\n\n        //画内部背景\n        int circleColor = inCircleColors.getColorForState(getDrawableState(), 0);\n        mPaint.setStyle(Paint.Style.FILL);\n        mPaint.setColor(circleColor);\n        canvas.drawCircle(bounds.centerX(), bounds.centerY(), outerRadius - outLineWidth, mPaint);\n\n        //画边框圆\n        mPaint.setStyle(Paint.Style.STROKE);\n        mPaint.setStrokeWidth(outLineWidth);\n        mPaint.setColor(outLineColor);\n        canvas.drawCircle(bounds.centerX(), bounds.centerY(), outerRadius - outLineWidth / 2, mPaint);\n\n        //画字\n        Paint paint = getPaint();\n        paint.setColor(getCurrentTextColor());\n        paint.setAntiAlias(true);\n        paint.setTextAlign(Paint.Align.CENTER);\n        float textY = bounds.centerY() - (paint.descent() + paint.ascent()) / 2;\n        canvas.drawText(getText().toString(), bounds.centerX(), textY, paint);\n\n        //画进度条\n        mPaint.setColor(progressLineColor);\n        mPaint.setStyle(Paint.Style.STROKE);\n        mPaint.setStrokeWidth(progressLineWidth);\n        mPaint.setStrokeCap(Paint.Cap.ROUND);\n        int deleteWidth = progressLineWidth + outLineWidth;\n        mArcRect.set(bounds.left + deleteWidth / 2, bounds.top + deleteWidth / 2, bounds.right - deleteWidth / 2, bounds.bottom - deleteWidth / 2);\n\n        canvas.drawArc(mArcRect, 0, 360 * progress / 100, false, mPaint);\n    }\n\n    @Override\n    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n        super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n        int lineWidth = 4 * (outLineWidth + progressLineWidth);\n        int width = getMeasuredWidth();\n        int height = getMeasuredHeight();\n        int size = (width > height ? width : height) + lineWidth;\n        setMeasuredDimension(size, size);\n    }\n\n    @Override\n    protected void drawableStateChanged() {\n        super.drawableStateChanged();\n        validateCircleColor();\n    }\n\n    /**\n     * 进度更新task。\n     */\n    private Runnable progressChangeTask = new Runnable() {\n        @Override\n        public void run() {\n            removeCallbacks(this);\n            switch (mProgressType) {\n                case COUNT:\n                    progress += 1;\n                    break;\n                case COUNT_BACK:\n                    progress -= 1;\n                    break;\n            }\n            if (progress >= 0 && progress <= 100) {\n                if (mCountdownProgressListener != null)\n                    mCountdownProgressListener.onProgress(listenerWhat, progress);\n                invalidate();\n                postDelayed(progressChangeTask, timeMillis / 100);\n            } else\n                progress = validateProgress(progress);\n        }\n    };\n\n    /**\n     * 进度条类型。\n     */\n    public enum ProgressType {\n        /**\n         * 顺数进度条，从0-100；\n         */\n        COUNT,\n\n        /**\n         * 倒数进度条，从100-0；\n         */\n        COUNT_BACK;\n    }\n\n    /**\n     * 进度监听。\n     */\n    public interface OnCountdownProgressListener {\n\n        /**\n         * 进度通知。\n         *\n         * @param progress 进度值。\n         */\n        void onProgress(int what, int progress);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/com/yanzhenjie/countdownprogress/MainActivity.java",
    "content": "package com.yanzhenjie.countdownprogress;\n\nimport android.graphics.Color;\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.view.Menu;\nimport android.view.MenuItem;\nimport android.view.View;\n\npublic class MainActivity extends AppCompatActivity {\n    /**\n     * 默认类型。\n     */\n    private CircleTextProgressbar mTvDefault;\n    /**\n     * 五个字的。\n     */\n    private CircleTextProgressbar mTvFive;\n    /**\n     * 圆心点击变色。\n     */\n    private CircleTextProgressbar mTvCicleColor;\n\n    /**\n     * 顺数进度条。\n     */\n    private CircleTextProgressbar mTvCount;\n    /**\n     * 宽进度条。\n     */\n    private CircleTextProgressbar mTvWide;\n    /**\n     * 窄进度条。\n     */\n    private CircleTextProgressbar mTvNarrow;\n    /**\n     * 红色进度条。\n     */\n    private CircleTextProgressbar mTvRedPro;\n    /**\n     * 红色边框。\n     */\n    private CircleTextProgressbar mTvRedFrame;\n    /**\n     * 红色圆心。\n     */\n    private CircleTextProgressbar mTvRedCircle;\n    /**\n     * 跳过。\n     */\n    private CircleTextProgressbar mTvSkip;\n    /**\n     * 更新进度条文字。\n     */\n    private CircleTextProgressbar mTvProgressBar1, mTvProgressBar2;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        mTvDefault = (CircleTextProgressbar) findViewById(R.id.tv_default);\n        mTvFive = (CircleTextProgressbar) findViewById(R.id.tv_five_text);\n        mTvCicleColor = (CircleTextProgressbar) findViewById(R.id.tv_red_circle_color);\n\n        // 和系统进度条一样，由0-100。\n        mTvCount = (CircleTextProgressbar) findViewById(R.id.tv_count);\n        mTvCount.setProgressType(CircleTextProgressbar.ProgressType.COUNT);\n\n        // 宽进度条。\n        mTvWide = (CircleTextProgressbar) findViewById(R.id.tv_five_wide);\n        mTvWide.setProgressLineWidth(30);//写入宽度。\n        mTvWide.setTimeMillis(3500);// 把倒计时时间改长一点。\n\n        // 窄进度条。\n        mTvNarrow = (CircleTextProgressbar) findViewById(R.id.tv_five_narrow);\n        mTvNarrow.setProgressLineWidth(3);// 写入宽度。\n\n        // 红色进度条。\n        mTvRedPro = (CircleTextProgressbar) findViewById(R.id.tv_red_progress);\n        mTvRedPro.setProgressColor(Color.RED);\n\n        // 红色边框进度条。\n        mTvRedFrame = (CircleTextProgressbar) findViewById(R.id.tv_red_frame);\n        mTvRedFrame.setOutLineColor(Color.RED);\n\n        // 红色圆心进度条。\n        mTvRedCircle = (CircleTextProgressbar) findViewById(R.id.tv_red_circle);\n        mTvRedCircle.setInCircleColor(Color.RED);\n\n        mTvProgressBar1 = (CircleTextProgressbar) findViewById(R.id.tv_red_progress_text1);\n        mTvProgressBar1.setCountdownProgressListener(1, progressListener);\n        mTvProgressBar1.setProgressType(CircleTextProgressbar.ProgressType.COUNT);\n\n        mTvProgressBar2 = (CircleTextProgressbar) findViewById(R.id.tv_red_progress_text2);\n        mTvProgressBar2.setCountdownProgressListener(2, progressListener);\n\n\n        // 模拟网易新闻跳过。\n        mTvSkip = (CircleTextProgressbar) findViewById(R.id.tv_red_skip);\n        mTvSkip.setOutLineColor(Color.TRANSPARENT);\n        mTvSkip.setInCircleColor(Color.parseColor(\"#AAC6C6C6\"));\n        mTvSkip.setProgressColor(Color.DKGRAY);\n        mTvSkip.setProgressLineWidth(3);\n    }\n\n    private CircleTextProgressbar.OnCountdownProgressListener progressListener = new CircleTextProgressbar.OnCountdownProgressListener() {\n        @Override\n        public void onProgress(int what, int progress) {\n            if (what == 1) {\n                mTvProgressBar1.setText(progress + \"%\");\n            } else if (what == 2) {\n                mTvProgressBar2.setText(progress + \"%\");\n            }\n            // 比如在首页，这里可以判断进度，进度到了100或者0的时候，你可以做跳过操作。\n        }\n    };\n\n    public void onClick(View view) {\n    }\n\n    @Override\n    public boolean onPrepareOptionsMenu(Menu menu) {\n        getMenuInflater().inflate(R.menu.menu, menu);\n        return true;\n    }\n\n    @Override\n    public boolean onOptionsItemSelected(MenuItem item) {\n        if (item.getItemId() == R.id.menu_start) {\n            mTvDefault.reStart();\n            mTvFive.reStart();\n            mTvCicleColor.reStart();\n            mTvCount.reStart();\n            mTvWide.reStart();\n            mTvNarrow.reStart();\n            mTvRedPro.reStart();\n            mTvRedFrame.reStart();\n            mTvRedCircle.reStart();\n            mTvProgressBar1.reStart();\n            mTvProgressBar2.reStart();\n            mTvSkip.reStart();\n        }\n        return true;\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/color/state_color.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <item android:color=\"@color/colorAccent\" android:state_pressed=\"true\" />\n    <item android:color=\"@color/colorAccent\" android:state_selected=\"true\" />\n    <item android:color=\"@color/colorAccent\" android:state_checked=\"true\" />\n    <item android:color=\"@color/colorPrimary\" />\n\n</selector>"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\">\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:gravity=\"center_horizontal\"\n        android:orientation=\"horizontal\">\n\n        <LinearLayout\n            android:layout_width=\"0dp\"\n            android:layout_height=\"wrap_content\"\n            android:layout_weight=\"1\"\n            android:gravity=\"center_horizontal\"\n            android:orientation=\"vertical\">\n\n            <com.yanzhenjie.countdownprogress.CircleTextProgressbar\n                android:id=\"@+id/tv_default\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:onClick=\"onClick\"\n                android:text=\"跳过\" />\n\n            <com.yanzhenjie.countdownprogress.CircleTextProgressbar\n                android:id=\"@+id/tv_count\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:onClick=\"onClick\"\n                android:text=\"跳过\" />\n\n\n            <com.yanzhenjie.countdownprogress.CircleTextProgressbar\n                android:id=\"@+id/tv_five_narrow\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:onClick=\"onClick\"\n                android:text=\"窄进度条\" />\n\n            <com.yanzhenjie.countdownprogress.CircleTextProgressbar\n                android:id=\"@+id/tv_red_progress\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:onClick=\"onClick\"\n                android:text=\"红色进度\" />\n\n            <com.yanzhenjie.countdownprogress.CircleTextProgressbar\n                android:id=\"@+id/tv_red_frame\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:onClick=\"onClick\"\n                android:text=\"红色边框\" />\n\n            <com.yanzhenjie.countdownprogress.CircleTextProgressbar\n                android:id=\"@+id/tv_red_circle\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:onClick=\"onClick\"\n                android:text=\"红色圆\" />\n\n            <com.yanzhenjie.countdownprogress.CircleTextProgressbar\n                android:id=\"@+id/tv_red_skip\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:onClick=\"onClick\"\n                android:text=\"跳过\" />\n        </LinearLayout>\n\n        <LinearLayout\n            android:layout_width=\"0dp\"\n            android:layout_height=\"wrap_content\"\n            android:layout_weight=\"1\"\n            android:gravity=\"center_horizontal\"\n            android:orientation=\"vertical\">\n\n\n            <com.yanzhenjie.countdownprogress.CircleTextProgressbar\n                android:id=\"@+id/tv_five_text\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:onClick=\"onClick\"\n                android:text=\"我是五个字\" />\n\n            <com.yanzhenjie.countdownprogress.CircleTextProgressbar\n                android:id=\"@+id/tv_five_wide\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:onClick=\"onClick\"\n                android:text=\"宽进度条\" />\n\n            <com.yanzhenjie.countdownprogress.CircleTextProgressbar\n                android:id=\"@+id/tv_red_circle_color\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:onClick=\"onClick\"\n                android:text=\"圆心点击变色\"\n                app:in_circle_color=\"@color/state_color\" />\n\n            <com.yanzhenjie.countdownprogress.CircleTextProgressbar\n                android:id=\"@+id/tv_red_progress_text1\"\n                android:layout_width=\"50dp\"\n                android:layout_height=\"50dp\"\n                android:onClick=\"onClick\"\n                android:text=\"0%\"\n                app:in_circle_color=\"@color/state_color\" />\n\n            <com.yanzhenjie.countdownprogress.CircleTextProgressbar\n                android:id=\"@+id/tv_red_progress_text2\"\n                android:layout_width=\"50dp\"\n                android:layout_height=\"50dp\"\n                android:onClick=\"onClick\"\n                android:text=\"100%\"\n                app:in_circle_color=\"@color/state_color\" />\n        </LinearLayout>\n    </LinearLayout>\n\n</ScrollView>"
  },
  {
    "path": "app/src/main/res/menu/menu.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\">\n\n    <item\n        android:id=\"@+id/menu_start\"\n        android:title=\"开始\"\n        app:showAsAction=\"always\" />\n\n</menu>"
  },
  {
    "path": "app/src/main/res/values/attr.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n\n    <declare-styleable name=\"CircleTextProgressbar\">\n        <attr name=\"in_circle_color\" format=\"color\" />\n    </declare-styleable>\n\n</resources>"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"colorPrimaryDark\">#303F9F</color>\n    <color name=\"colorAccent\">#FF4081</color>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">CountdownProgress</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:2.1.2'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windowz variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\ngoto execute\n\n:4NT_args\n@rem Get arguments from the 4NT Shell from JP Software\nset CMD_LINE_ARGS=%$\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app'\n"
  }
]