CymChad / CymChad/BaseRecyclerViewAdapterHelper

DraggableModule

Open
#3,733 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
24.6k
Forks
5.2k
PR merge metrics
No merged PRs in 30d

Description

package com.chad.baserecyclerviewadapterhelper.adapter;

import androidx.annotation.NonNull;

import com.chad.baserecyclerviewadapterhelper.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.BaseDraggableModule;
import com.chad.library.adapter.base.module.DraggableModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

import java.util.List;

public class DragAndSwipeAdapter extends BaseQuickAdapter<String, BaseViewHolder> implements DraggableModule {

public DragAndSwipeAdapter(List<String> data) {
    super(R.layout.item_draggable_view, data);
}

@Override
protected void convert(@NotNull BaseViewHolder helper, @NotNull String item) {
    switch (helper.getLayoutPosition() % 3) {
        case 0:
            helper.setImageResource(R.id.iv_head, R.mipmap.head_img0);
            break;
        case 1:
            helper.setImageResource(R.id.iv_head, R.mipmap.head_img1);
            break;
        case 2:
            helper.setImageResource(R.id.iv_head, R.mipmap.head_img2);
            break;
        default:
            break;
    }
    helper.setText(R.id.tv, item);
}

@NonNull
@Override
public BaseDraggableModule addDraggableModule(@NonNull BaseQuickAdapter<?, ?> baseQuickAdapter) {
    return DraggableModule.super.addDraggableModule(baseQuickAdapter);
}

}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The body shows DragAndSwipeAdapter and its addDraggableModule override, but names no file, test, or requested change. Start by locating DragAndSwipeAdapter and the DraggableModule/BaseDraggableModule definitions; done cannot be determined until the desired outcome is specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.