use of com.android.settings.dashboard.conditional.ConditionAdapter in project android_packages_apps_Settings by crdroidandroid.
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));
}
use of com.android.settings.dashboard.conditional.ConditionAdapter in project platform_packages_apps_Settings by BlissRoms.
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));
}
use of com.android.settings.dashboard.conditional.ConditionAdapter in project android_packages_apps_Settings by LineageOS.
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));
}
use of com.android.settings.dashboard.conditional.ConditionAdapter in project android_packages_apps_Settings by omnirom.
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));
}
use of com.android.settings.dashboard.conditional.ConditionAdapter in project android_packages_apps_Settings by DirtyUnicorns.
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