Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a59b7f9 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Add new test for showing very slow animations.

Change-Id: Ibcc3e46a72210cf8a8e4cf5a932e2c9a7995f0f1
parent 3df01599
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2011, 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.
*/
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
        android:shareInterpolator="false" >
    <scale android:fromXScale="0.9" android:toXScale="1.5"
           android:fromYScale="0.9" android:toYScale="1.5"
           android:pivotX="50%" android:pivotY="50%"
           android:interpolator="@interpolator/slow_enter"
           android:duration="40000" />
    <alpha android:fromAlpha="0.0" android:toAlpha="1.0"
            android:interpolator="@android:interpolator/decelerate_cubic"
            android:duration="1000" />
</set>
+30 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2011, 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.
*/
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
        android:shareInterpolator="false" >
    <scale android:fromXScale="1.0" android:toXScale="0.9"
            android:fromYScale="1.0" android:toYScale="0.9"
            android:pivotX="50%" android:pivotY="50%"
            android:interpolator="@android:interpolator/decelerate_quint"
            android:duration="300" />
    <alpha android:fromAlpha="1.0" android:toAlpha="0.0"
            android:interpolator="@android:interpolator/decelerate_cubic"
            android:duration="300"/>
</set>
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2011, 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.
*/
-->

<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
    android:cycles="10" />
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->

<resources>
    <style name="SlowDialog" parent="@android:style/Theme.Holo.Dialog">
        <item name="android:windowAnimationStyle">@style/SlowDialog</item>
    </style>
    <style name="SlowDialog">
        <item name="android:windowEnterAnimation">@anim/slow_enter</item>
        <item name="android:windowExitAnimation">@anim/slow_exit</item>
    </style>
</resources>
+17 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import java.util.List;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityThread;
import android.app.AlertDialog;
import android.app.Application;
import android.content.ActivityNotFoundException;
import android.os.Bundle;
@@ -35,6 +36,8 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.ScrollView;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.content.Context;
import android.content.pm.ApplicationInfo;
@@ -100,6 +103,20 @@ public class ActivityTestMain extends Activity {
        mAm = (ActivityManager)getSystemService(ACTIVITY_SERVICE);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        menu.add("Animate!").setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
            @Override public boolean onMenuItemClick(MenuItem item) {
                AlertDialog.Builder builder = new AlertDialog.Builder(ActivityTestMain.this,
                        R.style.SlowDialog);
                builder.setTitle("This is a title");
                builder.show();
                return true;
            }
        });
        return true;
    }

    @Override
    protected void onStart() {
        super.onStart();