Search in sources :

Example 1 with SearchSuggestion

use of in.bugzy.data.model.SearchSuggestion in project bugzy by cpunq.

the class SearchSuggestionRepository method insertDefaultSearchSuggestions.

@WorkerThread
public void insertDefaultSearchSuggestions() {
    List<SearchSuggestion> suggestions = new ArrayList<>();
    List<String> orderingOptions = getOrderringOptions();
    for (String option : orderingOptions) {
        String text = "orderBy:" + option;
        String id = "orderby:" + option;
        suggestions.add(new SearchSuggestion(id, text, SearchSuggestionType.ORDER_BY));
    }
    for (int i = 1; i < 8; i++) {
        String text = "priority:" + i;
        suggestions.add(new SearchSuggestion(text, text, SearchSuggestionType.PRIORITY));
    }
    for (String option : getLastEditOptions()) {
        String text = "lastEdited:" + option;
        String id = "lastedited:" + option.replace("'", "");
        suggestions.add(new SearchSuggestion(id, text, SearchSuggestionType.LAST_EDITED));
    }
    for (String option : getLastEditOptions()) {
        String text = "opened:" + option;
        String id = "opened:" + option.replace("'", "");
        suggestions.add(new SearchSuggestion(id, text, SearchSuggestionType.OPENED));
    }
    for (String option : getLastEditOptions()) {
        String text = "closed:" + option;
        String id = "closed:" + option.replace("'", "");
        suggestions.add(new SearchSuggestion(id, text, SearchSuggestionType.CLOSED));
    }
    String text = "status:active";
    suggestions.add(new SearchSuggestion(text, text, SearchSuggestionType.STATUS));
    text = "status:closed";
    suggestions.add(new SearchSuggestion(text, text, SearchSuggestionType.STATUS));
    text = "status:open";
    suggestions.add(new SearchSuggestion(text, text, SearchSuggestionType.STATUS));
    text = "status:resolved";
    suggestions.add(new SearchSuggestion(text, text, SearchSuggestionType.STATUS));
    db.miscDao().insertSearchSuggestions(suggestions);
}
Also used : SearchSuggestion(in.bugzy.data.model.SearchSuggestion) ArrayList(java.util.ArrayList) WorkerThread(android.support.annotation.WorkerThread)

Example 2 with SearchSuggestion

use of in.bugzy.data.model.SearchSuggestion in project bugzy by cpunq.

the class SearchSuggestionAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(SearchSuggestionHolder holder, int position) {
    SearchSuggestion bug = mSearchSuggestions.get(position);
    holder.bindData(bug);
}
Also used : SearchSuggestion(in.bugzy.data.model.SearchSuggestion)

Aggregations

SearchSuggestion (in.bugzy.data.model.SearchSuggestion)2 WorkerThread (android.support.annotation.WorkerThread)1 ArrayList (java.util.ArrayList)1