Search in sources :

Example 1 with TagSuggestionAdapter

use of org.wordpress.android.ui.suggestion.adapters.TagSuggestionAdapter in project WordPress-Android by wordpress-mobile.

the class SuggestionUtils method setupTagSuggestions.

public static TagSuggestionAdapter setupTagSuggestions(final long siteId, Context context, SuggestionServiceConnectionManager serviceConnectionManager, boolean isDotcomFlag) {
    if (!isDotcomFlag) {
        return null;
    }
    TagSuggestionAdapter tagSuggestionAdapter = new TagSuggestionAdapter(context);
    List<Tag> tags = SuggestionTable.getTagsForSite(siteId);
    // if the tags are not stored yet, we want to trigger an update for it
    if (tags.isEmpty()) {
        serviceConnectionManager.bindToService();
    }
    tagSuggestionAdapter.setTagList(tags);
    return tagSuggestionAdapter;
}
Also used : Tag(org.wordpress.android.models.Tag) TagSuggestionAdapter(org.wordpress.android.ui.suggestion.adapters.TagSuggestionAdapter)

Example 2 with TagSuggestionAdapter

use of org.wordpress.android.ui.suggestion.adapters.TagSuggestionAdapter in project WordPress-Android by wordpress-mobile.

the class EditPostSettingsFragment method setupSuggestionServiceAndAdapter.

private void setupSuggestionServiceAndAdapter() {
    if (!isAdded())
        return;
    long remoteBlogId = mSite.getSiteId();
    mSuggestionServiceConnectionManager = new SuggestionServiceConnectionManager(getActivity(), remoteBlogId);
    TagSuggestionAdapter tagSuggestionAdapter = SuggestionUtils.setupTagSuggestions(mSite, getActivity(), mSuggestionServiceConnectionManager);
    if (tagSuggestionAdapter != null) {
        mTagsEditText.setAdapter(tagSuggestionAdapter);
    }
}
Also used : SuggestionServiceConnectionManager(org.wordpress.android.ui.suggestion.util.SuggestionServiceConnectionManager) TagSuggestionAdapter(org.wordpress.android.ui.suggestion.adapters.TagSuggestionAdapter)

Aggregations

TagSuggestionAdapter (org.wordpress.android.ui.suggestion.adapters.TagSuggestionAdapter)2 Tag (org.wordpress.android.models.Tag)1 SuggestionServiceConnectionManager (org.wordpress.android.ui.suggestion.util.SuggestionServiceConnectionManager)1