Freeze ProgressBar
Bug 6413044
animationResolution is deprecated
Change-Id: Ibad1591d28f6b463ea9ab1ece4d0634c6bac15ed
diff --git a/tests/tests/holo/res/layout/progressbar.xml b/tests/tests/holo/res/layout/progressbar.xml
index 4e810fc..0975c86 100644
--- a/tests/tests/holo/res/layout/progressbar.xml
+++ b/tests/tests/holo/res/layout/progressbar.xml
@@ -16,5 +16,4 @@
<ProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:animationResolution="60000"
/>
diff --git a/tests/tests/holo/res/layout/progressbar_large.xml b/tests/tests/holo/res/layout/progressbar_large.xml
index 4b66447..6b84669 100644
--- a/tests/tests/holo/res/layout/progressbar_large.xml
+++ b/tests/tests/holo/res/layout/progressbar_large.xml
@@ -16,6 +16,5 @@
<ProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:animationResolution="60000"
style="?android:attr/progressBarStyleLarge"
/>
diff --git a/tests/tests/holo/res/layout/progressbar_small.xml b/tests/tests/holo/res/layout/progressbar_small.xml
index ae813d6..cdb4339 100644
--- a/tests/tests/holo/res/layout/progressbar_small.xml
+++ b/tests/tests/holo/res/layout/progressbar_small.xml
@@ -16,6 +16,5 @@
<ProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:animationResolution="60000"
style="?android:attr/progressBarStyleSmall"
/>
diff --git a/tests/tests/holo/src/android/holo/cts/LayoutAdapter.java b/tests/tests/holo/src/android/holo/cts/LayoutAdapter.java
index 8b974e7..aa161a2 100644
--- a/tests/tests/holo/src/android/holo/cts/LayoutAdapter.java
+++ b/tests/tests/holo/src/android/holo/cts/LayoutAdapter.java
@@ -19,6 +19,7 @@
import com.android.cts.holo.R;
import android.holo.cts.modifiers.CalendarViewModifier;
+import android.holo.cts.modifiers.ProgressBarModifier;
import android.holo.cts.modifiers.SearchViewModifier;
import android.holo.cts.modifiers.TabHostModifier;
import android.holo.cts.modifiers.TimePickerModifier;
@@ -129,13 +130,13 @@
R.layout.edittext, null, NO_TIMEOUT_MS);
addLayout(R.string.progressbar, "progressbar",
- R.layout.progressbar, null, NO_TIMEOUT_MS);
+ R.layout.progressbar, new ProgressBarModifier(), NO_TIMEOUT_MS);
addLayout(R.string.progressbar_small, "progressbar_small",
- R.layout.progressbar_small, null, NO_TIMEOUT_MS);
+ R.layout.progressbar_small, new ProgressBarModifier(), NO_TIMEOUT_MS);
addLayout(R.string.progressbar_large, "progressbar_large",
- R.layout.progressbar_large, null, NO_TIMEOUT_MS);
+ R.layout.progressbar_large, new ProgressBarModifier(), NO_TIMEOUT_MS);
addLayout(R.string.progressbar_horizontal_0, "progressbar_horizontal_0",
R.layout.progressbar_horizontal_0, null, NO_TIMEOUT_MS);
diff --git a/tests/tests/holo/src/android/holo/cts/modifiers/ProgressBarModifier.java b/tests/tests/holo/src/android/holo/cts/modifiers/ProgressBarModifier.java
new file mode 100644
index 0000000..ffb93fb
--- /dev/null
+++ b/tests/tests/holo/src/android/holo/cts/modifiers/ProgressBarModifier.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2012 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 android.holo.cts.modifiers;
+
+import android.view.View;
+import android.view.animation.Interpolator;
+import android.widget.ProgressBar;
+
+public class ProgressBarModifier extends AbstractLayoutModifier {
+
+ @Override
+ public View modifyView(View view) {
+ ProgressBar pb = (ProgressBar) view;
+ pb.setInterpolator(new ZeroInterpolator());
+ return pb;
+ }
+
+ private static class ZeroInterpolator implements Interpolator {
+ @Override
+ public float getInterpolation(float input) {
+ return 0;
+ }
+ }
+}