ADD week 5
This commit is contained in:
		| @@ -0,0 +1,28 @@ | ||||
| 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: classes.dex */ | ||||
| class SmoothCalendarLayoutManager extends LinearLayoutManager { | ||||
|     private static final float MILLISECONDS_PER_INCH = 100.0f; | ||||
|  | ||||
|     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 | ||||
|             @Override // androidx.recyclerview.widget.LinearSmoothScroller | ||||
|             protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) { | ||||
|                 return SmoothCalendarLayoutManager.MILLISECONDS_PER_INCH / displayMetrics.densityDpi; | ||||
|             } | ||||
|         }; | ||||
|         linearSmoothScroller.setTargetPosition(i); | ||||
|         startSmoothScroll(linearSmoothScroller); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user