Skip to content

Commit 827951a

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "Add new test for showing very slow animations."
2 parents 3f36129 + 8a59b7f commit 827951a

File tree

5 files changed

+124
-0
lines changed

5 files changed

+124
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
** Copyright 2011, The Android Open Source Project
5+
**
6+
** Licensed under the Apache License, Version 2.0 (the "License");
7+
** you may not use this file except in compliance with the License.
8+
** You may obtain a copy of the License at
9+
**
10+
** http://www.apache.org/licenses/LICENSE-2.0
11+
**
12+
** Unless required by applicable law or agreed to in writing, software
13+
** distributed under the License is distributed on an "AS IS" BASIS,
14+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
** See the License for the specific language governing permissions and
16+
** limitations under the License.
17+
*/
18+
-->
19+
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:shareInterpolator="false" >
22+
<scale android:fromXScale="0.9" android:toXScale="1.5"
23+
android:fromYScale="0.9" android:toYScale="1.5"
24+
android:pivotX="50%" android:pivotY="50%"
25+
android:interpolator="@interpolator/slow_enter"
26+
android:duration="40000" />
27+
<alpha android:fromAlpha="0.0" android:toAlpha="1.0"
28+
android:interpolator="@android:interpolator/decelerate_cubic"
29+
android:duration="1000" />
30+
</set>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
** Copyright 2011, The Android Open Source Project
5+
**
6+
** Licensed under the Apache License, Version 2.0 (the "License");
7+
** you may not use this file except in compliance with the License.
8+
** You may obtain a copy of the License at
9+
**
10+
** http://www.apache.org/licenses/LICENSE-2.0
11+
**
12+
** Unless required by applicable law or agreed to in writing, software
13+
** distributed under the License is distributed on an "AS IS" BASIS,
14+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
** See the License for the specific language governing permissions and
16+
** limitations under the License.
17+
*/
18+
-->
19+
20+
<set xmlns:android="http://schemas.android.com/apk/res/android"
21+
android:shareInterpolator="false" >
22+
<scale android:fromXScale="1.0" android:toXScale="0.9"
23+
android:fromYScale="1.0" android:toYScale="0.9"
24+
android:pivotX="50%" android:pivotY="50%"
25+
android:interpolator="@android:interpolator/decelerate_quint"
26+
android:duration="300" />
27+
<alpha android:fromAlpha="1.0" android:toAlpha="0.0"
28+
android:interpolator="@android:interpolator/decelerate_cubic"
29+
android:duration="300"/>
30+
</set>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
**
5+
** Copyright 2011, The Android Open Source Project
6+
**
7+
** Licensed under the Apache License, Version 2.0 (the "License");
8+
** you may not use this file except in compliance with the License.
9+
** You may obtain a copy of the License at
10+
**
11+
** http://www.apache.org/licenses/LICENSE-2.0
12+
**
13+
** Unless required by applicable law or agreed to in writing, software
14+
** distributed under the License is distributed on an "AS IS" BASIS,
15+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
** See the License for the specific language governing permissions and
17+
** limitations under the License.
18+
*/
19+
-->
20+
21+
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
22+
android:cycles="10" />
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2011 The Android Open Source Project
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
17+
<resources>
18+
<style name="SlowDialog" parent="@android:style/Theme.Holo.Dialog">
19+
<item name="android:windowAnimationStyle">@style/SlowDialog</item>
20+
</style>
21+
<style name="SlowDialog">
22+
<item name="android:windowEnterAnimation">@anim/slow_enter</item>
23+
<item name="android:windowExitAnimation">@anim/slow_exit</item>
24+
</style>
25+
</resources>

tests/ActivityTests/src/com/google/android/test/activity/ActivityTestMain.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import android.app.Activity;
2323
import android.app.ActivityManager;
2424
import android.app.ActivityThread;
25+
import android.app.AlertDialog;
2526
import android.app.Application;
2627
import android.content.ActivityNotFoundException;
2728
import android.os.Bundle;
@@ -35,6 +36,8 @@
3536
import android.widget.TextView;
3637
import android.widget.ScrollView;
3738
import android.view.LayoutInflater;
39+
import android.view.Menu;
40+
import android.view.MenuItem;
3841
import android.view.View;
3942
import android.content.Context;
4043
import android.content.pm.ApplicationInfo;
@@ -100,6 +103,20 @@ protected void onCreate(Bundle savedInstanceState) {
100103
mAm = (ActivityManager)getSystemService(ACTIVITY_SERVICE);
101104
}
102105

106+
@Override
107+
public boolean onCreateOptionsMenu(Menu menu) {
108+
menu.add("Animate!").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
109+
@Override public boolean onMenuItemClick(MenuItem item) {
110+
AlertDialog.Builder builder = new AlertDialog.Builder(ActivityTestMain.this,
111+
R.style.SlowDialog);
112+
builder.setTitle("This is a title");
113+
builder.show();
114+
return true;
115+
}
116+
});
117+
return true;
118+
}
119+
103120
@Override
104121
protected void onStart() {
105122
super.onStart();

0 commit comments

Comments
 (0)