1 /* 2 * Copyright (C) 2023 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.systemui.haptics.slider 18 19 import androidx.annotation.FloatRange 20 21 /** 22 * Configuration parameters of a seekable slider tracker. 23 * 24 * @property[waitTimeMillis] Wait period to determine if a touch event acquires the slider handle. 25 * @property[jumpThreshold] Threshold on the slider progress to detect if a touch event is qualified 26 * as an imprecise acquisition of the slider handle. 27 * @property[lowerBookendThreshold] Threshold to determine the progress on the slider that qualifies 28 * as reaching the lower bookend. 29 * @property[upperBookendThreshold] Threshold to determine the progress on the slider that qualifies 30 * as reaching the upper bookend. 31 */ 32 data class SeekableSliderTrackerConfig( 33 val waitTimeMillis: Long = 100, 34 @FloatRange(from = 0.0, to = 1.0) val jumpThreshold: Float = 0.02f, 35 @FloatRange(from = 0.0, to = 1.0) val lowerBookendThreshold: Float = 0.05f, 36 @FloatRange(from = 0.0, to = 1.0) val upperBookendThreshold: Float = 0.95f, 37 ) 38