AndroidSwipeLayout icon indicating copy to clipboard operation
AndroidSwipeLayout copied to clipboard

Can not manage to dynamically populate the "actions"

Open Chuque opened this issue 8 years ago • 2 comments

the items that are revealed when we swype, let's call them "actions". I can add those actions on xml, but have not found a way to programmatically populate them for each item. how can achieve this? If I should not open an issue for this, let me know.

Chuque avatar Jan 31 '18 20:01 Chuque

any help here please?

Chuque avatar Apr 03 '18 02:04 Chuque

Hello, I'm just an end user, but I have found you can add items to a when using a recyclerview by adding the following code to onBindViewHolder inside your adapter:

    LinearLayout myLayout = viewHolder.swipeLayout.findViewById(R.id.bottom_wraper);
    Button myButton = new Button(mContext);
    myButton.setText("New Button");
    myButton.setTextSize(12);
    myButton.setLayoutParams(new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.WRAP_CONTENT,
            ViewGroup.LayoutParams.WRAP_CONTENT));
    myLayout.addView(myButton);

Hope that helps.

Troyaz12 avatar Apr 29 '18 21:04 Troyaz12