Correct GesturePreviewTrail.getWidth() implementation
Bug: 7981153 Change-Id: I20785b7f82329ce6f19c883e77a9716772cda290main
parent
89a1755627
commit
2763fc22ce
|
@ -100,7 +100,7 @@
|
||||||
<fraction name="center_suggestion_percentile">36%</fraction>
|
<fraction name="center_suggestion_percentile">36%</fraction>
|
||||||
|
|
||||||
<!-- Gesture preview trail parameters -->
|
<!-- 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>
|
<dimen name="gesture_preview_trail_end_width">2.5dp</dimen>
|
||||||
<!-- Gesture floating preview text parameters -->
|
<!-- Gesture floating preview text parameters -->
|
||||||
<dimen name="gesture_floating_preview_text_size">24dp</dimen>
|
<dimen name="gesture_floating_preview_text_size">24dp</dimen>
|
||||||
|
|
|
@ -131,10 +131,8 @@ final class GesturePreviewTrail {
|
||||||
* @return the width of a gesture trail
|
* @return the width of a gesture trail
|
||||||
*/
|
*/
|
||||||
private static float getWidth(final int elapsedTime, final Params params) {
|
private static float getWidth(final int elapsedTime, final Params params) {
|
||||||
final int deltaTime = params.mTrailLingerDuration - elapsedTime;
|
|
||||||
final float deltaWidth = params.mTrailStartWidth - params.mTrailEndWidth;
|
final float deltaWidth = params.mTrailStartWidth - params.mTrailEndWidth;
|
||||||
return Math.max(
|
return params.mTrailStartWidth - (deltaWidth * elapsedTime) / params.mTrailLingerDuration;
|
||||||
(deltaTime * deltaWidth) / params.mTrailLingerDuration, params.mTrailEndWidth);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final RoundedLine mRoundedLine = new RoundedLine();
|
private final RoundedLine mRoundedLine = new RoundedLine();
|
||||||
|
|
Loading…
Reference in New Issue