1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- 3 Copyright (C) 2017 The Android Open Source Project 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software 12 distributed under the License is distributed on an "AS IS" BASIS, 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 See the License for the specific language governing permissions and 15 limitations under the License. 16 --> 17 <RelativeLayout 18 xmlns:android="http://schemas.android.com/apk/res/android" 19 xmlns:app="http://schemas.android.com/apk/res-auto" 20 xmlns:tools="http://schemas.android.com/tools" 21 android:id="@+id/activity_main" 22 android:layout_width="match_parent" 23 android:layout_height="match_parent" 24 android:paddingBottom="@dimen/activity_vertical_margin" 25 android:paddingLeft="@dimen/activity_horizontal_margin" 26 android:paddingRight="@dimen/activity_horizontal_margin" 27 android:paddingTop="@dimen/activity_vertical_margin" 28 tools:context="com.example.android.support.animation.SpringActivity"> 29 30 <FrameLayout 31 android:id="@+id/container" 32 android:layout_width="match_parent" 33 android:layout_height="match_parent"> 34 <com.example.android.support.animation.SpringView 35 android:id="@+id/actual_spring" 36 android:layout_width="100dp" 37 android:layout_height="match_parent" 38 android:layout_gravity="center_horizontal"/> 39 <ImageView 40 android:id="@+id/imageView" 41 android:layout_width="100dp" 42 android:layout_height="100dp" 43 android:layout_centerHorizontal="true" 44 android:layout_centerVertical="true" 45 android:layout_gravity="center_horizontal" 46 android:layout_marginTop="50dp" 47 android:src="@drawable/spring_demo_circle"/> 48 49 <LinearLayout 50 android:layout_width="match_parent" 51 android:layout_height="50dp" 52 android:layout_gravity="bottom" 53 android:layout_marginBottom="50dp" 54 android:orientation="horizontal"> 55 <LinearLayout 56 android:layout_width="100dp" 57 android:layout_height="match_parent" 58 android:gravity="center_horizontal" 59 android:orientation="vertical"> 60 <TextView 61 android:layout_width="wrap_content" 62 android:layout_height="wrap_content" 63 android:text="Damping Ratio:"/> 64 <TextView 65 android:id="@+id/damping_ratio_txt" 66 android:layout_width="wrap_content" 67 android:layout_height="wrap_content" 68 android:layout_gravity="center_horizontal"/> 69 </LinearLayout> 70 <SeekBar 71 android:id="@+id/damping_ratio" 72 android:layout_width="match_parent" 73 android:layout_height="wrap_content" 74 android:layout_gravity="center_vertical"/> 75 </LinearLayout> 76 <LinearLayout 77 android:layout_width="match_parent" 78 android:layout_height="50dp" 79 android:layout_gravity="bottom" 80 android:orientation="horizontal"> 81 <LinearLayout 82 android:layout_width="100dp" 83 android:layout_height="match_parent" 84 android:gravity="center_horizontal" 85 android:orientation="vertical"> 86 <TextView 87 android:layout_width="wrap_content" 88 android:layout_height="wrap_content" 89 android:text="Stiffness:"/> 90 <TextView 91 android:id="@+id/stiffness_txt" 92 android:layout_width="wrap_content" 93 android:layout_height="wrap_content" 94 android:layout_gravity="center_horizontal"/> 95 </LinearLayout> 96 <SeekBar 97 android:id="@+id/stiffness" 98 android:layout_width="match_parent" 99 android:layout_height="wrap_content" 100 android:layout_gravity="center_vertical"/> 101 </LinearLayout> 102 103 </FrameLayout> 104 </RelativeLayout> 105