-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVerticalProgressBar.java
More file actions
38 lines (32 loc) · 875 Bytes
/
VerticalProgressBar.java
File metadata and controls
38 lines (32 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.ProgressBar;
/**
* Function: VerticalProgressBar<br/>
* Date: 2015-1-18 下午9:00:21 <br/>
*
* @author YeMeng
*/
public class VerticalProgressBar extends ProgressBar {
public VerticalProgressBar(Context context) {
super(context);
}
public VerticalProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
}
public VerticalProgressBar(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(h, w, oldh, oldw);
}
@Override
protected synchronized void onDraw(Canvas canvas) {
// 旋转
canvas.rotate(-90);
canvas.translate(-this.getHeight(), 0);
super.onDraw(canvas);
}
}