예제 #1
0
 @Override
 public void onPause() {
   super.onPause();
   if (mActionBar != null) {
     mActionBar.show();
   }
   mActivity.setLightsOutMode(false);
   if (mApplication.getEventBus().isRegistered(this)) {
     mApplication.getEventBus().unregister(this);
   }
   mSlideshowHandler.removeCallbacks(mSlideshowAction);
   mController.updateStatus(PlayStatus.STOPPED, null);
 }
예제 #2
0
 @Override
 public void onResume() {
   super.onResume();
   if (mActionBar != null) {
     mActionBar.hide();
   }
   mActivity.setLightsOutMode(true);
   if (!mApplication.getEventBus().isRegistered(this)) {
     mApplication.getEventBus().register(this);
   }
   mSlideshowHandler.postDelayed(mSlideshowAction, SLIDESHOW_INTERVAL_MS);
   mController.updateStatus(PlayStatus.PLAYING, mBucketId);
 }
예제 #3
0
 @Override
 public void onAttach(Activity activity) {
   super.onAttach(activity);
   if (mActivity == null) {
     mActivity = (PhotoFrameActivity) activity;
     mActionBar = mActivity.getSupportActionBar();
     mApplication = mActivity.getPhotoFrameApplication();
     mController = mApplication.getController();
   }
 }
예제 #4
0
 public void updateBucketId(String bucketId) {
   if (!mBucketId.equals(bucketId)) {
     mSlideshowHandler.removeCallbacks(mSlideshowAction);
     mBucketId = bucketId;
     mSlideShowPagerAdapter =
         new SlideshowPageAdapter(mActivity, mApplication.getImageLoader(), mBucketId);
     mViewPager.setAdapter(mSlideShowPagerAdapter);
     mSlideshowHandler.postDelayed(mSlideshowAction, SLIDESHOW_INTERVAL_MS);
     mController.updateStatus(PlayStatus.PLAYING, mBucketId);
   }
 }
예제 #5
0
  @Override
  public View onCreateView(
      LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.fragment_slideshow, container, false);
    mViewPager = (ViewPager) rootView.findViewById(R.id.pager);
    mSlideShowPagerAdapter =
        new SlideshowPageAdapter(mActivity, mApplication.getImageLoader(), mBucketId);
    mViewPager.setAdapter(mSlideShowPagerAdapter);
    return rootView;
  }