예제 #1
0
 @Override
 public void onDestroyView() {
   super.onDestroyView();
   if (mAdapter != null) {
     mAdapter.forceStopLoadingIfNecessary();
   }
   GuiUtils.removeGlobalOnLayoutListener(photosGrid, photosGridListener);
 }
예제 #2
0
 @Override
 public void pageDeactivated() {
   super.pageDeactivated();
   if (mTags != null || mAlbum != null) {
     mTags = null;
     mAlbum = null;
     // we need to schedule refresh when the page will be activated in
     // viewpager to clear filters
     refreshOnPageActivated = true;
   }
 };
예제 #3
0
 @Override
 public View onCreateView(
     LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
   super.onCreateView(inflater, container, savedInstanceState);
   View v = inflater.inflate(R.layout.fragment_gallery, container, false);
   if (savedInstanceState != null) {
     mTags = savedInstanceState.getString(EXTRA_TAG);
     mAlbum = savedInstanceState.getString(EXTRA_ALBUM);
   } else {
     mTags = null;
     mAlbum = null;
   }
   return v;
 }
예제 #4
0
 @Override
 public void pageActivated() {
   super.pageActivated();
   if (!isVisible()) {
     return;
   }
   // if filtering is requested
   if (!refreshOnPageActivated) {
     Intent intent = getActivity().getIntent();
     if (intent != null) {
       if (intent.hasExtra(EXTRA_ALBUM) || intent.hasExtra(EXTRA_TAG)) {
         refresh();
       }
     }
   }
 }
예제 #5
0
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   loadingControl = ((LoadingControl) activity);
   startNowHandler = ((StartNowHandler) activity);
 }
예제 #6
0
 @Override
 public void onViewCreated(View view, Bundle savedInstanceState) {
   super.onViewCreated(view, savedInstanceState);
   refresh();
 }
예제 #7
0
 @Override
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putString(EXTRA_TAG, mTags);
   outState.putString(EXTRA_ALBUM, mAlbum);
 }
예제 #8
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    pageSize = Utils.isTablet(getActivity()) ? 45 : PhotosEndlessAdapter.DEFAULT_PAGE_SIZE;
  }