This file contains hidden or 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
plop.addHelper('lowerCase', (text) => text.toLowerCase()); |
This file contains hidden or 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
fun isLowMemory(): Boolean { | |
val memoryLimit: Long = (getTotalInternalMemorySize() * DEFAULT_THRESHOLD_PERCENTAGE) / 100; | |
return availableMemorySize() <= tenPercentLimit; | |
} |
This file contains hidden or 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
fun availableMemorySize(): Long { | |
val path: File = Environment.getDataDirectory() | |
val stat: StatFs = StatFs(path.getPath()) | |
return stat.getAvailableBlocksLong() * stat.getBlockSizeLong() | |
} |
This file contains hidden or 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
fun totalMemorySize(): Long { | |
val path: File = Environment.getDataDirectory() | |
val stat: StatFs = StatFs(path.getPath()) | |
return stat.getBlockCountLong() * stat.getBlockSizeLong() | |
} |
This file contains hidden or 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 final int DEFAULT_THRESHOLD_PERCENTAGE = 10; |
This file contains hidden or 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
case ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW: | |
case ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL: |
This file contains hidden or 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
onTrimMemory(int level) |
This file contains hidden or 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
@Override public void render() { | |
setupAnimation(); | |
animationTimer.subscribe(timerValue -> startAnimation()); | |
} |
This file contains hidden or 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
public CustomRendererBuilder(PublishSubject<Long> animationTimer) { | |
ListAdapteeCollection<Renderer<? extends Item>> prototypes = new | |
ListAdapteeCollection<>(); | |
prototypes.add(new CustomRenderer(animationTimer)); | |
setPrototypes(prototypes); | |
} | |
@Override protected Class getPrototypeClass(Item item) { | |
return CustomRenderer.class; | |
} |