@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
if (mDragging && mDragBitmap != null) {
if (mAnimationState == ANIMATION_STATE_STARTING) {
mAnimationStartTime = SystemClock.uptimeMillis();
mAnimationState = ANIMATION_STATE_RUNNING;
}
if (mAnimationState == ANIMATION_STATE_RUNNING) {
float normalized = (float) (SystemClock.uptimeMillis() - mAnimationStartTime) /
mAnimationDuration;
if (normalized >= 1.0f) {
mAnimationState = ANIMATION_STATE_DONE;
}
normalized = Math.min(normalized, 1.0f);
final float value = mAnimationFrom + (mAnimationTo - mAnimationFrom) * normalized;
switch (mAnimationType) {
case ANIMATION_TYPE_SCALE:
final Bitmap dragBitmap = mDragBitmap;
mDragPaint = mTranslucence;
canvas.save();
canvas.translate(mScrollX + mLastMotionX - mTouchOffsetX - mBitmapOffsetX,
mScrollY + mLastMotionY - mTouchOffsetY - mBitmapOffsetY);
canvas.translate((dragBitmap.getWidth() * (1.0f - value)) / 2,
(dragBitmap.getHeight() * (1.0f - value)) / 2);
canvas.scale(value, value);
canvas.drawBitmap(dragBitmap, 0.0f, 0.0f, mDragPaint);
canvas.restore();
break;
}
} else {
//AAA
//calculate.setGroupHeight(groupNavi.getHeight());
drawCanUseSpace(canvas);
drawWingsImg(canvas);
canvas.drawBitmap(mDragBitmap,
mScrollX + mLastMotionX - mTouchOffsetX - mBitmapOffsetX,
mScrollY + mLastMotionY - mTouchOffsetY - mBitmapOffsetY, mDragPaint);
}
//AAAA
} else {
if (needWingsAnimation) {
drawWingsImg(canvas);
}
}
}
private void endDrag() {
if (mDragging) {
//AAA
setDraging(false);
//groupNavi.updateFocusGroup(workspace.getCurrentGroup());
if (workspace.isScrollerFinished()) {
doWingsAnimation();
} else {
if (haveGroupChange) {
haveGroupChange = false;
doWingsAnimation();
} else {
doNotWingsAnimation();
}
}
//
mDragging = false;
if (mDragBitmap != null) {
mDragBitmap.recycle();
}
if (mOriginator != null) {
// mOriginator.setVisibility(VISIBLE);
}
if (mListener != null) {
mListener.onDragEnd();
}
}
}
分享到:
相关推荐
Windows 7and8 Enterprise Upgrade 注册码
NetEngine 8000 M14 and M8_V5.0_05_zh_AZK0820J.hdx
标题“Windows-7-Games-For-Windows-8-and-10-Multilanguage-x86-x64.zip”指的是一个包含Windows 7经典游戏的软件包,它被设计为适用于Windows 8和Windows 10操作系统,且支持多语言环境。这个压缩包可能包含了32位...
Lecture 8 Maxflat Filters: Daubechies and Meyer Formulas Spectral Factorization Lecture 9 Multiresolution Analysis (MRA): Requirements for MRA Nested Spaces and Complementary Spaces Scaling Functions ...
i.MX 8QuadXPlus and 8DualXPlus processors, which, along with the i.MX 8DualX processor, comprise the i.MX 8X Family (for i.MX 8DualX specifications, see i.MX 8DualX Automotive and Infotainment ...
SSD8: Networks and Distributed Computing Unit 1. Core Network Protocols Exam 1 Unit 2. End-to-End Protocols Exam 2 Unit 3. Distributed Systems Exam 3 Description This course focuses on the ...
Write a Drupal 8 module with custom functionality and hook into various extension points Master numerous Drupal 8 sub-systems and APIs Model, store, and manipulate data in various ways and for various...
Reimagined for full-screen and touch-optimized apps, Windows 8 provides a platform for reaching new users in new ways. In response, programming legend Charles Petzold is rewriting his classic ...
$198.8 An introduction to operating systems with up-to-date and comprehensive coverage Now in its 9th Edition, Operating Systems: Internals and Design Principles provides a comprehensive, unified ...
Chapter 8 Stacks Chapter 9 Queues Chapter 10 Skip Lists and Hashing Chapter 11 Binary and Other Trees Chapter 12 Priority Queues Chapter 13 Tournament Trees Chapter 14 Binary Search Trees Chapter 15 ...
8. **版本更新**:为了保持与最新的CAN标准和技术同步,CANdb++会定期发布新版本,修复已知问题,增加新功能,提高用户体验。 通过理解并掌握以上知识点,开发者能够有效地利用CANdb++软件来构建和维护高效的CAN...
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 ...
In this fully updated second edition of the highly acclaimed Managing Gigabytes, authors Witten, Moffat, and Bell continue to provide unparalleled coverage of state-of-the-art techniques for ...
English | 30 May 2017 | ASIN: B01IF7NLM8 | 310 Pages | AZW3 | 6.63 MB Key Features A step by step guide, which will provide you with a thorough discussion on the analysis and design of fundamental ...
Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development (3rd Edition) <br>by Craig Larman <br>Publisher: Prentice Hall PTR;......
Since then he has supported his brother David in refining and expanding the scope of this popular linear algebra text, including writing most of Chapters 8 and 9. Steven is also the author of three ...
SOIC, 8-lead MAP and 8-lead TSSOP packages and is accessed via a 2-wire serial interface. In addition, the entire family is available in 2.7V (2.7V to 5.5V) and 1.8V (1.8V to 5.5V) versions.