src/main/java/ru/mail/dondokidon/extensions/PagerAdapterHandler.java
/**
     * Destroy and remove determined info in not relative positions to passed position.
     *
     * @param middlePos Middle position
     */
Destroy and remove determined info in not relative positions to passed position.
@param middlePos Middle position
Destroy and remove determined info in not relative positions to passed position . @param middlePos Middle position
private void destroyInfo(int middlePos){
        if (mAdapter == null || (middlePos < 0 || middlePos > mAdapter.getCount()))
            return;
        final ArrayList<Integer> Positions = countRelativePositions(middlePos);
        mAdapter.startUpdate(Target);
        int ChildCount = InfoHolder.size();
        for (int i = 0; i < ChildCount; i++) {
            boolean isUseful = false;
            int Key = InfoHolder.keyAt(i);
            IH unit = InfoHolder.get(Key);
            if (Positions.contains(Key)) {
                    isUseful = true;
            }
            if (!isUseful) {
                mAdapter.destroyItem(Key, unit);
                InfoHolder.remove(Key);
                i--;
                ChildCount--;
            }
        }
        mAdapter.finishUpdate(Target);
        if (Debug)
            Log.i(TAG, "Preloaded info after destroyInfo(): " + InfoHolder);
    }
private void destroyInfo ( int middlePos ) { if ( mAdapter == null || ( middlePos < 0 || middlePos > mAdapter . getCount ( ) ) ) return ; final ArrayList < Integer > Positions = countRelativePositions ( middlePos ) ; mAdapter . startUpdate ( Target ) ; int ChildCount = InfoHolder . size ( ) ; for ( int i = 0 ; i < ChildCount ; i ++ ) { boolean isUseful = false ; int Key = InfoHolder . keyAt ( i ) ; IH unit = InfoHolder . get ( Key ) ; if ( Positions . contains ( Key ) ) { isUseful = true ; } if ( ! isUseful ) { mAdapter . destroyItem ( Key , unit ) ; InfoHolder . remove ( Key ) ; i -- ; ChildCount -- ; } } mAdapter . finishUpdate ( Target ) ; if ( Debug ) Log . i ( TAG , "Preloaded info after destroyInfo(): " + InfoHolder ) ; }
Destroy and remove determined info in not relative positions to passed position.
Destroy and remove determined info in not relative positions to passed position .
//                int currentItemPos = mAdapter.getItemPosition(unit); //                if (Key == currentItemPos) { //                }