From e48a39979a4f0865ecb12223ed191626d8e75070 Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Fri, 12 May 2017 18:12:28 +0800 Subject: [PATCH] fixed read on main thread updated version --- build.gradle | 2 +- twidere/build.gradle | 4 ++-- .../twidere/extension/model/RefreshTaskParamExtensions.kt | 3 --- .../org/mariotaku/twidere/fragment/CursorStatusesFragment.kt | 3 +++ .../org/mariotaku/twidere/fragment/HomeTimelineFragment.kt | 1 - .../kotlin/org/mariotaku/twidere/model/RefreshTaskParam.kt | 3 +++ 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index bb56d5ca2..1b068507b 100644 --- a/build.gradle +++ b/build.gradle @@ -56,7 +56,7 @@ subprojects { KPreferences : '0.9.7', Kovenant : '3.3.0', ParcelablePlease : '1.0.2', - Chameleon : '0.9.17', + Chameleon : '0.9.18', UniqR : '0.9.1', SQLiteQB : '0.9.15', Glide : '3.7.0', diff --git a/twidere/build.gradle b/twidere/build.gradle index 93ed16bc6..1b61ef98f 100644 --- a/twidere/build.gradle +++ b/twidere/build.gradle @@ -41,8 +41,8 @@ android { applicationId "org.mariotaku.twidere" minSdkVersion project.properties['overrideMinSdkVersion'] ?: 14 targetSdkVersion 25 - versionCode 362 - versionName '3.6.2' + versionCode 363 + versionName '3.6.3' multiDexEnabled true buildConfigField 'boolean', 'LEAK_CANARY_ENABLED', 'Boolean.parseBoolean("true")' diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/RefreshTaskParamExtensions.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/RefreshTaskParamExtensions.kt index 6fe8263c2..7978b71d6 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/RefreshTaskParamExtensions.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/RefreshTaskParamExtensions.kt @@ -22,9 +22,6 @@ package org.mariotaku.twidere.extension.model import org.mariotaku.twidere.model.RefreshTaskParam import org.mariotaku.twidere.model.pagination.SinceMaxPagination -val RefreshTaskParam.hasMaxIds: Boolean - get() = pagination?.any { (it as? SinceMaxPagination)?.maxId != null } ?: false - fun RefreshTaskParam.getMaxId(index: Int): String? { return (pagination?.get(index) as? SinceMaxPagination)?.maxId } diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/CursorStatusesFragment.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/CursorStatusesFragment.kt index 765c1df3c..464bc7835 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/CursorStatusesFragment.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/CursorStatusesFragment.kt @@ -192,6 +192,9 @@ abstract class CursorStatusesFragment : AbsStatusesFragment() { override val shouldAbort: Boolean get() = context == null + + override val hasMaxIds: Boolean + get() = false }) return true } diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/HomeTimelineFragment.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/HomeTimelineFragment.kt index fd605f70d..e6becb321 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/HomeTimelineFragment.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/HomeTimelineFragment.kt @@ -23,7 +23,6 @@ import org.mariotaku.sqliteqb.library.Expression import org.mariotaku.twidere.TwidereConstants.NOTIFICATION_ID_HOME_TIMELINE import org.mariotaku.twidere.annotation.ReadPositionTag import org.mariotaku.twidere.constant.IntentConstants.EXTRA_EXTRAS -import org.mariotaku.twidere.extension.model.hasMaxIds import org.mariotaku.twidere.model.ParameterizedExpression import org.mariotaku.twidere.model.RefreshTaskParam import org.mariotaku.twidere.model.UserKey diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/model/RefreshTaskParam.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/model/RefreshTaskParam.kt index e0f330802..c62b5faa8 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/model/RefreshTaskParam.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/model/RefreshTaskParam.kt @@ -1,6 +1,7 @@ package org.mariotaku.twidere.model import org.mariotaku.twidere.model.pagination.Pagination +import org.mariotaku.twidere.model.pagination.SinceMaxPagination /** * Created by mariotaku on 16/2/14. @@ -18,4 +19,6 @@ interface RefreshTaskParam { val isBackground: Boolean get() = false + val hasMaxIds: Boolean + get() = pagination?.any { (it as? SinceMaxPagination)?.maxId != null } ?: false }