Lines Matching refs:position

31  * Calculates the snap targets and the snap position given a position and a velocity. All positions
133 public SnapTarget calculateSnapTarget(int position, float velocity) {
134 return calculateSnapTarget(position, velocity, true /* hardDismiss */);
138 * @param position the top/left position of the divider
142 public SnapTarget calculateSnapTarget(int position, float velocity, boolean hardDismiss) {
143 if (position < mFirstSplitTarget.position && velocity < -mMinDismissVelocityPxPerSecond) {
146 if (position > mLastSplitTarget.position && velocity > mMinDismissVelocityPxPerSecond) {
150 return snap(position, hardDismiss);
159 public SnapTarget calculateNonDismissingSnapTarget(int position) {
160 SnapTarget target = snap(position, false /* hardDismiss */);
170 public float calculateDismissingFraction(int position) {
171 if (position < mFirstSplitTarget.position) {
172 return 1f - (float) (position - getStartInset())
173 / (mFirstSplitTarget.position - getStartInset());
174 } else if (position > mLastSplitTarget.position) {
175 return (float) (position - mLastSplitTarget.position)
176 / (mDismissEndTarget.position - mLastSplitTarget.position - mDividerSize);
181 public SnapTarget getClosestDismissTarget(int position) {
182 if (position < mFirstSplitTarget.position) {
184 } else if (position > mLastSplitTarget.position) {
186 } else if (position - mDismissStartTarget.position
187 < mDismissEndTarget.position - position) {
226 private SnapTarget snap(int position, boolean hardDismiss) {
232 float distance = Math.abs(position - target.position);
303 * Adds a target at {@param position} but only if the area with size of {@param smallerSize}
306 private void maybeAddTarget(int position, int smallerSize) {
308 mTargets.add(new SnapTarget(position, position, SnapTarget.FLAG_NONE));
313 int position = DockedDividerUtils.calculateMiddlePosition(isHorizontalDivision,
315 mTargets.add(new SnapTarget(position, position, SnapTarget.FLAG_NONE));
379 public final int position;
382 * Like {@link #position}, but used to calculate the task bounds which might be different
390 * Multiplier used to calculate distance to snap position. The lower this value, the harder
395 public SnapTarget(int position, int taskPosition, int flag) {
396 this(position, taskPosition, flag, 1f);
399 public SnapTarget(int position, int taskPosition, int flag, float distanceMultiplier) {
400 this.position = position;