A third party 18comic app build with ReactNative
Prerelease at Release Page
- using okhttp to as http client done
- category screen
- pull to load
- Video screen
- Anime screen
- using thread pool to download image
- UI
requirements: NDK
these steps are tring to resolve the problom that when RN displays <Large Image>, fresco will auto down sample the image which make the image low quality
special thanks to @clytras
yarn fresco-clone // clone fresco
ndk.dir=<Path to NDK> ## such as E:\\NDK\\android-ndk-r21e
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true
/android/libraries/fresco/imagepipline/src/main/java/producers/DecodeProducer.java
JobRunnable job =
new JobRunnable() {
@Override
public void run(EncodedImage encodedImage, @Status int status) {
if (encodedImage != null) {
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);
}
}
};
JobRunnable job =
new JobRunnable() {
@Override
public void run(EncodedImage encodedImage, @Status int status) {
// if (encodedImage != null) {
// 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);
}
}
};
yarn install
yarn android
npm run fresco-clean
cd android
// if want to release apk
/gradlew assembleRelease
// if want to release aab
gradlew bundleRelease