List of usage examples for android.util AttributeSet getAttributeUnsignedIntValue
public int getAttributeUnsignedIntValue(String namespace, String attribute, int defaultValue);
From source file:uk.org.ngo.squeezer.NowPlayingFragment.java
/** * Called before onAttach. Pull out the layout spec to figure out which layout to use later. */// w w w . j a v a 2s . c o m @Override public void onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState) { super.onInflate(activity, attrs, savedInstanceState); int layout_height = attrs.getAttributeUnsignedIntValue("http://schemas.android.com/apk/res/android", "layout_height", 0); mFullHeightLayout = (layout_height == ViewGroup.LayoutParams.FILL_PARENT); }
From source file:com.anysoftkeyboard.addons.AddOnsFactory.java
@Nullable private E createAddOnFromXmlAttributes(AttributeSet attrs, Context packContext) { final CharSequence prefId = getTextFromResourceOrText(packContext, attrs, XML_PREF_ID_ATTRIBUTE); final CharSequence name = getTextFromResourceOrText(packContext, attrs, XML_NAME_RES_ID_ATTRIBUTE); if ((!mDevAddOnsIncluded) && attrs.getAttributeBooleanValue(null, XML_DEV_ADD_ON_ATTRIBUTE, false)) { Logger.w(mTag,/*w w w .j a v a 2 s .c o m*/ "Discarding add-on %s (name %s) since it is marked as DEV addon, and we're not a TESTING_BUILD build.", prefId, name); return null; } final boolean isHidden = attrs.getAttributeBooleanValue(null, XML_HIDDEN_ADD_ON_ATTRIBUTE, false); final CharSequence description = getTextFromResourceOrText(packContext, attrs, XML_DESCRIPTION_ATTRIBUTE); final int sortIndex = attrs.getAttributeUnsignedIntValue(null, XML_SORT_INDEX_ATTRIBUTE, 1); // asserting if (TextUtils.isEmpty(prefId) || TextUtils.isEmpty(name)) { Logger.e(mTag, "External add-on does not include all mandatory details! Will not create add-on."); return null; } else { Logger.d(mTag, "External addon details: prefId:" + prefId + " name:" + name); return createConcreteAddOn(mContext, packContext, prefId, name, description, isHidden, sortIndex, attrs); } }