We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried like this but my new view is null-
` slidePanel.setAdapter(new CardAdapter() { @OverRide public int getLayoutId(int index) { if (dataList.get(index).imagePath == null) { return R.layout.gads; } else { return R.layout.card_item; }
} @Override public int getCount() { return dataList.size(); } @Override public void bindView(View view, int index) { if (dataList.get(index).imagePath == null) { AdViewHolder adViewHolder; adViewHolder = new AdViewHolder(view); AdRequest request = new AdRequest.Builder().build(); if (adViewHolder.adView != null) { adViewHolder.adView.loadAd(request); adViewHolder.adView.setAdListener(new AdListener() { @Override public void onAdFailedToLoad(int i) { super.onAdFailedToLoad(i); } @Override public void onAdLeftApplication() { super.onAdLeftApplication(); } @Override public void onAdLoaded() { super.onAdLoaded(); } }); } } else { Object tag = view.getTag(); ViewHolder viewHolder; if (null != tag) { viewHolder = (ViewHolder) tag; } else { viewHolder = new ViewHolder(view); view.setTag(viewHolder); } viewHolder.bindData(dataList.get(index)); } } @Override public Object getItem(int index) { return dataList.get(index); } @Override public Rect obtainDraggableArea(View view) { // 可滑动区域定制,该函数只会调用一次 View contentView = view.findViewById(R.id.card_item_content); View topLayout = view.findViewById(R.id.card_top_layout); View bottomLayout = view.findViewById(R.id.card_bottom_layout); int left = view.getLeft() + contentView.getPaddingLeft() + topLayout.getPaddingLeft(); int right = view.getRight() - contentView.getPaddingRight() - topLayout.getPaddingRight(); int top = view.getTop() + contentView.getPaddingTop() + topLayout.getPaddingTop(); int bottom = view.getBottom() - contentView.getPaddingBottom() - bottomLayout.getPaddingBottom(); return new Rect(left, top, right, bottom); } });`
The text was updated successfully, but these errors were encountered:
sorry that is not supported.
Sorry, something went wrong.
@xmuSistone is there a way to achieve this? I want to have ads inside of card view.
@bozzmob the underlying recycle logic does not support this. You may search other github repositories for help. Sorry for that.
@xmuSistone Thanks a lot for the info.
No branches or pull requests
I tried like this but my new view is null-
` slidePanel.setAdapter(new CardAdapter() {
@OverRide
public int getLayoutId(int index) {
if (dataList.get(index).imagePath == null) {
return R.layout.gads;
} else {
return R.layout.card_item;
}
The text was updated successfully, but these errors were encountered: