Skip to content

Commit

Permalink
修复动画抖动
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuRi committed Jan 24, 2017
1 parent 881198f commit 5fad63b
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,14 @@ public boolean onTouch(View v, MotionEvent event) {
}

contentPanel.setLayoutParams(new RelativeLayout.LayoutParams(_PST.dpToPx((int) (width * 1.1)), _PST.dpToPx((int) (panelHeight * 1.1))));
contentPanel.setX(_PST.dpToPx((int) (_PST.screenWidthDp() / 2 - width * 0.55)));
contentPanel.setY(_PST.dpToPx((int) (_PST.screenHeightDp() / 2 - panelHeight * 0.55)));
contentPanel.setX(_PST.dpToPx((int) (_PST.screenWidthDp() / 2 - width / 2)));
contentPanel.setY(_PST.dpToPx((int) (_PST.screenHeightDp() / 2 - panelHeight / 2)));

// 使用下面这种特效会让窗口有点颤抖,暂不明原因,待考究
// contentPanel.setX(_PST.dpToPx((int) (_PST.screenWidthDp() / 2 - width * 0.55)));
// contentPanel.setY(_PST.dpToPx((int) (_PST.screenHeightDp() / 2 - panelHeight * 0.55)));

_PAT.setLocation(contentPanel, (_PST.screenWidthDp() - width) / 2, (_PST.screenHeightDp() - panelHeight) / 2);

titleView.setX(_PST.dpToPx(titleX));
titleView.setY(_PST.dpToPx(titleY));
Expand All @@ -564,7 +570,6 @@ public boolean onTouch(View v, MotionEvent event) {

_PAT.setLocation(contentLayout, 0, 0);

_PAT.setLocation(contentPanel, (_PST.screenWidthDp() - width) / 2, (_PST.screenHeightDp() - panelHeight) / 2);
_PAT.setSize(contentPanel, width, panelHeight);

}
Expand Down

0 comments on commit 5fad63b

Please sign in to comment.