mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
commit
1924c2b421
4 changed files with 17 additions and 6 deletions
|
@ -168,6 +168,7 @@ public abstract class ItemsList extends NbActivity implements StoryOrderChangedL
|
||||||
searchQueryInput.requestFocus();
|
searchQueryInput.requestFocus();
|
||||||
} else {
|
} else {
|
||||||
searchQueryInput.setVisibility(View.GONE);
|
searchQueryInput.setVisibility(View.GONE);
|
||||||
|
checkSearchQuery();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class StoryItemsAdapter extends SimpleCursorAdapter {
|
||||||
return cursor.getCount();
|
return cursor.getCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isStale() {
|
public synchronized boolean isStale() {
|
||||||
return cursor.isClosed();
|
return cursor.isClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,19 +91,28 @@ public class StoryItemsAdapter extends SimpleCursorAdapter {
|
||||||
return super.swapCursor(c);
|
return super.swapCursor(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setShowNone(boolean showNone) {
|
public synchronized void setShowNone(boolean showNone) {
|
||||||
this.showNone = showNone;
|
this.showNone = showNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Story getStory(int position) {
|
public synchronized Story getStory(int position) {
|
||||||
cursor.moveToPosition(position);
|
if (cursor == null || cursor.isClosed() || cursor.getColumnCount() == 0 || position >= cursor.getCount() || position < 0) {
|
||||||
return Story.fromCursor(cursor);
|
return null;
|
||||||
|
} else {
|
||||||
|
cursor.moveToPosition(position);
|
||||||
|
return Story.fromCursor(cursor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTextSize(float textSize) {
|
public void setTextSize(float textSize) {
|
||||||
this.textSize = textSize;
|
this.textSize = textSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public synchronized long getItemId(int position) {
|
||||||
|
return super.getItemId(position);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void bindView(View v, Context context, Cursor cursor) {
|
public synchronized void bindView(View v, Context context, Cursor cursor) {
|
||||||
super.bindView(v, context, cursor);
|
super.bindView(v, context, cursor);
|
||||||
|
|
|
@ -487,6 +487,7 @@ public abstract class ItemListFragment extends NbFragment implements OnScrollLis
|
||||||
}
|
}
|
||||||
if (index <= -1) return;
|
if (index <= -1) return;
|
||||||
Story story = adapter.getStory(index-1);
|
Story story = adapter.getStory(index-1);
|
||||||
|
if (story == null) return;
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case GEST_ACTION_MARKREAD:
|
case GEST_ACTION_MARKREAD:
|
||||||
FeedUtils.markStoryAsRead(story, getActivity());;
|
FeedUtils.markStoryAsRead(story, getActivity());;
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class NotificationUtils {
|
||||||
// force a new Reading activity, since if multiple notifications are tapped, any re-use or
|
// force a new Reading activity, since if multiple notifications are tapped, any re-use or
|
||||||
// stacking of the activity would almost certainly out-race the sync loop and cause stale
|
// stacking of the activity would almost certainly out-race the sync loop and cause stale
|
||||||
// UI on some devices.
|
// UI on some devices.
|
||||||
i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NO_HISTORY);
|
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
// set the requestCode to the story hashcode to prevent the PI re-using the wrong Intent
|
// set the requestCode to the story hashcode to prevent the PI re-using the wrong Intent
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, story.hashCode(), i, 0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, story.hashCode(), i, 0);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue