Rabbit-R1/android (non root)/java/sources/com/google/android/material/datepicker/SmoothCalendarLayoutManager.java
2024-05-21 17:08:36 -04:00

30 lines
1.4 KiB
Java

package com.google.android.material.datepicker;
import android.content.Context;
import android.util.DisplayMetrics;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.LinearSmoothScroller;
import androidx.recyclerview.widget.RecyclerView;
/* loaded from: classes2.dex */
class SmoothCalendarLayoutManager extends LinearLayoutManager {
private static final float MILLISECONDS_PER_INCH = 100.0f;
/* JADX INFO: Access modifiers changed from: package-private */
public SmoothCalendarLayoutManager(Context context, int i, boolean z) {
super(context, i, z);
}
@Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int i) {
LinearSmoothScroller linearSmoothScroller = new LinearSmoothScroller(recyclerView.getContext()) { // from class: com.google.android.material.datepicker.SmoothCalendarLayoutManager.1
/* JADX INFO: Access modifiers changed from: protected */
@Override // androidx.recyclerview.widget.LinearSmoothScroller
public float calculateSpeedPerPixel(DisplayMetrics displayMetrics) {
return 100.0f / displayMetrics.densityDpi;
}
};
linearSmoothScroller.setTargetPosition(i);
startSmoothScroll(linearSmoothScroller);
}
}