Skip to content

Commit 752f803

Browse files
committed
添加圆形进度条
1 parent 7d01060 commit 752f803

File tree

180 files changed

+3563
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+3563
-32
lines changed

.idea/gradle.xml

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#Wed Sep 21 14:17:29 CST 2016
1+
#Thu Nov 03 14:59:23 CST 2016

P002_图片firstPage_template1/build/intermediates/incremental/mergeDebugResources/compile-file-map.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
#Wed Sep 21 14:17:27 CST 2016
1+
#Thu Nov 03 14:59:23 CST 2016
22
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\drawable-xxhdpi\\ic_launcher.png=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\drawable-xxhdpi\\ic_launcher.png
33
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\drawable-hdpi\\image04.jpg=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi-v4\\image04.jpg
44
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\anim\\left_shake.xml=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\anim\\left_shake.xml
55
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\anim\\right_shake.xml=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\anim\\right_shake.xml
66
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\drawable-hdpi\\image01.jpg=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi-v4\\image01.jpg
7-
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\drawable-xhdpi\\ic_launcher.png=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\drawable-xhdpi\\ic_launcher.png
87
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\drawable-hdpi\\up.png=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi\\up.png
8+
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\drawable-xhdpi\\ic_launcher.png=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\drawable-xhdpi\\ic_launcher.png
99
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\drawable-hdpi\\ic_launcher.png=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi\\ic_launcher.png
10-
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\layout\\activity_main.xml=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\layout\\activity_main.xml
1110
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\anim\\cycle_interpolator.xml=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\anim\\cycle_interpolator.xml
11+
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\layout\\activity_main.xml=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\layout\\activity_main.xml
1212
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\drawable-hdpi\\right.png=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi\\right.png
1313
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\drawable-hdpi\\image03.jpg=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\drawable-hdpi-v4\\image03.jpg
1414
D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\src\\main\\res\\anim\\bottom_shake.xml=D\:\\Repositories\\MyApplication\\P002_ͼƬfirstPage_template1\\build\\intermediates\\res\\merged\\debug\\anim\\bottom_shake.xml
Binary file not shown.

P008_QQColorprogressbar/src/main/res/layout/activity_demo.xml

+13-11
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,22 @@
1919
android:layout_height="wrap_content"
2020
android:text="start" />
2121

22+
<!--app:string_unit="百分比%"-->
2223
<com.example.p008_qqcolorarcprogressbar.ColorArcProgressBar
2324
android:id="@+id/bar1"
2425
android:layout_width="300dp"
2526
android:layout_height="300dp"
2627
android:layout_gravity="center_horizontal"
2728
android:layout_marginBottom="150dp"
28-
app:back_color="@android:color/darker_gray"
29+
android:background="@mipmap/ic_launcher"
30+
app:back_color="#00000000"
2931
app:back_width="10dp"
3032
app:front_color1="@color/colorAccent"
3133
app:front_width="10dp"
32-
app:is_need_content="true"
33-
app:is_need_unit="true"
34+
app:is_need_content="false"
35+
app:is_need_unit="false"
3436
app:max_value="100"
35-
app:string_unit="百分比%"
37+
app:string_unit="@null"
3638
app:total_engle="360" />
3739

3840

@@ -44,22 +46,22 @@
4446

4547
<com.example.p008_qqcolorarcprogressbar.ColorArcProgressBar
4648
android:id="@+id/bar2"
47-
android:layout_width="300dp"
48-
android:layout_height="300dp"
49+
android:layout_width="10dp"
50+
android:layout_height="10dp"
4951
android:layout_gravity="center_horizontal"
5052
android:layout_marginBottom="150dp"
51-
app:back_color="@android:color/darker_gray"
52-
app:back_width="2dp"
53+
app:back_color="#00000000"
54+
app:back_width="0dp"
5355
app:front_color1="#69cbd2"
5456
app:front_color2="#7eb6e2"
5557
app:front_color3="#989df7"
56-
app:front_width="10dp"
58+
app:front_width="5dp"
5759
app:is_need_content="true"
5860
app:is_need_title="true"
5961
app:is_need_unit="true"
6062
app:max_value="100"
61-
app:string_title="截止当前已走"
62-
app:string_unit=""
63+
app:string_title="新鲜度"
64+
app:string_unit="%"
6365
app:total_engle="270" />
6466

6567
<Button
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,60 @@
11
package com.example.p009_glide;
22

3-
import android.support.v7.app.AppCompatActivity;
3+
import android.graphics.Color;
44
import android.os.Bundle;
5+
import android.support.v7.app.AppCompatActivity;
56
import android.widget.ImageView;
67

78
import com.example.p009_glide.glide.GlideOptions;
89
import com.example.p009_glide.glide.GlideOptionsFactory;
910
import com.example.p009_glide.glide.GlideUtil;
11+
import com.example.p009_glide.util.ColorArcProgressBar;
1012

1113
public class MainActivity extends AppCompatActivity {
1214

1315
private ImageView iv1;
1416
private ImageView iv2;
1517
private ImageView iv3;
18+
private ImageView iv4;
19+
private ColorArcProgressBar bar4;
20+
1621
@Override
1722
protected void onCreate(Bundle savedInstanceState) {
1823
super.onCreate(savedInstanceState);
1924
setContentView(R.layout.activity_main);
2025
iv1 = (ImageView) findViewById(R.id.iv1);
2126
iv2 = (ImageView) findViewById(R.id.iv2);
2227
iv3 = (ImageView) findViewById(R.id.iv3);
23-
; //1
28+
iv4 = (ImageView) findViewById(R.id.iv4);
29+
bar4 = (ColorArcProgressBar) findViewById(R.id.bar4);
30+
; //1
2431
GlideUtil.display(MainActivity.this, iv1, "http://img0.bdstatic.com/img/image/touxiang01.jpg", GlideOptionsFactory.get(GlideOptionsFactory.Type.RADIUS));
2532
//2
2633
GlideOptions glideOptions = new GlideOptions(R.drawable.pic_head, R.drawable.pic_head, 300);
2734
GlideUtil.display(MainActivity.this, iv2, "http://img0.bdstatic.com/img/image/touxiang01.jpg", glideOptions);
2835
//3
2936
GlideUtil.display(MainActivity.this, iv3, "http://img0.bdstatic.com/img/image/touxiang01.jpg");
37+
//4
38+
// bar4.setTextSize(18);//字体大小
39+
bar4.setMaxValues(100);//最大百分比显示值
40+
// bar4.setDiameter(200);//直径
41+
42+
bar4.setTitleString("新鲜度");
43+
bar4.setCurrentValues(100);//最大显示值
44+
bar4.setUnit("%");
45+
46+
bar4.setNeedTitle(true);//title
47+
bar4.setNeedContent(true);//content
48+
bar4.setNeedUnit(true);//单位
49+
50+
int[] colors = new int[]{Color.GREEN, Color.YELLOW, Color.RED, Color.RED};
51+
int color1 = getResources().getColor(R.color.colorAccent);
52+
int color2 = getResources().getColor(R.color.colorPrimary);
53+
int color3 = getResources().getColor(R.color.colorPrimaryDark);
54+
colors = new int[]{color1, color2, color3, color3};
55+
bar4.setColors(colors);
56+
57+
GlideOptions glideOptions4 = new GlideOptions(R.drawable.pic_head, R.drawable.pic_head, 300);
58+
GlideUtil.display(MainActivity.this, iv4, "http://img0.bdstatic.com/img/image/touxiang01.jpg", glideOptions4);
3059
}
3160
}

0 commit comments

Comments
 (0)