/** * This method should be called by the application if the data backing this adapter has changed * and associated views should update. */ public void notifyDataSetChanged() { synchronized (this) { if (mViewPagerObserver != null) { mViewPagerObserver.onChanged(); } } mObservable.notifyChanged(); }
@Override public void onInvalidated() { super.onInvalidated(); clearData(); } };
@Override public void onChanged() { super.onChanged(); if (mViewpager == null) { return; } int newCount = mViewpager.getAdapter().getCount(); int currentCount = getChildCount(); if (newCount == currentCount) { // No change return; } else if (mLastPosition < newCount) { mLastPosition = mViewpager.getCurrentItem(); } else { mLastPosition = -1; } createIndicators(); } };
@Override public void onInvalidated() { super.onInvalidated(); mItemCountTemp = -1; } });
@Override public void onChanged() { super.onChanged(); if (mPageIndicator != null) { mPageIndicator.setPagesCount(mTutorialOptions.getPagesCount()); mPageIndicator.postInvalidate(); } } };
/** * Notifies observers about invalidating data */ protected void notifyDataInvalidatedEvent() { if (datasetObservers != null) { for (DataSetObserver observer : datasetObservers) { observer.onInvalidated(); } } } }
@Override public void onChanged() { super.onChanged(); if (mViewpager == null) { return; } PagerAdapter adapter = mViewpager.getAdapter(); int newCount = adapter != null ? adapter.getCount() : 0; int currentCount = getChildCount(); if (newCount == currentCount) { // No change return; } else if (mLastPosition < newCount) { mLastPosition = mViewpager.getCurrentItem(); } else { mLastPosition = -1; } createIndicators(); } };
@Override public void onInvalidated() { super.onInvalidated(); } };
@Override public void onChanged() { super.onChanged(); populatePath(); if (sparkAnimator != null) { doPathAnimation(); } }
@Override public void onInvalidated() { super.onInvalidated(); } }
@Override public void onChanged() { super.onChanged(); refreshDots(); } });
/** * Notifies observers about invalidating data */ protected void notifyDataInvalidatedEvent() { if (datasetObservers != null) { for (DataSetObserver observer : datasetObservers) { observer.onInvalidated(); } } } }
@Override public void onChanged() { super.onChanged(); refreshDots(); } });
@Override public void onInvalidated() { super.onInvalidated(); } });
@Override public void onChanged() { super.onChanged(); refreshDots(); } });
/** * Notifies observers about invalidating data */ protected void notifyDataInvalidatedEvent() { if (datasetObservers != null) { for (DataSetObserver observer : datasetObservers) { observer.onInvalidated(); } } } }
@Override public void onChanged() { super.onChanged(); if (adapter.isEmpty()) { // Display help text when no results available listContainer.setVisibility(View.GONE); emptyListView.setVisibility(View.VISIBLE); } else { // Otherwise, display results listContainer.setVisibility(View.VISIBLE); emptyListView.setVisibility(View.GONE); } forwarderManager.onDataSetChanged(); } });
/** * Notifies observers about invalidating data */ protected void notifyDataInvalidatedEvent() { if (datasetObservers != null) { for (DataSetObserver observer : datasetObservers) { observer.onInvalidated(); } } } }
@Override public void onChanged() { super.onChanged(); //handle data set changes //if we need to add any cards at this point (ie. the amount of cards on screen //is less than the max number of cards to display) add the cards. int childCount = getChildCount(); //only perform action if there are less cards on screen than NUMBER_OF_CARDS if (childCount < NUMBER_OF_CARDS) { for (int i = childCount; i < NUMBER_OF_CARDS; ++i) { addNextCard(); } //position the items correctly on screen for (int i = 0; i < getChildCount(); ++i) { positionItem(i); } } }
@Override public void onInvalidated() { super.onInvalidated(); } }