2023-08-17 10:46:24 +02:00
|
|
|
package android.view;
|
|
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
|
2024-02-25 17:41:26 +01:00
|
|
|
/**
|
|
|
|
|
* default values are mainly based on AOSPs defaults. Does not account for scaling yet.
|
|
|
|
|
*/
|
2023-08-17 10:46:24 +02:00
|
|
|
public class ViewConfiguration {
|
|
|
|
|
|
|
|
|
|
public static ViewConfiguration get(Context context) {
|
|
|
|
|
return new ViewConfiguration();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getScaledTouchSlop() {
|
2024-02-25 17:41:26 +01:00
|
|
|
return 8;
|
2023-08-17 10:46:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getScaledMaximumFlingVelocity() {
|
2024-02-25 17:41:26 +01:00
|
|
|
return 8000;
|
2023-08-17 10:46:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getScaledMinimumFlingVelocity() {
|
2024-02-25 17:41:26 +01:00
|
|
|
return 50;
|
2023-08-17 10:46:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static int getTapTimeout() {
|
2024-05-06 06:24:00 +02:00
|
|
|
return 100;
|
2023-08-17 10:46:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static int getLongPressTimeout() {
|
2024-05-06 06:24:00 +02:00
|
|
|
return 400;
|
2023-08-17 10:46:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getScaledPagingTouchSlop(){
|
2024-02-25 17:41:26 +01:00
|
|
|
return 16;
|
2023-08-17 10:46:24 +02:00
|
|
|
}
|
2023-08-22 14:41:01 +02:00
|
|
|
|
|
|
|
|
public boolean hasPermanentMenuKey() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2023-08-23 09:16:45 +02:00
|
|
|
|
|
|
|
|
public static int getDoubleTapTimeout() {
|
2024-05-06 06:24:00 +02:00
|
|
|
return 300;
|
2023-08-23 09:16:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getScaledDoubleTapSlop() {
|
2024-05-15 23:04:09 +02:00
|
|
|
return 100;
|
2023-08-23 09:16:45 +02:00
|
|
|
}
|
2023-09-01 12:13:24 +02:00
|
|
|
|
|
|
|
|
public static float getScrollFriction() {
|
2024-02-25 17:41:26 +01:00
|
|
|
return 0.015f;
|
2023-09-01 12:13:24 +02:00
|
|
|
}
|
2023-08-17 10:46:24 +02:00
|
|
|
}
|