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;
}
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);
}
}
Aggregations