slightly improved list performance

This commit is contained in:
Mariotaku Lee 2017-09-02 22:31:52 +08:00
parent b0cca160eb
commit 31393f1d9c
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
4 changed files with 23 additions and 14 deletions

View File

@ -63,11 +63,6 @@ public class ParcelableMedia implements Parcelable {
@JsonField(name = "height")
@ParcelableThisPlease
public int height;
@JsonField(name = "video_info")
@ParcelableThisPlease
public VideoInfo video_info;
@ParcelableNoThanks
public ParcelableCardEntity card;
@JsonField(name = "page_url")
public String page_url;
@ParcelableThisPlease
@ -77,6 +72,15 @@ public class ParcelableMedia implements Parcelable {
@JsonField(name = "alt_text")
public String alt_text;
@JsonField(name = "video_info")
@ParcelableThisPlease
@Nullable
public VideoInfo video_info;
@ParcelableNoThanks
@Nullable
public ParcelableCardEntity card;
public static final Creator<ParcelableMedia> CREATOR = new Creator<ParcelableMedia>() {
@Override
public ParcelableMedia createFromParcel(Parcel source) {

View File

@ -280,26 +280,28 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
public ParcelableLocation location;
@JsonField(name = "place_full_name")
@CursorField(value = Statuses.PLACE_FULL_NAME, converter = LoganSquareCursorFieldConverter.class)
@CursorField(value = Statuses.PLACE_FULL_NAME)
public String place_full_name;
@JsonField(name = "mentions")
@CursorField(value = Statuses.MENTIONS_JSON, converter = LoganSquareCursorFieldConverter.class)
public ParcelableUserMention[] mentions;
// TODO: Simplify for list loader
@JsonField(name = "media")
@CursorField(value = Statuses.MEDIA_JSON, converter = LoganSquareCursorFieldConverter.class)
@Nullable
public ParcelableMedia[] media;
// TODO: Simplify for list loader
@JsonField(name = "quoted_media")
@CursorField(value = Statuses.QUOTED_MEDIA_JSON, converter = LoganSquareCursorFieldConverter.class)
@Nullable
public ParcelableMedia[] quoted_media;
@Nullable
@JsonField(name = "card")
@CursorField(value = Statuses.CARD, converter = LoganSquareCursorFieldConverter.class)
@Nullable
public ParcelableCardEntity card;
@JsonField(name = "extras")
@ -314,7 +316,6 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
@JsonField(name = "quoted_spans")
@CursorField(value = Statuses.QUOTED_SPANS, converter = LoganSquareCursorFieldConverter.class)
public SpanItem[] quoted_spans;
public transient boolean is_filtered;
@JsonField(name = "account_color")
@CursorField(Statuses.ACCOUNT_COLOR)
@ -323,14 +324,13 @@ public class ParcelableStatus implements Parcelable, Comparable<ParcelableStatus
@CursorField(Statuses.INSERTED_DATE)
public long inserted_date;
public boolean is_pinned_status;
@FilterFlags
@CursorField(Statuses.FILTER_FLAGS)
public long filter_flags;
public transient boolean is_pinned_status;
public transient boolean is_filtered;
public ParcelableStatus() {
}

View File

@ -349,5 +349,6 @@ abstract class CursorActivitiesFragment : AbsActivitiesFragment() {
companion object {
val activityColumnsLite = Activities.COLUMNS - arrayOf(Activities.SOURCES, Activities.TARGETS,
Activities.TARGET_OBJECTS)
}
}

View File

@ -124,7 +124,7 @@ abstract class CursorStatusesFragment : AbsStatusesFragment() {
where = accountWhere
}
adapter.showAccountsColor = accountKeys.size > 1
val projection = Statuses.COLUMNS
val projection = statusColumnsLite
val selectionArgs = Array(accountKeys.size) {
accountKeys[it].toString()
}
@ -314,4 +314,8 @@ abstract class CursorStatusesFragment : AbsStatusesFragment() {
}
companion object {
private val statusColumnsLite = Statuses.COLUMNS - arrayOf(Statuses.MENTIONS_JSON,
Statuses.CARD)
}
}