This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xml.dom import minidom | |
from pathlib import Path | |
import sys | |
import os | |
import re | |
import glob | |
import json | |
import argparse | |
path_to_konsist_report = os.getcwd() + '/konsistTest/build/test-results/testAppProductionDebugUnitTest' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Bitmap | |
import android.graphics.drawable.Drawable | |
import androidx.compose.foundation.Image | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.height | |
import androidx.compose.foundation.layout.width | |
import androidx.compose.runtime.* | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.graphics.ColorFilter | |
import androidx.compose.ui.graphics.asImageBitmap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.test.android.helpers; | |
import android.os.Build; | |
import android.webkit.WebResourceResponse; | |
import com.google.gson.Gson; | |
import com.google.gson.reflect.TypeToken; | |
import com.test.android.Application; | |
import org.apache.commons.collections.CollectionUtils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CacheKey cacheKey = DefaultCacheKeyFactory.getInstance().getEncodedCacheKey(ImageRequest.fromUri(imageUrl)); | |
StagingArea stagingArea = StagingArea.getInstance(); | |
EncodedImage result = stagingArea.get(cacheKey); | |
if(result != null){ | |
result.close(); | |
return true; | |
} | |
return ImagePipelineFactory.getInstance().getMainDiskStorageCache() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
CacheKey cacheKey = new SimpleCacheKey(url); | |
ByteArrayOutputStream stream = new ByteArrayOutputStream(); | |
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); | |
final byte[] byteArray = stream.toByteArray(); | |
Fresco.getImagePipelineFactory().getMainDiskStorageCache().insert(cacheKey, new WriterCallback() { | |
@Override | |
public void write(OutputStream outputStream) throws IOException { | |
outputStream.write(byteArray); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Iterator<Map.Entry<String, CloseableReference<CloseableImage>>> entries = imageRefMap.entrySet().iterator(); | |
while (entries.hasNext()) { | |
Map.Entry<String, CloseableReference<CloseableImage>> entry = entries.next(); | |
CloseableReference<CloseableImage> closeableRef = entry.getValue(); | |
if(closeableRef != null){ | |
closeableRef.close(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CloseableReference<CloseableImage> imageRef = imageReference.clone(); | |
imageRefMap.put(imageUrl,imageRef); | |
CloseableImage image = imageRef.get(); | |
final Bitmap bitmap = ((CloseableBitmap) image).getUnderlyingBitmap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void downloadBitmap(ImageRequest imageRequest, Context context, final IBitmapDownloader iBitmapDownloader) { | |
DataSource<CloseableReference<CloseableImage>> dataSourceImage = Fresco.getImagePipeline().fetchDecodedImage(imageRequest, context); | |
DataSubscriber<CloseableReference<CloseableImage>> dataSubscriberImage = new BaseDataSubscriber<CloseableReference<CloseableImage>>() { | |
@Override | |
public void onNewResultImpl(DataSource<CloseableReference<CloseableImage>> dataSource) { | |
CloseableReference<CloseableImage> imageReference = dataSource.getResult(); | |
if (imageReference != null) { | |
iBitmapDownloader.onSuccess(imageReference); | |
} | |
else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"hash": "5d5a03b6cc4edc0cc7d44f46c8ad3b30", | |
"urls": [ | |
"http://myntra.myntassets.com/checkout/build/css/mobile-cart-android-v2-b0533de818b7c79a0c51249a869214dca3f09d53.zip.css", | |
"http://myntra.myntassets.com/checkout/build/js/cart-app-android-v2-319197031848b6cc165d220a48a4c96764cb5cc6.zip.js", | |
"http://myntra.myntassets.com/checkout/build/js/common-app-android-v2-b001242bcde0440a307bd801bc67f9cb54869924.zip.js", | |
"http://myntra.myntassets.com/checkout/build/js/common-app-v2-b001242bcde0440a307bd801bc67f9cb54869924.zip.js", | |
"http://myntra.myntassets.com/checkout/images/checkout_sprite_2x_v22.png", | |
"http://myntra.myntassets.com/checkout/images/checkout_sprite_v22.png", | |
"http://myntra.myntassets.com/checkout/images/sprite-global_v70.png", |
NewerOlder