File tree Expand file tree Collapse file tree 5 files changed +124
-0
lines changed
src/com/google/android/test/activity Expand file tree Collapse file tree 5 files changed +124
-0
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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" />
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 2222import android .app .Activity ;
2323import android .app .ActivityManager ;
2424import android .app .ActivityThread ;
25+ import android .app .AlertDialog ;
2526import android .app .Application ;
2627import android .content .ActivityNotFoundException ;
2728import android .os .Bundle ;
3536import android .widget .TextView ;
3637import android .widget .ScrollView ;
3738import android .view .LayoutInflater ;
39+ import android .view .Menu ;
40+ import android .view .MenuItem ;
3841import android .view .View ;
3942import android .content .Context ;
4043import 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 ();
You can’t perform that action at this time.
0 commit comments