mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-07 17:43:18 +02:00
Recyclerview selection experiment
This commit is contained in:
30
app/src/main/java/eu/faircode/email/MyItemDetail.java
Normal file
30
app/src/main/java/eu/faircode/email/MyItemDetail.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package eu.faircode.email;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.selection.ItemDetailsLookup;
|
||||
|
||||
public class MyItemDetail extends ItemDetailsLookup.ItemDetails<Long> {
|
||||
private final int adapterPosition;
|
||||
private final Long selectionKey;
|
||||
|
||||
public MyItemDetail(int adapterPosition, Long selectionKey) {
|
||||
Log.i(Helper.TAG, "MyItemDetail");
|
||||
this.adapterPosition = adapterPosition;
|
||||
this.selectionKey = selectionKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPosition() {
|
||||
Log.i(Helper.TAG, "MyItemDetail.getPosition=" + adapterPosition);
|
||||
return adapterPosition;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Long getSelectionKey() {
|
||||
Log.i(Helper.TAG, "MyItemDetail.getSelectionKey=" + selectionKey);
|
||||
return selectionKey;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user