-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transfer of improvements to an existing project #5
Comments
Yes it is possible, but it's not an easy task. |
can I get more details? |
You can clone and patch Fresco using these commands: react-native-fresco/template/package.json Lines 11 to 13 in d87d0d3
but for the patching, there has to be the correct public ProgressiveDecoder(
final Consumer<CloseableReference<CloseableImage>> consumer,
final ProducerContext producerContext,
final boolean decodeCancellationEnabled,
final int maxBitmapSize) {
super(consumer);
mProducerContext = producerContext;
mProducerListener = producerContext.getProducerListener();
mImageDecodeOptions = producerContext.getImageRequest().getImageDecodeOptions();
mIsFinished = false;
JobRunnable job =
new JobRunnable() {
@Override
public void run(EncodedImage encodedImage, @Status int status) {
if (encodedImage != null) {
mProducerContext.setExtra(
ProducerContext.ExtraKeys.IMAGE_FORMAT,
encodedImage.getImageFormat().getName());
// if (mDownsampleEnabled || !statusHasFlag(status, Consumer.IS_RESIZING_DONE)) {
// ImageRequest request = producerContext.getImageRequest();
// if (mDownsampleEnabledForNetwork
// || !UriUtil.isNetworkUri(request.getSourceUri())) {
// encodedImage.setSampleSize(
// DownsampleUtil.determineSampleSize(
// request.getRotationOptions(),
// request.getResizeOptions(),
// encodedImage,
// maxBitmapSize));
// }
// }
// if (producerContext
// .getImagePipelineConfig()
// .getExperiments()
// .shouldDownsampleIfLargeBitmap()) {
// maybeIncreaseSampleSize(encodedImage);
// }
doDecode(encodedImage, status);
}
}
};
mJobScheduler = new JobScheduler(mExecutor, job, mImageDecodeOptions.minDecodeIntervalMs);
mProducerContext.addCallbacks(
new BaseProducerContextCallbacks() {
@Override
public void onIsIntermediateResultExpectedChanged() {
if (mProducerContext.isIntermediateResultExpected()) {
mJobScheduler.scheduleJob();
}
}
@Override
public void onCancellationRequested() {
if (decodeCancellationEnabled) {
handleCancellation();
}
}
});
} Then download and unzip/install Android NDK Revision 23 or the one that matches your RN version NDK. Then create a file ndk.dir=G:\\Dev\\Android\\android-ndk-r23b
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true Remember to change Inside react-native-fresco/template/android/settings.gradle Lines 1 to 6 in d87d0d3
Inside
And now, after sacrificing a cow and pray to the gods, try to build your app and see what happens! Also, if you have a newer RN version, you might skip the direct NDK download and use Android Studio "NDK (Side by side)" install the proper NDK version, but I haven't tried that yet. |
@clytras thanks, it remains to find a cow )) |
hey, i have an issue, i opened a fresh react-native app and did all the steps, and the build is failing with this error:
it happens after the step to add includeBuild ('libraries/fresco') in settings.gradle |
Is it possible to make changes to an existing project, fix it to disable downsampling of the image. because it is very difficult to transfer the project to this assembly
The text was updated successfully, but these errors were encountered: