diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2020-02-14 15:27:17 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-14 15:27:17 +0530 |
commit | 02ea696070aea1cdf0b71af0639499f87196ec8c (patch) | |
tree | 39ea7eb8c9cc2daded826d782cda1bf04c0ffee7 /app/src/main/res/layout | |
parent | d25702d99ded6946608713e670c6a6ce323f8f87 (diff) |
Port tunnel creation UI from Viscerion
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r-- | app/src/main/res/layout/add_tunnels_bottom_sheet.xml | 73 | ||||
-rw-r--r-- | app/src/main/res/layout/tunnel_list_fragment.xml | 38 |
2 files changed, 77 insertions, 34 deletions
diff --git a/app/src/main/res/layout/add_tunnels_bottom_sheet.xml b/app/src/main/res/layout/add_tunnels_bottom_sheet.xml new file mode 100644 index 00000000..62f168b1 --- /dev/null +++ b/app/src/main/res/layout/add_tunnels_bottom_sheet.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/root" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="@dimen/bottom_sheet_top_padding"> + + <com.google.android.material.button.MaterialButton + android:id="@+id/create_empty" + android:layout_width="match_parent" + android:layout_height="@dimen/bottom_sheet_item_height" + android:layout_marginLeft="@dimen/normal_margin" + android:layout_marginRight="@dimen/normal_margin" + android:layout_marginStart="@dimen/normal_margin" + android:layout_marginEnd="@dimen/normal_margin" + android:text="@string/create_empty" + android:textAlignment="viewStart" + android:textColor="?attr/colorOnSurface" + app:icon="@drawable/ic_action_edit" + app:iconPadding="@dimen/bottom_sheet_icon_padding" + app:iconTint="?attr/colorSecondary" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toTopOf="@+id/create_from_file" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:rippleColor="?attr/colorSecondary" + style="@style/Widget.MaterialComponents.Button.TextButton.Icon"/> + + <com.google.android.material.button.MaterialButton + android:id="@+id/create_from_file" + android:layout_width="match_parent" + android:layout_height="@dimen/bottom_sheet_item_height" + android:layout_marginLeft="@dimen/normal_margin" + android:layout_marginRight="@dimen/normal_margin" + android:layout_marginStart="@dimen/normal_margin" + android:layout_marginEnd="@dimen/normal_margin" + android:text="@string/create_from_file" + android:textAlignment="viewStart" + android:textColor="?attr/colorOnSurface" + app:icon="@drawable/ic_action_open_white" + app:iconPadding="@dimen/bottom_sheet_icon_padding" + app:iconTint="?attr/colorSecondary" + app:layout_constraintTop_toBottomOf="@+id/create_empty" + app:layout_constraintBottom_toTopOf="@+id/create_from_qrcode" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:rippleColor="?attr/colorSecondary" + style="@style/Widget.MaterialComponents.Button.TextButton.Icon"/> + + <com.google.android.material.button.MaterialButton + android:id="@+id/create_from_qrcode" + android:layout_width="match_parent" + android:layout_height="@dimen/bottom_sheet_item_height" + android:layout_marginLeft="@dimen/normal_margin" + android:layout_marginRight="@dimen/normal_margin" + android:layout_marginStart="@dimen/normal_margin" + android:layout_marginEnd="@dimen/normal_margin" + android:text="@string/create_from_qr_code" + android:textAlignment="viewStart" + android:textColor="?attr/colorOnSurface" + app:icon="@drawable/ic_action_scan_qr_code_white" + app:iconPadding="@dimen/bottom_sheet_icon_padding" + app:iconTint="?attr/colorSecondary" + app:layout_constraintTop_toBottomOf="@+id/create_from_file" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:rippleColor="?attr/colorSecondary" + style="@style/Widget.MaterialComponents.Button.TextButton.Icon"/> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/layout/tunnel_list_fragment.xml b/app/src/main/res/layout/tunnel_list_fragment.xml index 4189fa5f..c4247019 100644 --- a/app/src/main/res/layout/tunnel_list_fragment.xml +++ b/app/src/main/res/layout/tunnel_list_fragment.xml @@ -65,44 +65,14 @@ android:text="@string/tunnel_list_placeholder" android:textSize="20sp" /> </LinearLayout> - - <com.wireguard.android.widget.fab.FloatingActionsMenu - android:id="@+id/create_menu" + <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton + style="@style/Widget.MaterialComponents.ExtendedFloatingActionButton.Icon" + android:id="@+id/create_fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin" - android:clipChildren="false" - app:fab_labelStyle="@style/fab_label" - app:fab_labelsPosition="@integer/label_position" - app:layout_behavior="com.wireguard.android.widget.fab.FloatingActionButtonBehavior"> + app:icon="@drawable/ic_action_add_white" /> - <com.wireguard.android.widget.fab.LabeledFloatingActionButton - android:id="@+id/create_from_file" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:onClick="@{fragment::onRequestImportConfig}" - app:fabSize="mini" - app:fab_title="@string/create_from_file" - app:srcCompat="@drawable/ic_action_open_white" /> - - <com.wireguard.android.widget.fab.LabeledFloatingActionButton - android:id="@+id/create_from_qrcode" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:onClick="@{fragment::onRequestScanQRCode}" - app:fabSize="mini" - app:fab_title="@string/create_from_qr_code" - app:srcCompat="@drawable/ic_action_scan_qr_code_white" /> - - <com.wireguard.android.widget.fab.LabeledFloatingActionButton - android:id="@+id/create_empty" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:onClick="@{fragment::onRequestCreateConfig}" - app:fabSize="mini" - app:fab_title="@string/create_empty" - app:srcCompat="@drawable/ic_action_edit_white" /> - </com.wireguard.android.widget.fab.FloatingActionsMenu> </androidx.coordinatorlayout.widget.CoordinatorLayout> </layout> |