Brian Attwell | 89ee395 | 2014-07-09 16:40:39 -0700 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <!-- Copyright (C) 2014 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 | |
Marcus Hagerott | 8d62cd2 | 2016-08-01 17:31:38 -0700 | [diff] [blame] | 17 | <!-- This expects to be included inside a RelativeLayout or a CoordinatorLayout --> |
Brian Attwell | 89ee395 | 2014-07-09 16:40:39 -0700 | [diff] [blame] | 18 | <FrameLayout |
| 19 | xmlns:android="http://schemas.android.com/apk/res/android" |
Marcus Hagerott | 9702063 | 2016-09-28 11:17:22 -0700 | [diff] [blame] | 20 | xmlns:app="http://schemas.android.com/apk/res-auto" |
Brian Attwell | 89ee395 | 2014-07-09 16:40:39 -0700 | [diff] [blame] | 21 | android:id="@+id/floating_action_button_container" |
| 22 | android:layout_width="@dimen/floating_action_button_width" |
| 23 | android:layout_height="@dimen/floating_action_button_height" |
Marcus Hagerott | 8d62cd2 | 2016-08-01 17:31:38 -0700 | [diff] [blame] | 24 | android:layout_alignParentBottom="true" |
Brian Attwell | 89ee395 | 2014-07-09 16:40:39 -0700 | [diff] [blame] | 25 | android:layout_alignParentEnd="true" |
Marcus Hagerott | 8d62cd2 | 2016-08-01 17:31:38 -0700 | [diff] [blame] | 26 | android:layout_gravity="bottom|end" |
| 27 | android:layout_marginBottom="@dimen/floating_action_button_margin_bottom" |
| 28 | android:layout_marginEnd="@dimen/floating_action_button_margin_right" |
yaolu | 14235e6 | 2016-10-21 16:09:42 -0700 | [diff] [blame] | 29 | android:background="@drawable/fab_pink" |
Marcus Hagerott | 9702063 | 2016-09-28 11:17:22 -0700 | [diff] [blame] | 30 | android:elevation="@dimen/design_fab_elevation" |
| 31 | app:layout_dodgeInsetEdges="bottom" > |
Brian Attwell | 89ee395 | 2014-07-09 16:40:39 -0700 | [diff] [blame] | 32 | |
| 33 | <ImageButton |
| 34 | android:id="@+id/floating_action_button" |
| 35 | android:layout_width="match_parent" |
| 36 | android:layout_height="match_parent" |
| 37 | android:background="@drawable/floating_action_button" |
Brian Attwell | 89ee395 | 2014-07-09 16:40:39 -0700 | [diff] [blame] | 38 | android:contentDescription="@string/action_menu_add_new_contact_button" |
Marcus Hagerott | 8d62cd2 | 2016-08-01 17:31:38 -0700 | [diff] [blame] | 39 | android:src="@drawable/ic_add" |
| 40 | android:tint="@color/floating_action_button_icon_color"/> |
Brian Attwell | 89ee395 | 2014-07-09 16:40:39 -0700 | [diff] [blame] | 41 | </FrameLayout> |