@@ -31,7 +31,7 @@ public class ENVolumeView extends View{
31
31
32
32
private static final int DEFAULT_LINE_COLOR = Color .WHITE ;
33
33
34
- private static final int DEFAULT_BG_LINE_COLOR = 0xff4f5559 ;
34
+ private static final int DEFAULT_BG_LINE_COLOR = 0xff64696d ;
35
35
36
36
private static final int DEFAULT_LINE_WIDTH = 10 ;
37
37
@@ -129,22 +129,22 @@ protected void onDraw(Canvas canvas) {
129
129
super .onDraw (canvas );
130
130
if (mCurrentState != STATE_VIBRATE ) {
131
131
if (mFraction <= 0.5 ) {
132
- mDstPath .reset ();
132
+ mDstPath .reset (); //嗷~ 在这画喇叭
133
133
mPathMeasure .getSegment (0 , mPathLength * 0.38f - mPathLength * 0.13f * mFraction , mDstPath , true );
134
134
canvas .drawPath (mDstPath , mBgPaint );
135
135
mDstPath .reset ();
136
136
mPathMeasure .getSegment (mPathLength * 0.62f + mPathLength * 0.13f * mFraction , mPathLength , mDstPath , true );
137
137
canvas .drawPath (mDstPath , mBgPaint );
138
138
139
- canvas .save ();
139
+ canvas .save (); //嗷~ 在这画X
140
140
canvas .translate (- mFraction * mBaseLength * 2 , 0 );
141
141
canvas .drawLine (mCenterX - mBaseLength * (0.5f - mFraction ) , mCenterY - mBaseLength * (0.5f - mFraction )
142
142
,mCenterX + mBaseLength * (0.5f - mFraction ), mCenterY + mBaseLength * (0.5f - mFraction ), mBgPaint );
143
143
canvas .drawLine (mCenterX - mBaseLength * (0.5f - mFraction ), mCenterY + mBaseLength * (0.5f - mFraction )
144
144
,mCenterX + mBaseLength * (0.5f - mFraction ), mCenterY - mBaseLength * (0.5f - mFraction ), mBgPaint );
145
145
canvas .restore ();
146
146
} else {
147
- mDstPath .reset ();
147
+ mDstPath .reset (); //嗷~ 在这画喇叭
148
148
mPathMeasure .getSegment (0 , mPathLength * 0.25f + mPathLength * 0.13f * (mFraction - 0.5f ), mDstPath , true );
149
149
canvas .drawPath (mDstPath , mBgPaint );
150
150
mDstPath .reset ();
@@ -157,7 +157,7 @@ protected void onDraw(Canvas canvas) {
157
157
mPathMeasure .getSegment (mPathLength - mPathLength * 0.38f / 0.5f * (mFraction - 0.5f ), mPathLength , mDstPath , true );
158
158
canvas .drawPath (mDstPath , mPaint );
159
159
160
- canvas .save ();
160
+ canvas .save (); //嗷~ 在这画小声波
161
161
canvas .translate ( - (1 - mFraction ) * mBaseLength * 2 , 0 );
162
162
canvas .drawArc (mCenterX - 0.5f * mBaseLength - mBaseLength / 0.5f * (mFraction - 0.5f ),
163
163
mCenterY - mBaseLength / 0.5f * (mFraction - 0.5f ),
@@ -172,7 +172,7 @@ protected void onDraw(Canvas canvas) {
172
172
mCenterY + mBaseLength / 0.5f * (mFraction - 0.5f ), -55 / 50 * sVolume , 110 / 50 * sVolume ,false , mPaint );
173
173
canvas .restore ();
174
174
175
- canvas .save ();
175
+ canvas .save (); //嗷~ 在这画大声波
176
176
canvas .translate ( - (1 - mFraction ) * mBaseLength * 3 , 0 );
177
177
canvas .drawArc (mCenterX - 1.6f * mBaseLength / 0.5f * (mFraction - 0.5f ),
178
178
mCenterY - 1.6f * mBaseLength / 0.5f * (mFraction - 0.5f ),
@@ -188,14 +188,14 @@ protected void onDraw(Canvas canvas) {
188
188
canvas .restore ();
189
189
}
190
190
} else {
191
- mDstPath .reset ();
191
+ mDstPath .reset (); //嗷~ 在这画喇叭
192
192
mPathMeasure .getSegment (0 , mPathLength * 0.38f , mDstPath , true );
193
193
canvas .drawPath (mDstPath , mPaint );
194
194
mDstPath .reset ();
195
195
mPathMeasure .getSegment (mPathLength - mPathLength * 0.38f , mPathLength , mDstPath , true );
196
196
canvas .drawPath (mDstPath , mPaint );
197
197
198
- canvas .save ();
198
+ canvas .save (); //嗷~ 在这画小声波
199
199
canvas .translate ( - (1 - mFraction ) * mBaseLength / 3 , 0 );
200
200
canvas .drawArc (mCenterX - 1.5f * mBaseLength ,
201
201
mCenterY - mBaseLength ,
@@ -210,7 +210,7 @@ protected void onDraw(Canvas canvas) {
210
210
mCenterY + mBaseLength , -55 / 50 * sVolume , 110 / 50 * sVolume ,false , mPaint );
211
211
canvas .restore ();
212
212
213
- canvas .save ();
213
+ canvas .save (); //嗷~ 在这画大声波
214
214
canvas .translate ( - (1 - mFraction ) * mBaseLength / 3 , 0 );
215
215
canvas .drawArc (mCenterX - 1.6f * mBaseLength ,
216
216
mCenterY - 1.6f * mBaseLength ,
0 commit comments