Example usage for android.support.v4.view PagerAdapter notifyDataSetChanged

List of usage examples for android.support.v4.view PagerAdapter notifyDataSetChanged

Introduction

In this page you can find the example usage for android.support.v4.view PagerAdapter notifyDataSetChanged.

Prototype

public void notifyDataSetChanged() 

Source Link

Document

This method should be called by the application if the data backing this adapter has changed and associated views should update.

Usage

From source file:com.poloure.simplerss.PagerAdapterTags.java

public static void run(FeedsActivity activity) {
    s_tagList = getTagsFromIndex(activity, activity.m_index);
    PagerAdapter adapter = s_viewPager.getAdapter();
    adapter.notifyDataSetChanged();
}

From source file:android.support.wear.internal.widget.drawer.MultiPageUi.java

@Override
public void notifyNavigationPagerAdapterDataChanged() {
    if (mNavigationPager != null) {
        PagerAdapter adapter = mNavigationPager.getAdapter();
        if (adapter != null) {
            adapter.notifyDataSetChanged();
        }//from   ww  w .jav  a 2 s.c o  m
    }
}

From source file:com.drisoftie.frags.comp.FragManagedPaging.java

@Override
public <AdaptT extends IAdaptManagedPager> void switchPagerAdapter(AdaptT adaptPager) {
    PagerAdapter ad = (PagerAdapter) adaptPager.getFragmentPagerAdapter();
    pager.setAdapter(ad);/*  w  ww  . ja v  a 2s  .  co  m*/
    ad.notifyDataSetChanged();
}

From source file:com.robotsandpencils.walkthrough.presentation.main.paging.PagerFragment.java

public boolean deletePage() {
    PagerAdapter adapter = mBinding.viewPager.getAdapter();
    ((ScreensAdapter) (mBinding.viewPager.getAdapter())).removePage(mBinding.viewPager.getCurrentItem());
    adapter.notifyDataSetChanged();
    return mBinding.viewPager.getAdapter().getCount() > 0;
}

From source file:com.example.julia.popularmovies.MovieGridActivity.java

private void setupViewPager(ViewPager viewPager) {
    PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager());
    adapter.addFragment(MovieGridFragment.newInstance(Config.POPULARITY_DESC), FRAGMENT_NAME[0]);
    adapter.addFragment(MovieGridFragment.newInstance(Config.RATING_DESC), FRAGMENT_NAME[1]);
    adapter.addFragment(MovieGridFragment.newInstance(Config.FAVORITES), FRAGMENT_NAME[2]);
    viewPager.setAdapter(adapter);//from   w  ww. j av a 2 s.c o  m
    adapter.notifyDataSetChanged();
}

From source file:com.duolingo.open.rtlviewpager.RtlViewPager.java

@Override
public void onRtlPropertiesChanged(int layoutDirection) {
    super.onRtlPropertiesChanged(layoutDirection);
    int viewCompatLayoutDirection = layoutDirection == View.LAYOUT_DIRECTION_RTL
            ? ViewCompat.LAYOUT_DIRECTION_RTL
            : ViewCompat.LAYOUT_DIRECTION_LTR;
    if (viewCompatLayoutDirection != mLayoutDirection) {
        PagerAdapter adapter = super.getAdapter();
        int position = 0;
        if (adapter != null) {
            position = getCurrentItem();
        }/*from w w  w  .j  a va  2  s. co  m*/
        mLayoutDirection = viewCompatLayoutDirection;
        if (adapter != null) {
            adapter.notifyDataSetChanged();
            setCurrentItem(position);
        }
    }
}

From source file:com.ultramegasoft.flavordex2.fragment.ViewPhotosFragment.java

/**
 * Called whenever the list of photos might have been changed. This notifies the ViewPager's
 * Adapter and the ActionBar./*from  www .jav a 2s . co m*/
 */
private void notifyDataChanged() {
    if (mPager != null) {
        final PagerAdapter adapter = (PagerAdapter) mPager.getAdapter();
        if (adapter != null) {
            adapter.notifyDataSetChanged();
        }
    }

    if (!getPhotos().isEmpty()) {
        if (mNoDataLayout != null) {
            mNoDataLayout.setVisibility(View.GONE);
        }
    } else {
        showNoDataLayout();
    }

    final AppCompatActivity activity = (AppCompatActivity) getActivity();
    if (activity != null) {
        activity.invalidateOptionsMenu();
    }
}

From source file:me.xiaopan.android.viewplayer.ViewPlayer.java

@Override
public void setAdapter(PagerAdapter arg0) {
    if (arg0 == null || !(arg0 instanceof ViewPlayAdapterInterface)) {
        throw new IllegalArgumentException("?PagerPlayAdapterInterface?");
    }//w  w  w  .  j a v a  2 s . c o m

    super.setAdapter(arg0);
    if (viewPlayController == null) {
        viewPlayController = new ViewPlayController(this);
    }
    viewPlayController.setViewPlayMode(viewPlayMode);
    ((ViewPlayAdapterInterface) arg0).setViewPlayMode(viewPlayMode);
    arg0.notifyDataSetChanged();
    viewPlayController.reset();
    if (onSetAdapterListener != null) {
        onSetAdapterListener.onSertAdapter();
    }
}