mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Fix laggy updates for saved stories unsave ops.
This commit is contained in:
parent
4acddfdf0c
commit
873d6fbacc
3 changed files with 5 additions and 4 deletions
|
@ -9,7 +9,6 @@ import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.newsblur.domain.Story;
|
import com.newsblur.domain.Story;
|
||||||
import com.newsblur.fragment.LoadingFragment;
|
import com.newsblur.fragment.LoadingFragment;
|
||||||
import com.newsblur.fragment.ReadingItemFragment;
|
|
||||||
|
|
||||||
public abstract class ReadingAdapter extends FragmentStatePagerAdapter {
|
public abstract class ReadingAdapter extends FragmentStatePagerAdapter {
|
||||||
|
|
||||||
|
|
|
@ -603,8 +603,11 @@ public class FeedProvider extends ContentProvider {
|
||||||
case SOCIALFEED_STORIES:
|
case SOCIALFEED_STORIES:
|
||||||
return db.update(DatabaseConstants.SOCIALFEED_TABLE, values, DatabaseConstants.FEED_ID + " = ?", new String[] { uri.getLastPathSegment() });
|
return db.update(DatabaseConstants.SOCIALFEED_TABLE, values, DatabaseConstants.FEED_ID + " = ?", new String[] { uri.getLastPathSegment() });
|
||||||
case INDIVIDUAL_STORY:
|
case INDIVIDUAL_STORY:
|
||||||
return db.update(DatabaseConstants.STORY_TABLE, values, DatabaseConstants.STORY_ID + " = ?", new String[] { uri.getLastPathSegment() });
|
int count = 0;
|
||||||
// In order to run a raw SQL query whereby we make decrement the column we need to a dynamic reference - something the usual content provider can't easily handle. Hence this circuitous hack.
|
count += db.update(DatabaseConstants.STORY_TABLE, values, DatabaseConstants.STORY_ID + " = ?", new String[] { uri.getLastPathSegment() });
|
||||||
|
count += db.update(DatabaseConstants.STARRED_STORIES_TABLE, values, DatabaseConstants.STORY_ID + " = ?", new String[] { uri.getLastPathSegment() });
|
||||||
|
return count;
|
||||||
|
// In order to run a raw SQL query whereby we make decrement the column we need to a dynamic reference - something the usual content provider can't easily handle. Hence this circuitous hack.
|
||||||
case FEED_COUNT:
|
case FEED_COUNT:
|
||||||
db.execSQL("UPDATE " + DatabaseConstants.FEED_TABLE + " SET " + selectionArgs[0] + " = " + selectionArgs[0] + " - 1 WHERE " + DatabaseConstants.FEED_ID + " = " + selectionArgs[1]);
|
db.execSQL("UPDATE " + DatabaseConstants.FEED_TABLE + " SET " + selectionArgs[0] + " = " + selectionArgs[0] + " - 1 WHERE " + DatabaseConstants.FEED_ID + " = " + selectionArgs[1]);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -14,7 +14,6 @@ import com.newsblur.fragment.ReadingItemFragment;
|
||||||
|
|
||||||
public class MixedFeedsReadingAdapter extends ReadingAdapter {
|
public class MixedFeedsReadingAdapter extends ReadingAdapter {
|
||||||
|
|
||||||
private String TAG = "FeedReadingAdapter";
|
|
||||||
private LoadingFragment loadingFragment;
|
private LoadingFragment loadingFragment;
|
||||||
private final ContentResolver resolver;
|
private final ContentResolver resolver;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue