use of com.android.settings.dashboard.suggestions.SuggestionAdapter in project android_packages_apps_Settings by SudaMod.
the class DashboardAdapter method onBindConditionAndSuggestion.
@VisibleForTesting
void onBindConditionAndSuggestion(final SuggestionAndConditionContainerHolder holder, int position) {
// If there is suggestions to show, it will be at position 0 as we don't show the suggestion
// header anymore.
final List<Tile> suggestions = mDashboardData.getSuggestions();
if (position == SUGGESTION_CONDITION_HEADER_POSITION && suggestions != null && suggestions.size() > 0) {
mSuggestionAdapter = new SuggestionAdapter(mContext, (List<Tile>) mDashboardData.getItemEntityByPosition(position), mSuggestionsShownLogged);
mSuggestionDismissHandler = new SuggestionDismissController(mContext, holder.data, mSuggestionParser, mCallback);
holder.data.setAdapter(mSuggestionAdapter);
} else {
ConditionAdapter adapter = new ConditionAdapter(mContext, (List<Condition>) mDashboardData.getItemEntityByPosition(position), mDashboardData.getSuggestionConditionMode());
adapter.addDismissHandling(holder.data);
holder.data.setAdapter(adapter);
}
holder.data.setLayoutManager(new LinearLayoutManager(mContext));
}
Aggregations