Allow the use of any fragment instead of a PhotoViewFragment
This lets other users build their own photoViewFragment
Change-Id: I7c915b7ed3ccdadf00bc9e46c7a686cb0146188f
diff --git a/src/com/android/ex/photo/PhotoViewActivity.java b/src/com/android/ex/photo/PhotoViewActivity.java
index 323ebc8..417a971 100644
--- a/src/com/android/ex/photo/PhotoViewActivity.java
+++ b/src/com/android/ex/photo/PhotoViewActivity.java
@@ -380,8 +380,11 @@
}
@Override
- public void onFragmentVisible(PhotoViewFragment fragment) {
- updateActionBar(fragment);
+ public void onFragmentVisible(Fragment fragment) {
+ if (fragment instanceof PhotoViewFragment) {
+ PhotoViewFragment photoFragment = (PhotoViewFragment)fragment;
+ updateActionBar(photoFragment);
+ }
}
@Override
diff --git a/src/com/android/ex/photo/PhotoViewCallbacks.java b/src/com/android/ex/photo/PhotoViewCallbacks.java
index 2d4e84a..a454b48 100644
--- a/src/com/android/ex/photo/PhotoViewCallbacks.java
+++ b/src/com/android/ex/photo/PhotoViewCallbacks.java
@@ -3,8 +3,6 @@
import android.database.Cursor;
import android.support.v4.app.Fragment;
-import com.android.ex.photo.fragments.PhotoViewFragment;
-
public interface PhotoViewCallbacks {
/**
* Listener to be invoked for screen events.
@@ -64,7 +62,7 @@
public boolean isFragmentActive(Fragment fragment);
- public void onFragmentVisible(PhotoViewFragment fragment);
+ public void onFragmentVisible(Fragment fragment);
public boolean isFragmentFullScreen(Fragment fragment);
}