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">Это образец проекта, демонстрирующего использование Светоотражающие Drawable Земляные библиотеки.
Библиотека (и код) можно найти здесь: https://github.com/alt236/Reflective-Drawable-Loader---Android
Описание проекта
---
Были ли вы когда-нибудь в ситуации, когда вы должны были получить доступ к вводимого коэффициента на основе их имен (например, если Drawable имена хранятся в БД), и нужно было писать длинные таблицы поиска преобразования имен в R.drawable.ids? И их содержание?
Эта библиотека предлагает способ обойти это с помощью отражения для доступа к Drawable непосредственно по имени. Вам нужно всего лишь включить их как нормальные в ваш дереве папок Res. Было протестированные на до 5 раз быстрее, чем метод платформы Resources.getIdentifier ().
Он использует кэширование LRU смягчить времени накладные расходы отражения как для отражения "хитов" и "промахов".</div> <div class="show-more-end">