Improved fab speed dial

This commit is contained in:
2017-07-26 21:01:07 +02:00
parent faa6752b10
commit e064012551
15 changed files with 187 additions and 212 deletions

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#DEFFFFFF"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>

View File

@ -58,4 +58,15 @@
tools:ignore="InconsistentLayout"
tools:layout="@layout/fragment_message_detail" />
<io.github.kobakei.materialfabspeeddial.FabSpeedDial
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:elevation="8dp"
app:fab_useTouchGuard="true"/>
</android.support.constraint.ConstraintLayout>

View File

@ -0,0 +1,35 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
tools:ignore="UnusedAttribute" />
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"
tools:context=".MessageListActivity"
tools:layout="@android:layout/list_content" />
<io.github.kobakei.materialfabspeeddial.FabSpeedDial
android:id="@+id/fab"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:fab_useTouchGuard="true"
app:fab_miniFabTextBackground="@color/colorAccent"
app:fab_miniFabTextColor="@color/colorPrimaryDarkText" />
</RelativeLayout>

View File

@ -1,26 +0,0 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:elevation="4dp"
tools:ignore="UnusedAttribute"/>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_below="@id/toolbar"
android:id="@+id/item_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MessageListActivity"
tools:layout="@android:layout/list_content"/>
</RelativeLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -17,17 +16,4 @@
android:paddingBottom="88dp"
android:scrollbarStyle="outsideOverlay" />
<io.github.kobakei.materialfabspeeddial.FabSpeedDial
android:id="@+id/fab_add_contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
app:elevation="8dp"
app:fab_useTouchGuard="true"
app:fab_miniFabTextBackground="@color/colorPrimaryLight"
app:fab_fabDrawable="@drawable/ic_action_add_contact"
app:fab_menu="@menu/fab_address" />
</RelativeLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -19,17 +18,4 @@
android:scrollbars="vertical"
tools:listitem="@layout/message_row"/>
<io.github.kobakei.materialfabspeeddial.FabSpeedDial
android:id="@+id/fab_compose_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
app:elevation="8dp"
app:fab_useTouchGuard="true"
app:fab_miniFabTextBackground="@color/colorPrimaryLight"
app:fab_fabDrawable="@drawable/ic_action_compose_message"
app:fab_menu="@menu/fab_message"/>
</RelativeLayout>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Christian Basler
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_read_qr_code"
android:icon="@drawable/ic_action_qr_code"
android:title="@string/scan_qr_code"/>
<item
android:id="@+id/action_create_contact"
android:icon="@drawable/ic_action_create_contact"
android:title="@string/create_contact"/>
</menu>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2016 Christian Basler
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_compose_broadcast"
android:icon="@drawable/ic_action_broadcast"
android:title="@string/broadcast"/>
<item
android:id="@+id/action_compose_message"
android:icon="@drawable/ic_action_personal"
android:title="@string/personal_message"/>
</menu>