ImageUriProvider: Update ImagePipelinePostProcessorFragment
@@ -31,6 +31,7 @@ import com.facebook.drawee.interfaces.DraweeController;
import com.facebook.drawee.view.SimpleDraweeView;
import com.facebook.fresco.samples.showcase.BaseShowcaseFragment;
import com.facebook.fresco.samples.showcase.R;
+import com.facebook.fresco.samples.showcase.misc.ImageUriProvider;
import com.facebook.fresco.samples.showcase.postprocessor.BlurPostprocessor;
import com.facebook.fresco.samples.showcase.postprocessor.CachedWatermarkPostprocessor;
import com.facebook.fresco.samples.showcase.postprocessor.FasterGreyScalePostprocessor;
@@ -48,9 +49,6 @@ import com.facebook.imagepipeline.request.Postprocessor;
public class ImagePipelinePostProcessorFragment extends BaseShowcaseFragment
implements DurationCallback {
- private static final Uri URI =
- Uri.parse("http://frescolib.org/static/sample-images/animal_a_l.jpg");
-
private static final int WATERMARK_COUNT = 10;
private static final String WATERMARK_STRING = "WATERMARK";
@@ -81,6 +79,7 @@ public class ImagePipelinePostProcessorFragment extends BaseShowcaseFragment
private Button mButton;
private SimpleDraweeView mDraweeMain;
private Spinner mSpinner;
+ private Uri mUri;
@Nullable
@Override
@@ -93,6 +92,9 @@ public class ImagePipelinePostProcessorFragment extends BaseShowcaseFragment
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ final ImageUriProvider imageUriProvider = ImageUriProvider.getInstance(getContext());
+ mUri = imageUriProvider.createSampleUri(ImageUriProvider.ImageSize.L);
+
mButton = (Button) view.findViewById(R.id.button);
mDraweeMain = (SimpleDraweeView) view.findViewById(R.id.drawee_view);
mSpinner = (Spinner) view.findViewById(R.id.spinner);
@@ -138,7 +140,7 @@ public class ImagePipelinePostProcessorFragment extends BaseShowcaseFragment
}
private void setPostprocessor(Postprocessor postprocessor) {
- final ImageRequest imageRequest = ImageRequestBuilder.newBuilderWithSource(URI)
+ final ImageRequest imageRequest = ImageRequestBuilder.newBuilderWithSource(mUri)
.setPostprocessor(postprocessor)
.build();
