get System Animation Property Name - Android Animation

Android examples for Animation:Animation Creation

Description

get System Animation Property Name

Demo Code

/*/*from ww w.  j  a v a 2 s .  co m*/
 * Copyright (C) 2013 AOKP by Steve Spear - Stevespear426
 *
 * 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.
 */
import android.content.Context;
import android.content.res.Resources;
import java.util.ArrayList;

public class Main{
    public final static int ANIMATION_DEFAULT = 0;
    public final static int ANIMATION_FADE = 1;
    public final static int ANIMATION_SLIDE_RIGHT = 2;
    public final static int ANIMATION_SLIDE_LEFT = 3;
    public final static int ANIMATION_SLIDE_RIGHT_NO_FADE = 4;
    public final static int ANIMATION_SLIDE_LEFT_NO_FADE = 5;
    public final static int ANIMATION_SLIDE_UP = 6;
    public final static int ANIMATION_SLIDE_DOWN = 7;
    public final static int ANIMATION_TRANSLUCENT = 8;
    public final static int ANIMATION_GROW_SHRINK = 9;
    public final static int ANIMATION_GROW_SHRINK_CENTER = 10;
    public final static int ANIMATION_GROW_SHRINK_BOTTOM = 11;
    public final static int ANIMATION_GROW_SHRINK_LEFT = 12;
    public final static int ANIMATION_GROW_SHRINK_RIGHT = 13;
    public static String getProperName(Context context, int mAnim) {
        Resources res = context.getResources();
        String value = "";
        switch (mAnim) {
        case ANIMATION_DEFAULT:
            value = res
                    .getString(com.android.internal.R.string.animation_default);
            break;
        case ANIMATION_FADE:
            value = res
                    .getString(com.android.internal.R.string.animation_fade);
            break;
        case ANIMATION_SLIDE_RIGHT:
            value = res
                    .getString(com.android.internal.R.string.animation_slide_right);
            break;
        case ANIMATION_SLIDE_RIGHT_NO_FADE:
            value = res
                    .getString(com.android.internal.R.string.animation_slide_right_no_fade);
            break;
        case ANIMATION_SLIDE_LEFT:
            value = res
                    .getString(com.android.internal.R.string.animation_slide_left);
            break;
        case ANIMATION_SLIDE_UP:
            value = res
                    .getString(com.android.internal.R.string.animation_slide_up);
            break;
        case ANIMATION_SLIDE_DOWN:
            value = res
                    .getString(com.android.internal.R.string.animation_slide_down);
            break;
        case ANIMATION_SLIDE_LEFT_NO_FADE:
            value = res
                    .getString(com.android.internal.R.string.animation_slide_left_no_fade);
            break;
        case ANIMATION_TRANSLUCENT:
            value = res
                    .getString(com.android.internal.R.string.animation_translucent);
            break;
        case ANIMATION_GROW_SHRINK_BOTTOM:
            value = res
                    .getString(com.android.internal.R.string.animation_grow_shrink_bottom);
            break;
        case ANIMATION_GROW_SHRINK_CENTER:
            value = res
                    .getString(com.android.internal.R.string.animation_grow_shrink_center);
            break;
        case ANIMATION_GROW_SHRINK_LEFT:
            value = res
                    .getString(com.android.internal.R.string.animation_grow_shrink_left);
            break;
        case ANIMATION_GROW_SHRINK_RIGHT:
            value = res
                    .getString(com.android.internal.R.string.animation_grow_shrink_right);
            break;
        case ANIMATION_GROW_SHRINK:
            value = res
                    .getString(com.android.internal.R.string.animation_grow_shrink);
            break;
        default:
            value = res
                    .getString(com.android.internal.R.string.action_null);
            break;

        }
        return value;
    }
}

Related Tutorials