Search in sources :

Example 1 with UpdateSuggestedTagsTask

use of com.odysee.app.tasks.UpdateSuggestedTagsTask in project odysee-android by OdyseeTeam.

the class PublishFormFragment method updateSuggestedTags.

private void updateSuggestedTags(String filter, int limit, boolean clearPrevious) {
    UpdateSuggestedTagsTask task = new UpdateSuggestedTagsTask(filter, limit, addedTagsAdapter, suggestedTagsAdapter, clearPrevious, true, new UpdateSuggestedTagsTask.KnownTagsHandler() {

        @Override
        public void onSuccess(List<Tag> tags) {
            if (suggestedTagsAdapter == null) {
                suggestedTagsAdapter = new TagListAdapter(tags, getContext());
                suggestedTagsAdapter.setCustomizeMode(TagListAdapter.CUSTOMIZE_MODE_ADD);
                suggestedTagsAdapter.setClickListener(PublishFormFragment.this);
                if (suggestedTagsList != null) {
                    suggestedTagsList.setAdapter(suggestedTagsAdapter);
                }
            } else {
                suggestedTagsAdapter.setTags(tags);
            }
            checkNoAddedTags();
            checkNoTagResults();
        }
    });
    task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Also used : TagListAdapter(com.odysee.app.adapter.TagListAdapter) UpdateSuggestedTagsTask(com.odysee.app.tasks.UpdateSuggestedTagsTask) Tag(com.odysee.app.model.Tag)

Example 2 with UpdateSuggestedTagsTask

use of com.odysee.app.tasks.UpdateSuggestedTagsTask in project odysee-android by OdyseeTeam.

the class ChannelFormFragment method updateSuggestedTags.

private void updateSuggestedTags(String filter, int limit, boolean clearPrevious) {
    UpdateSuggestedTagsTask task = new UpdateSuggestedTagsTask(filter, limit, addedTagsAdapter, suggestedTagsAdapter, clearPrevious, false, new UpdateSuggestedTagsTask.KnownTagsHandler() {

        @Override
        public void onSuccess(List<Tag> tags) {
            if (suggestedTagsAdapter == null) {
                suggestedTagsAdapter = new TagListAdapter(tags, getContext());
                suggestedTagsAdapter.setCustomizeMode(TagListAdapter.CUSTOMIZE_MODE_ADD);
                suggestedTagsAdapter.setClickListener(ChannelFormFragment.this);
                if (suggestedTagsList != null) {
                    suggestedTagsList.setAdapter(suggestedTagsAdapter);
                }
            } else {
                suggestedTagsAdapter.setTags(tags);
            }
            checkNoAddedTags();
            checkNoTagResults();
        }
    });
    task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Also used : TagListAdapter(com.odysee.app.adapter.TagListAdapter) UpdateSuggestedTagsTask(com.odysee.app.tasks.UpdateSuggestedTagsTask) Tag(com.odysee.app.model.Tag)

Example 3 with UpdateSuggestedTagsTask

use of com.odysee.app.tasks.UpdateSuggestedTagsTask in project odysee-android by OdyseeTeam.

the class CustomizeTagsDialogFragment method updateKnownTags.

private void updateKnownTags(String filter, int limit, boolean clearPrevious) {
    UpdateSuggestedTagsTask task = new UpdateSuggestedTagsTask(filter, SUGGESTED_LIMIT, followedTagsAdapter, suggestedTagsAdapter, clearPrevious, false, new UpdateSuggestedTagsTask.KnownTagsHandler() {

        @Override
        public void onSuccess(List<Tag> tags) {
            if (suggestedTagsAdapter == null) {
                suggestedTagsAdapter = new TagListAdapter(tags, getContext());
                suggestedTagsAdapter.setCustomizeMode(TagListAdapter.CUSTOMIZE_MODE_ADD);
                suggestedTagsAdapter.setClickListener(customizeTagClickListener);
                if (suggestedTagsList != null) {
                    suggestedTagsList.setAdapter(suggestedTagsAdapter);
                }
            } else {
                suggestedTagsAdapter.setTags(tags);
            }
            checkNoResults();
        }
    });
    task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
Also used : TagListAdapter(com.odysee.app.adapter.TagListAdapter) UpdateSuggestedTagsTask(com.odysee.app.tasks.UpdateSuggestedTagsTask) Tag(com.odysee.app.model.Tag)

Aggregations

TagListAdapter (com.odysee.app.adapter.TagListAdapter)3 Tag (com.odysee.app.model.Tag)3 UpdateSuggestedTagsTask (com.odysee.app.tasks.UpdateSuggestedTagsTask)3