import net.ktnx.mobileledger.ui.activity.ProfileDetailActivity;
import net.ktnx.mobileledger.utils.Colors;
+import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Locale;
import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.lifecycle.MutableLiveData;
import androidx.recyclerview.widget.ItemTouchHelper;
editProfile(view, profile);
};
public MutableLiveData<Boolean> editingProfiles = new MutableLiveData<>(false);
+ private static WeakReference<ProfilesRecyclerViewAdapter> instanceRef;
private RecyclerView recyclerView;
private ItemTouchHelper rearrangeHelper;
private boolean animationsEnabled = true;
public ProfilesRecyclerViewAdapter() {
+ instanceRef = new WeakReference<>(this);
debug("flow", "ProfilesRecyclerViewAdapter.new()");
ItemTouchHelper.Callback cb = new ItemTouchHelper.Callback() {
};
rearrangeHelper = new ItemTouchHelper(cb);
}
+ public static @Nullable ProfilesRecyclerViewAdapter getInstance() {
+ return instanceRef.get();
+ }
public void setAnimationsEnabled(boolean animationsEnabled) {
this.animationsEnabled = animationsEnabled;
}