Merge "Correct GesturePreviewTrail.getWidth() implementation"
This commit is contained in:
commit
5d894dcfaa
2 changed files with 2 additions and 4 deletions
|
@ -100,7 +100,7 @@
|
|||
<fraction name="center_suggestion_percentile">36%</fraction>
|
||||
|
||||
<!-- Gesture preview trail parameters -->
|
||||
<dimen name="gesture_preview_trail_start_width">12.6dp</dimen>
|
||||
<dimen name="gesture_preview_trail_start_width">10.0dp</dimen>
|
||||
<dimen name="gesture_preview_trail_end_width">2.5dp</dimen>
|
||||
<!-- Gesture floating preview text parameters -->
|
||||
<dimen name="gesture_floating_preview_text_size">24dp</dimen>
|
||||
|
|
|
@ -131,10 +131,8 @@ final class GesturePreviewTrail {
|
|||
* @return the width of a gesture trail
|
||||
*/
|
||||
private static float getWidth(final int elapsedTime, final Params params) {
|
||||
final int deltaTime = params.mTrailLingerDuration - elapsedTime;
|
||||
final float deltaWidth = params.mTrailStartWidth - params.mTrailEndWidth;
|
||||
return Math.max(
|
||||
(deltaTime * deltaWidth) / params.mTrailLingerDuration, params.mTrailEndWidth);
|
||||
return params.mTrailStartWidth - (deltaWidth * elapsedTime) / params.mTrailLingerDuration;
|
||||
}
|
||||
|
||||
private final RoundedLine mRoundedLine = new RoundedLine();
|
||||
|
|
Loading…
Reference in a new issue