- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
79 lines
2.6 KiB
Java
79 lines
2.6 KiB
Java
package androidx.recyclerview.widget;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.collection.LongSparseArray;
|
|
|
|
/* loaded from: classes.dex */
|
|
interface StableIdStorage {
|
|
|
|
public static class NoStableIdStorage implements StableIdStorage {
|
|
private final StableIdLookup mNoIdLookup = new StableIdLookup() { // from class: androidx.recyclerview.widget.StableIdStorage.NoStableIdStorage.1
|
|
@Override // androidx.recyclerview.widget.StableIdStorage.StableIdLookup
|
|
public long localToGlobal(long j) {
|
|
return -1L;
|
|
}
|
|
};
|
|
|
|
@Override // androidx.recyclerview.widget.StableIdStorage
|
|
@NonNull
|
|
public StableIdLookup createStableIdLookup() {
|
|
return this.mNoIdLookup;
|
|
}
|
|
}
|
|
|
|
public static class SharedPoolStableIdStorage implements StableIdStorage {
|
|
private final StableIdLookup mSameIdLookup = new StableIdLookup() { // from class: androidx.recyclerview.widget.StableIdStorage.SharedPoolStableIdStorage.1
|
|
@Override // androidx.recyclerview.widget.StableIdStorage.StableIdLookup
|
|
public long localToGlobal(long j) {
|
|
return j;
|
|
}
|
|
};
|
|
|
|
@Override // androidx.recyclerview.widget.StableIdStorage
|
|
@NonNull
|
|
public StableIdLookup createStableIdLookup() {
|
|
return this.mSameIdLookup;
|
|
}
|
|
}
|
|
|
|
public interface StableIdLookup {
|
|
long localToGlobal(long j);
|
|
}
|
|
|
|
@NonNull
|
|
StableIdLookup createStableIdLookup();
|
|
|
|
public static class IsolatedStableIdStorage implements StableIdStorage {
|
|
long mNextStableId = 0;
|
|
|
|
public long obtainId() {
|
|
long j = this.mNextStableId;
|
|
this.mNextStableId = 1 + j;
|
|
return j;
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.StableIdStorage
|
|
@NonNull
|
|
public StableIdLookup createStableIdLookup() {
|
|
return new WrapperStableIdLookup();
|
|
}
|
|
|
|
public class WrapperStableIdLookup implements StableIdLookup {
|
|
private final LongSparseArray<Long> mLocalToGlobalLookup = new LongSparseArray<>();
|
|
|
|
public WrapperStableIdLookup() {
|
|
}
|
|
|
|
@Override // androidx.recyclerview.widget.StableIdStorage.StableIdLookup
|
|
public long localToGlobal(long j) {
|
|
Long l = this.mLocalToGlobalLookup.get(j);
|
|
if (l == null) {
|
|
l = Long.valueOf(IsolatedStableIdStorage.this.obtainId());
|
|
this.mLocalToGlobalLookup.put(j, l);
|
|
}
|
|
return l.longValue();
|
|
}
|
|
}
|
|
}
|
|
}
|