[Android] Ubuntu 12.04 LTS 에서 Android Studio 설치

1. Install Java JDK 7

$tar xzvf ~/Downloads/jdk-7u21-linux-x64.tar.gz sudo mv jdk1.7.0_21/ /usr/lib/jvm/
sudo update-alternatives –install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_21/bin/java 1
sudo update-alternatives –install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_21/bin/javac 1
sudo update-alternatives –install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.0_21/bin/javaws 1
sudo update-alternatives –config java
sudo update-alternatives –config javaws

java -version 확인하여 1.7 인지 확인.
java version “1.7.0_21”
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

Read more: http://www.cnx-software.com/2013/05/16/installing-android-studio-ide-in-ubuntu-hello-world-application/#ixzz3PPfveKmf

2. JAVA 환경 설정

JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21
CLASSPATH=JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21/lib
PATH=$PATH:/usr/lib/jvm/jdk1.7.0_21/bin

3. Android studio 압축해제

– proxy를 사용할 경우  “Fetching android sdk component information” 에서 넘어가지 않는 문제 발생 : idea.properties 파일의 마지막에 “disable.android.first.run=true”  추가하면 넘어감.

4. gradle, JDK, SDK의 path 설정

5. SDK-Manager에서 툴 설치

[Android] Ubuntu 12.04 LTS 에서 Android Studio 설치

[Android] Activity transition animation

Android 5.0에서 activity나 fragment 전환할 때 Shared Element transition animation이 제공된다.

전환 전의 View에 transition name을 설정하고, 전환 후의 Activity나 fragment의 view에 transition name을 설정하면 animation이 동작된다.

 

적용하는 방법은 아래와 같다.


1. style.xml에서 windowSharedElementEnterTransition의 style을 적용하는 방법

<style name="BaseAppTheme" parent="android:Theme.Material">
  <!-- enable window content transitions -->
  <item name="android:windowContentTransitions">true</item>

  <!-- specify enter and exit transitions -->
  <item name="android:windowEnterTransition">@transition/explode</item>
  <item name="android:windowExitTransition">@transition/explode</item>

  <!-- specify shared element transitions -->
  <item name="android:windowSharedElementEnterTransition">
    @transition/change_image_transform</item>
  <item name="android:windowSharedElementExitTransition">
    @transition/change_image_transform</item>
</style>

change_image_transform.xml

<!-- res/transition/change_image_transform.xml -->
<!-- (see also Shared Transitions below) -->
<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
  <changeImageTransform/>
</transitionSet>

2. activity에서 아래의 API를 사용하여 적용하는 방법

To specify transitions in your code, call these methods with a Transition object:

3. fragment에서 아래의 API를 사용하여 적용하는 방법

void setSharedElementEnterTransition(Transition transition)

Sets the Transition that will be used for shared elements transferred into the content Scene.
void setSharedElementReturnTransition(Transition transition)

Sets the Transition that will be used for shared elements transferred back during a pop of the back stack.

 

Continue reading “[Android] Activity transition animation”

[Android] Activity transition animation