Skip to content

Commit aefb7d7

Browse files
author
gabri
committed
Expand and collapse a view with Animation
1 parent b38fc4d commit aefb7d7

File tree

15 files changed

+300
-0
lines changed

15 files changed

+300
-0
lines changed

AnimationTest/AndroidManifest.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="it.gmariotti.android.examples.animationtest"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-sdk
8+
android:minSdkVersion="14"
9+
android:targetSdkVersion="18" />
10+
11+
<application
12+
android:allowBackup="true"
13+
android:icon="@drawable/ic_launcher"
14+
android:label="@string/app_name"
15+
android:theme="@style/AppTheme" >
16+
<activity
17+
android:name=".MainActivity"
18+
android:label="@string/app_name" >
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
22+
<category android:name="android.intent.category.LAUNCHER" />
23+
</intent-filter>
24+
</activity>
25+
</application>
26+
27+
</manifest>

AnimationTest/ic_launcher-web.png

72.5 KB
Loading
5.38 KB
Loading
3.12 KB
Loading
8.01 KB
Loading
14.6 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
3+
<solid android:color="#33b5e5"/>
4+
<corners android:radius="0px"/>
5+
</shape>
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:id="@+id/container"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
7+
android:orientation="vertical" >
8+
9+
<LinearLayout
10+
android:id="@+id/header"
11+
android:layout_width="fill_parent"
12+
android:layout_height="64dp"
13+
android:layout_marginTop="15dp"
14+
android:layout_marginLeft="15dp"
15+
android:layout_marginRight="15dp"
16+
android:background="#FFF"
17+
android:orientation="horizontal" >
18+
19+
<TextView
20+
android:layout_marginTop="8dp"
21+
android:layout_marginLeft="8dp"
22+
android:layout_marginBottom="8dp"
23+
android:id="@+id/color"
24+
android:layout_width="@dimen/color_width"
25+
android:layout_height="@dimen/color_height"
26+
android:background="@drawable/rectangle"
27+
android:gravity="center_vertical"
28+
android:text=""
29+
android:textAlignment="center"
30+
android:textStyle="bold"
31+
android:fontFamily="sans-serif-light"
32+
/>
33+
34+
<TextView
35+
android:id="@+id/clickme"
36+
android:layout_width="wrap_content"
37+
android:layout_height="wrap_content"
38+
android:layout_marginLeft="5dp"
39+
android:textStyle="bold"
40+
android:gravity="center_vertical"
41+
android:fontFamily="sans-serif-light"
42+
android:text="@string/clickme" />
43+
</LinearLayout>
44+
45+
<LinearLayout
46+
android:id="@+id/expandable"
47+
android:layout_width="match_parent"
48+
android:layout_height="wrap_content"
49+
android:layout_marginLeft="15dp"
50+
android:layout_marginRight="15dp"
51+
android:background="#FFF"
52+
android:orientation="vertical" >
53+
54+
<TextView
55+
android:layout_width="wrap_content"
56+
android:layout_height="wrap_content"
57+
android:fontFamily="sans-serif-light"
58+
android:text="@string/hello_world" />
59+
60+
<TextView
61+
android:layout_width="wrap_content"
62+
android:layout_height="wrap_content"
63+
android:fontFamily="sans-serif-light"
64+
android:text="@string/hello_world" />
65+
66+
<TextView
67+
android:layout_width="wrap_content"
68+
android:layout_height="wrap_content"
69+
android:fontFamily="sans-serif-light"
70+
android:text="@string/hello_world" />
71+
72+
<TextView
73+
android:layout_width="wrap_content"
74+
android:layout_height="wrap_content"
75+
android:fontFamily="sans-serif-light"
76+
android:text="@string/hello_world" />
77+
78+
<TextView
79+
android:layout_width="wrap_content"
80+
android:layout_height="wrap_content"
81+
android:fontFamily="sans-serif-light"
82+
android:text="@string/hello_world" />
83+
84+
</LinearLayout>
85+
86+
</LinearLayout>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<resources>
2+
3+
<!--
4+
Customize dimensions originally defined in res/values/dimens.xml (such as
5+
screen margins) for sw600dp devices (e.g. 7" tablets) here.
6+
-->
7+
8+
</resources>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<resources>
2+
3+
<!--
4+
Customize dimensions originally defined in res/values/dimens.xml (such as
5+
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
6+
-->
7+
<dimen name="activity_horizontal_margin">128dp</dimen>
8+
9+
</resources>

0 commit comments

Comments
 (0)