diff options
Diffstat (limited to 'main/src/com')
33 files changed, 154 insertions, 422 deletions
diff --git a/main/src/com/google/android/setupdesign/DividerItemDecoration.java b/main/src/com/google/android/setupdesign/DividerItemDecoration.java index 5dfe351..fa0166f 100644 --- a/main/src/com/google/android/setupdesign/DividerItemDecoration.java +++ b/main/src/com/google/android/setupdesign/DividerItemDecoration.java @@ -83,15 +83,15 @@ public class DividerItemDecoration extends RecyclerView.ItemDecoration { public DividerItemDecoration() {} public DividerItemDecoration(Context context) { - final TypedArray a = context.obtainStyledAttributes(R.styleable.SuwDividerItemDecoration); + final TypedArray a = context.obtainStyledAttributes(R.styleable.SudDividerItemDecoration); final Drawable divider = - a.getDrawable(R.styleable.SuwDividerItemDecoration_android_listDivider); + a.getDrawable(R.styleable.SudDividerItemDecoration_android_listDivider); final int dividerHeight = - a.getDimensionPixelSize(R.styleable.SuwDividerItemDecoration_android_dividerHeight, 0); + a.getDimensionPixelSize(R.styleable.SudDividerItemDecoration_android_dividerHeight, 0); @DividerCondition final int dividerCondition = a.getInt( - R.styleable.SuwDividerItemDecoration_suwDividerCondition, DIVIDER_CONDITION_EITHER); + R.styleable.SudDividerItemDecoration_sudDividerCondition, DIVIDER_CONDITION_EITHER); a.recycle(); setDivider(divider); diff --git a/main/src/com/google/android/setupdesign/GlifLayout.java b/main/src/com/google/android/setupdesign/GlifLayout.java index d3a7354..4c21f56 100644 --- a/main/src/com/google/android/setupdesign/GlifLayout.java +++ b/main/src/com/google/android/setupdesign/GlifLayout.java @@ -35,10 +35,10 @@ import android.widget.ProgressBar; import android.widget.ScrollView; import android.widget.TextView; import com.google.android.setupcompat.PartnerCustomizationLayout; +import com.google.android.setupcompat.template.ColoredHeaderMixin; +import com.google.android.setupcompat.template.HeaderMixin; +import com.google.android.setupcompat.template.IconMixin; import com.google.android.setupcompat.template.StatusBarMixin; -import com.google.android.setupdesign.template.ColoredHeaderMixin; -import com.google.android.setupdesign.template.HeaderMixin; -import com.google.android.setupdesign.template.IconMixin; import com.google.android.setupdesign.template.ProgressBarMixin; import com.google.android.setupdesign.template.RequireScrollMixin; import com.google.android.setupdesign.template.ScrollViewScrollHandlingDelegate; @@ -55,7 +55,7 @@ import com.google.android.setupdesign.template.ScrollViewScrollHandlingDelegate; * android:layout_width="match_parent" * android:layout_height="match_parent" * android:icon="@drawable/my_icon" - * app:suwHeaderText="@string/my_title"> + * app:sucHeaderText="@string/my_title"> * * <!-- Content here --> * @@ -83,12 +83,12 @@ public class GlifLayout extends PartnerCustomizationLayout { public GlifLayout(Context context, int template, int containerId) { super(context, template, containerId); - init(null, R.attr.suwLayoutTheme); + init(null, R.attr.sudLayoutTheme); } public GlifLayout(Context context, AttributeSet attrs) { super(context, attrs); - init(attrs, R.attr.suwLayoutTheme); + init(attrs, R.attr.sudLayoutTheme); } @TargetApi(VERSION_CODES.HONEYCOMB) @@ -113,22 +113,22 @@ public class GlifLayout extends PartnerCustomizationLayout { } TypedArray a = - getContext().obtainStyledAttributes(attrs, R.styleable.SuwGlifLayout, defStyleAttr, 0); + getContext().obtainStyledAttributes(attrs, R.styleable.SudGlifLayout, defStyleAttr, 0); - ColorStateList primaryColor = a.getColorStateList(R.styleable.SuwGlifLayout_suwColorPrimary); + ColorStateList primaryColor = a.getColorStateList(R.styleable.SudGlifLayout_sudColorPrimary); if (primaryColor != null) { setPrimaryColor(primaryColor); } ColorStateList backgroundColor = - a.getColorStateList(R.styleable.SuwGlifLayout_suwBackgroundBaseColor); + a.getColorStateList(R.styleable.SudGlifLayout_sudBackgroundBaseColor); setBackgroundBaseColor(backgroundColor); boolean backgroundPatterned = - a.getBoolean(R.styleable.SuwGlifLayout_suwBackgroundPatterned, true); + a.getBoolean(R.styleable.SudGlifLayout_sudBackgroundPatterned, true); setBackgroundPatterned(backgroundPatterned); - final int stickyHeader = a.getResourceId(R.styleable.SuwGlifLayout_suwStickyHeader, 0); + final int stickyHeader = a.getResourceId(R.styleable.SudGlifLayout_sudStickyHeader, 0); if (stickyHeader != 0) { inflateStickyHeader(stickyHeader); } @@ -140,13 +140,13 @@ public class GlifLayout extends PartnerCustomizationLayout { if (template == 0) { template = R.layout.sud_glif_template; } - return inflateTemplate(inflater, R.style.SuwThemeGlif_Light, template); + return inflateTemplate(inflater, R.style.SudThemeGlif_Light, template); } @Override protected ViewGroup findContainer(int containerId) { if (containerId == 0) { - containerId = R.id.suw_layout_content; + containerId = R.id.sud_layout_content; } return super.findContainer(containerId); } @@ -160,13 +160,13 @@ public class GlifLayout extends PartnerCustomizationLayout { * @return The root of the inflated header view. */ public View inflateStickyHeader(@LayoutRes int header) { - ViewStub stickyHeaderStub = findManagedViewById(R.id.suw_layout_sticky_header); + ViewStub stickyHeaderStub = findManagedViewById(R.id.sud_layout_sticky_header); stickyHeaderStub.setLayoutResource(header); return stickyHeaderStub.inflate(); } public ScrollView getScrollView() { - final View view = findManagedViewById(R.id.suw_scroll_view); + final View view = findManagedViewById(R.id.sud_scroll_view); return view instanceof ScrollView ? (ScrollView) view : null; } diff --git a/main/src/com/google/android/setupdesign/GlifListLayout.java b/main/src/com/google/android/setupdesign/GlifListLayout.java index c5a78f3..31335cc 100644 --- a/main/src/com/google/android/setupdesign/GlifListLayout.java +++ b/main/src/com/google/android/setupdesign/GlifListLayout.java @@ -116,8 +116,8 @@ public class GlifListLayout extends GlifLayout { * theme and apply insets to it. * * @param start The number of pixels to inset on the "start" side of the list divider. Typically - * this will be either {@code @dimen/suw_items_glif_icon_divider_inset} or - * {@code @dimen/suw_items_glif_text_divider_inset}. + * this will be either {@code @dimen/sud_items_glif_icon_divider_inset} or + * {@code @dimen/sud_items_glif_text_divider_inset}. * @param end The number of pixels to inset on the "end" side of the list divider. * @see ListMixin#setDividerInsets(int, int) */ diff --git a/main/src/com/google/android/setupdesign/GlifPreferenceLayout.java b/main/src/com/google/android/setupdesign/GlifPreferenceLayout.java index 5947644..f235442 100644 --- a/main/src/com/google/android/setupdesign/GlifPreferenceLayout.java +++ b/main/src/com/google/android/setupdesign/GlifPreferenceLayout.java @@ -84,7 +84,7 @@ public class GlifPreferenceLayout extends GlifRecyclerLayout { @Override protected ViewGroup findContainer(int containerId) { if (containerId == 0) { - containerId = R.id.suw_layout_content; + containerId = R.id.sud_layout_content; } return super.findContainer(containerId); } diff --git a/main/src/com/google/android/setupdesign/GlifRecyclerLayout.java b/main/src/com/google/android/setupdesign/GlifRecyclerLayout.java index c62ac85..c74cff0 100644 --- a/main/src/com/google/android/setupdesign/GlifRecyclerLayout.java +++ b/main/src/com/google/android/setupdesign/GlifRecyclerLayout.java @@ -88,7 +88,7 @@ public class GlifRecyclerLayout extends GlifLayout { @Override protected void onTemplateInflated() { - final View recyclerView = findViewById(R.id.suw_recycler_view); + final View recyclerView = findViewById(R.id.sud_recycler_view); if (recyclerView instanceof RecyclerView) { recyclerMixin = new RecyclerMixin(this, (RecyclerView) recyclerView); } else { @@ -100,7 +100,7 @@ public class GlifRecyclerLayout extends GlifLayout { @Override protected ViewGroup findContainer(int containerId) { if (containerId == 0) { - containerId = R.id.suw_recycler_view; + containerId = R.id.sud_recycler_view; } return super.findContainer(containerId); } diff --git a/main/src/com/google/android/setupdesign/SetupWizardLayout.java b/main/src/com/google/android/setupdesign/SetupWizardLayout.java index a90b839..28df4fc 100644 --- a/main/src/com/google/android/setupdesign/SetupWizardLayout.java +++ b/main/src/com/google/android/setupdesign/SetupWizardLayout.java @@ -39,7 +39,7 @@ import android.view.ViewGroup; import android.widget.ScrollView; import android.widget.TextView; import com.google.android.setupcompat.TemplateLayout; -import com.google.android.setupdesign.template.HeaderMixin; +import com.google.android.setupcompat.template.HeaderMixin; import com.google.android.setupdesign.template.NavigationBarMixin; import com.google.android.setupdesign.template.ProgressBarMixin; import com.google.android.setupdesign.template.RequireScrollMixin; @@ -53,7 +53,7 @@ public class SetupWizardLayout extends TemplateLayout { public SetupWizardLayout(Context context) { super(context, 0, 0); - init(null, R.attr.suwLayoutTheme); + init(null, R.attr.sudLayoutTheme); } public SetupWizardLayout(Context context, int template) { @@ -62,12 +62,12 @@ public class SetupWizardLayout extends TemplateLayout { public SetupWizardLayout(Context context, int template, int containerId) { super(context, template, containerId); - init(null, R.attr.suwLayoutTheme); + init(null, R.attr.sudLayoutTheme); } public SetupWizardLayout(Context context, AttributeSet attrs) { super(context, attrs); - init(attrs, R.attr.suwLayoutTheme); + init(attrs, R.attr.sudLayoutTheme); } @TargetApi(VERSION_CODES.HONEYCOMB) @@ -93,29 +93,29 @@ public class SetupWizardLayout extends TemplateLayout { final TypedArray a = getContext() - .obtainStyledAttributes(attrs, R.styleable.SuwSetupWizardLayout, defStyleAttr, 0); + .obtainStyledAttributes(attrs, R.styleable.SudSetupWizardLayout, defStyleAttr, 0); // Set the background from XML, either directly or built from a bitmap tile - final Drawable background = a.getDrawable(R.styleable.SuwSetupWizardLayout_suwBackground); + final Drawable background = a.getDrawable(R.styleable.SudSetupWizardLayout_sudBackground); if (background != null) { setLayoutBackground(background); } else { final Drawable backgroundTile = - a.getDrawable(R.styleable.SuwSetupWizardLayout_suwBackgroundTile); + a.getDrawable(R.styleable.SudSetupWizardLayout_sudBackgroundTile); if (backgroundTile != null) { setBackgroundTile(backgroundTile); } } // Set the illustration from XML, either directly or built from image + horizontal tile - final Drawable illustration = a.getDrawable(R.styleable.SuwSetupWizardLayout_suwIllustration); + final Drawable illustration = a.getDrawable(R.styleable.SudSetupWizardLayout_sudIllustration); if (illustration != null) { setIllustration(illustration); } else { final Drawable illustrationImage = - a.getDrawable(R.styleable.SuwSetupWizardLayout_suwIllustrationImage); + a.getDrawable(R.styleable.SudSetupWizardLayout_sudIllustrationImage); final Drawable horizontalTile = - a.getDrawable(R.styleable.SuwSetupWizardLayout_suwIllustrationHorizontalTile); + a.getDrawable(R.styleable.SudSetupWizardLayout_sudIllustrationHorizontalTile); if (illustrationImage != null && horizontalTile != null) { setIllustration(illustrationImage, horizontalTile); } @@ -123,19 +123,19 @@ public class SetupWizardLayout extends TemplateLayout { // Set the top padding of the illustration int decorPaddingTop = - a.getDimensionPixelSize(R.styleable.SuwSetupWizardLayout_suwDecorPaddingTop, -1); + a.getDimensionPixelSize(R.styleable.SudSetupWizardLayout_sudDecorPaddingTop, -1); if (decorPaddingTop == -1) { - decorPaddingTop = getResources().getDimensionPixelSize(R.dimen.suw_decor_padding_top); + decorPaddingTop = getResources().getDimensionPixelSize(R.dimen.sud_decor_padding_top); } setDecorPaddingTop(decorPaddingTop); // Set the illustration aspect ratio. See Illustration.setAspectRatio(float). This will - // override suwDecorPaddingTop if its value is not 0. + // override sudDecorPaddingTop if its value is not 0. float illustrationAspectRatio = - a.getFloat(R.styleable.SuwSetupWizardLayout_suwIllustrationAspectRatio, -1f); + a.getFloat(R.styleable.SudSetupWizardLayout_sudIllustrationAspectRatio, -1f); if (illustrationAspectRatio == -1f) { final TypedValue out = new TypedValue(); - getResources().getValue(R.dimen.suw_illustration_aspect_ratio, out, true); + getResources().getValue(R.dimen.sud_illustration_aspect_ratio, out, true); illustrationAspectRatio = out.getFloat(); } setIllustrationAspectRatio(illustrationAspectRatio); @@ -170,13 +170,13 @@ public class SetupWizardLayout extends TemplateLayout { if (template == 0) { template = R.layout.sud_template; } - return inflateTemplate(inflater, R.style.SuwThemeMaterial_Light, template); + return inflateTemplate(inflater, R.style.SudThemeMaterial_Light, template); } @Override protected ViewGroup findContainer(int containerId) { if (containerId == 0) { - containerId = R.id.suw_layout_content; + containerId = R.id.sud_layout_content; } return super.findContainer(containerId); } @@ -186,7 +186,7 @@ public class SetupWizardLayout extends TemplateLayout { } public ScrollView getScrollView() { - final View view = findManagedViewById(R.id.suw_bottom_scroll_view); + final View view = findManagedViewById(R.id.sud_bottom_scroll_view); return view instanceof ScrollView ? (ScrollView) view : null; } @@ -225,7 +225,7 @@ public class SetupWizardLayout extends TemplateLayout { * @param drawable The drawable specifying the illustration. */ public void setIllustration(Drawable drawable) { - final View view = findManagedViewById(R.id.suw_layout_decor); + final View view = findManagedViewById(R.id.sud_layout_decor); if (view instanceof Illustration) { final Illustration illustration = (Illustration) view; illustration.setIllustration(drawable); @@ -242,7 +242,7 @@ public class SetupWizardLayout extends TemplateLayout { * @param horizontalTile Resource ID of the horizontally repeating tile for tablet layout. */ public void setIllustration(int asset, int horizontalTile) { - final View view = findManagedViewById(R.id.suw_layout_decor); + final View view = findManagedViewById(R.id.sud_layout_decor); if (view instanceof Illustration) { final Illustration illustration = (Illustration) view; final Drawable illustrationDrawable = getIllustration(asset, horizontalTile); @@ -251,7 +251,7 @@ public class SetupWizardLayout extends TemplateLayout { } private void setIllustration(Drawable asset, Drawable horizontalTile) { - final View view = findManagedViewById(R.id.suw_layout_decor); + final View view = findManagedViewById(R.id.sud_layout_decor); if (view instanceof Illustration) { final Illustration illustration = (Illustration) view; final Drawable illustrationDrawable = getIllustration(asset, horizontalTile); @@ -267,7 +267,7 @@ public class SetupWizardLayout extends TemplateLayout { * @see com.google.android.setupdesign.view.Illustration#setAspectRatio(float) */ public void setIllustrationAspectRatio(float aspectRatio) { - final View view = findManagedViewById(R.id.suw_layout_decor); + final View view = findManagedViewById(R.id.sud_layout_decor); if (view instanceof Illustration) { final Illustration illustration = (Illustration) view; illustration.setAspectRatio(aspectRatio); @@ -285,7 +285,7 @@ public class SetupWizardLayout extends TemplateLayout { * @param paddingTop The top padding in pixels. */ public void setDecorPaddingTop(int paddingTop) { - final View view = findManagedViewById(R.id.suw_layout_decor); + final View view = findManagedViewById(R.id.sud_layout_decor); if (view != null) { view.setPadding( view.getPaddingLeft(), paddingTop, view.getPaddingRight(), view.getPaddingBottom()); @@ -297,7 +297,7 @@ public class SetupWizardLayout extends TemplateLayout { * bitmap tile and you want it to repeat, use {@link #setBackgroundTile(int)} instead. */ public void setLayoutBackground(Drawable background) { - final View view = findManagedViewById(R.id.suw_layout_decor); + final View view = findManagedViewById(R.id.sud_layout_decor); if (view != null) { //noinspection deprecation view.setBackgroundDrawable(background); @@ -330,7 +330,7 @@ public class SetupWizardLayout extends TemplateLayout { @SuppressLint("RtlHardcoded") private Drawable getIllustration(Drawable asset, Drawable horizontalTile) { final Context context = getContext(); - if (context.getResources().getBoolean(R.bool.suwUseTabletLayout)) { + if (context.getResources().getBoolean(R.bool.sudUseTabletLayout)) { // If it is a "tablet" (sw600dp), create a LayerDrawable with the horizontal tile. if (horizontalTile instanceof BitmapDrawable) { ((BitmapDrawable) horizontalTile).setTileModeX(TileMode.REPEAT); diff --git a/main/src/com/google/android/setupdesign/SetupWizardListLayout.java b/main/src/com/google/android/setupdesign/SetupWizardListLayout.java index ad05735..760602f 100644 --- a/main/src/com/google/android/setupdesign/SetupWizardListLayout.java +++ b/main/src/com/google/android/setupdesign/SetupWizardListLayout.java @@ -106,8 +106,8 @@ public class SetupWizardListLayout extends SetupWizardLayout { * theme and inset it {@code inset} pixels to the right (or left in RTL layouts). * * @param inset The number of pixels to inset on the "start" side of the list divider. Typically - * this will be either {@code @dimen/suw_items_icon_divider_inset} or - * {@code @dimen/suw_items_text_divider_inset}. + * this will be either {@code @dimen/sud_items_icon_divider_inset} or + * {@code @dimen/sud_items_text_divider_inset}. * @see ListMixin#setDividerInset(int) * @deprecated Use {@link #setDividerInsets(int, int)} instead. */ @@ -121,8 +121,8 @@ public class SetupWizardListLayout extends SetupWizardLayout { * theme and apply insets to it. * * @param start The number of pixels to inset on the "start" side of the list divider. Typically - * this will be either {@code @dimen/suw_items_icon_divider_inset} or - * {@code @dimen/suw_items_text_divider_inset}. + * this will be either {@code @dimen/sud_items_icon_divider_inset} or + * {@code @dimen/sud_items_text_divider_inset}. * @param end The number of pixels to inset on the "end" side of the list divider. * @see ListMixin#setDividerInsets(int, int) */ diff --git a/main/src/com/google/android/setupdesign/SetupWizardPreferenceLayout.java b/main/src/com/google/android/setupdesign/SetupWizardPreferenceLayout.java index fe6c5a2..7bfeccb 100644 --- a/main/src/com/google/android/setupdesign/SetupWizardPreferenceLayout.java +++ b/main/src/com/google/android/setupdesign/SetupWizardPreferenceLayout.java @@ -83,7 +83,7 @@ public class SetupWizardPreferenceLayout extends SetupWizardRecyclerLayout { @Override protected ViewGroup findContainer(int containerId) { if (containerId == 0) { - containerId = R.id.suw_layout_content; + containerId = R.id.sud_layout_content; } return super.findContainer(containerId); } diff --git a/main/src/com/google/android/setupdesign/SetupWizardRecyclerLayout.java b/main/src/com/google/android/setupdesign/SetupWizardRecyclerLayout.java index 7808c4c..f0dc138 100644 --- a/main/src/com/google/android/setupdesign/SetupWizardRecyclerLayout.java +++ b/main/src/com/google/android/setupdesign/SetupWizardRecyclerLayout.java @@ -92,7 +92,7 @@ public class SetupWizardRecyclerLayout extends SetupWizardLayout { @Override protected ViewGroup findContainer(int containerId) { if (containerId == 0) { - containerId = R.id.suw_recycler_view; + containerId = R.id.sud_recycler_view; } return super.findContainer(containerId); } @@ -107,7 +107,7 @@ public class SetupWizardRecyclerLayout extends SetupWizardLayout { @Override protected void onTemplateInflated() { - final View recyclerView = findViewById(R.id.suw_recycler_view); + final View recyclerView = findViewById(R.id.sud_recycler_view); if (recyclerView instanceof RecyclerView) { recyclerMixin = new RecyclerMixin(this, (RecyclerView) recyclerView); } else { @@ -141,8 +141,8 @@ public class SetupWizardRecyclerLayout extends SetupWizardLayout { * theme and apply insets to it. * * @param start The number of pixels to inset on the "start" side of the list divider. Typically - * this will be either {@code @dimen/suw_items_icon_divider_inset} or - * {@code @dimen/suw_items_text_divider_inset}. + * this will be either {@code @dimen/sud_items_icon_divider_inset} or + * {@code @dimen/sud_items_text_divider_inset}. * @param end The number of pixels to inset on the "end" side of the list divider. * @see RecyclerMixin#setDividerInsets(int, int) */ diff --git a/main/src/com/google/android/setupdesign/items/AbstractItemHierarchy.java b/main/src/com/google/android/setupdesign/items/AbstractItemHierarchy.java index 6cb5fab..267e4ab 100644 --- a/main/src/com/google/android/setupdesign/items/AbstractItemHierarchy.java +++ b/main/src/com/google/android/setupdesign/items/AbstractItemHierarchy.java @@ -38,8 +38,8 @@ public abstract class AbstractItemHierarchy implements ItemHierarchy { public AbstractItemHierarchy() {} public AbstractItemHierarchy(Context context, AttributeSet attrs) { - TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SuwAbstractItem); - id = a.getResourceId(R.styleable.SuwAbstractItem_android_id, 0); + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SudAbstractItem); + id = a.getResourceId(R.styleable.SudAbstractItem_android_id, 0); a.recycle(); } diff --git a/main/src/com/google/android/setupdesign/items/ButtonBarItem.java b/main/src/com/google/android/setupdesign/items/ButtonBarItem.java index 77d06d0..0f63a50 100644 --- a/main/src/com/google/android/setupdesign/items/ButtonBarItem.java +++ b/main/src/com/google/android/setupdesign/items/ButtonBarItem.java @@ -40,7 +40,7 @@ import java.util.ArrayList; * <ButtonItem * android:id="@+id/next_button" * android:text="@string/next_button_label - * android:theme="@style/SuwButtonItem.Colored" /> + * android:theme="@style/SudButtonItem.Colored" /> * * </ButtonBarItem> * }</pre> diff --git a/main/src/com/google/android/setupdesign/items/ButtonItem.java b/main/src/com/google/android/setupdesign/items/ButtonItem.java index ffefbcf..a2e746e 100644 --- a/main/src/com/google/android/setupdesign/items/ButtonItem.java +++ b/main/src/com/google/android/setupdesign/items/ButtonItem.java @@ -39,7 +39,7 @@ public class ButtonItem extends AbstractItem implements View.OnClickListener { private boolean enabled = true; private CharSequence text; - private int theme = R.style.SuwButtonItem; + private int theme = R.style.SudButtonItem; private OnClickListener listener; private Button button; @@ -50,10 +50,10 @@ public class ButtonItem extends AbstractItem implements View.OnClickListener { public ButtonItem(Context context, AttributeSet attrs) { super(context, attrs); - TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SuwButtonItem); - enabled = a.getBoolean(R.styleable.SuwButtonItem_android_enabled, true); - text = a.getText(R.styleable.SuwButtonItem_android_text); - theme = a.getResourceId(R.styleable.SuwButtonItem_android_theme, R.style.SuwButtonItem); + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SudButtonItem); + enabled = a.getBoolean(R.styleable.SudButtonItem_android_enabled, true); + text = a.getText(R.styleable.SudButtonItem_android_text); + theme = a.getResourceId(R.styleable.SudButtonItem_android_theme, R.style.SudButtonItem); a.recycle(); } diff --git a/main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java b/main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java index 1e23ff7..d20ed02 100644 --- a/main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java +++ b/main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java @@ -54,9 +54,9 @@ public class ExpandableSwitchItem extends SwitchItem public ExpandableSwitchItem(Context context, AttributeSet attrs) { super(context, attrs); - final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SuwExpandableSwitchItem); - collapsedSummary = a.getText(R.styleable.SuwExpandableSwitchItem_suwCollapsedSummary); - expandedSummary = a.getText(R.styleable.SuwExpandableSwitchItem_suwExpandedSummary); + final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SudExpandableSwitchItem); + collapsedSummary = a.getText(R.styleable.SudExpandableSwitchItem_sudCollapsedSummary); + expandedSummary = a.getText(R.styleable.SudExpandableSwitchItem_sudExpandedSummary); a.recycle(); } @@ -91,7 +91,7 @@ public class ExpandableSwitchItem extends SwitchItem /** * Sets the summary text shown when the item is collapsed. Corresponds to the {@code - * app:suwCollapsedSummary} XML attribute. + * app:sudCollapsedSummary} XML attribute. */ public void setCollapsedSummary(CharSequence collapsedSummary) { this.collapsedSummary = collapsedSummary; @@ -107,7 +107,7 @@ public class ExpandableSwitchItem extends SwitchItem /** * Sets the summary text shown when the item is expanded. Corresponds to the {@code - * app:suwExpandedSummary} XML attribute. + * app:sudExpandedSummary} XML attribute. */ public void setExpandedSummary(CharSequence expandedSummary) { this.expandedSummary = expandedSummary; @@ -147,7 +147,7 @@ public class ExpandableSwitchItem extends SwitchItem a.recycle(); if (tintColor != null) { - TextView titleView = (TextView) view.findViewById(R.id.suw_items_title); + TextView titleView = (TextView) view.findViewById(R.id.sud_items_title); for (Drawable drawable : titleView.getCompoundDrawables()) { if (drawable != null) { drawable.setColorFilter(tintColor.getDefaultColor(), Mode.SRC_IN); diff --git a/main/src/com/google/android/setupdesign/items/Item.java b/main/src/com/google/android/setupdesign/items/Item.java index fac23fb..4217b4e 100644 --- a/main/src/com/google/android/setupdesign/items/Item.java +++ b/main/src/com/google/android/setupdesign/items/Item.java @@ -45,13 +45,13 @@ public class Item extends AbstractItem { public Item(Context context, AttributeSet attrs) { super(context, attrs); - TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SuwItem); - enabled = a.getBoolean(R.styleable.SuwItem_android_enabled, true); - icon = a.getDrawable(R.styleable.SuwItem_android_icon); - title = a.getText(R.styleable.SuwItem_android_title); - summary = a.getText(R.styleable.SuwItem_android_summary); - layoutRes = a.getResourceId(R.styleable.SuwItem_android_layout, getDefaultLayoutResource()); - visible = a.getBoolean(R.styleable.SuwItem_android_visible, true); + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SudItem); + enabled = a.getBoolean(R.styleable.SudItem_android_enabled, true); + icon = a.getDrawable(R.styleable.SudItem_android_icon); + title = a.getText(R.styleable.SudItem_android_title); + summary = a.getText(R.styleable.SudItem_android_summary); + layoutRes = a.getResourceId(R.styleable.SudItem_android_layout, getDefaultLayoutResource()); + visible = a.getBoolean(R.styleable.SudItem_android_visible, true); a.recycle(); } @@ -134,10 +134,10 @@ public class Item extends AbstractItem { @Override public void onBindView(View view) { - TextView label = (TextView) view.findViewById(R.id.suw_items_title); + TextView label = (TextView) view.findViewById(R.id.sud_items_title); label.setText(getTitle()); - TextView summaryView = (TextView) view.findViewById(R.id.suw_items_summary); + TextView summaryView = (TextView) view.findViewById(R.id.sud_items_summary); CharSequence summary = getSummary(); if (summary != null && summary.length() > 0) { summaryView.setText(summary); @@ -146,10 +146,10 @@ public class Item extends AbstractItem { summaryView.setVisibility(View.GONE); } - final View iconContainer = view.findViewById(R.id.suw_items_icon_container); + final View iconContainer = view.findViewById(R.id.sud_items_icon_container); final Drawable icon = getIcon(); if (icon != null) { - final ImageView iconView = (ImageView) view.findViewById(R.id.suw_items_icon); + final ImageView iconView = (ImageView) view.findViewById(R.id.sud_items_icon); // Set the image drawable to null before setting the state and level to avoid affecting // any recycled drawable in the ImageView iconView.setImageDrawable(null); diff --git a/main/src/com/google/android/setupdesign/items/RecyclerItemAdapter.java b/main/src/com/google/android/setupdesign/items/RecyclerItemAdapter.java index 2e86fe0..b8ba8a1 100644 --- a/main/src/com/google/android/setupdesign/items/RecyclerItemAdapter.java +++ b/main/src/com/google/android/setupdesign/items/RecyclerItemAdapter.java @@ -98,19 +98,19 @@ public class RecyclerItemAdapter extends RecyclerView.Adapter<ItemViewHolder> final Object viewTag = view.getTag(); if (!TAG_NO_BACKGROUND.equals(viewTag)) { final TypedArray typedArray = - parent.getContext().obtainStyledAttributes(R.styleable.SuwRecyclerItemAdapter); + parent.getContext().obtainStyledAttributes(R.styleable.SudRecyclerItemAdapter); Drawable selectableItemBackground = typedArray.getDrawable( - R.styleable.SuwRecyclerItemAdapter_android_selectableItemBackground); + R.styleable.SudRecyclerItemAdapter_android_selectableItemBackground); if (selectableItemBackground == null) { selectableItemBackground = - typedArray.getDrawable(R.styleable.SuwRecyclerItemAdapter_selectableItemBackground); + typedArray.getDrawable(R.styleable.SudRecyclerItemAdapter_selectableItemBackground); } Drawable background = view.getBackground(); if (background == null) { background = - typedArray.getDrawable(R.styleable.SuwRecyclerItemAdapter_android_colorBackground); + typedArray.getDrawable(R.styleable.SudRecyclerItemAdapter_android_colorBackground); } if (selectableItemBackground == null || background == null) { diff --git a/main/src/com/google/android/setupdesign/items/SwitchItem.java b/main/src/com/google/android/setupdesign/items/SwitchItem.java index 940acea..862197e 100644 --- a/main/src/com/google/android/setupdesign/items/SwitchItem.java +++ b/main/src/com/google/android/setupdesign/items/SwitchItem.java @@ -59,8 +59,8 @@ public class SwitchItem extends Item implements CompoundButton.OnCheckedChangeLi */ public SwitchItem(Context context, AttributeSet attrs) { super(context, attrs); - final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SuwSwitchItem); - checked = a.getBoolean(R.styleable.SuwSwitchItem_android_checked, false); + final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.SudSwitchItem); + checked = a.getBoolean(R.styleable.SudSwitchItem_android_checked, false); a.recycle(); } diff --git a/main/src/com/google/android/setupdesign/template/ColoredHeaderMixin.java b/main/src/com/google/android/setupdesign/template/ColoredHeaderMixin.java deleted file mode 100644 index fb581ca..0000000 --- a/main/src/com/google/android/setupdesign/template/ColoredHeaderMixin.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.setupdesign.template; - -import android.content.res.ColorStateList; -import android.content.res.TypedArray; -import android.util.AttributeSet; -import android.widget.TextView; -import com.google.android.setupcompat.TemplateLayout; -import com.google.android.setupdesign.R; - -/** - * A {@link Mixin} displaying a header text that can be set to different colors. This Mixin is - * registered to the template using HeaderMixin.class, and can be retrieved using: {@code - * (ColoredHeaderMixin) templateLayout.getMixin(HeaderMixin.class}. - */ -public class ColoredHeaderMixin extends HeaderMixin { - - /** {@inheritDoc} */ - public ColoredHeaderMixin(TemplateLayout layout, AttributeSet attrs, int defStyleAttr) { - super(layout, attrs, defStyleAttr); - - final TypedArray a = - layout - .getContext() - .obtainStyledAttributes(attrs, R.styleable.SuwColoredHeaderMixin, defStyleAttr, 0); - - // Set the header color - final ColorStateList headerColor = - a.getColorStateList(R.styleable.SuwColoredHeaderMixin_suwHeaderColor); - if (headerColor != null) { - setColor(headerColor); - } - - a.recycle(); - } - - /** - * Sets the color of the header text. This can also be set via XML using {@code - * app:suwHeaderColor}. - * - * @param color The text color of the header. - */ - public void setColor(ColorStateList color) { - final TextView titleView = getTextView(); - if (titleView != null) { - titleView.setTextColor(color); - } - } - - /** @return The current text color of the header. */ - public ColorStateList getColor() { - final TextView titleView = getTextView(); - return titleView != null ? titleView.getTextColors() : null; - } -} diff --git a/main/src/com/google/android/setupdesign/template/HeaderMixin.java b/main/src/com/google/android/setupdesign/template/HeaderMixin.java deleted file mode 100644 index bde0667..0000000 --- a/main/src/com/google/android/setupdesign/template/HeaderMixin.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.setupdesign.template; - -import android.content.res.TypedArray; -import androidx.annotation.AttrRes; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import android.util.AttributeSet; -import android.widget.TextView; -import com.google.android.setupcompat.TemplateLayout; -import com.google.android.setupcompat.template.Mixin; -import com.google.android.setupdesign.R; - -/** A {@link Mixin} for setting and getting the header text. */ -public class HeaderMixin implements Mixin { - - private final TemplateLayout templateLayout; - - /** - * @param layout The layout this Mixin belongs to. - * @param attrs XML attributes given to the layout. - * @param defStyleAttr The default style attribute as given to the constructor of the layout. - */ - public HeaderMixin( - @NonNull TemplateLayout layout, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) { - templateLayout = layout; - - final TypedArray a = - layout - .getContext() - .obtainStyledAttributes(attrs, R.styleable.SuwHeaderMixin, defStyleAttr, 0); - - // Set the header text - final CharSequence headerText = a.getText(R.styleable.SuwHeaderMixin_suwHeaderText); - if (headerText != null) { - setText(headerText); - } - - a.recycle(); - } - - /** @return The TextView displaying the header. */ - public TextView getTextView() { - return (TextView) templateLayout.findManagedViewById(R.id.suw_layout_title); - } - - /** - * Sets the header text. This can also be set via the XML attribute {@code app:suwHeaderText}. - * - * @param title The resource ID of the text to be set as header. - */ - public void setText(int title) { - final TextView titleView = getTextView(); - if (titleView != null) { - titleView.setText(title); - } - } - - /** - * Sets the header text. This can also be set via the XML attribute {@code app:suwHeaderText}. - * - * @param title The text to be set as header. - */ - public void setText(CharSequence title) { - final TextView titleView = getTextView(); - if (titleView != null) { - titleView.setText(title); - } - } - - /** @return The current header text. */ - public CharSequence getText() { - final TextView titleView = getTextView(); - return titleView != null ? titleView.getText() : null; - } -} diff --git a/main/src/com/google/android/setupdesign/template/IconMixin.java b/main/src/com/google/android/setupdesign/template/IconMixin.java deleted file mode 100644 index 7627132..0000000 --- a/main/src/com/google/android/setupdesign/template/IconMixin.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.setupdesign.template; - -import android.content.Context; -import android.content.res.TypedArray; -import android.graphics.drawable.Drawable; -import androidx.annotation.DrawableRes; -import android.util.AttributeSet; -import android.view.View; -import android.widget.ImageView; -import com.google.android.setupcompat.TemplateLayout; -import com.google.android.setupcompat.template.Mixin; -import com.google.android.setupdesign.R; - -/** A {@link Mixin} for setting an icon on the template layout. */ -public class IconMixin implements Mixin { - - private final TemplateLayout templateLayout; - - /** - * @param layout The template layout that this Mixin is a part of. - * @param attrs XML attributes given to the layout. - * @param defStyleAttr The default style attribute as given to the constructor of the layout. - */ - public IconMixin(TemplateLayout layout, AttributeSet attrs, int defStyleAttr) { - templateLayout = layout; - final Context context = layout.getContext(); - - final TypedArray a = - context.obtainStyledAttributes(attrs, R.styleable.SuwIconMixin, defStyleAttr, 0); - - final @DrawableRes int icon = a.getResourceId(R.styleable.SuwIconMixin_android_icon, 0); - if (icon != 0) { - setIcon(icon); - } - - a.recycle(); - } - - /** - * Sets the icon on this layout. The icon can also be set in XML using {@code android:icon}. - * - * @param icon A drawable icon. - */ - public void setIcon(Drawable icon) { - final ImageView iconView = getView(); - if (iconView != null) { - iconView.setImageDrawable(icon); - iconView.setVisibility(icon != null ? View.VISIBLE : View.GONE); - } - } - - /** - * Sets the icon on this layout. The icon can also be set in XML using {@code android:icon}. - * - * @param icon A drawable icon resource. - */ - public void setIcon(@DrawableRes int icon) { - final ImageView iconView = getView(); - if (iconView != null) { - // Note: setImageResource on the ImageView is overridden in AppCompatImageView for - // support lib users, which enables vector drawable compat to work on versions pre-L. - iconView.setImageResource(icon); - iconView.setVisibility(icon != 0 ? View.VISIBLE : View.GONE); - } - } - - /** @return The icon previously set in {@link #setIcon(Drawable)} or {@code android:icon} */ - public Drawable getIcon() { - final ImageView iconView = getView(); - return iconView != null ? iconView.getDrawable() : null; - } - - /** Sets the content description of the icon view */ - public void setContentDescription(CharSequence description) { - final ImageView iconView = getView(); - if (iconView != null) { - iconView.setContentDescription(description); - } - } - - /** @return The content description of the icon view */ - public CharSequence getContentDescription() { - final ImageView iconView = getView(); - return iconView != null ? iconView.getContentDescription() : null; - } - - /** @return The ImageView responsible for displaying the icon. */ - protected ImageView getView() { - return (ImageView) templateLayout.findManagedViewById(R.id.suw_layout_icon); - } -} diff --git a/main/src/com/google/android/setupdesign/template/ListMixin.java b/main/src/com/google/android/setupdesign/template/ListMixin.java index 99ca7c8..012fb86 100644 --- a/main/src/com/google/android/setupdesign/template/ListMixin.java +++ b/main/src/com/google/android/setupdesign/template/ListMixin.java @@ -57,20 +57,20 @@ public class ListMixin implements Mixin { final Context context = layout.getContext(); final TypedArray a = - context.obtainStyledAttributes(attrs, R.styleable.SuwListMixin, defStyleAttr, 0); + context.obtainStyledAttributes(attrs, R.styleable.SudListMixin, defStyleAttr, 0); - final int entries = a.getResourceId(R.styleable.SuwListMixin_android_entries, 0); + final int entries = a.getResourceId(R.styleable.SudListMixin_android_entries, 0); if (entries != 0) { final ItemGroup inflated = (ItemGroup) new ItemInflater(context).inflate(entries); setAdapter(new ItemAdapter(inflated)); } - int dividerInset = a.getDimensionPixelSize(R.styleable.SuwListMixin_suwDividerInset, -1); + int dividerInset = a.getDimensionPixelSize(R.styleable.SudListMixin_sudDividerInset, -1); if (dividerInset != -1) { setDividerInset(dividerInset); } else { int dividerInsetStart = - a.getDimensionPixelSize(R.styleable.SuwListMixin_suwDividerInsetStart, 0); - int dividerInsetEnd = a.getDimensionPixelSize(R.styleable.SuwListMixin_suwDividerInsetEnd, 0); + a.getDimensionPixelSize(R.styleable.SudListMixin_sudDividerInsetStart, 0); + int dividerInsetEnd = a.getDimensionPixelSize(R.styleable.SudListMixin_sudDividerInsetEnd, 0); setDividerInsets(dividerInsetStart, dividerInsetEnd); } a.recycle(); @@ -145,8 +145,8 @@ public class ListMixin implements Mixin { * theme and apply insets to it. * * @param start The number of pixels to inset on the "start" side of the list divider. Typically - * this will be either {@code @dimen/suw_items_glif_icon_divider_inset} or - * {@code @dimen/suw_items_glif_text_divider_inset}. + * this will be either {@code @dimen/sud_items_glif_icon_divider_inset} or + * {@code @dimen/sud_items_glif_text_divider_inset}. * @param end The number of pixels to inset on the "end" side of the list divider. */ public void setDividerInsets(int start, int end) { diff --git a/main/src/com/google/android/setupdesign/template/NavigationBarMixin.java b/main/src/com/google/android/setupdesign/template/NavigationBarMixin.java index f9e29ed..3ef9a34 100644 --- a/main/src/com/google/android/setupdesign/template/NavigationBarMixin.java +++ b/main/src/com/google/android/setupdesign/template/NavigationBarMixin.java @@ -38,7 +38,7 @@ public class NavigationBarMixin implements Mixin { * navigation bar. */ public NavigationBar getNavigationBar() { - final View view = templateLayout.findManagedViewById(R.id.suw_layout_navigation_bar); + final View view = templateLayout.findManagedViewById(R.id.sud_layout_navigation_bar); return view instanceof NavigationBar ? (NavigationBar) view : null; } diff --git a/main/src/com/google/android/setupdesign/template/ProgressBarMixin.java b/main/src/com/google/android/setupdesign/template/ProgressBarMixin.java index 61b9e86..717fd57 100644 --- a/main/src/com/google/android/setupdesign/template/ProgressBarMixin.java +++ b/main/src/com/google/android/setupdesign/template/ProgressBarMixin.java @@ -41,7 +41,7 @@ public class ProgressBarMixin implements Mixin { /** @return True if the progress bar is currently shown. */ public boolean isShown() { - final View progressBar = templateLayout.findManagedViewById(R.id.suw_layout_progress); + final View progressBar = templateLayout.findManagedViewById(R.id.sud_layout_progress); return progressBar != null && progressBar.getVisibility() == View.VISIBLE; } @@ -76,7 +76,7 @@ public class ProgressBarMixin implements Mixin { final View progressBar = peekProgressBar(); if (progressBar == null) { final ViewStub progressBarStub = - (ViewStub) templateLayout.findManagedViewById(R.id.suw_layout_progress_stub); + (ViewStub) templateLayout.findManagedViewById(R.id.sud_layout_progress_stub); if (progressBarStub != null) { progressBarStub.inflate(); } @@ -94,7 +94,7 @@ public class ProgressBarMixin implements Mixin { * or if the template does not contain a progress bar. */ public ProgressBar peekProgressBar() { - return (ProgressBar) templateLayout.findManagedViewById(R.id.suw_layout_progress); + return (ProgressBar) templateLayout.findManagedViewById(R.id.sud_layout_progress); } /** Sets the color of the indeterminate progress bar. This method is a no-op on SDK < 21. */ diff --git a/main/src/com/google/android/setupdesign/template/RecyclerMixin.java b/main/src/com/google/android/setupdesign/template/RecyclerMixin.java index b1809e8..e523dbc 100644 --- a/main/src/com/google/android/setupdesign/template/RecyclerMixin.java +++ b/main/src/com/google/android/setupdesign/template/RecyclerMixin.java @@ -100,23 +100,23 @@ public class RecyclerMixin implements Mixin { public void parseAttributes(@Nullable AttributeSet attrs, int defStyleAttr) { final Context context = templateLayout.getContext(); final TypedArray a = - context.obtainStyledAttributes(attrs, R.styleable.SuwRecyclerMixin, defStyleAttr, 0); + context.obtainStyledAttributes(attrs, R.styleable.SudRecyclerMixin, defStyleAttr, 0); - final int entries = a.getResourceId(R.styleable.SuwRecyclerMixin_android_entries, 0); + final int entries = a.getResourceId(R.styleable.SudRecyclerMixin_android_entries, 0); if (entries != 0) { final ItemHierarchy inflated = new ItemInflater(context).inflate(entries); final RecyclerItemAdapter adapter = new RecyclerItemAdapter(inflated); - adapter.setHasStableIds(a.getBoolean(R.styleable.SuwRecyclerMixin_suwHasStableIds, false)); + adapter.setHasStableIds(a.getBoolean(R.styleable.SudRecyclerMixin_sudHasStableIds, false)); setAdapter(adapter); } - int dividerInset = a.getDimensionPixelSize(R.styleable.SuwRecyclerMixin_suwDividerInset, -1); + int dividerInset = a.getDimensionPixelSize(R.styleable.SudRecyclerMixin_sudDividerInset, -1); if (dividerInset != -1) { setDividerInset(dividerInset); } else { int dividerInsetStart = - a.getDimensionPixelSize(R.styleable.SuwRecyclerMixin_suwDividerInsetStart, 0); + a.getDimensionPixelSize(R.styleable.SudRecyclerMixin_sudDividerInsetStart, 0); int dividerInsetEnd = - a.getDimensionPixelSize(R.styleable.SuwRecyclerMixin_suwDividerInsetEnd, 0); + a.getDimensionPixelSize(R.styleable.SudRecyclerMixin_sudDividerInsetEnd, 0); setDividerInsets(dividerInsetStart, dividerInsetEnd); } @@ -124,7 +124,7 @@ public class RecyclerMixin implements Mixin { } /** - * @return The recycler view contained in the layout, as marked by {@code @id/suw_recycler_view}. + * @return The recycler view contained in the layout, as marked by {@code @id/sud_recycler_view}. * This will return {@code null} if the recycler view doesn't exist in the layout. */ @SuppressWarnings("NullableProblems") // If clients guarantee that the template has a recycler @@ -187,8 +187,8 @@ public class RecyclerMixin implements Mixin { * theme and apply insets to it. * * @param start The number of pixels to inset on the "start" side of the list divider. Typically - * this will be either {@code @dimen/suw_items_glif_icon_divider_inset} or - * {@code @dimen/suw_items_glif_text_divider_inset}. + * this will be either {@code @dimen/sud_items_glif_icon_divider_inset} or + * {@code @dimen/sud_items_glif_text_divider_inset}. * @param end The number of pixels to inset on the "end" side of the list divider. */ public void setDividerInsets(int start, int end) { diff --git a/main/src/com/google/android/setupdesign/util/Partner.java b/main/src/com/google/android/setupdesign/util/Partner.java index d335490..b35237c 100644 --- a/main/src/com/google/android/setupdesign/util/Partner.java +++ b/main/src/com/google/android/setupdesign/util/Partner.java @@ -45,7 +45,7 @@ import java.util.List; */ public class Partner { - private static final String TAG = "(SUW) Partner"; + private static final String TAG = "(setupdesign) Partner"; /** Marker action used to discover partner. */ private static final String ACTION_PARTNER_CUSTOMIZATION = diff --git a/main/src/com/google/android/setupdesign/util/ThemeResolver.java b/main/src/com/google/android/setupdesign/util/ThemeResolver.java index 2870af9..d0264e0 100644 --- a/main/src/com/google/android/setupdesign/util/ThemeResolver.java +++ b/main/src/com/google/android/setupdesign/util/ThemeResolver.java @@ -53,7 +53,7 @@ public class ThemeResolver { if (defaultResolver == null) { defaultResolver = new ThemeResolver.Builder() - .setDefaultTheme(R.style.SuwThemeGlif_DayNight) + .setDefaultTheme(R.style.SudThemeGlif_DayNight) .setUseDayNight(true) .build(); } @@ -114,7 +114,7 @@ public class ThemeResolver { * Returns the corresponding DayNight theme resource ID for the given string theme. DayNight * themes are themes that will be either light or dark depending on the system setting. For * example, the string {@link ThemeHelper#THEME_GLIF_LIGHT} will return - * {@code @style/SuwThemeGlif.DayNight}. + * {@code @style/SudThemeGlif.DayNight}. */ @StyleRes private static int getDayNightThemeRes(@Nullable String theme) { @@ -122,16 +122,16 @@ public class ThemeResolver { switch (theme) { case ThemeHelper.THEME_GLIF_V3_LIGHT: case ThemeHelper.THEME_GLIF_V3: - return R.style.SuwThemeGlifV3_DayNight; + return R.style.SudThemeGlifV3_DayNight; case ThemeHelper.THEME_GLIF_V2_LIGHT: case ThemeHelper.THEME_GLIF_V2: - return R.style.SuwThemeGlifV2_DayNight; + return R.style.SudThemeGlifV2_DayNight; case ThemeHelper.THEME_GLIF_LIGHT: case ThemeHelper.THEME_GLIF: - return R.style.SuwThemeGlif_DayNight; + return R.style.SudThemeGlif_DayNight; case ThemeHelper.THEME_MATERIAL_LIGHT: case ThemeHelper.THEME_MATERIAL: - return R.style.SuwThemeMaterial_DayNight; + return R.style.SudThemeMaterial_DayNight; default: // fall through } @@ -141,28 +141,28 @@ public class ThemeResolver { /** * Returns the theme resource ID for the given string theme. For example, the string {@link - * ThemeHelper#THEME_GLIF_LIGHT} will return {@code @style/SuwThemeGlif.Light}. + * ThemeHelper#THEME_GLIF_LIGHT} will return {@code @style/SudThemeGlif.Light}. */ @StyleRes private static int getThemeRes(@Nullable String theme) { if (theme != null) { switch (theme) { case ThemeHelper.THEME_GLIF_V3_LIGHT: - return R.style.SuwThemeGlifV3_Light; + return R.style.SudThemeGlifV3_Light; case ThemeHelper.THEME_GLIF_V3: - return R.style.SuwThemeGlifV3; + return R.style.SudThemeGlifV3; case ThemeHelper.THEME_GLIF_V2_LIGHT: - return R.style.SuwThemeGlifV2_Light; + return R.style.SudThemeGlifV2_Light; case ThemeHelper.THEME_GLIF_V2: - return R.style.SuwThemeGlifV2; + return R.style.SudThemeGlifV2; case ThemeHelper.THEME_GLIF_LIGHT: - return R.style.SuwThemeGlif_Light; + return R.style.SudThemeGlif_Light; case ThemeHelper.THEME_GLIF: - return R.style.SuwThemeGlif; + return R.style.SudThemeGlif; case ThemeHelper.THEME_MATERIAL_LIGHT: - return R.style.SuwThemeMaterial_Light; + return R.style.SudThemeMaterial_Light; case ThemeHelper.THEME_MATERIAL: - return R.style.SuwThemeMaterial; + return R.style.SudThemeMaterial; default: // fall through } @@ -203,7 +203,7 @@ public class ThemeResolver { /** Builder class for {@link ThemeResolver}. */ public static class Builder { - @StyleRes private int defaultTheme = R.style.SuwThemeGlif_DayNight; + @StyleRes private int defaultTheme = R.style.SudThemeGlif_DayNight; @Nullable private String oldestSupportedTheme = null; private boolean useDayNight = true; diff --git a/main/src/com/google/android/setupdesign/view/ButtonBarLayout.java b/main/src/com/google/android/setupdesign/view/ButtonBarLayout.java index add436a..c3188f2 100644 --- a/main/src/com/google/android/setupdesign/view/ButtonBarLayout.java +++ b/main/src/com/google/android/setupdesign/view/ButtonBarLayout.java @@ -84,10 +84,10 @@ public class ButtonBarLayout extends LinearLayout { View child = getChildAt(i); LayoutParams childParams = (LayoutParams) child.getLayoutParams(); if (stacked) { - child.setTag(R.id.suw_original_weight, childParams.weight); + child.setTag(R.id.sud_original_weight, childParams.weight); childParams.weight = 0; } else { - Float weight = (Float) child.getTag(R.id.suw_original_weight); + Float weight = (Float) child.getTag(R.id.sud_original_weight); if (weight != null) { childParams.weight = weight; } diff --git a/main/src/com/google/android/setupdesign/view/FillContentLayout.java b/main/src/com/google/android/setupdesign/view/FillContentLayout.java index d11333b..49e195f 100644 --- a/main/src/com/google/android/setupdesign/view/FillContentLayout.java +++ b/main/src/com/google/android/setupdesign/view/FillContentLayout.java @@ -49,7 +49,7 @@ public class FillContentLayout extends FrameLayout { } public FillContentLayout(Context context, AttributeSet attrs) { - this(context, attrs, R.attr.suwFillContentLayoutStyle); + this(context, attrs, R.attr.sudFillContentLayoutStyle); } public FillContentLayout(Context context, AttributeSet attrs, int defStyleAttr) { @@ -59,10 +59,10 @@ public class FillContentLayout extends FrameLayout { private void init(Context context, AttributeSet attrs, int defStyleAttr) { TypedArray a = - context.obtainStyledAttributes(attrs, R.styleable.SuwFillContentLayout, defStyleAttr, 0); + context.obtainStyledAttributes(attrs, R.styleable.SudFillContentLayout, defStyleAttr, 0); - maxHeight = a.getDimensionPixelSize(R.styleable.SuwFillContentLayout_android_maxHeight, -1); - maxWidth = a.getDimensionPixelSize(R.styleable.SuwFillContentLayout_android_maxWidth, -1); + maxHeight = a.getDimensionPixelSize(R.styleable.SudFillContentLayout_android_maxHeight, -1); + maxWidth = a.getDimensionPixelSize(R.styleable.SudFillContentLayout_android_maxWidth, -1); a.recycle(); } diff --git a/main/src/com/google/android/setupdesign/view/HeaderRecyclerView.java b/main/src/com/google/android/setupdesign/view/HeaderRecyclerView.java index c5f2593..0e40875 100644 --- a/main/src/com/google/android/setupdesign/view/HeaderRecyclerView.java +++ b/main/src/com/google/android/setupdesign/view/HeaderRecyclerView.java @@ -31,7 +31,7 @@ import com.google.android.setupdesign.R; /** * A RecyclerView that can display a header item at the start of the list. The header can be set by - * {@code app:suwHeader} in XML. Note that the header will not be inflated until a layout manager is + * {@code app:sudHeader} in XML. Note that the header will not be inflated until a layout manager is * set. */ public class HeaderRecyclerView extends RecyclerView { @@ -219,8 +219,8 @@ public class HeaderRecyclerView extends RecyclerView { private void init(AttributeSet attrs, int defStyleAttr) { final TypedArray a = getContext() - .obtainStyledAttributes(attrs, R.styleable.SuwHeaderRecyclerView, defStyleAttr, 0); - headerRes = a.getResourceId(R.styleable.SuwHeaderRecyclerView_suwHeader, 0); + .obtainStyledAttributes(attrs, R.styleable.SudHeaderRecyclerView, defStyleAttr, 0); + headerRes = a.getResourceId(R.styleable.SudHeaderRecyclerView_sudHeader, 0); a.recycle(); } diff --git a/main/src/com/google/android/setupdesign/view/Illustration.java b/main/src/com/google/android/setupdesign/view/Illustration.java index 2b4924e..14072db 100644 --- a/main/src/com/google/android/setupdesign/view/Illustration.java +++ b/main/src/com/google/android/setupdesign/view/Illustration.java @@ -72,8 +72,8 @@ public class Illustration extends FrameLayout { private void init(AttributeSet attrs, int defStyleAttr) { if (attrs != null) { TypedArray a = - getContext().obtainStyledAttributes(attrs, R.styleable.SuwIllustration, defStyleAttr, 0); - aspectRatio = a.getFloat(R.styleable.SuwIllustration_suwAspectRatio, 0.0f); + getContext().obtainStyledAttributes(attrs, R.styleable.SudIllustration, defStyleAttr, 0); + aspectRatio = a.getFloat(R.styleable.SudIllustration_sudAspectRatio, 0.0f); a.recycle(); } // Number of pixels of the 8dp baseline grid as defined in material design specs diff --git a/main/src/com/google/android/setupdesign/view/IllustrationVideoView.java b/main/src/com/google/android/setupdesign/view/IllustrationVideoView.java index 91743c7..928fe92 100644 --- a/main/src/com/google/android/setupdesign/view/IllustrationVideoView.java +++ b/main/src/com/google/android/setupdesign/view/IllustrationVideoView.java @@ -44,8 +44,8 @@ import java.io.IOException; * A view for displaying videos in a continuous loop (without audio). This is typically used for * animated illustrations. * - * <p>The video can be specified using {@code app:suwVideo}, specifying the raw resource to the mp4 - * video. Optionally, {@code app:suwLoopStartMs} can be used to specify which part of the video it + * <p>The video can be specified using {@code app:sudVideo}, specifying the raw resource to the mp4 + * video. Optionally, {@code app:sudLoopStartMs} can be used to specify which part of the video it * should loop back to * * <p>For optimal file size, use avconv or other video compression tool to remove the unused audio @@ -79,8 +79,8 @@ public class IllustrationVideoView extends TextureView public IllustrationVideoView(Context context, AttributeSet attrs) { super(context, attrs); final TypedArray a = - context.obtainStyledAttributes(attrs, R.styleable.SuwIllustrationVideoView); - final int videoResId = a.getResourceId(R.styleable.SuwIllustrationVideoView_suwVideo, 0); + context.obtainStyledAttributes(attrs, R.styleable.SudIllustrationVideoView); + final int videoResId = a.getResourceId(R.styleable.SudIllustrationVideoView_sudVideo, 0); a.recycle(); setVideoResource(videoResId); diff --git a/main/src/com/google/android/setupdesign/view/IntrinsicSizeFrameLayout.java b/main/src/com/google/android/setupdesign/view/IntrinsicSizeFrameLayout.java index 926f3c9..f714205 100644 --- a/main/src/com/google/android/setupdesign/view/IntrinsicSizeFrameLayout.java +++ b/main/src/com/google/android/setupdesign/view/IntrinsicSizeFrameLayout.java @@ -56,11 +56,11 @@ public class IntrinsicSizeFrameLayout extends FrameLayout { private void init(Context context, AttributeSet attrs, int defStyleAttr) { final TypedArray a = context.obtainStyledAttributes( - attrs, R.styleable.SuwIntrinsicSizeFrameLayout, defStyleAttr, 0); + attrs, R.styleable.SudIntrinsicSizeFrameLayout, defStyleAttr, 0); intrinsicHeight = - a.getDimensionPixelSize(R.styleable.SuwIntrinsicSizeFrameLayout_android_height, 0); + a.getDimensionPixelSize(R.styleable.SudIntrinsicSizeFrameLayout_android_height, 0); intrinsicWidth = - a.getDimensionPixelSize(R.styleable.SuwIntrinsicSizeFrameLayout_android_width, 0); + a.getDimensionPixelSize(R.styleable.SudIntrinsicSizeFrameLayout_android_width, 0); a.recycle(); } diff --git a/main/src/com/google/android/setupdesign/view/NavigationBar.java b/main/src/com/google/android/setupdesign/view/NavigationBar.java index ac0f8c8..9d978f0 100644 --- a/main/src/com/google/android/setupdesign/view/NavigationBar.java +++ b/main/src/com/google/android/setupdesign/view/NavigationBar.java @@ -50,16 +50,16 @@ public class NavigationBar extends LinearLayout implements View.OnClickListener private static int getNavbarTheme(Context context) { // Normally we can automatically guess the theme by comparing the foreground color against - // the background color. But we also allow specifying explicitly using suwNavBarTheme. + // the background color. But we also allow specifying explicitly using sudNavBarTheme. TypedArray attributes = context.obtainStyledAttributes( new int[] { - R.attr.suwNavBarTheme, android.R.attr.colorForeground, android.R.attr.colorBackground + R.attr.sudNavBarTheme, android.R.attr.colorForeground, android.R.attr.colorBackground }); - @StyleableRes int suwNavBarTheme = 0; + @StyleableRes int navBarTheme = 0; @StyleableRes int colorForeground = 1; @StyleableRes int colorBackground = 2; - int theme = attributes.getResourceId(suwNavBarTheme, 0); + int theme = attributes.getResourceId(navBarTheme, 0); if (theme == 0) { // Compare the value of the foreground against the background color to see if current // theme is light-on-dark or dark-on-light. @@ -68,7 +68,7 @@ public class NavigationBar extends LinearLayout implements View.OnClickListener Color.colorToHSV(attributes.getColor(colorForeground, 0), foregroundHsv); Color.colorToHSV(attributes.getColor(colorBackground, 0), backgroundHsv); boolean isDarkBg = foregroundHsv[2] > backgroundHsv[2]; - theme = isDarkBg ? R.style.SuwNavBarThemeDark : R.style.SuwNavBarThemeLight; + theme = isDarkBg ? R.style.SudNavBarThemeDark : R.style.SudNavBarThemeLight; } attributes.recycle(); return theme; @@ -104,9 +104,9 @@ public class NavigationBar extends LinearLayout implements View.OnClickListener // available in LinearLayout before v11, so call super with the exact same arguments. private void init() { View.inflate(getContext(), R.layout.sud_navbar_view, this); - nextButton = (Button) findViewById(R.id.suw_navbar_next); - backButton = (Button) findViewById(R.id.suw_navbar_back); - moreButton = (Button) findViewById(R.id.suw_navbar_more); + nextButton = (Button) findViewById(R.id.sud_navbar_next); + backButton = (Button) findViewById(R.id.sud_navbar_back); + moreButton = (Button) findViewById(R.id.sud_navbar_more); } public Button getBackButton() { diff --git a/main/src/com/google/android/setupdesign/view/StickyHeaderListView.java b/main/src/com/google/android/setupdesign/view/StickyHeaderListView.java index d5fef1a..3efb85c 100644 --- a/main/src/com/google/android/setupdesign/view/StickyHeaderListView.java +++ b/main/src/com/google/android/setupdesign/view/StickyHeaderListView.java @@ -75,8 +75,8 @@ public class StickyHeaderListView extends ListView { private void init(AttributeSet attrs, int defStyleAttr) { final TypedArray a = getContext() - .obtainStyledAttributes(attrs, R.styleable.SuwStickyHeaderListView, defStyleAttr, 0); - int headerResId = a.getResourceId(R.styleable.SuwStickyHeaderListView_suwHeader, 0); + .obtainStyledAttributes(attrs, R.styleable.SudStickyHeaderListView, defStyleAttr, 0); + int headerResId = a.getResourceId(R.styleable.SudStickyHeaderListView_sudHeader, 0); if (headerResId != 0) { LayoutInflater inflater = LayoutInflater.from(getContext()); View header = inflater.inflate(headerResId, this, false); |