ConstraintLayout for main activity buttons

This commit is contained in:
Matéo Duparc 2021-04-05 19:27:22 +02:00
parent 57d1a90ac2
commit 01f01590e2
Signed by untrusted user: hardcoresushi
GPG Key ID: 007F84120107191E
2 changed files with 12 additions and 9 deletions

View File

@ -3,12 +3,12 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
tools:context="sushi.hardcore.droidfs.MainActivity">
<include layout="@layout/toolbar"/>
<sushi.hardcore.droidfs.widgets.ColoredImageView
android:id="@+id/image_logo"
android:layout_width="match_parent"
@ -17,40 +17,44 @@
android:src="@drawable/logo"
android:layout_weight="1"/>
<LinearLayout
android:id="@+id/aaa"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
android:layout_weight="1">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/button_open"
android:layout_width="match_parent"
android:layout_height="@dimen/main_activity_button_height"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/button_create"
android:layout_marginHorizontal="@dimen/main_activity_button_hor_margin"
android:layout_marginVertical="@dimen/main_activity_button_ver_margin"
android:onClick="onClickOpen"
android:text="@string/open_volume"
style="@style/button"/>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/button_create"
android:layout_width="match_parent"
android:layout_height="@dimen/main_activity_button_height"
app:layout_constraintTop_toBottomOf="@id/button_open"
app:layout_constraintBottom_toTopOf="@id/button_change_password"
android:layout_marginHorizontal="@dimen/main_activity_button_hor_margin"
android:layout_marginVertical="@dimen/main_activity_button_ver_margin"
android:onClick="onClickCreate"
android:text="@string/create_volume"
style="@style/button"/>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/button_change_password"
android:layout_width="match_parent"
android:layout_height="@dimen/main_activity_button_height"
app:layout_constraintTop_toBottomOf="@id/button_create"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginHorizontal="@dimen/main_activity_button_hor_margin"
android:layout_marginVertical="@dimen/main_activity_button_ver_margin"
android:onClick="onClickChangePassword"
android:text="@string/change_volume_password"
style="@style/button"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View File

@ -2,7 +2,6 @@
<resources>
<dimen name="main_activity_button_height">60dp</dimen>
<dimen name="main_activity_button_hor_margin">50dp</dimen>
<dimen name="main_activity_button_ver_margin">20dp</dimen>
<dimen name="create_activity_label_width">100dp</dimen>
<dimen name="edit_text_label_text_size">15sp</dimen>
<dimen name="open_activity_label_width">90dp</dimen>