速報APP / 工具 / Reflective Drawable Loader

Reflective Drawable Loader

價格:免費

更新日期:2013-12-04

檔案大小:407k

目前版本:0.0.3

版本需求:Android 2.2 以上版本

官方網站:http://aschillings.co.uk/

Email:aschillings.dev@gmail.com

聯絡地址:33 Craufurd Rise Maidenhead SL6 7LR UK

Reflective Drawable Loader(圖1)-速報App

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

Reflective Drawable Loader(圖2)-速報App

---

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".