private void drawCanUseSpace(Canvas canvas) {
try {
if (cellPosition != null && cellPosition.length >= 2 && workspace.isScrollerFinished()) {
CellLayout current = (CellLayout) workspace.getCurrentCellLayout();
if (current != null && !current.isOpenFolder()) {
Drawable canUseSpace = getResources().getDrawable(R.drawable.can_use_space);
current.cellToPoint(cellPosition[0], cellPosition[1], position);
int x = position[0];
int y = position[1] + GREEN_RECT_TOP_OFFSET;
int w = x + current.getCellWidth() * dragObjectInfo.spanX
+ (current.getLongAxisCells() - dragObjectInfo.cellX) * current.getWidthGap();
int h = position[1] + (current.getCellHeight()) * dragObjectInfo.spanY
+ (current.getShortAxisCells() - dragObjectInfo.cellY) * current.getHeightGap();
matrix.setScale(CellLayout.REDUCE_FINAL_VALUE, CellLayout.REDUCE_FINAL_VALUE,
getWidth() / 2, getHeight() / 2);
canvas.save();
canvas.concat(matrix);
canUseSpace.setBounds(x, y, w, h);
canUseSpace.draw(canvas);
canvas.restore();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
private void startWingsAnimation(float start, float end, float increment, long sleepTime) {
if (transferAt != null) {
transferAt.stopAnimation();
}
transferAt = new AnimationThread(this, start, end, increment, sleepTime);
transferAt.setOnListener(transferAtListener);
transferAt.start();
}
private class DragLayerAnimationThread implements AnimationThread.AnimationListener {
public static final int MOVE_IN = 0;
public static final int MOVE_OUT = 1;
public static final int MOVE_FINISH = 2;
private int animationState = MOVE_IN;
public void onEnd() {
animationState++;
if (!mDragging || animationState == MOVE_FINISH) {
changeWingsAnimationState = false;
clearAnimationState();
}
if (!changeWingsAnimationState) {
doNotWingsAnimation();
}
}
public void onError() {
}
public void onStart() {
}
public void clearAnimationState() {
animationState = MOVE_IN;
}
public int getAnimationState() {
return animationState;
}
}
分享到:
相关推荐
Oracle 9i, 10g, 11g编程艺术:深入数据库体系结构(第二版)源码 Expert Oracle Database Architecture: Oracle Database Programming 9i, 10g, and 11g Techniques and Solutions, Second Edition
Chapters 10 and 11- Externalities and Public Goods_en.ttml
挺好的东东,建议大家去仔细阅读,审计这块可能不太认真去关注。还是多学点儿的好啊
This compact book includes in-depth introductions to RxJava, Akka Streams, and Reactor, and integrates the latest related features from Java 9 and 11, as well as reactive streams programming with the...
But updates in this latest edition include a complete reworking of the section on the Hand, an expansion of the dermatology coverage, a new section on body contouring, and 11 new chapters; Principles...
papers and 11 short papers (acceptance rate of 42.4%). This symposium would not have been possible without the efforts of many people. First of all, we are very grateful to all authors who contributed...
《Expert Oracle Database Architecture Oracle Database Programming 9i, 10g, and 11g Techniques and Solutions, Second Edition》的源代码,跟着书做实验用。
canon ip100 linux deb was ...Some old dep libs are not available in the new debain (10, 11) or Unbantu (18, 19). In this package, libpng12-0, libtiff4 were packed as well as the deb of ip100 driver.
stochastic differential equations (Chapters 6, 7, and 11), and numerical solutions to master equations (Chapters 8 and 9), although they are intertwined in many occasions and we have tried to ...
In a bid to offer faster and faster machines, designers had been pro- ducing hardware with ever higher clock frequencies, leading to extreme levels of power dissipation. This approach began to give ...
《Next Generation Wireless LANs - 802.11n and 802.11ac, 2nd Ed 2013》是关于下一代无线局域网技术的重要参考资料,主要聚焦于802.11n和802.11ac这两种标准。这些标准代表了无线通信领域的重大进步,显著提升了Wi...
Direct3D 11 offers such a wealth of capabilities that users can sometimes get lost in the details of specific APIs and their implementation. While there is a great deal of low-level information ...
Lecture 11 Orthogonal Wavelet Bases: Connection to Orthogonal Filters Orthogonality in the Frequency Domain Biorthogonal Wavelet Bases Lecture 12 Mallat Pyramid Algorithm Sec Lecture 13 Accuracy of ...
黑水果macOS Monterey 12.5 (21G72) Clove5148 and OC 0.8.3 and Win11PE 三分区镜像