java.lang.Object | |
↳ | com.htc.res.HtcResources |
A convinient class for access HTC common resources.
Normally Android application is not able to access the resources defined in another package directly. Android common resources are put insideapps/common/
and will be built to system/framework/framework-res.apk
, but Resources
(actually libs/utils/AssetManager.cpp:AssetManager::addDefaultAssets()
) implictly includes all resources defined there to give applications direct access to them. This can be done because the IDs of common resources are reserved by Android and won't collide with resource IDs defined by applications.
On the other hand, HTC common resources are put in apps/HtcCommonRes/
and will be packed to system/framework/com.htc.resources.apk
. Although it's also possible to support direct access to these resources (like Android common resources do), that would require modifying (native) AssetManager
class.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the context representing the package of HTC common resource.
| |||||||||||
Looks up an id by name in Htc framework (com.htc.R.id)
| |||||||||||
Looks up a layout by name in Htc framework
| |||||||||||
Retrieves the HTC common resources.
| |||||||||||
Looks up a drawable resource Id by name in the theme package.
| |||||||||||
Inflates a layout in HTC common resource package.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns the context representing the package of HTC common resource.
Users can use the returned context to load resources inside the HTC common resource package.context | The calling context. |
---|
Looks up an id by name in Htc framework (com.htc.R.id)
Looks up a layout by name in Htc framework
Retrieves the HTC common resources.
context | The calling context. |
---|
PackageManager.NameNotFoundException | if the resource package is not installed properly. |
---|
Looks up a drawable resource Id by name in the theme package.
Inflates a layout in HTC common resource package.
context | The calling context. |
---|---|
layout | Which layout to inflate. |