public void finishZoomOutAnimation() {
if (at != null) {
if (at.isAlive()) {
dragZoomOutAnimation = true;
at.setEndScale(INIT_REDUCE_FINAL_VALUE);
at.setSleepTime(FINISH_ZOOM_OUT_SLEEP_TIME);
at.setAnimationState(AnimationThread.STATE_ZOOM_OUT);
setAnimationListener();
} else {
dragZoomOutAnimation = true;
at = new AnimationThread(this, getScaleValue(matrix), INIT_REDUCE_FINAL_VALUE, SCALE_INCREMENT_VALUE,
FINISH_ZOOM_OUT_SLEEP_TIME);
needScaleCenterImg = true;
setAnimationListener();
at.start();
}
}
}
private void setAnimationListener() {
at.setOnListener(new AnimationThread.AnimationListener() {
public void onStart() {
}
public void onEnd() {
needScaleCenterImg = false;
if (at != null) {
at.setCurrentScale(BLOWUP_FINAL_VALUE);
}
}
public void onError() {
}
});
}
private float getScaleValue(Matrix matrix) {
float[] a = new float[9];
matrix.getValues(a);
return a[0];
}
private void drawCenterImg(Canvas canvas, boolean flag) {
LengthCalculate calculate = LengthCalculate.getInstance();
Drawable centerDrag = getResources().getDrawable(R.drawable.center_drag);
Rect rect = new Rect(0, 0, getWidth(), getHeight() - calculate.getGroupHeight());
if (flag) {
matrix.setScale(at.getCurrentScale(), at.getCurrentScale(), calculate.getCenterPointX(this),
calculate.getCenterPointY(this));
}
canvas.concat(matrix);
centerDrag.setBounds(rect);
centerDrag.draw(canvas);
}
private void startAnimation(float start, float end, float increment, long sleepTime) {
if (at != null) {
at.stopAnimation();
}
at = new AnimationThread(this, start, end, increment, sleepTime);
needScaleCenterImg = true;
at.start();
}
分享到:
相关推荐
DOCOMO_5G Evolution and 6G white paper.rar
SOT 23 -5 and 6 封装,本文件为SOT 23 -5 and 6 封装库可直接在DXP软件中应用,不需要手动画
A visual memory scale (VMS) Designed to measure short-term visual recognition memory in 5- and 6-year-old children 152 CHARLES K. MILLEH. AND NORMAN M. CHANSKY and the manner in which they can ...
Linear Algebra and Its Applications, Global 6th Edition
Lecture 6 MATLAB® Wavelet Toolbox Lecture 7 Orthogonal Filter Banks: Paraunitary Matrices Orthogonality Condition (Condition O) in the Time Domain, Modulation Domain and Polyphase Domain Lecture 8 ...
MSP430x5xx and MSP430x6xx Family User's Guide About This Manual This manual describes the modules and peripherals of the MSP430x5xx and MSP430x6xx family of devices. Each description presents the ...
Current, comprehensive, and designed to maximize clarity of the concepts students need to know, long time best seller ADVANCED NUTRITION AND HUMAN METABOLISM, SIXTH EDITION delivers its signature ...
Cryptography and Network Security Principles and Practice, International Edition(6th) 英文无水印原版pdf 第6版 pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本...
Xshell6 and Xftp6组合,免破解,直接能使用,注意上传时间
Cryptography and Network Security Principles and Practice 6th edition
Computer Organization and Design, Fifth Edition, is the latest update to the classic introduction to computer organization. The text now contains new examples and material highlighting the emergence ...
本文将深入探讨“Help and Manual 6.x”这一专业级的帮助文档制作工具,并聚焦于其注册机(KeyGen.exe)的相关知识点。 “Help and Manual 6.x”是一款功能强大的帮助文档创作工具,它为程序员、技术作家和文档编写...
6. **应用领域**:CANdb++不仅适用于汽车电子,还广泛应用于工业自动化、医疗设备、航空航天等多个领域,任何需要CAN通信的系统设计和调试过程中,都可能用到CANdb++。 7. **集成开发环境**:CANdb++软件往往与其他...
Chapter 6 Linear Lists - Linked Representation Chapter 7 Arrays and Matrices Chapter 8 Stacks Chapter 9 Queues Chapter 10 Skip Lists and Hashing Chapter 11 Binary and Other Trees Chapter 12 Priority ...
Judi has received three teaching awards: two Inspiring Teaching awards at the University of Regina, and the Thomas Lutz College of Arts and Sciences Teaching Award at Washington State University....