Commit 8007897c authored by fallenstardust's avatar fallenstardust

recycleerview 懒加载卡包展示列表

parent a374a73c
...@@ -77,7 +77,7 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D ...@@ -77,7 +77,7 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
//item是deckFile类型 //item是deckFile类型
this.deckFile = (DeckFile) item; this.deckFile = (DeckFile) item;
holder.deckName.setText(item.getName()); holder.deckName.setText(item.getName());
if (!deckFile.getTypeName().equals(YGOUtil.s(R.string.category_pack))) { //if (!deckFile.getTypeName().equals(YGOUtil.s(R.string.category_pack))) {
//预读卡组信息 //预读卡组信息
this.deckInfo = mDeckLoader.readDeck(mCardLoader, deckFile.getPathFile(), mLimitList); this.deckInfo = mDeckLoader.readDeck(mCardLoader, deckFile.getPathFile(), mLimitList);
//加载卡组第一张卡的图 //加载卡组第一张卡的图
...@@ -145,10 +145,10 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D ...@@ -145,10 +145,10 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
} }
} }
} }
} else { //} else {
holder.deck_info.setVisibility(View.GONE); // holder.deck_info.setVisibility(View.GONE);
holder.cardImage.setVisibility(View.GONE); // holder.cardImage.setVisibility(View.GONE);
} //}
//多选 //多选
if (isManySelect) { if (isManySelect) {
if (selectList.contains(item)) if (selectList.contains(item))
......
...@@ -82,6 +82,7 @@ import ocgcore.data.Card; ...@@ -82,6 +82,7 @@ import ocgcore.data.Card;
public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListener, View.OnClickListener { public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListener, View.OnClickListener {
private static final String TAG = "HomeFragment";
public static final int ID_HOMEFRAGMENT = 0; public static final int ID_HOMEFRAGMENT = 0;
private DuelAssistantManagement duelAssistantManagement; private DuelAssistantManagement duelAssistantManagement;
private HomeActivity activity; private HomeActivity activity;
...@@ -277,7 +278,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene ...@@ -277,7 +278,7 @@ public class HomeFragment extends BaseFragemnt implements OnDuelAssistantListene
* ServerUtil获取到版本状态后会通过eventmessage通知调用本函数,不需要在主函数显式调用 * ServerUtil获取到版本状态后会通过eventmessage通知调用本函数,不需要在主函数显式调用
*/ */
public void changeExCardNewMark() { public void changeExCardNewMark() {
Log.i("webCrawler", "check excard new mark, version:" + ServerUtil.exCardState); Log.i(TAG, "check excard new mark, version:" + ServerUtil.exCardState);
if (ServerUtil.exCardState == ServerUtil.ExCardState.UPDATED) { if (ServerUtil.exCardState == ServerUtil.ExCardState.UPDATED) {
ll_new_notice.setVisibility(View.GONE); ll_new_notice.setVisibility(View.GONE);
} else if (ServerUtil.exCardState == ServerUtil.ExCardState.NEED_UPDATE) { } else if (ServerUtil.exCardState == ServerUtil.ExCardState.NEED_UPDATE) {
......
...@@ -190,7 +190,6 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { ...@@ -190,7 +190,6 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
@Override @Override
protected Integer doInBackground(Void... params) { protected Integer doInBackground(Void... params) {
if (Constants.DEBUG)
Log.d(TAG, "check start"); Log.d(TAG, "check start");
boolean needsUpdate = isNewVersion; boolean needsUpdate = isNewVersion;
//清空下载缓存 //清空下载缓存
...@@ -296,10 +295,8 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { ...@@ -296,10 +295,8 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
han.sendEmptyMessage(0); han.sendEmptyMessage(0);
loadData(); loadData();
} catch ( } catch (Exception e) {
Exception e) { Log.e(TAG, "ERROR COPY", e);
if (Constants.DEBUG)
Log.e(TAG, "check", e);
return ERROR_COPY; return ERROR_COPY;
} }
return ERROR_NONE; return ERROR_NONE;
......
...@@ -125,44 +125,28 @@ ...@@ -125,44 +125,28 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal"> android:orientation="horizontal"
android:weightSum="3">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_type" android:id="@+id/rv_type"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1" />
android:nestedScrollingEnabled="true" />
<View <View
android:layout_width="1dp" android:layout_width="1dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/holo_blue_light" /> android:background="@color/holo_blue_light" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_deck" android:id="@+id/rv_deck"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="2"
android:nestedScrollingEnabled="true" /> android:nestedScrollingEnabled="true" />
</LinearLayout> </LinearLayout>
</LinearLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</androidx.core.widget.NestedScrollView>
</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