예제 #1
0
 /** Notifies observers about invalidating data */
 protected void notifyDataInvalidatedEvent() {
   if (datasetObservers != null) {
     for (DataSetObserver observer : datasetObservers) {
       observer.onInvalidated();
     }
   }
 }
 @Override
 public void onInvalidated() {
   super.onInvalidated();
   mDataValid = false;
   notifyDataSetChanged();
   // There is no notifyDataSetInvalidated() method in RecyclerView.Adapter
 }
예제 #3
0
 @Override
 public void onChanged() {
   super.onChanged();
   int count = mAdapter.getCount();
   mContainer.removeAllViews();
   if (count < 1) {
     requestLayout();
     return;
   }
   if (count == 1) {
     View view = mAdapter.getView(0);
     mContainer.addView(view, mLinearLayoutParams);
     requestLayout();
     return;
   }
   int position = count - 1;
   View view = mAdapter.getView(position);
   mContainer.addView(view, mLinearLayoutParams);
   for (position = 0; position < count; position++) {
     view = mAdapter.getView(position);
     mContainer.addView(view, mLinearLayoutParams);
   }
   view = mAdapter.getView(0);
   mContainer.addView(view, mLinearLayoutParams);
   requestLayout();
   scrollToPage(0, false);
 }
    @Override
    public void onInvalidated() {
      Log.i(LOG_TAG, "onInvalidated");
      super.onInvalidated();

      resetList();
      reloadAdapter();
    }
 @Override
 public void onChanged() {
   super.onChanged();
   mDataValid = true;
   notifyDataSetChanged();
 }
 @Override
 public void onInvalidated() {
   super.onInvalidated();
   valid = false;
   notifyDataSetChanged();
 }
 @Override
 public void onInvalidated() {
   Log.i(TAG, "WorkspaceDataSetObserver::onInvalidated");
   super.onInvalidated();
 }
예제 #8
0
 private void notifyObserver() {
   if (null != datasetObserver) {
     datasetObserver.onChanged();
   }
 }
 /** Notify registered observers of changes. */
 private void notifyObservers() {
   for (DataSetObserver dso : observers) {
     dso.onChanged();
   }
 }
 @Override
 public void onInvalidated() {
   super.onInvalidated();
   mHasInvalidated = true;
 }
 @Override
 public void onChanged() {
   super.onChanged();
   mHasChanged = true;
 }