public DrawerView addFixedItems ( List < DrawerItem > items ) { mAdapterFixed . setNotifyOnChange ( false ) ; for ( DrawerItem item : items ) { if ( item . getId ( ) <= 0 ) { item . setId ( System . nanoTime ( ) * 100 + Math . round ( Math . random ( ) * 100 ) ) ; } for ( DrawerItem oldItem : mAdapterFixed . getItems ( ) ) { if ( oldItem . getId ( ) == item . getId ( ) ) { mAdapterFixed . remove ( oldItem ) ; break ; } } item . attachTo ( mAdapterFixed ) ; mAdapterFixed . add ( item ) ; } mAdapterFixed . setNotifyOnChange ( true ) ; mAdapterFixed . notifyDataSetChanged ( ) ; updateFixedList ( ) ; return this ; }
Adds fixed items to the drawer view