From 70422e524a50dba35d94aafa3de90eedaf98562f Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 5 Feb 2020 20:15:12 +0100 Subject: [PATCH] Updated AndroidX --- app/build.gradle | 6 +++--- .../selection/ViewAutoScroller.java | 17 ++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1b48d9ca9e..4eb3f8baae 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -188,7 +188,7 @@ dependencies { def core_version = "1.3.0-alpha01" def appcompat_version = "1.2.0-alpha02" - def fragment_version = "1.2.0" + def fragment_version = "1.2.1" def recyclerview_version = "1.2.0-alpha01" def coordinatorlayout_version = "1.1.0" def constraintlayout_version = "2.0.0-beta3" @@ -202,7 +202,7 @@ dependencies { def room_version = "2.2.3" def paging_version = "2.1.1" def preference_version = "1.1.0" - def work_version = "2.3.0" + def work_version = "2.3.1" def exif_version = "1.2.0-beta01" def biometric_version = "1.0.1" def billingclient_version = "2.1.0" @@ -234,7 +234,7 @@ dependencies { // https://mvnrepository.com/artifact/androidx.recyclerview/recyclerview // https://mvnrepository.com/artifact/androidx.recyclerview/recyclerview-selection implementation "androidx.recyclerview:recyclerview:$recyclerview_version" - //implementation "androidx.recyclerview:recyclerview-selection:1.1.0-beta01" + //implementation "androidx.recyclerview:recyclerview-selection:1.1.0-rc01" // https://mvnrepository.com/artifact/androidx.coordinatorlayout/coordinatorlayout implementation "androidx.coordinatorlayout:coordinatorlayout:$coordinatorlayout_version" diff --git a/app/src/main/java/androidx/recyclerview/selection/ViewAutoScroller.java b/app/src/main/java/androidx/recyclerview/selection/ViewAutoScroller.java index 34b43e22cf..1faf59c6bb 100644 --- a/app/src/main/java/androidx/recyclerview/selection/ViewAutoScroller.java +++ b/app/src/main/java/androidx/recyclerview/selection/ViewAutoScroller.java @@ -22,6 +22,7 @@ import static androidx.recyclerview.selection.Shared.DEBUG; import static androidx.recyclerview.selection.Shared.VERBOSE; import android.graphics.Point; +import android.graphics.Rect; import android.util.Log; import androidx.annotation.NonNull; @@ -243,31 +244,33 @@ final class ViewAutoScroller extends AutoScroller { */ private static final class RuntimeHost extends ScrollHost { - private final RecyclerView mRecyclerView; + private final RecyclerView mView; - RuntimeHost(@NonNull RecyclerView recyclerView) { - mRecyclerView = recyclerView; + RuntimeHost(@NonNull RecyclerView view) { + mView = view; } @Override void runAtNextFrame(@NonNull Runnable r) { - ViewCompat.postOnAnimation(mRecyclerView, r); + ViewCompat.postOnAnimation(mView, r); } @Override void removeCallback(@NonNull Runnable r) { - mRecyclerView.removeCallbacks(r); + mView.removeCallbacks(r); } @Override void scrollBy(int dy) { if (VERBOSE) Log.v(TAG, "Scrolling view by: " + dy); - mRecyclerView.scrollBy(0, dy); + mView.scrollBy(0, dy); } @Override int getViewHeight() { - return mRecyclerView.getHeight(); + Rect r = new Rect(); + mView.getGlobalVisibleRect(r); + return r.height(); } } }