From 31393f1d9c4578960521e0026b0ed04233863104 Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Sat, 2 Sep 2017 22:31:52 +0800 Subject: [PATCH] slightly improved list performance --- .../mariotaku/twidere/model/ParcelableMedia.java | 14 +++++++++----- .../mariotaku/twidere/model/ParcelableStatus.java | 14 +++++++------- .../twidere/fragment/CursorActivitiesFragment.kt | 3 ++- .../twidere/fragment/CursorStatusesFragment.kt | 6 +++++- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMedia.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMedia.java index 28bf442b9..e88cc5cbf 100644 --- a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMedia.java +++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableMedia.java @@ -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 CREATOR = new Creator() { @Override public ParcelableMedia createFromParcel(Parcel source) { diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableStatus.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableStatus.java index def8faaa9..21fae03d0 100644 --- a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableStatus.java +++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableStatus.java @@ -280,26 +280,28 @@ public class ParcelableStatus implements Parcelable, Comparable 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) + } }