Just make sure that the layout you inflate in your adapter contains the @+id/back and @+id/front components.
In other words, if your SwipeListView declaration declares @+id/back and @+id/front as scroll views ...
<...SwipeListView android:id="@+id/swipe_list" android:layout_width="match_parent" android:layout_weight="1.0" android:layout_height="0dp" app:swipeFrontView="@+id/front" <===== app:swipeBackView="@+id/back" <===== app:swipeActionLeft="dismiss" app:swipeCloseAllItemsWhenMoveList="true" app:swipeMode="both" />
... then it is expected that the layout you inflate in your adapter contains these components. In the example, the layout inflated in the adapter is called package_row.xml, there is a compressed adapter here:
@Override public View getView(final int position, View convertView, ViewGroup parent) { final PackageItem item = getItem(position); ViewHolder holder; if (convertView == null) { LayoutInflater li = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = li.inflate(R.layout.package_row, parent, false); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ holder = new ViewHolder(); holder.ivImage = (ImageView) convertView.findViewById(R.id.example_row_iv_image); ... } else { holder = (ViewHolder) convertView.getTag(); } ...
source share