MCPcopy Index your code
hub / github.com/GcsSloop/AndroidNote / initHandler

Method initHandler

CustomView/Advance/Code/SearchView.java:154–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152 }
153
154 private void initHandler() {
155 mAnimatorHandler = new Handler() {
156 @Override
157 public void handleMessage(Message msg) {
158 super.handleMessage(msg);
159 switch (mCurrentState) {
160 case STARTING:
161 // 从开始动画转换好搜索动画
162 isOver = false;
163 mCurrentState = State.SEARCHING;
164 mStartingAnimator.removeAllListeners();
165 mSearchingAnimator.start();
166 break;
167 case SEARCHING:
168 if (!isOver) { // 如果搜索未结束 则继续执行搜索动画
169 mSearchingAnimator.start();
170 Log.e("Update", "RESTART");
171
172 count++;
173 if (count>2){ // count大于2则进入结束状态
174 isOver = true;
175 }
176 } else { // 如果搜索已经结束 则进入结束动画
177 mCurrentState = State.ENDING;
178 mEndingAnimator.start();
179 }
180 break;
181 case ENDING:
182 // 从结束动画转变为无状态
183 mCurrentState = State.NONE;
184 break;
185 }
186 }
187 };
188 }
189
190 private void initAnimator() {
191 mStartingAnimator = ValueAnimator.ofFloat(0, 1).setDuration(defaultDuration);

Callers 1

initAllMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected