use of com.github.pockethub.android.core.issue.IssueFilter in project PocketHub by pockethub.
the class FilterListFragment method onListItemClick.
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
IssueFilter filter = (IssueFilter) l.getItemAtPosition(position);
startActivity(IssueBrowseActivity.createIntent(filter));
}
use of com.github.pockethub.android.core.issue.IssueFilter in project PocketHub by pockethub.
the class FiltersViewActivity method onDialogResult.
@Override
public void onDialogResult(int requestCode, int resultCode, Bundle arguments) {
if (requestCode == REQUEST_DELETE && resultCode == RESULT_OK) {
IssueFilter filter = arguments.getParcelable(ARG_FILTER);
cache.removeIssueFilter(filter, new Consumer<IssueFilter>() {
@Override
public void accept(@NonNull IssueFilter response) throws Exception {
if (fragment != null) {
fragment.refresh();
}
}
});
return;
}
super.onDialogResult(requestCode, resultCode, arguments);
}
use of com.github.pockethub.android.core.issue.IssueFilter in project PocketHub by pockethub.
the class FiltersViewFragment method onDialogResult.
@Override
public void onDialogResult(int requestCode, int resultCode, Bundle arguments) {
if (requestCode == REQUEST_DELETE && resultCode == Activity.RESULT_OK) {
IssueFilter filter = arguments.getParcelable(ARG_FILTER);
cache.removeIssueFilter(filter, new Consumer<IssueFilter>() {
@Override
public void accept(@NonNull IssueFilter response) throws Exception {
if (fragment != null) {
fragment.refresh();
}
}
});
return;
}
super.onDialogResult(requestCode, resultCode, arguments);
}
use of com.github.pockethub.android.core.issue.IssueFilter in project PocketHub by pockethub.
the class AccountDataManager method addIssueFilter.
/**
* Add issue filter to store
* <p/>
* This method may perform file I/O and should never be called on the
* UI-thread
*
* @param filter
*/
public void addIssueFilter(IssueFilter filter) {
final File cache = new File(root, "issue_filters.ser");
Collection<IssueFilter> filters = read(cache);
if (filters == null) {
filters = new HashSet<>();
}
if (filters.add(filter)) {
write(cache, filters);
}
}
use of com.github.pockethub.android.core.issue.IssueFilter in project PocketHub by pockethub.
the class AccountDataManager method getIssueFilters.
/**
* Get bookmarked issue filters
* <p/>
* This method may perform network I/O and should never be called on the
* UI-thread
*
* @return non-null but possibly empty collection of issue filters
*/
public Collection<IssueFilter> getIssueFilters() {
final File cache = new File(root, "issue_filters.ser");
Collection<IssueFilter> cached = read(cache);
if (cached != null) {
return cached;
}
return Collections.emptyList();
}
Aggregations