Search in sources :

Example 1 with IssueFilter

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));
}
Also used : IssueFilter(com.github.pockethub.android.core.issue.IssueFilter)

Example 2 with IssueFilter

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);
}
Also used : IssueFilter(com.github.pockethub.android.core.issue.IssueFilter)

Example 3 with IssueFilter

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);
}
Also used : IssueFilter(com.github.pockethub.android.core.issue.IssueFilter)

Example 4 with IssueFilter

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);
    }
}
Also used : File(java.io.File) IssueFilter(com.github.pockethub.android.core.issue.IssueFilter)

Example 5 with IssueFilter

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();
}
Also used : File(java.io.File) IssueFilter(com.github.pockethub.android.core.issue.IssueFilter)

Aggregations

IssueFilter (com.github.pockethub.android.core.issue.IssueFilter)11 File (java.io.File)3 Bundle (android.os.Bundle)2 Repository (com.meisolsson.githubsdk.model.Repository)2 Issue (com.meisolsson.githubsdk.model.Issue)1 Milestone (com.meisolsson.githubsdk.model.Milestone)1 User (com.meisolsson.githubsdk.model.User)1