Commit 904f91f2 authored by fallenstardust's avatar fallenstardust

卡包展示列表改为文件名标注时间顺序排序

移除无用布局
parent 8d3d9015
......@@ -4,7 +4,6 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
......@@ -19,7 +18,6 @@ import cn.garymb.ygomobile.bean.Deck;
import cn.garymb.ygomobile.bean.DeckInfo;
import cn.garymb.ygomobile.bean.TextSelect;
import cn.garymb.ygomobile.bean.events.DeckFile;
import cn.garymb.ygomobile.lite.BuildConfig;
import cn.garymb.ygomobile.lite.R;
import cn.garymb.ygomobile.loader.CardLoader;
import cn.garymb.ygomobile.loader.DeckLoader;
......
......@@ -396,10 +396,10 @@ public class DeckAdapater extends RecyclerView.Adapter<DeckViewHolder> implement
return null;
}
public void setDeck(DeckInfo deck) {
mDeckInfo = deck;
if (deck != null) {
loadData(deck);
public void setDeck(DeckInfo deckinfo) {
mDeckInfo = deckinfo;
if (deckinfo != null) {
loadData(deckinfo);
}
mDeckMd5 = DeckItemUtils.makeMd5(mItems);
}
......
......@@ -50,6 +50,13 @@ public class DeckUtil {
}
};
private final static Comparator<DeckFile> dateInNameCom = new Comparator<DeckFile>() {
@Override
public int compare(DeckFile ydk1, DeckFile ydk2) {
return ydk2.getName().compareTo(ydk1.getName());
}
};
private final static Comparator<DeckFile> dateCom = new Comparator<DeckFile>() {
@Override
public int compare(DeckFile ydk1, DeckFile ydk2) {
......@@ -85,7 +92,7 @@ public class DeckUtil {
}
}
if (path.equals(AppsSettings.get().getPackDeckDir())) {
Collections.sort(deckList, dateCom);
Collections.sort(deckList, dateInNameCom);
} else {
Collections.sort(deckList, nameCom);
}
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sp_li"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/white"
android:gravity="center"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/sp_jz"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginLeft="10dp"
android:id="@+id/sp_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/logining_in"
android:textColor="@color/dark_purple"
android:textSize="18sp" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/layout_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/veil"
android:gravity="top"
android:paddingLeft="8dp"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="12sp"
tools:text="name" />
</LinearLayout>
<ImageView
android:id="@+id/card_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="1px"
android:layout_marginRight="1px"
android:layout_marginBottom="1px"
android:scaleType="fitCenter"
tools:src="@drawable/unknown" />
<ImageView
android:id="@+id/right_top"
android:layout_width="@dimen/right_size2"
android:layout_height="@dimen/right_size2"
android:layout_alignParentLeft="true"
android:visibility="gone"
tools:srcCompat="@drawable/ic_close_black_24dp"
tools:visibility="visible" />
</RelativeLayout>
\ 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