Make some members protected
This allows users to extend PhotoViewFragment and
PhotoPagerAdapter.
Change-Id: I7945b33116601fe23f84723f14c76634c2219f52
diff --git a/src/com/android/ex/photo/adapters/BaseCursorPagerAdapter.java b/src/com/android/ex/photo/adapters/BaseCursorPagerAdapter.java
index 447a4a9..9967662 100644
--- a/src/com/android/ex/photo/adapters/BaseCursorPagerAdapter.java
+++ b/src/com/android/ex/photo/adapters/BaseCursorPagerAdapter.java
@@ -37,13 +37,13 @@
public abstract class BaseCursorPagerAdapter extends BaseFragmentPagerAdapter {
private static final String TAG = "BaseCursorPagerAdapter";
- Context mContext;
- private Cursor mCursor;
- private int mRowIDColumn;
+ protected Context mContext;
+ protected Cursor mCursor;
+ protected int mRowIDColumn;
/** Mapping of row ID to cursor position */
- private SparseIntArray mItemPosition;
+ protected SparseIntArray mItemPosition;
/** Mapping of instantiated object to row ID */
- private final HashMap<Object, Integer> mObjectRowMap = new HashMap<Object, Integer>();
+ protected final HashMap<Object, Integer> mObjectRowMap = new HashMap<Object, Integer>();
/**
* Constructor that always enables auto-requery.
diff --git a/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java b/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
index 1492c81..121ef46 100644
--- a/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
+++ b/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
@@ -30,10 +30,10 @@
* Pager adapter for the photo view
*/
public class PhotoPagerAdapter extends BaseCursorPagerAdapter {
- private int mContentUriIndex;
- private int mThumbnailUriIndex;
- private int mLoadingIndex;
- private final float mMaxScale;
+ protected int mContentUriIndex;
+ protected int mThumbnailUriIndex;
+ protected int mLoadingIndex;
+ protected final float mMaxScale;
public PhotoPagerAdapter(Context context, android.support.v4.app.FragmentManager fm, Cursor c, float maxScale) {
super(context, fm, c);
diff --git a/src/com/android/ex/photo/fragments/PhotoViewFragment.java b/src/com/android/ex/photo/fragments/PhotoViewFragment.java
index efa9404..4d4d789 100644
--- a/src/com/android/ex/photo/fragments/PhotoViewFragment.java
+++ b/src/com/android/ex/photo/fragments/PhotoViewFragment.java
@@ -76,42 +76,42 @@
public boolean interceptMoveRight(float origX, float origY);
}
- private final static String STATE_INTENT_KEY =
+ protected final static String STATE_INTENT_KEY =
"com.android.mail.photo.fragments.PhotoViewFragment.INTENT";
// Loader IDs
- private final static int LOADER_ID_PHOTO = 1;
- private final static int LOADER_ID_THUMBNAIL = 2;
+ final static int LOADER_ID_PHOTO = 1;
+ final static int LOADER_ID_THUMBNAIL = 2;
/** The size of the photo */
public static Integer sPhotoSize;
/** The URL of a photo to display */
- private String mResolvedPhotoUri;
- private String mThumbnailUri;
+ protected String mResolvedPhotoUri;
+ protected String mThumbnailUri;
/** The intent we were launched with */
- private Intent mIntent;
- private PhotoViewCallbacks mCallback;
- private PhotoPagerAdapter mAdapter;
+ protected Intent mIntent;
+ protected PhotoViewCallbacks mCallback;
+ protected PhotoPagerAdapter mAdapter;
- private PhotoView mPhotoView;
- private ImageView mPhotoPreviewImage;
- private TextView mEmptyText;
- private ImageView mRetryButton;
- private ProgressBarWrapper mPhotoProgressBar;
+ protected PhotoView mPhotoView;
+ protected ImageView mPhotoPreviewImage;
+ protected TextView mEmptyText;
+ protected ImageView mRetryButton;
+ protected ProgressBarWrapper mPhotoProgressBar;
- private final int mPosition;
+ protected final int mPosition;
/** Whether or not the fragment should make the photo full-screen */
- private boolean mFullScreen;
+ protected boolean mFullScreen;
/** Whether or not this fragment will only show the loading spinner */
- private final boolean mOnlyShowSpinner;
+ protected final boolean mOnlyShowSpinner;
/** Whether or not the progress bar is showing valid information about the progress stated */
- private boolean mProgressBarNeeded = true;
+ protected boolean mProgressBarNeeded = true;
- private View mPhotoPreviewAndProgress;
+ protected View mPhotoPreviewAndProgress;
public PhotoViewFragment() {
mPosition = -1;