Skip to content

Commit

Permalink
说明
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangqinhao committed Feb 28, 2017
1 parent be13097 commit 12f0bc1
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 9 deletions.
69 changes: 67 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,67 @@
# MProgressBar
some views like progressbar
# MProgressBar
对于系统ProgressBar,对于其宽高,样式的固定不好掌控,故而自定义view实现了横向,纵向,环状进度条,尽力满足不同UI需求。今后会对UI兼容性以及绘制效率进行优化。

### 引用

- Android Studio
在build.gradle引入 `compile 'com.zhangmonke:MProgressBar:1.0.0' `

- Maven
``` stylus
<dependency>
<groupId>com.zhangmonke</groupId>
<artifactId>MProgressBar</artifactId>
<version>1.0.0</version>
<type>pom</type>
</dependency>
```
### 样式(Sample中可以看到对应属性值)
![enter description here][1]

![enter description here][2]

![enter description here][3]
### 控件属性
MRingProgressBar暂时不支持滑动点击,后续会改进。
``` stylus
<declare-styleable name="MProgressBar">
<attr name="maxprogress" format="float"/> <!--设置最大值--> <!--通用-->
<attr name="durprogress" format="float"/> <!--设置当前值--> <!--通用-->
<attr name="bgdrawable" format="color|reference"/> <!--进度条背景颜色或者图片--> <!--通用-->
<attr name="bgbordercolor" format="color"/> <!--底部边框颜色 默认与底色相同--> <!--通用-->
<attr name="bgborderwidth" format="dimension"/> <!--底部边框宽度--> <!--通用-->
<attr name="fontdrawable" format="color|reference"/> <!--进度颜色或者图片--> <!--通用-->
<attr name="cursordrawable" format="reference"/> <!--游标图标--> <!--通用-->
<attr name="cursordrawable_width" format="dimension"/> <!--游标图标宽度--> <!--通用-->
<attr name="cursordrawable_height" format="dimension"/> <!--游标图标高度--> <!--通用-->
<attr name="progresswidth" format="dimension"/> <!--进度条宽度 默认最大--> <!--通用-->
<attr name="fontdrawable_type"> <!--进度颜色或者图片显示类型--> <!--MVerProgressBar MHorProgressBar-->
<enum name="clamp" value="0"/> <!--拉伸-->
<enum name="repeat" value="1"/> <!--重复-->
<enum name="cover" value="2"/> <!--覆盖 一般适用上层图片覆盖下层图片,通常bgdrawable_type=clamp 详见Sample - id:mpb_5-->
</attr>
<attr name="cantouch" format="boolean"/> <!--是否可以点击--> <!--MVerProgressBar MHorProgressBar-->
<attr name="bgdrawable_type"> <!--进度条背景颜色或者图片显示类型--> <!--MVerProgressBar MHorProgressBar-->
<enum name="clamp" value="0"/> <!--拉伸-->
<enum name="repeat" value="1"/> <!--重复-->
</attr>
<attr name="radius" format="dimension"/> <!--进度条圆角半径--> <!--MVerProgressBar MHorProgressBar-->
<attr name="startLeftOrRight"> <!--进度方向:从左开始/从右开始--><!--进度方向:逆时针/顺时针--> <!--MHorProgressBar MRingProgressBar-->
<enum name="left" value="0"/>
<enum name="right" value="1"/>
</attr>
<attr name="startTopOrBottom"> <!--进度方向:从下开始/还是从上开始--> <!--MVerProgressBar-->
<enum name="bottom" value="0"/>
<enum name="top" value="1"/>
</attr>
<attr name="startangle" format="integer"/> <!--开始角度--> <!--MRingProgressBar-->
```


[1]: ./images/a.gif "a.gif"
[2]: ./images/b.gif "b.gif"
[3]: ./images/c.gif "c.gif"
Binary file added images/a.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/b.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/c.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.1.0'
compile project(':app')
compile 'com.zhangmonke:ImmerseLayout:1.0.1'
}
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/activity_demo.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.monke.immerselayout.ImmerseLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
Expand Down Expand Up @@ -77,4 +77,4 @@
android:textSize="16sp"
android:layout_marginLeft="10dp"/>
</FrameLayout>
</com.monke.immerselayout.ImmerseLinearLayout>
</LinearLayout>
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/activity_mhorprogressbar.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.monke.immerselayout.ImmerseLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down Expand Up @@ -98,4 +98,4 @@
app:startTopOrBottom="bottom"
app:cantouch="true"
app:maxprogress="100"/>
</com.monke.immerselayout.ImmerseLinearLayout>
</LinearLayout>
4 changes: 2 additions & 2 deletions sample/src/main/res/layout/activity_mringprogressbar.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.monke.immerselayout.ImmerseLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down Expand Up @@ -86,4 +86,4 @@
app:fontdrawable="#0168CD"
app:startangle="-90"/>
</LinearLayout>
</com.monke.immerselayout.ImmerseLinearLayout>
</LinearLayout>

0 comments on commit 12f0bc1

Please sign in to comment.