Initial commit
This commit is contained in:
15
sources/com/daimajia/swipe/R$styleable.java
Normal file
15
sources/com/daimajia/swipe/R$styleable.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.daimajia.swipe;
|
||||
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class R$styleable {
|
||||
public static final int[] SwipeLayout = {R.attr.bottomEdgeSwipeOffset, R.attr.clickToClose, R.attr.drag_edge, R.attr.leftEdgeSwipeOffset, R.attr.rightEdgeSwipeOffset, R.attr.show_mode, R.attr.topEdgeSwipeOffset};
|
||||
public static final int SwipeLayout_bottomEdgeSwipeOffset = 0;
|
||||
public static final int SwipeLayout_clickToClose = 1;
|
||||
public static final int SwipeLayout_drag_edge = 2;
|
||||
public static final int SwipeLayout_leftEdgeSwipeOffset = 3;
|
||||
public static final int SwipeLayout_rightEdgeSwipeOffset = 4;
|
||||
public static final int SwipeLayout_show_mode = 5;
|
||||
public static final int SwipeLayout_topEdgeSwipeOffset = 6;
|
||||
}
|
18
sources/com/daimajia/swipe/SimpleSwipeListener.java
Normal file
18
sources/com/daimajia/swipe/SimpleSwipeListener.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.daimajia.swipe;
|
||||
|
||||
import com.daimajia.swipe.SwipeLayout;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class SimpleSwipeListener implements SwipeLayout.SwipeListener {
|
||||
@Override // com.daimajia.swipe.SwipeLayout.SwipeListener
|
||||
public void a(SwipeLayout swipeLayout, float f, float f2) {
|
||||
}
|
||||
|
||||
@Override // com.daimajia.swipe.SwipeLayout.SwipeListener
|
||||
public void a(SwipeLayout swipeLayout, int i, int i2) {
|
||||
}
|
||||
|
||||
@Override // com.daimajia.swipe.SwipeLayout.SwipeListener
|
||||
public void b(SwipeLayout swipeLayout) {
|
||||
}
|
||||
}
|
1307
sources/com/daimajia/swipe/SwipeLayout.java
Normal file
1307
sources/com/daimajia/swipe/SwipeLayout.java
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,17 @@
|
||||
package com.daimajia.swipe.adapters;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
|
||||
import com.daimajia.swipe.implments.SwipeItemRecyclerMangerImpl;
|
||||
import com.daimajia.swipe.interfaces.SwipeAdapterInterface;
|
||||
import com.daimajia.swipe.interfaces.SwipeItemMangerInterface;
|
||||
import com.daimajia.swipe.util.Attributes$Mode;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class RecyclerSwipeAdapter<VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> implements SwipeItemMangerInterface, SwipeAdapterInterface {
|
||||
public SwipeItemRecyclerMangerImpl a = new SwipeItemRecyclerMangerImpl(this);
|
||||
|
||||
public void a(Attributes$Mode attributes$Mode) {
|
||||
this.a.a(attributes$Mode);
|
||||
}
|
||||
}
|
133
sources/com/daimajia/swipe/implments/SwipeItemMangerImpl.java
Normal file
133
sources/com/daimajia/swipe/implments/SwipeItemMangerImpl.java
Normal file
@@ -0,0 +1,133 @@
|
||||
package com.daimajia.swipe.implments;
|
||||
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.SpinnerAdapter;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.daimajia.swipe.SimpleSwipeListener;
|
||||
import com.daimajia.swipe.SwipeLayout;
|
||||
import com.daimajia.swipe.interfaces.SwipeAdapterInterface;
|
||||
import com.daimajia.swipe.interfaces.SwipeItemMangerInterface;
|
||||
import com.daimajia.swipe.util.Attributes$Mode;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public abstract class SwipeItemMangerImpl implements SwipeItemMangerInterface {
|
||||
private Attributes$Mode a = Attributes$Mode.Single;
|
||||
protected int b = -1;
|
||||
protected Set<Integer> c = new HashSet();
|
||||
protected Set<SwipeLayout> d = new HashSet();
|
||||
protected BaseAdapter e;
|
||||
protected RecyclerView.Adapter f;
|
||||
|
||||
class OnLayoutListener implements SwipeLayout.OnLayout {
|
||||
private int a;
|
||||
|
||||
OnLayoutListener(int i) {
|
||||
this.a = i;
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.a = i;
|
||||
}
|
||||
|
||||
@Override // com.daimajia.swipe.SwipeLayout.OnLayout
|
||||
public void a(SwipeLayout swipeLayout) {
|
||||
if (SwipeItemMangerImpl.this.b(this.a)) {
|
||||
swipeLayout.b(false, false);
|
||||
} else {
|
||||
swipeLayout.a(false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ValueBox {
|
||||
OnLayoutListener a;
|
||||
SwipeMemory b;
|
||||
int c;
|
||||
|
||||
ValueBox(SwipeItemMangerImpl swipeItemMangerImpl, int i, SwipeMemory swipeMemory, OnLayoutListener onLayoutListener) {
|
||||
this.b = swipeMemory;
|
||||
this.a = onLayoutListener;
|
||||
}
|
||||
}
|
||||
|
||||
public SwipeItemMangerImpl(RecyclerView.Adapter adapter) {
|
||||
if (adapter == null) {
|
||||
throw new IllegalArgumentException("Adapter can not be null");
|
||||
}
|
||||
if (!(adapter instanceof SwipeItemMangerInterface)) {
|
||||
throw new IllegalArgumentException("adapter should implement the SwipeAdapterInterface");
|
||||
}
|
||||
this.f = adapter;
|
||||
}
|
||||
|
||||
public boolean b(int i) {
|
||||
return this.a == Attributes$Mode.Multiple ? this.c.contains(Integer.valueOf(i)) : this.b == i;
|
||||
}
|
||||
|
||||
class SwipeMemory extends SimpleSwipeListener {
|
||||
private int a;
|
||||
|
||||
SwipeMemory(int i) {
|
||||
this.a = i;
|
||||
}
|
||||
|
||||
@Override // com.daimajia.swipe.SwipeLayout.SwipeListener
|
||||
public void a(SwipeLayout swipeLayout) {
|
||||
if (SwipeItemMangerImpl.this.a == Attributes$Mode.Single) {
|
||||
SwipeItemMangerImpl.this.a(swipeLayout);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // com.daimajia.swipe.SwipeLayout.SwipeListener
|
||||
public void c(SwipeLayout swipeLayout) {
|
||||
if (SwipeItemMangerImpl.this.a == Attributes$Mode.Multiple) {
|
||||
SwipeItemMangerImpl.this.c.add(Integer.valueOf(this.a));
|
||||
return;
|
||||
}
|
||||
SwipeItemMangerImpl.this.a(swipeLayout);
|
||||
SwipeItemMangerImpl.this.b = this.a;
|
||||
}
|
||||
|
||||
@Override // com.daimajia.swipe.SwipeLayout.SwipeListener
|
||||
public void d(SwipeLayout swipeLayout) {
|
||||
if (SwipeItemMangerImpl.this.a == Attributes$Mode.Multiple) {
|
||||
SwipeItemMangerImpl.this.c.remove(Integer.valueOf(this.a));
|
||||
} else {
|
||||
SwipeItemMangerImpl.this.b = -1;
|
||||
}
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.a = i;
|
||||
}
|
||||
}
|
||||
|
||||
public void a(Attributes$Mode attributes$Mode) {
|
||||
this.a = attributes$Mode;
|
||||
this.c.clear();
|
||||
this.d.clear();
|
||||
this.b = -1;
|
||||
}
|
||||
|
||||
public int a(int i) {
|
||||
SpinnerAdapter spinnerAdapter = this.e;
|
||||
if (spinnerAdapter != null) {
|
||||
return ((SwipeAdapterInterface) spinnerAdapter).a(i);
|
||||
}
|
||||
Object obj = this.f;
|
||||
if (obj != null) {
|
||||
return ((SwipeAdapterInterface) obj).a(i);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void a(SwipeLayout swipeLayout) {
|
||||
for (SwipeLayout swipeLayout2 : this.d) {
|
||||
if (swipeLayout2 != swipeLayout) {
|
||||
swipeLayout2.a();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package com.daimajia.swipe.implments;
|
||||
|
||||
import android.view.View;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.daimajia.swipe.SwipeLayout;
|
||||
import com.daimajia.swipe.implments.SwipeItemMangerImpl;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public class SwipeItemRecyclerMangerImpl extends SwipeItemMangerImpl {
|
||||
public SwipeItemRecyclerMangerImpl(RecyclerView.Adapter adapter) {
|
||||
super(adapter);
|
||||
}
|
||||
|
||||
public void a(View view, int i) {
|
||||
int a = a(i);
|
||||
SwipeItemMangerImpl.OnLayoutListener onLayoutListener = new SwipeItemMangerImpl.OnLayoutListener(i);
|
||||
SwipeLayout swipeLayout = (SwipeLayout) view.findViewById(a);
|
||||
if (swipeLayout == null) {
|
||||
throw new IllegalStateException("can not find SwipeLayout in target view");
|
||||
}
|
||||
if (swipeLayout.getTag(a) != null) {
|
||||
SwipeItemMangerImpl.ValueBox valueBox = (SwipeItemMangerImpl.ValueBox) swipeLayout.getTag(a);
|
||||
valueBox.b.a(i);
|
||||
valueBox.a.a(i);
|
||||
valueBox.c = i;
|
||||
return;
|
||||
}
|
||||
SwipeItemMangerImpl.SwipeMemory swipeMemory = new SwipeItemMangerImpl.SwipeMemory(i);
|
||||
swipeLayout.a(swipeMemory);
|
||||
swipeLayout.a(onLayoutListener);
|
||||
swipeLayout.setTag(a, new SwipeItemMangerImpl.ValueBox(this, i, swipeMemory, onLayoutListener));
|
||||
this.d.add(swipeLayout);
|
||||
}
|
||||
}
|
@@ -0,0 +1,6 @@
|
||||
package com.daimajia.swipe.interfaces;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface SwipeAdapterInterface {
|
||||
int a(int i);
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
package com.daimajia.swipe.interfaces;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public interface SwipeItemMangerInterface {
|
||||
}
|
7
sources/com/daimajia/swipe/util/Attributes$Mode.java
Normal file
7
sources/com/daimajia/swipe/util/Attributes$Mode.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package com.daimajia.swipe.util;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public enum Attributes$Mode {
|
||||
Single,
|
||||
Multiple
|
||||
}
|
Reference in New Issue
Block a user