|
|
@@ -8,10 +8,8 @@ import androidx.annotation.Nullable;
|
|
|
|
|
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
import com.chad.library.adapter.base.BaseViewHolder;
|
|
|
-import com.miekir.common.utils.ToastTool;
|
|
|
-import com.miekir.eden.BuildConfig;
|
|
|
import com.miekir.eden.R;
|
|
|
-import com.miekir.eden.tool.SystemTool;
|
|
|
+import com.miekir.eden.base.BaseBeiActivity;
|
|
|
import com.miekir.eden.ui.home.goods.MagnetBean;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -24,6 +22,8 @@ import java.util.List;
|
|
|
* Description: 详情图片适配器
|
|
|
*/
|
|
|
public class MagnetAdapter extends BaseQuickAdapter<MagnetBean, BaseViewHolder> {
|
|
|
+ private SeePresenter seePresenter;
|
|
|
+
|
|
|
private Context mContext;
|
|
|
public MagnetAdapter(Context context, @Nullable List<MagnetBean> data) {
|
|
|
super(R.layout.item_goods_detail_magnet, data);
|
|
|
@@ -35,10 +35,16 @@ public class MagnetAdapter extends BaseQuickAdapter<MagnetBean, BaseViewHolder>
|
|
|
TextView tv_detail_magnet = helper.getView(R.id.tv_detail_magnet);
|
|
|
tv_detail_magnet.setText(magnetBean.text + "(点击复制)");
|
|
|
|
|
|
- String realUrl = magnetBean.url.startsWith("http") ? magnetBean.url : BuildConfig.HOST_STATIC_RESOURCE+magnetBean.url;
|
|
|
+ //String realUrl = magnetBean.url.startsWith("http") ? magnetBean.url : BuildConfig.HOST_STATIC_RESOURCE+magnetBean.url;
|
|
|
tv_detail_magnet.setOnClickListener(v -> {
|
|
|
- SystemTool.copyText(mContext, realUrl);
|
|
|
- ToastTool.showShort("已复制资源链接");
|
|
|
+ if (mContext instanceof BaseBeiActivity) {
|
|
|
+ ((BaseBeiActivity) mContext).showLoading();
|
|
|
+ }
|
|
|
+ seePresenter.getTorrentSecret(magnetBean.url);
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ public void setSeePresenter(SeePresenter seePresenter) {
|
|
|
+ this.seePresenter = seePresenter;
|
|
|
+ }
|
|
|
}
|