mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Add fab menu
This commit is contained in:
@@ -77,8 +77,8 @@ public class AddNodeButtonView extends RelativeLayout {
|
|||||||
addGroupEnable = true;
|
addGroupEnable = true;
|
||||||
|
|
||||||
addButtonView = findViewById(R.id.add_button);
|
addButtonView = findViewById(R.id.add_button);
|
||||||
addEntryView = findViewById(R.id.add_entry);
|
addEntryView = findViewById(R.id.container_add_entry);
|
||||||
addGroupView = findViewById(R.id.add_group);
|
addGroupView = findViewById(R.id.container_add_group);
|
||||||
|
|
||||||
animationDuration = 300L;
|
animationDuration = 300L;
|
||||||
|
|
||||||
@@ -195,11 +195,16 @@ public class AddNodeButtonView extends RelativeLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setAddEntryClickListener(OnClickListener onClickListener) {
|
public void setAddEntryClickListener(OnClickListener onClickListener) {
|
||||||
if (addEntryEnable)
|
if (addEntryEnable) {
|
||||||
addEntryView.setOnClickListener(view -> {
|
addEntryView.setOnClickListener(view -> {
|
||||||
onClickListener.onClick(view);
|
onClickListener.onClick(view);
|
||||||
closeButtonIfOpen();
|
closeButtonIfOpen();
|
||||||
});
|
});
|
||||||
|
addEntryView.setOnClickListener(view -> {
|
||||||
|
onClickListener.onClick(view);
|
||||||
|
closeButtonIfOpen();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void startGlobalAnimation() {
|
private void startGlobalAnimation() {
|
||||||
|
|||||||
@@ -14,30 +14,70 @@
|
|||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
app:useCompatPadding="true"
|
app:useCompatPadding="true"
|
||||||
|
app:fabSize="normal"
|
||||||
style="@style/KeepassDXStyle.Fab" />
|
style="@style/KeepassDXStyle.Fab" />
|
||||||
|
|
||||||
<TextView android:id="@+id/add_entry"
|
<LinearLayout
|
||||||
android:layout_margin="12dp"
|
android:orientation="horizontal"
|
||||||
android:layout_above="@+id/add_button"
|
android:id="@+id/container_add_entry"
|
||||||
android:layout_alignRight="@+id/add_button"
|
|
||||||
android:layout_alignEnd="@+id/add_button"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_above="@+id/add_button"
|
||||||
|
android:layout_alignEnd="@+id/add_button"
|
||||||
|
android:layout_alignRight="@+id/add_button"
|
||||||
|
android:layout_marginBottom="-12dp"
|
||||||
|
android:visibility="gone">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_add_entry"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="end|center_vertical"
|
||||||
android:text="@string/add_entry"
|
android:text="@string/add_entry"
|
||||||
style="@style/KeepassDXStyle.FabMenu"
|
style="@style/KeepassDXStyle.FabMenu"
|
||||||
android:visibility="gone"
|
|
||||||
tools:ignore="UnusedAttribute" />
|
tools:ignore="UnusedAttribute" />
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
<TextView android:id="@+id/add_group"
|
android:id="@+id/fab_add_entry"
|
||||||
android:layout_margin="12dp"
|
|
||||||
android:layout_above="@+id/add_entry"
|
|
||||||
android:layout_alignRight="@+id/add_button"
|
|
||||||
android:layout_alignEnd="@+id/add_button"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginRight="@dimen/fab_menu_margin"
|
||||||
|
android:layout_marginEnd="@dimen/fab_menu_margin"
|
||||||
|
android:src="@drawable/ic_key_white_24dp"
|
||||||
|
android:tint="?attr/colorAccentCompat"
|
||||||
|
android:theme="@style/KeepassDXStyle.Fab.White"
|
||||||
|
app:fabSize="mini"
|
||||||
|
app:useCompatPadding="true" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:id="@+id/container_add_group"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_above="@+id/container_add_entry"
|
||||||
|
android:layout_alignEnd="@+id/container_add_entry"
|
||||||
|
android:layout_alignRight="@+id/container_add_entry"
|
||||||
|
android:layout_marginBottom="-12dp"
|
||||||
|
android:visibility="gone">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text_add_group"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:text="@string/add_group"
|
android:text="@string/add_group"
|
||||||
style="@style/KeepassDXStyle.FabMenu"
|
style="@style/KeepassDXStyle.FabMenu"
|
||||||
android:visibility="gone"
|
|
||||||
tools:ignore="UnusedAttribute" />
|
tools:ignore="UnusedAttribute" />
|
||||||
|
<android.support.design.widget.FloatingActionButton
|
||||||
|
android:id="@+id/fab_add_group"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="@dimen/fab_menu_margin"
|
||||||
|
android:layout_marginEnd="@dimen/fab_menu_margin"
|
||||||
|
android:src="@drawable/ic_folder_white_24dp"
|
||||||
|
android:tint="?attr/colorAccentCompat"
|
||||||
|
android:theme="@style/KeepassDXStyle.Fab.White"
|
||||||
|
app:fabSize="mini"
|
||||||
|
app:useCompatPadding="true" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<dimen name="list_margin">5dp</dimen>
|
<dimen name="list_margin">5dp</dimen>
|
||||||
<dimen name="default_margin">12dp</dimen>
|
<dimen name="default_margin">12dp</dimen>
|
||||||
<dimen name="button_margin">5dp</dimen>
|
<dimen name="button_margin">5dp</dimen>
|
||||||
<dimen name="fab_margin">24dp</dimen>
|
<dimen name="fab_menu_margin">8dp</dimen>
|
||||||
<dimen name="margin_tiny">4dp</dimen>
|
<dimen name="margin_tiny">4dp</dimen>
|
||||||
<dimen name="margin_small">8dp</dimen>
|
<dimen name="margin_small">8dp</dimen>
|
||||||
<dimen name="margin_medium">16dp</dimen>
|
<dimen name="margin_medium">16dp</dimen>
|
||||||
|
|||||||
Reference in New Issue
Block a user