1/* 2 * Copyright (C) 2012 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 17package android.support.v4.app; 18 19import android.app.ActivityOptions; 20import android.content.Context; 21import android.graphics.Bitmap; 22import android.os.Bundle; 23import android.view.View; 24 25class ActivityOptionsCompatJB { 26 27 public static ActivityOptionsCompatJB makeCustomAnimation(Context context, 28 int enterResId, int exitResId) { 29 return new ActivityOptionsCompatJB( 30 ActivityOptions.makeCustomAnimation(context, enterResId, exitResId)); 31 } 32 33 public static ActivityOptionsCompatJB makeScaleUpAnimation(View source, 34 int startX, int startY, int startWidth, int startHeight) { 35 return new ActivityOptionsCompatJB( 36 ActivityOptions.makeScaleUpAnimation(source, startX, startY, startWidth, startHeight)); 37 } 38 39 public static ActivityOptionsCompatJB makeThumbnailScaleUpAnimation(View source, 40 Bitmap thumbnail, int startX, int startY) { 41 return new ActivityOptionsCompatJB( 42 ActivityOptions.makeThumbnailScaleUpAnimation(source, thumbnail, startX, startY)); 43 } 44 45 private final ActivityOptions mActivityOptions; 46 47 private ActivityOptionsCompatJB(ActivityOptions activityOptions) { 48 mActivityOptions = activityOptions; 49 } 50 51 public Bundle toBundle() { 52 return mActivityOptions.toBundle(); 53 } 54 55 public void update(ActivityOptionsCompatJB otherOptions) { 56 mActivityOptions.update(otherOptions.mActivityOptions); 57 } 58} 59