android.database.DataSetObservable Java Examples

The following examples show how to use android.database.DataSetObservable. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TimelineDelegate.java    From twitter-kit-android with Apache License 2.0 6 votes vote down vote up
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;
    }
}
 
Example #2
Source File: TimelineDelegateTest.java    From twitter-kit-android with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #3
Source File: BaseDescriptorList.java    From aard2-android with GNU General Public License v3.0 5 votes vote down vote up
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;
}
 
Example #4
Source File: BaseAdapter.java    From all-base-adapter with Apache License 2.0 4 votes vote down vote up
public BaseAdapter(Context context, List<T> datas) {
    mDatas = datas;
    mContext = context;
    mInflater = LayoutInflater.from(mContext);
    mDataSetObservable = new DataSetObservable();
}
 
Example #5
Source File: PagerAdapter.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public PagerAdapter()
{
    a = new DataSetObservable();
}
 
Example #6
Source File: BlobDescriptorList.java    From aard2-android with GNU General Public License v3.0 4 votes vote down vote up
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());
}
 
Example #7
Source File: ObservableSparseArrayCompat.java    From opentasks with Apache License 2.0 4 votes vote down vote up
public ObservableSparseArrayCompat()
{
    super();
    mDataSetObservable = new DataSetObservable();
}
 
Example #8
Source File: ObservableSparseArrayCompat.java    From opentasks with Apache License 2.0 4 votes vote down vote up
public ObservableSparseArrayCompat(final int initialCapacity)
{
    super(initialCapacity);
    mDataSetObservable = new DataSetObservable();
}
 
Example #9
Source File: ObservableSparseArrayCompat.java    From opentasks with Apache License 2.0 4 votes vote down vote up
public DataSetObservable getDataSetObservable()
{
    return mDataSetObservable;
}