/**
* Gets boolean from theme apk
*/
public static Boolean getBoolean(Context context, @BoolRes int resId) {
return getBoolean(context, Theme.get(context, resId));
}
java类android.support.annotation.BoolRes的实例源码
Theme.java 文件源码
项目:ThemeEngine
阅读 29
收藏 0
点赞 0
评论 0
ExternalResources.java 文件源码
项目:external-resources
阅读 40
收藏 0
点赞 0
评论 0
/**
* Return a boolean associated with a particular resource ID. This resource can come from
* resources you provided via the URL or via default resources.
*
* @param resId The desired resource identifier, as generated by the aapt
* tool. This integer encodes the package, type, and resource
* entry. The value 0 is an invalid identifier.
* @return Returns the boolean value contained in the resource.
* @throws NotFoundException Throws NotFoundException if the given ID does not exist.
*/
public boolean getBoolean(@BoolRes int resId) throws NotFoundException {
String key = getApplicationResourceEntryName(resId);
if (null == key) {
throw new NotFoundException("Boolean resource with resId: " + resId);
}
return getBoolean(key);
}
Check.java 文件源码
项目:SimpleDialogFragments
阅读 35
收藏 0
点赞 0
评论 0
/**
* Sets the initial state of the checkbox
*
* @param preset initial state as boolean resource
*/
public Check check(@BoolRes int preset){
this.presetId = preset;
return this;
}
DefaultPrefs.java 文件源码
项目:TwistyTimer
阅读 30
收藏 0
点赞 0
评论 0
/**
* Returns the boolean value assigned to the resource key
*
* @param defaultResID
* The resource key ID
*
* @return
* The resource value
*/
public static boolean getBoolean(@BoolRes int defaultResID) {
return getRes().getBoolean(defaultResID);
}
Check.java 文件源码
项目:SimpleDialogFragments
阅读 34
收藏 0
点赞 0
评论 0
/**
* Sets the initial state of the checkbox
*
* @param preset initial state as boolean resource
*/
public Check check(@BoolRes int preset){
this.presetId = preset;
return this;
}
ChipGroup.java 文件源码
项目:material-components-android
阅读 36
收藏 0
点赞 0
评论 0
/**
* Sets whether this chip group only allows a single chip to be checked.
*
* <p>Calling this method results in all the chips in this group to become unchecked.
*/
public void setSingleSelection(@BoolRes int id) {
setSingleSelection(getResources().getBoolean(id));
}
BottomNavigationView.java 文件源码
项目:material-components-android
阅读 27
收藏 0
点赞 0
评论 0
/**
* Sets whether the menu items horizontally translate when in shifting mode using a resource ID.
*
* @param itemHorizontalTranslation whether the items horizontally translate in shifting mode
* @see #getItemHorizontalTranslation()
*/
public void setItemHorizontalTranslation(@BoolRes int itemHorizontalTranslation) {
setItemHorizontalTranslation(getResources().getBoolean(itemHorizontalTranslation));
}
TabLayout.java 文件源码
项目:material-components-android
阅读 44
收藏 0
点赞 0
评论 0
/**
* Set whether tab labels will be displayed inline with tab icons, or if they will be displayed
* underneath tab icons.
*
* @param inlineResourceId Resource ID for boolean inline flag
* @see #isInlineLabel()
* @attr ref android.support.design.R.styleable#TabLayout_tabInlineLabel
*/
public void setInlineLabelResource(@BoolRes int inlineResourceId) {
setInlineLabel(getResources().getBoolean(inlineResourceId));
}
AppResources.java 文件源码
项目:android-tao-core
阅读 30
收藏 0
点赞 0
评论 0
/**
* Return a boolean associated with a particular resource ID. This can be
* used with any integral resource value, and will return true if it is
* non-zero.
*
* @param id The desired resource identifier, as generated by the aapt
* tool. This integer encodes the package, type, and resource
* entry. The value 0 is an invalid identifier.
* @return Returns the boolean value contained in the resource.
* @throws NotFoundException Throws NotFoundException if the given ID does not exist.
*/
public static boolean getBoolean(@BoolRes int id) throws NotFoundException {
return resources.getBoolean(id);
}