TimelineDelegate(Timeline<T> timeline, DataSetObservable observable, List<T> items) { if (timeline == null) { throw new IllegalArgumentException("Timeline must not be null"); } this.timeline = timeline; this.timelineStateHolder = new TimelineStateHolder(); if (observable == null) { listAdapterObservable = new DataSetObservable(); } else { listAdapterObservable = observable; } if (items == null) { itemList = new ArrayList<>(); } else { itemList = items; } }
public ImageStripAdapter(int paramInt, OnImageChildViewTapListener paramOnImageChildViewTapListener) { this.mImageCount = paramInt; this.mImages = new Drawable[this.mImageCount]; this.mImageDimensions = new Common.Image.Dimension[this.mImageCount]; this.mDataSetObservable = new DataSetObservable(); this.mImageChildTappedListener = paramOnImageChildViewTapListener; }
@Before public void setUp() throws Exception { mockTimeline = mock(Timeline.class); mockObservable = mock(DataSetObservable.class); // lists of items ordered from larger id to smaller testItems.add(TEST_ITEM_2); testItems.add(TEST_ITEM_1); // extra result items ordered from larger id to smaller testExtraItems.add(TEST_ITEM_4); testExtraItems.add(TEST_ITEM_3); testResult = new Result<>(new TimelineResult<>(TEST_TIMELINE_CURSOR, testItems), null); }
BaseDescriptorList(Class<T> typeParameterClass, DescriptorStore<T> store) { this.typeParameterClass = typeParameterClass; this.store = store; this.dataSetObservable = new DataSetObservable(); this.list = new ArrayList<T>(); this.updating = 0; }
public BaseAdapter(Context context, List<T> datas) { mDatas = datas; mContext = context; mInflater = LayoutInflater.from(mContext); mDataSetObservable = new DataSetObservable(); }
public PagerAdapter() { a = new DataSetObservable(); }
public PagerAdapter() { mObservable = new DataSetObservable(); }
BlobDescriptorList(Application app, DescriptorStore<BlobDescriptor> store, int maxSize) { this.app = app; this.store = store; this.maxSize = maxSize; this.list = new ArrayList<BlobDescriptor>(); this.filteredList = new ArrayList<BlobDescriptor>(); this.dataSetObservable = new DataSetObservable(); this.filter = ""; keyComparator = Slob.Strength.QUATERNARY.comparator; nameComparatorAsc = new Comparator<BlobDescriptor>() { @Override public int compare(BlobDescriptor b1, BlobDescriptor b2) { return keyComparator.compare(b1.key, b2.key); } }; nameComparatorDesc = Collections.reverseOrder(nameComparatorAsc); timeComparatorAsc = new Comparator<BlobDescriptor>() { @Override public int compare(BlobDescriptor b1, BlobDescriptor b2) { return Util.compare(b1.createdAt, b2.createdAt); } }; timeComparatorDesc = Collections.reverseOrder(timeComparatorAsc); lastAccessComparator = new Comparator<BlobDescriptor>() { @Override public int compare(BlobDescriptor b1, BlobDescriptor b2) { return Util.compare(b2.lastAccess, b1.lastAccess); } }; order = SortOrder.TIME; ascending = false; setSort(order, ascending); try { filterCollator = (RuleBasedCollator) Collator.getInstance(Locale.ROOT).clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } filterCollator.setStrength(Collator.PRIMARY); filterCollator.setAlternateHandlingShifted(true); handler = new Handler(Looper.getMainLooper()); }
@Override public DataSetObservable getAccountObservable() { return mAccountObservable; }
@Override public DataSetObservable getDrawerObservable() { return mDrawerObservable; }
@Override public DataSetObservable getDrawerObserverable() { return mDrawerObservable; }
@Override public DataSetObservable getFolderObserverable() { return mFolderObservable; }
/** * This is hidden until the data set change model has been re-evaluated. * @hide */ protected DataSetObservable getDataSetObservable() { return mDataSetObservable; }
public ObservableSparseArrayCompat() { super(); mDataSetObservable = new DataSetObservable(); }
public ObservableSparseArrayCompat(final int initialCapacity) { super(initialCapacity); mDataSetObservable = new DataSetObservable(); }
public DataSetObservable getDataSetObservable() { return mDataSetObservable; }
protected DataSetObservable getDataSetObservable() { return dataSetObservable; }
/** * Creates a new adapter, whose underlying data is managed as a list of arbitrary group and * child items. * * @param context * The context, the adapter belongs to, as an instance of the class {@link Context}. The * context may not be null * @param decorator * The decorator, which should be used to customize the appearance of the views, which * are used to visualize the group and child items of the adapter, as an instance of the * generic type DecoratorType. The decorator may not be null * @param logLevel * The log level, which should be used for logging, as a value of the enum LogLevel. The * log level may not be null * @param groupAdapter * The adapter, which should manage the adapter's group items, as an instance of the * type {@link MultipleChoiceListAdapter}. The adapter may not be null * @param allowDuplicateChildren * True, if duplicate child items, regardless from the group they belong to, should be * allowed, false otherwise * @param notifyOnChange * True, if the method <code>notifyDataSetChanged():void</code> should be automatically * called when the adapter's underlying data has been changed, false otherwise * @param triggerGroupExpansionOnClick * True, if a group's expansion should be triggered, when it is clicked by the user, * false otherwise * @param itemClickListeners * A set, which contains the listeners, which should be notified, when an item of the * adapter has been clicked by the user, as an instance of the type {@link Set}, or an * empty set, if no listeners should be notified * @param itemLongClickListeners * A set, which contains the listeners, which should be notified, when an item of the * adapter has been long-clicked by the user, as an instance of the type {@link Set}, or * an empty set, if no listeners should be notified * @param adapterListeners * A set, which contains the listeners, which should be notified, when the adapter's * underlying data has been modified, as an instance of the type {@link Set}, or an * empty set, if no listeners should be notified * @param expansionListeners * A set, which contains the listeners, which should be notified, when a group item has * been expanded or collapsed, as an instance of the type {@link Set}, or an empty set, * if no listeners should be notified */ protected AbstractExpandableListAdapter(@NonNull final Context context, @NonNull final DecoratorType decorator, @NonNull final LogLevel logLevel, @NonNull final MultipleChoiceListAdapter<Group<GroupType, ChildType>> groupAdapter, final boolean allowDuplicateChildren, final boolean notifyOnChange, final boolean triggerGroupExpansionOnClick, @NonNull final Set<ExpandableListAdapterItemClickListener<GroupType, ChildType>> itemClickListeners, @NonNull final Set<ExpandableListAdapterItemLongClickListener<GroupType, ChildType>> itemLongClickListeners, @NonNull final Set<ExpandableListAdapterListener<GroupType, ChildType>> adapterListeners, @NonNull final Set<ExpansionListener<GroupType, ChildType>> expansionListeners) { ensureNotNull(context, "The context may not be null"); ensureNotNull(decorator, "The decorator may not be null"); ensureNotNull(itemClickListeners, "The item click listeners may not be null"); ensureNotNull(itemLongClickListeners, "The item long click listeners may not be null"); ensureNotNull(adapterListeners, "The adapter listeners may not be null"); ensureNotNull(expansionListeners, "The expansion listeners may not be null"); this.context = context; this.decorator = decorator; this.logger = new Logger(logLevel); this.dataSetObservable = new DataSetObservable(); this.groupAdapter = groupAdapter; this.groupAdapter.setLogLevel(LogLevel.OFF); this.groupAdapter.notifyOnChange(false); this.allowDuplicateChildren = allowDuplicateChildren; this.notifyOnChange = notifyOnChange; this.triggerGroupExpansionOnClick = triggerGroupExpansionOnClick; this.itemClickListeners = itemClickListeners; this.itemLongClickListeners = itemLongClickListeners; this.adapterListeners = adapterListeners; this.expansionListeners = expansionListeners; addItemClickListener(createGroupClickListener()); registerAdapterDataObserver(createAdapterDataSetObserver()); }
/** * Get the account's {@link android.database.DataSetObservable}. * <em> * For a fragment, a folder {@link android.database.DataSetObserver} maybe need to be registered * when the fragment is created successfully, and to be unregistered when the fragment is to be destroyed. * </em> */ DataSetObservable getAccountObservable();
/** * Get the Drawer's {@link DataSetObservable}. * <em> * For a fragment, a drawer {@link android.database.DataSetObserver} maybe need to be registered * when the fragment is created successfully, and to be unregistered when the fragment is to be destroyed. * </em> * When the drawer's state changed, like opened or closed, the relative fragment should be notified to do data change. */ DataSetObservable getDrawerObservable();
/** * Get the account's {@link DataSetObservable}. For a fragment, a folder * {@link DataSetObserver} may be need to be registered when the fragment is * created successfully, and to be unregistered when the fragment is to be * destroyed. */ DataSetObservable getAccountObservable();
/** * Get the Drawer's {@link DataSetObservable}. * <p> * For a fragment, a drawer {@link DataSetObserver} may be need to be * registered when the fragment is created successfully, and to be * unregistered when the fragment is to be destroyed. * <p/> * When the drawer's state chagned, like opened or closed, the relative * fragment should be notified to do data change. */ DataSetObservable getDrawerObserverable();
/** * Get the folder's {@link DataSetObservable}. For a fragment, a folder * {@link DataSetObserver} may be need to be registered when the fragment is * created successfully, and to be unregistered when the fragment is to be * destroyed. */ DataSetObservable getFolderObserverable();