TransitionSliding.java revision fdacc8be92cd36f712cfdb0fcf9b0e847f8eeb58
1/* 2 * Copyright (C) 2010 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 18package android.media.videoeditor; 19 20/** 21 * This class allows to create sliding transitions 22 * {@hide} 23 */ 24public class TransitionSliding extends Transition { 25 26 /** Video 1 is pushed to the right while video 2 is coming from left */ 27 public final static int DIRECTION_RIGHT_OUT_LEFT_IN = 0; 28 /** Video 1 is pushed to the left while video 2 is coming from right */ 29 public static final int DIRECTION_LEFT_OUT_RIGHT_IN = 1; 30 /** Video 1 is pushed to the top while video 2 is coming from bottom */ 31 public static final int DIRECTION_TOP_OUT_BOTTOM_IN = 2; 32 /** Video 1 is pushed to the bottom while video 2 is coming from top */ 33 public static final int DIRECTION_BOTTOM_OUT_TOP_IN = 3; 34 35 // The sliding transitions 36 private final int mSlidingDirection; 37 38 /** 39 * An object of this type cannot be instantiated by using the default 40 * constructor 41 */ 42 @SuppressWarnings("unused") 43 private TransitionSliding() { 44 this(null, null, null, 0, 0, 0); 45 } 46 47 /** 48 * Constructor 49 * 50 * @param transitionId The transition id 51 * @param afterMediaItem The transition is applied to the end of this 52 * media item 53 * @param beforeMediaItem The transition is applied to the beginning of 54 * this media item 55 * @param durationMs duration of the transition in milliseconds 56 * @param behavior behavior is one of the behavior defined in Transition 57 * class 58 * @param direction direction shall be one of the supported directions like 59 * RIGHT_OUT_LEFT_IN 60 * 61 * @throws IllegalArgumentException if behavior is not supported. 62 */ 63 public TransitionSliding(String transitionId, MediaItem afterMediaItem, 64 MediaItem beforeMediaItem, long durationMs, int behavior, int direction) { 65 super(transitionId, afterMediaItem, beforeMediaItem, durationMs, behavior); 66 mSlidingDirection = direction; 67 } 68 69 /** 70 * @return The sliding direction 71 */ 72 public int getDirection() { 73 return mSlidingDirection; 74 } 75 76 /* 77 * {@inheritDoc} 78 */ 79 @Override 80 void generate() { 81 } 82} 83