TintTypedArray a = TintTypedArray.obtainStyledAttributes(context, attrs, R.styleable.MaterialProgressBar, defStyleAttr, defStyleRes); mProgressStyle = a.getInt(R.styleable.MaterialProgressBar_mpb_progressStyle, PROGRESS_STYLE_CIRCULAR); boolean setBothDrawables = a.getBoolean( R.styleable.MaterialProgressBar_mpb_setBothDrawables, false); boolean useIntrinsicPadding = a.getBoolean( R.styleable.MaterialProgressBar_mpb_useIntrinsicPadding, true); boolean showProgressBackground = a.getBoolean( R.styleable.MaterialProgressBar_mpb_showProgressBackground, mProgressStyle == PROGRESS_STYLE_HORIZONTAL); int determinateCircularProgressStyle = a.getInt( R.styleable.MaterialProgressBar_mpb_determinateCircularProgressStyle, DETERMINATE_CIRCULAR_PROGRESS_STYLE_NORMAL); if (a.hasValue(R.styleable.MaterialProgressBar_mpb_progressTint)) { mProgressTintInfo.mProgressTint = a.getColorStateList( R.styleable.MaterialProgressBar_mpb_progressTint); mProgressTintInfo.mHasProgressTint = true; if (a.hasValue(R.styleable.MaterialProgressBar_mpb_progressTintMode)) { mProgressTintInfo.mProgressTintMode = DrawableCompat.parseTintMode(a.getInt( R.styleable.MaterialProgressBar_mpb_progressTintMode, -1), null); mProgressTintInfo.mHasProgressTintMode = true; if (a.hasValue(R.styleable.MaterialProgressBar_mpb_secondaryProgressTint)) { mProgressTintInfo.mSecondaryProgressTint = a.getColorStateList( R.styleable.MaterialProgressBar_mpb_secondaryProgressTint); mProgressTintInfo.mHasSecondaryProgressTint = true;
TintTypedArray a = TintTypedArray.obtainStyledAttributes(context, attrs, R.styleable.DrawerNavigationView, defStyleAttr, R.style.Widget_Drawer_NavigationView); this, a.getDrawable(R.styleable.DrawerNavigationView_android_background)); if (a.hasValue(R.styleable.DrawerNavigationView_elevation)) { ViewCompat.setElevation(this, a.getDimensionPixelSize( R.styleable.DrawerNavigationView_elevation, 0)); a.getBoolean(R.styleable.DrawerNavigationView_android_fitsSystemWindows, false)); mMaxWidth = a.getDimensionPixelSize(R.styleable.DrawerNavigationView_android_maxWidth, 0); if (a.hasValue(R.styleable.DrawerNavigationView_itemIconTint)) { itemIconTint = a.getColorStateList(R.styleable.DrawerNavigationView_itemIconTint); } else { itemIconTint = createDefaultColorStateList(android.R.attr.textColorSecondary); if (a.hasValue(R.styleable.DrawerNavigationView_itemTextAppearance)) { textAppearance = a.getResourceId(R.styleable.DrawerNavigationView_itemTextAppearance, 0); textAppearanceSet = true; if (a.hasValue(R.styleable.DrawerNavigationView_itemTextColor)) { itemTextColor = a.getColorStateList(R.styleable.DrawerNavigationView_itemTextColor); final Drawable itemBackground = a.getDrawable(R.styleable.DrawerNavigationView_itemBackground); if (a.hasValue(R.styleable.DrawerNavigationView_menu)) { inflateMenu(a.getResourceId(R.styleable.DrawerNavigationView_menu, 0));