summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorSetup Wizard Team <android-setup-team-eng@google.com>2018-12-20 15:49:19 +0800
committercnchen <cnchen@google.com>2018-12-21 10:26:07 +0800
commit545407a543787b20ff37e59c1bff7ce03e584a4b (patch)
tree073ab22cb468f480b4ba83c75ffd1d856ac12343 /main/src
parent266fef694f77328f3698d6d40fd48d4e29831dc4 (diff)
downloadsetupdesign-545407a543787b20ff37e59c1bff7ce03e584a4b.tar.gz
Import updated Android Setupdesign Library 226288747
Test: mm , manually test PixelSetupWizard.apk PiperOrigin-RevId: 226288747 Change-Id: I0b3d023cc770bf9ce13a3127fbc1c8a6919f888b
Diffstat (limited to 'main/src')
-rw-r--r--main/src/com/google/android/setupdesign/GlifLayout.java2
-rw-r--r--main/src/com/google/android/setupdesign/GlifListLayout.java2
-rw-r--r--main/src/com/google/android/setupdesign/GlifPreferenceLayout.java4
-rw-r--r--main/src/com/google/android/setupdesign/GlifRecyclerLayout.java2
-rw-r--r--main/src/com/google/android/setupdesign/SetupWizardLayout.java2
-rw-r--r--main/src/com/google/android/setupdesign/SetupWizardListLayout.java2
-rw-r--r--main/src/com/google/android/setupdesign/SetupWizardPreferenceLayout.java4
-rw-r--r--main/src/com/google/android/setupdesign/SetupWizardRecyclerLayout.java2
-rw-r--r--main/src/com/google/android/setupdesign/gesture/ConsecutiveTapsGestureDetector.java12
-rw-r--r--main/src/com/google/android/setupdesign/items/ButtonBarItem.java2
-rw-r--r--main/src/com/google/android/setupdesign/items/ButtonItem.java2
-rw-r--r--main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java4
-rw-r--r--main/src/com/google/android/setupdesign/items/Item.java2
-rw-r--r--main/src/com/google/android/setupdesign/items/SwitchItem.java6
-rw-r--r--main/src/com/google/android/setupdesign/view/NavigationBar.java2
15 files changed, 30 insertions, 20 deletions
diff --git a/main/src/com/google/android/setupdesign/GlifLayout.java b/main/src/com/google/android/setupdesign/GlifLayout.java
index 3a75d02..d3a7354 100644
--- a/main/src/com/google/android/setupdesign/GlifLayout.java
+++ b/main/src/com/google/android/setupdesign/GlifLayout.java
@@ -138,7 +138,7 @@ public class GlifLayout extends PartnerCustomizationLayout {
@Override
protected View onInflateTemplate(LayoutInflater inflater, @LayoutRes int template) {
if (template == 0) {
- template = R.layout.suw_glif_template;
+ template = R.layout.sud_glif_template;
}
return inflateTemplate(inflater, R.style.SuwThemeGlif_Light, template);
}
diff --git a/main/src/com/google/android/setupdesign/GlifListLayout.java b/main/src/com/google/android/setupdesign/GlifListLayout.java
index 2232476..c5a78f3 100644
--- a/main/src/com/google/android/setupdesign/GlifListLayout.java
+++ b/main/src/com/google/android/setupdesign/GlifListLayout.java
@@ -80,7 +80,7 @@ public class GlifListLayout extends GlifLayout {
@Override
protected View onInflateTemplate(LayoutInflater inflater, int template) {
if (template == 0) {
- template = R.layout.suw_glif_list_template;
+ template = R.layout.sud_glif_list_template;
}
return super.onInflateTemplate(inflater, template);
}
diff --git a/main/src/com/google/android/setupdesign/GlifPreferenceLayout.java b/main/src/com/google/android/setupdesign/GlifPreferenceLayout.java
index 5121e86..5947644 100644
--- a/main/src/com/google/android/setupdesign/GlifPreferenceLayout.java
+++ b/main/src/com/google/android/setupdesign/GlifPreferenceLayout.java
@@ -98,7 +98,7 @@ public class GlifPreferenceLayout extends GlifRecyclerLayout {
@Override
protected View onInflateTemplate(LayoutInflater inflater, int template) {
if (template == 0) {
- template = R.layout.suw_glif_preference_template;
+ template = R.layout.sud_glif_preference_template;
}
return super.onInflateTemplate(inflater, template);
}
@@ -109,7 +109,7 @@ public class GlifPreferenceLayout extends GlifRecyclerLayout {
// immediately.
final LayoutInflater inflater = LayoutInflater.from(getContext());
RecyclerView recyclerView =
- (RecyclerView) inflater.inflate(R.layout.suw_glif_preference_recycler_view, this, false);
+ (RecyclerView) inflater.inflate(R.layout.sud_glif_preference_recycler_view, this, false);
recyclerMixin = new RecyclerMixin(this, recyclerView);
}
}
diff --git a/main/src/com/google/android/setupdesign/GlifRecyclerLayout.java b/main/src/com/google/android/setupdesign/GlifRecyclerLayout.java
index ac7d7e5..c62ac85 100644
--- a/main/src/com/google/android/setupdesign/GlifRecyclerLayout.java
+++ b/main/src/com/google/android/setupdesign/GlifRecyclerLayout.java
@@ -81,7 +81,7 @@ public class GlifRecyclerLayout extends GlifLayout {
@Override
protected View onInflateTemplate(LayoutInflater inflater, int template) {
if (template == 0) {
- template = R.layout.suw_glif_recycler_template;
+ template = R.layout.sud_glif_recycler_template;
}
return super.onInflateTemplate(inflater, template);
}
diff --git a/main/src/com/google/android/setupdesign/SetupWizardLayout.java b/main/src/com/google/android/setupdesign/SetupWizardLayout.java
index 608646a..a90b839 100644
--- a/main/src/com/google/android/setupdesign/SetupWizardLayout.java
+++ b/main/src/com/google/android/setupdesign/SetupWizardLayout.java
@@ -168,7 +168,7 @@ public class SetupWizardLayout extends TemplateLayout {
@Override
protected View onInflateTemplate(LayoutInflater inflater, int template) {
if (template == 0) {
- template = R.layout.suw_template;
+ template = R.layout.sud_template;
}
return inflateTemplate(inflater, R.style.SuwThemeMaterial_Light, template);
}
diff --git a/main/src/com/google/android/setupdesign/SetupWizardListLayout.java b/main/src/com/google/android/setupdesign/SetupWizardListLayout.java
index 38358d9..ad05735 100644
--- a/main/src/com/google/android/setupdesign/SetupWizardListLayout.java
+++ b/main/src/com/google/android/setupdesign/SetupWizardListLayout.java
@@ -70,7 +70,7 @@ public class SetupWizardListLayout extends SetupWizardLayout {
@Override
protected View onInflateTemplate(LayoutInflater inflater, int template) {
if (template == 0) {
- template = R.layout.suw_list_template;
+ template = R.layout.sud_list_template;
}
return super.onInflateTemplate(inflater, template);
}
diff --git a/main/src/com/google/android/setupdesign/SetupWizardPreferenceLayout.java b/main/src/com/google/android/setupdesign/SetupWizardPreferenceLayout.java
index e4d38c6..fe6c5a2 100644
--- a/main/src/com/google/android/setupdesign/SetupWizardPreferenceLayout.java
+++ b/main/src/com/google/android/setupdesign/SetupWizardPreferenceLayout.java
@@ -97,7 +97,7 @@ public class SetupWizardPreferenceLayout extends SetupWizardRecyclerLayout {
@Override
protected View onInflateTemplate(LayoutInflater inflater, int template) {
if (template == 0) {
- template = R.layout.suw_preference_template;
+ template = R.layout.sud_preference_template;
}
return super.onInflateTemplate(inflater, template);
}
@@ -108,7 +108,7 @@ public class SetupWizardPreferenceLayout extends SetupWizardRecyclerLayout {
// immediately.
final LayoutInflater inflater = LayoutInflater.from(getContext());
RecyclerView recyclerView =
- (RecyclerView) inflater.inflate(R.layout.suw_preference_recycler_view, this, false);
+ (RecyclerView) inflater.inflate(R.layout.sud_preference_recycler_view, this, false);
recyclerMixin = new RecyclerMixin(this, recyclerView);
}
}
diff --git a/main/src/com/google/android/setupdesign/SetupWizardRecyclerLayout.java b/main/src/com/google/android/setupdesign/SetupWizardRecyclerLayout.java
index 4313123..7808c4c 100644
--- a/main/src/com/google/android/setupdesign/SetupWizardRecyclerLayout.java
+++ b/main/src/com/google/android/setupdesign/SetupWizardRecyclerLayout.java
@@ -100,7 +100,7 @@ public class SetupWizardRecyclerLayout extends SetupWizardLayout {
@Override
protected View onInflateTemplate(LayoutInflater inflater, int template) {
if (template == 0) {
- template = R.layout.suw_recycler_template;
+ template = R.layout.sud_recycler_template;
}
return super.onInflateTemplate(inflater, template);
}
diff --git a/main/src/com/google/android/setupdesign/gesture/ConsecutiveTapsGestureDetector.java b/main/src/com/google/android/setupdesign/gesture/ConsecutiveTapsGestureDetector.java
index 7ecae0e..c14e6de 100644
--- a/main/src/com/google/android/setupdesign/gesture/ConsecutiveTapsGestureDetector.java
+++ b/main/src/com/google/android/setupdesign/gesture/ConsecutiveTapsGestureDetector.java
@@ -47,11 +47,21 @@ public final class ConsecutiveTapsGestureDetector {
* @param view The target view that associated with consecutive-tap gesture.
*/
public ConsecutiveTapsGestureDetector(OnConsecutiveTapsListener listener, View view) {
+ this(listener, view, ViewConfiguration.getDoubleTapTimeout());
+ }
+
+ /**
+ * @param listener The listener that responds to the gesture.
+ * @param view The target view that associated with consecutive-tap gesture.
+ * @param consecutiveTapTimeout Maximum time in millis between two consecutive taps.
+ */
+ public ConsecutiveTapsGestureDetector(
+ OnConsecutiveTapsListener listener, View view, int consecutiveTapTimeout) {
this.listener = listener;
this.view = view;
+ this.consecutiveTapTimeout = consecutiveTapTimeout;
int doubleTapSlop = ViewConfiguration.get(this.view.getContext()).getScaledDoubleTapSlop();
consecutiveTapTouchSlopSquare = doubleTapSlop * doubleTapSlop;
- consecutiveTapTimeout = ViewConfiguration.getDoubleTapTimeout();
}
/**
diff --git a/main/src/com/google/android/setupdesign/items/ButtonBarItem.java b/main/src/com/google/android/setupdesign/items/ButtonBarItem.java
index f6b3f89..77d06d0 100644
--- a/main/src/com/google/android/setupdesign/items/ButtonBarItem.java
+++ b/main/src/com/google/android/setupdesign/items/ButtonBarItem.java
@@ -71,7 +71,7 @@ public class ButtonBarItem extends AbstractItem implements ItemInflater.ItemPare
@Override
public int getLayoutResource() {
- return R.layout.suw_items_button_bar;
+ return R.layout.sud_items_button_bar;
}
public void setVisible(boolean visible) {
diff --git a/main/src/com/google/android/setupdesign/items/ButtonItem.java b/main/src/com/google/android/setupdesign/items/ButtonItem.java
index a205d7a..ffefbcf 100644
--- a/main/src/com/google/android/setupdesign/items/ButtonItem.java
+++ b/main/src/com/google/android/setupdesign/items/ButtonItem.java
@@ -143,7 +143,7 @@ public class ButtonItem extends AbstractItem implements View.OnClickListener {
private Button createButton(Context context) {
// Inflate a single button from XML, so that when using support lib, it will take advantage
// of the injected layout inflater and give us AppCompatButton instead.
- return (Button) LayoutInflater.from(context).inflate(R.layout.suw_button, null, false);
+ return (Button) LayoutInflater.from(context).inflate(R.layout.sud_button, null, false);
}
@Override
diff --git a/main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java b/main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java
index ff9ae1f..1e23ff7 100644
--- a/main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java
+++ b/main/src/com/google/android/setupdesign/items/ExpandableSwitchItem.java
@@ -62,7 +62,7 @@ public class ExpandableSwitchItem extends SwitchItem
@Override
protected int getDefaultLayoutResource() {
- return R.layout.suw_items_expandable_switch;
+ return R.layout.sud_items_expandable_switch;
}
@Override
@@ -120,7 +120,7 @@ public class ExpandableSwitchItem extends SwitchItem
public void onBindView(View view) {
// TODO: If it is possible to detect, log a warning if this is being used with ListView.
super.onBindView(view);
- View content = view.findViewById(R.id.suw_items_expandable_switch_content);
+ View content = view.findViewById(R.id.sud_items_expandable_switch_content);
content.setOnClickListener(this);
if (content instanceof CheckableLinearLayout) {
diff --git a/main/src/com/google/android/setupdesign/items/Item.java b/main/src/com/google/android/setupdesign/items/Item.java
index b5c99b0..fac23fb 100644
--- a/main/src/com/google/android/setupdesign/items/Item.java
+++ b/main/src/com/google/android/setupdesign/items/Item.java
@@ -56,7 +56,7 @@ public class Item extends AbstractItem {
}
protected int getDefaultLayoutResource() {
- return R.layout.suw_items_default;
+ return R.layout.sud_items_default;
}
public void setEnabled(boolean enabled) {
diff --git a/main/src/com/google/android/setupdesign/items/SwitchItem.java b/main/src/com/google/android/setupdesign/items/SwitchItem.java
index 7174c0d..940acea 100644
--- a/main/src/com/google/android/setupdesign/items/SwitchItem.java
+++ b/main/src/com/google/android/setupdesign/items/SwitchItem.java
@@ -82,7 +82,7 @@ public class SwitchItem extends Item implements CompoundButton.OnCheckedChangeLi
@Override
protected int getDefaultLayoutResource() {
- return R.layout.suw_items_switch;
+ return R.layout.sud_items_switch;
}
/**
@@ -92,14 +92,14 @@ public class SwitchItem extends Item implements CompoundButton.OnCheckedChangeLi
*/
public void toggle(View view) {
checked = !checked;
- final SwitchCompat switchView = (SwitchCompat) view.findViewById(R.id.suw_items_switch);
+ final SwitchCompat switchView = (SwitchCompat) view.findViewById(R.id.sud_items_switch);
switchView.setChecked(checked);
}
@Override
public void onBindView(View view) {
super.onBindView(view);
- final SwitchCompat switchView = (SwitchCompat) view.findViewById(R.id.suw_items_switch);
+ final SwitchCompat switchView = (SwitchCompat) view.findViewById(R.id.sud_items_switch);
switchView.setOnCheckedChangeListener(null);
switchView.setChecked(checked);
switchView.setOnCheckedChangeListener(this);
diff --git a/main/src/com/google/android/setupdesign/view/NavigationBar.java b/main/src/com/google/android/setupdesign/view/NavigationBar.java
index 9e89ed0..ac0f8c8 100644
--- a/main/src/com/google/android/setupdesign/view/NavigationBar.java
+++ b/main/src/com/google/android/setupdesign/view/NavigationBar.java
@@ -103,7 +103,7 @@ public class NavigationBar extends LinearLayout implements View.OnClickListener
// All the constructors delegate to this init method. The 3-argument constructor is not
// available in LinearLayout before v11, so call super with the exact same arguments.
private void init() {
- View.inflate(getContext(), R.layout.suw_navbar_view, this);
+ 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);