This is a sample project demonstrating the use of the Reflective Drawable Loader Library.
The library (and code) can be found here: https://github.com/alt236/Reflective-Drawable-Loader---Android
Project Description
---
Were you ever in a situation where you had to access Drawables based on their names (for example if the Drawable names are stored in a DB) and you had to write long lookup tables converting the names into R.drawable.ids? And maintaining them?
This library is offering a way around it by using reflection to access the Drawable directly by name. You only need to include them as normal into your Res folder tree. It has been benchmarked at up to 5x faster than the platform's Resources.getIdentifier() method.
It is using LRU caching to mitigate the reflection time overhead for both reflection "hits" and "misses".
</div> <div jsname="WJz9Hc" style="display:none">Bu Yansıtıcı Drawable Loader Kütüphanesi kullanımını gösteren örnek bir projedir.
Kütüphane (ve kod) burada bulabilirsiniz: https://github.com/alt236/Reflective-Drawable-Loader---Android
Proje Açıklaması
---
Eğer (Drawable isimleri bir veritabanında saklanır eğer örneğin) kendi adlarına dayalı Drawables erişmek zorunda olduğu bir durumda hiç vardı ve R.drawable.ids içine adlarını dönüştürme uzun arama tabloları yazmak zorunda kaldım? Ve onları korumak?
Bu kütüphane doğrudan adı drawable erişmek için yansıma kullanarak etrafında bir yol sunuyor. Yalnızca Res klasör ağacının içine, normal olarak eklemeniz gerekir. Bu platformun Resources.getIdentifier () yönteminden daha hızlı 5 kata kadar karşılaştırılan olmuştur.
Hem yansıması "hit" ve "özlüyor" için yansıma zaman yükü hafifletmek için LRU önbelleğe alma kullanıyor.</div> <div class="show-more-end">