fixed notifications
This commit is contained in:
parent
7f380541e8
commit
ce02395841
|
@ -147,6 +147,7 @@ public interface TwidereConstants extends SharedPreferenceConstants, IntentConst
|
|||
String QUERY_PARAM_VALUE_USERS = "users";
|
||||
String QUERY_PARAM_VALUE_TWEETS = "tweets";
|
||||
String QUERY_PARAM_SHOW_NOTIFICATION = "show_notification";
|
||||
String QUERY_PARAM_NOTIFY_CHANGE = "notify_change";
|
||||
String QUERY_PARAM_LAT = "lat";
|
||||
String QUERY_PARAM_LNG = "lng";
|
||||
String QUERY_PARAM_URL = "url";
|
||||
|
|
|
@ -486,6 +486,7 @@ class TwidereDataProvider : ContentProvider(), LazyLoadCallback {
|
|||
}
|
||||
|
||||
private fun notifyContentObserver(uri: Uri) {
|
||||
if (!uri.getBooleanQueryParameter(QUERY_PARAM_NOTIFY_CHANGE, true)) return
|
||||
handler.post {
|
||||
context?.contentResolver?.notifyChange(uri, null)
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.mariotaku.microblog.library.twitter.model.ResponseList
|
|||
import org.mariotaku.sqliteqb.library.Expression
|
||||
import org.mariotaku.twidere.R
|
||||
import org.mariotaku.twidere.TwidereConstants.LOGTAG
|
||||
import org.mariotaku.twidere.TwidereConstants.QUERY_PARAM_SHOW_NOTIFICATION
|
||||
import org.mariotaku.twidere.TwidereConstants.QUERY_PARAM_NOTIFY_CHANGE
|
||||
import org.mariotaku.twidere.constant.loadItemLimitKey
|
||||
import org.mariotaku.twidere.extension.model.newMicroBlogInstance
|
||||
import org.mariotaku.twidere.model.AccountDetails
|
||||
|
@ -161,7 +161,7 @@ abstract class GetActivitiesTask(
|
|||
olderCount = DataStoreUtils.getActivitiesCount(context, contentUri, minPositionKey,
|
||||
Activities.POSITION_KEY, false, arrayOf(details.key))
|
||||
}
|
||||
val writeUri = UriUtils.appendQueryParameters(contentUri, QUERY_PARAM_SHOW_NOTIFICATION, notify)
|
||||
val writeUri = UriUtils.appendQueryParameters(contentUri, QUERY_PARAM_NOTIFY_CHANGE, notify)
|
||||
if (deleteBound[0] > 0 && deleteBound[1] > 0) {
|
||||
val where = Expression.and(
|
||||
Expression.equalsArgs(Activities.ACCOUNT_KEY),
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.mariotaku.sqliteqb.library.Columns
|
|||
import org.mariotaku.sqliteqb.library.Expression
|
||||
import org.mariotaku.twidere.R
|
||||
import org.mariotaku.twidere.TwidereConstants.LOGTAG
|
||||
import org.mariotaku.twidere.TwidereConstants.QUERY_PARAM_SHOW_NOTIFICATION
|
||||
import org.mariotaku.twidere.TwidereConstants.QUERY_PARAM_NOTIFY_CHANGE
|
||||
import org.mariotaku.twidere.constant.loadItemLimitKey
|
||||
import org.mariotaku.twidere.extension.model.newMicroBlogInstance
|
||||
import org.mariotaku.twidere.model.AccountDetails
|
||||
|
@ -151,7 +151,7 @@ abstract class GetStatusesTask(
|
|||
sinceSortId: Long, maxSortId: Long,
|
||||
loadItemLimit: Int, notify: Boolean): Int {
|
||||
val uri = contentUri
|
||||
val writeUri = UriUtils.appendQueryParameters(uri, QUERY_PARAM_SHOW_NOTIFICATION, notify)
|
||||
val writeUri = UriUtils.appendQueryParameters(uri, QUERY_PARAM_NOTIFY_CHANGE, notify)
|
||||
val resolver = context.contentResolver
|
||||
val noItemsBefore = DataStoreUtils.getStatusCount(context, uri, accountKey) <= 0
|
||||
val values = arrayOfNulls<ContentValues>(statuses.size)
|
||||
|
|
Loading…
Reference in New Issue