mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-06-21 16:41:05 +00:00
Replace the FAB with a bottom sheet dialog
This also removes the dependency on ``com.getbase:floatingactionbutton``.
This commit is contained in:
parent
dea13f56f5
commit
e324f649ee
9 changed files with 120 additions and 102 deletions
|
@ -46,50 +46,13 @@
|
|||
app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"/>
|
||||
</LinearLayout>
|
||||
|
||||
<!-- note: the fab should always be the last element to be sure it's displayed on top -->
|
||||
<com.getbase.floatingactionbutton.FloatingActionsMenu
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
style="@style/FloatingActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:src="@drawable/ic_add_black_24dp"
|
||||
app:fab_addButtonColorNormal="@color/colorAccent"
|
||||
app:fab_addButtonColorPressed="@color/colorAccent"
|
||||
app:fab_labelStyle="@style/fab_label_style">
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_scan"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fab_title="@string/scan"
|
||||
app:fab_size="mini"
|
||||
app:fab_colorNormal="@color/background"
|
||||
app:fab_colorPressed="@color/background"
|
||||
app:fab_icon="@drawable/ic_qrcode_scan"/>
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_scan_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fab_title="@string/scan_image"
|
||||
app:fab_size="mini"
|
||||
app:fab_colorNormal="@color/background"
|
||||
app:fab_colorPressed="@color/background"
|
||||
app:fab_icon="@drawable/ic_add_photo_24px"/>
|
||||
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_enter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:fab_title="@string/enter_manually"
|
||||
app:fab_size="mini"
|
||||
app:fab_colorNormal="@color/background"
|
||||
app:fab_colorPressed="@color/background"
|
||||
app:fab_icon="@drawable/ic_create_black_24dp"/>
|
||||
|
||||
</com.getbase.floatingactionbutton.FloatingActionsMenu>
|
||||
android:tint="@color/icon_primary_dark" />
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -18,16 +18,12 @@
|
|||
android:clipToPadding="false"
|
||||
android:scrollbars="vertical"/>
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
app:fab_icon="@drawable/ic_check_black_24dp"
|
||||
app:fab_colorNormal="@color/colorAccent"
|
||||
app:fab_colorPressed="@color/colorAccent"
|
||||
app:fab_labelStyle="@style/fab_label_style"
|
||||
app:fab_labelsPosition="left">
|
||||
</com.getbase.floatingactionbutton.FloatingActionButton>
|
||||
android:src="@drawable/ic_check_black_24dp"
|
||||
android:tint="@color/icon_primary_dark" />
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
|
84
app/src/main/res/layout/dialog_add_entry.xml
Normal file
84
app/src/main/res/layout/dialog_add_entry.xml
Normal file
|
@ -0,0 +1,84 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
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"
|
||||
android:orientation="vertical"
|
||||
android:background="?attr/background">
|
||||
<LinearLayout
|
||||
android:id="@+id/fab_scan"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="65dp"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingBottom="7.5dp"
|
||||
android:orientation="horizontal"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/ic_qrcode_scan"
|
||||
app:tint="?attr/iconColorPrimary" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/scan"
|
||||
android:textSize="17sp"
|
||||
android:textColor="?attr/primaryText"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="20dp" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/fab_scan_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="65dp"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:paddingTop="7.5dp"
|
||||
android:paddingBottom="7.5dp"
|
||||
android:orientation="horizontal"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/ic_add_photo_24px"
|
||||
app:tint="?attr/iconColorPrimary" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/scan_image"
|
||||
android:textSize="17sp"
|
||||
android:textColor="?attr/primaryText"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="20dp" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/fab_enter"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="65dp"
|
||||
android:paddingHorizontal="15dp"
|
||||
android:paddingTop="7.5dp"
|
||||
android:paddingBottom="15dp"
|
||||
android:orientation="horizontal"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
<ImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="match_parent"
|
||||
android:src="@drawable/ic_create_black_24dp"
|
||||
app:tint="?attr/iconColorPrimary" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/enter_manually"
|
||||
android:textSize="17sp"
|
||||
android:textColor="?attr/primaryText"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="20dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
Loading…
Add table
Add a link
Reference in a new issue