Commit 5889d920 authored by fallenstardust's avatar fallenstardust

移除本地卡组单个上传按钮

parent 3437cc3d
......@@ -77,37 +77,6 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
deckInfo = new DeckInfo();
mLimitList = DataManager.get().getLimitManager().getTopLimit();
mContext = context;
addChildClickViewIds(R.id.local_deck_upload_btn);
LogUtil.i(TAG, "DeckListAdapter constructor");
setOnItemChildClickListener((adapter, view, position) -> {
//判断是否登录,如果未登录,直接返回
LoginToken loginToken = DeckSquareApiUtil.getLoginData();
if (loginToken == null) {
return;
}
//获得点击的卡组
DeckFile deckFile = (DeckFile) adapter.getData().get(position);
LogUtil.i(TAG, "deckFile " + deckFile.toString());
//上传卡组
VUiKit.defer().when(() -> {
PushDeckResponse result = DeckSquareApiUtil.requestIdAndPushDeck(deckFile,loginToken);
return result;
}).fail(e -> {
LogUtil.i(TAG, "square deck detail fail" + e.getMessage());
}).done(pushDeckResponse -> {
if (pushDeckResponse.isData()) {
YGOUtil.showTextToast("push success!");
} else {
YGOUtil.showTextToast("卡组上传失败!");
}
});
});
}
......@@ -222,14 +191,6 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
} else {
holder.item_deck_list.setBackgroundResource(Color.TRANSPARENT);
}
//卡包展示、人机卡组不显示上传按钮图标
if (deckFile.getPathFile().getParent().endsWith(Constants.CORE_PACK_PATH)
|| deckFile.getPathFile().getParent().endsWith(Constants.WINDBOT_DECK_PATH)
||deckFile.getPathFile().getParent().endsWith("cacheDeck")) {
holder.local_deck_upload_btn.setVisibility(View.GONE);
} else {
holder.local_deck_upload_btn.setVisibility(View.VISIBLE);
}
}
public void setSelectPosition(int selectPosition) {
......@@ -296,7 +257,6 @@ class DeckViewHolder extends com.chad.library.adapter.base.viewholder.BaseViewHo
LinearLayout ll_extra_n_side;
View item_deck_list;
View deck_info;
Button local_deck_upload_btn;
public DeckViewHolder(View view) {
super(view);
......@@ -312,6 +272,5 @@ class DeckViewHolder extends com.chad.library.adapter.base.viewholder.BaseViewHo
prerelease_star = findView(R.id.prerelease_star);
banned_mark = findView(R.id.banned_mark);
deck_info = findView(R.id.deck_info);
local_deck_upload_btn = findView(R.id.local_deck_upload_btn);
}
}
\ No newline at end of file
......@@ -34,11 +34,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
android:weightSum="5">
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="10dp"
......@@ -137,19 +136,5 @@
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_weight="1">
<Button
android:id="@+id/local_deck_upload_btn"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="@dimen/dp_10"
android:background="@drawable/btn_cloud_upload_bg"
android:gravity="center" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment