@Test public void testSetPrimaryColor() { GlifLayout layout = new GlifLayout(mContext); layout.setProgressBarShown(true); layout.setPrimaryColor(ColorStateList.valueOf(Color.RED)); assertEquals("Primary color should be red", ColorStateList.valueOf(Color.RED), layout.getPrimaryColor()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { ProgressBar progressBar = (ProgressBar) layout.findViewById(R.id.suw_layout_progress); assertEquals("Progress bar should be tinted red", ColorStateList.valueOf(Color.RED), progressBar.getIndeterminateTintList()); assertEquals("Determinate progress bar should also be tinted red", ColorStateList.valueOf(Color.RED), progressBar.getProgressBackgroundTintList()); } }
public void setPrimaryColor(@NonNull ColorStateList color) { mPrimaryColor = color; updateBackground(); getMixin(ProgressBarMixin.class).setColor(color); }
GlifLayout extends TemplateLayout { public void setPrimaryColor(@NonNull ColorStateList color) { mPrimaryColor = color; updateBackground(); getMixin(ProgressBarMixin.class).setColor(color); } }
GlifLayout extends TemplateLayout { public void setPrimaryColor(@NonNull ColorStateList color) { mPrimaryColor = color; updateBackground(); getMixin(ProgressBarMixin.class).setColor(color); } GlifLayout(Context context);  GlifLayout(Context context, int template);  GlifLayout(Context context, int template, int containerId);  GlifLayout(Context context, AttributeSet attrs); @TargetApi(VERSION_CODES.HONEYCOMB)  GlifLayout(Context context, AttributeSet attrs, int defStyleAttr); }
GlifLayout extends TemplateLayout { public void setPrimaryColor(@NonNull ColorStateList color) { mPrimaryColor = color; updateBackground(); getMixin(ProgressBarMixin.class).setColor(color); } GlifLayout(Context context);  GlifLayout(Context context, int template);  GlifLayout(Context context, int template, int containerId);  GlifLayout(Context context, AttributeSet attrs); @TargetApi(VERSION_CODES.HONEYCOMB)  GlifLayout(Context context, AttributeSet attrs, int defStyleAttr); View inflateFooter(@LayoutRes int footer); View inflateStickyHeader(@LayoutRes int header); ScrollView getScrollView(); TextView getHeaderTextView(); void setHeaderText(int title); void setHeaderText(CharSequence title); CharSequence getHeaderText(); void setHeaderColor(ColorStateList color); ColorStateList getHeaderColor(); void setIcon(Drawable icon); Drawable getIcon(); void setPrimaryColor(@NonNull ColorStateList color); ColorStateList getPrimaryColor(); void setBackgroundBaseColor(@Nullable ColorStateList color); @Nullable ColorStateList getBackgroundBaseColor(); void setBackgroundPatterned(boolean patterned); boolean isBackgroundPatterned(); boolean isProgressBarShown(); void setProgressBarShown(boolean shown); ProgressBar peekProgressBar(); }
GlifLayout extends TemplateLayout { public void setPrimaryColor(@NonNull ColorStateList color) { mPrimaryColor = color; updateBackground(); getMixin(ProgressBarMixin.class).setColor(color); } GlifLayout(Context context);  GlifLayout(Context context, int template);  GlifLayout(Context context, int template, int containerId);  GlifLayout(Context context, AttributeSet attrs); @TargetApi(VERSION_CODES.HONEYCOMB)  GlifLayout(Context context, AttributeSet attrs, int defStyleAttr); View inflateFooter(@LayoutRes int footer); View inflateStickyHeader(@LayoutRes int header); ScrollView getScrollView(); TextView getHeaderTextView(); void setHeaderText(int title); void setHeaderText(CharSequence title); CharSequence getHeaderText(); void setHeaderColor(ColorStateList color); ColorStateList getHeaderColor(); void setIcon(Drawable icon); Drawable getIcon(); void setPrimaryColor(@NonNull ColorStateList color); ColorStateList getPrimaryColor(); void setBackgroundBaseColor(@Nullable ColorStateList color); @Nullable ColorStateList getBackgroundBaseColor(); void setBackgroundPatterned(boolean patterned); boolean isBackgroundPatterned(); boolean isProgressBarShown(); void setProgressBarShown(boolean shown); ProgressBar peekProgressBar();  }