am c06b017a: Always set ViewPager adapter immediately.

* commit 'c06b017aac740a6f9690f4c44c0068bc06db3206':
  Always set ViewPager adapter immediately.
diff --git a/res/values/config.xml b/res/values/config.xml
new file mode 100644
index 0000000..250b687
--- /dev/null
+++ b/res/values/config.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+  <!-- If true, thumbnails will be forcibly set to ScaleType.CENTER -->
+  <bool name="force_thumbnail_no_scaling">true</bool>
+</resources>
\ No newline at end of file
diff --git a/src/com/android/ex/photo/Intents.java b/src/com/android/ex/photo/Intents.java
index 4425a32..35bf33f 100644
--- a/src/com/android/ex/photo/Intents.java
+++ b/src/com/android/ex/photo/Intents.java
@@ -17,6 +17,7 @@
 
 package com.android.ex.photo;
 
+import android.app.Activity;
 import android.content.ContentProvider;
 import android.content.Context;
 import android.content.Intent;
@@ -58,7 +59,7 @@
 
     /** Gets a new photo view intent builder */
     public static PhotoViewIntentBuilder newPhotoViewIntentBuilder(
-            Context context, Class<? extends PhotoViewActivity> cls) {
+            Context context, Class<? extends Activity> cls) {
         return new PhotoViewIntentBuilder(context, cls);
     }
 
diff --git a/src/com/android/ex/photo/PhotoViewActivity.java b/src/com/android/ex/photo/PhotoViewActivity.java
index f626757..30bc916 100644
--- a/src/com/android/ex/photo/PhotoViewActivity.java
+++ b/src/com/android/ex/photo/PhotoViewActivity.java
@@ -409,7 +409,7 @@
     }
 
     @Override
-    public void onFragmentVisible(PhotoViewFragment fragment) {
+    public void onFragmentVisible(Fragment fragment) {
         updateActionBar();
     }
 
diff --git a/src/com/android/ex/photo/PhotoViewCallbacks.java b/src/com/android/ex/photo/PhotoViewCallbacks.java
index 6cb8a77..d71c710 100644
--- a/src/com/android/ex/photo/PhotoViewCallbacks.java
+++ b/src/com/android/ex/photo/PhotoViewCallbacks.java
@@ -67,7 +67,7 @@
 
     public boolean isFragmentActive(Fragment fragment);
 
-    public void onFragmentVisible(PhotoViewFragment fragment);
+    public void onFragmentVisible(Fragment fragment);
 
     public boolean isFragmentFullScreen(Fragment fragment);
 
diff --git a/src/com/android/ex/photo/fragments/PhotoViewFragment.java b/src/com/android/ex/photo/fragments/PhotoViewFragment.java
index 529ed1a..6702bd8 100644
--- a/src/com/android/ex/photo/fragments/PhotoViewFragment.java
+++ b/src/com/android/ex/photo/fragments/PhotoViewFragment.java
@@ -323,7 +323,9 @@
                     mThumbnailShown = true;
                 }
                 mPhotoPreviewImage.setVisibility(View.VISIBLE);
-                mPhotoPreviewImage.setScaleType(ImageView.ScaleType.CENTER);
+                if (getResources().getBoolean(R.bool.force_thumbnail_no_scaling)) {
+                    mPhotoPreviewImage.setScaleType(ImageView.ScaleType.CENTER);
+                }
                 enableImageTransforms(false);
                 break;
             case LOADER_ID_PHOTO: