Search in sources :

Example 1 with POSITION_FIRST

use of com.android.launcher3.recyclerview.ViewHolderBinder.POSITION_FIRST in project android_packages_apps_Launcher3 by ProtonAOSP.

the class WidgetsListAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(ViewHolder holder, int pos, List<Object> payloads) {
    ViewHolderBinder viewHolderBinder = mViewHolderBinders.get(getItemViewType(pos));
    WidgetsListBaseEntry entry = mVisibleEntries.get(pos);
    // The first entry has an empty space, count from second entries.
    int listPos = (pos > 1) ? POSITION_DEFAULT : POSITION_FIRST;
    if (pos == (getItemCount() - 1)) {
        listPos |= POSITION_LAST;
    }
    viewHolderBinder.bindViewHolder(holder, mVisibleEntries.get(pos), listPos, payloads);
    holder.itemView.setTag(R.id.tag_widget_entry, entry);
}
Also used : WidgetsListBaseEntry(com.android.launcher3.widget.model.WidgetsListBaseEntry) ViewHolderBinder(com.android.launcher3.recyclerview.ViewHolderBinder)

Example 2 with POSITION_FIRST

use of com.android.launcher3.recyclerview.ViewHolderBinder.POSITION_FIRST in project android_packages_apps_404Launcher by P-404.

the class WidgetsListAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(ViewHolder holder, int pos, List<Object> payloads) {
    ViewHolderBinder viewHolderBinder = mViewHolderBinders.get(getItemViewType(pos));
    WidgetsListBaseEntry entry = mVisibleEntries.get(pos);
    // The first entry has an empty space, count from second entries.
    int listPos = (pos > 1) ? POSITION_DEFAULT : POSITION_FIRST;
    if (pos == (getItemCount() - 1)) {
        listPos |= POSITION_LAST;
    }
    viewHolderBinder.bindViewHolder(holder, mVisibleEntries.get(pos), listPos, payloads);
    holder.itemView.setTag(R.id.tag_widget_entry, entry);
}
Also used : WidgetsListBaseEntry(com.android.launcher3.widget.model.WidgetsListBaseEntry) ViewHolderBinder(com.android.launcher3.recyclerview.ViewHolderBinder)

Example 3 with POSITION_FIRST

use of com.android.launcher3.recyclerview.ViewHolderBinder.POSITION_FIRST in project android_packages_apps_Launcher3 by ArrowOS.

the class WidgetsListAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(ViewHolder holder, int pos, List<Object> payloads) {
    ViewHolderBinder viewHolderBinder = mViewHolderBinders.get(getItemViewType(pos));
    WidgetsListBaseEntry entry = mVisibleEntries.get(pos);
    // The first entry has an empty space, count from second entries.
    int listPos = (pos > 1) ? POSITION_DEFAULT : POSITION_FIRST;
    if (pos == (getItemCount() - 1)) {
        listPos |= POSITION_LAST;
    }
    viewHolderBinder.bindViewHolder(holder, mVisibleEntries.get(pos), listPos, payloads);
    holder.itemView.setTag(R.id.tag_widget_entry, entry);
}
Also used : WidgetsListBaseEntry(com.android.launcher3.widget.model.WidgetsListBaseEntry) ViewHolderBinder(com.android.launcher3.recyclerview.ViewHolderBinder)

Example 4 with POSITION_FIRST

use of com.android.launcher3.recyclerview.ViewHolderBinder.POSITION_FIRST in project android_packages_apps_Launcher3 by AOSPA.

the class WidgetsListAdapter method onBindViewHolder.

@Override
public void onBindViewHolder(ViewHolder holder, int pos, List<Object> payloads) {
    ViewHolderBinder viewHolderBinder = mViewHolderBinders.get(getItemViewType(pos));
    WidgetsListBaseEntry entry = mVisibleEntries.get(pos);
    // The first entry has an empty space, count from second entries.
    int listPos = (pos > 1) ? POSITION_DEFAULT : POSITION_FIRST;
    if (pos == (getItemCount() - 1)) {
        listPos |= POSITION_LAST;
    }
    viewHolderBinder.bindViewHolder(holder, mVisibleEntries.get(pos), listPos, payloads);
    holder.itemView.setTag(R.id.tag_widget_entry, entry);
}
Also used : WidgetsListBaseEntry(com.android.launcher3.widget.model.WidgetsListBaseEntry) ViewHolderBinder(com.android.launcher3.recyclerview.ViewHolderBinder)

Aggregations

ViewHolderBinder (com.android.launcher3.recyclerview.ViewHolderBinder)4 WidgetsListBaseEntry (com.android.launcher3.widget.model.WidgetsListBaseEntry)4