Merge branch 'fix-alignment' into 'master'

Fix grid alignment (#242)

Closes #242

See merge request pixeldroid/PixelDroid!240
This commit is contained in:
Matthieu 2020-09-10 22:12:27 +02:00
commit 48849cf984
3 changed files with 12 additions and 8 deletions

View File

@ -151,6 +151,7 @@ dependencies {
implementation 'com.karumi:dexter:6.2.1'
implementation 'com.google.android:flexbox:2.0.1'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
<com.google.android.flexbox.FlexboxLayout 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="wrap_content"
android:orientation="horizontal">
app:flexWrap="wrap"
app:justifyContent="center">
<androidx.cardview.widget.CardView
@ -19,4 +21,4 @@
</androidx.cardview.widget.CardView>
</GridLayout>
</com.google.android.flexbox.FlexboxLayout>

View File

@ -2,7 +2,8 @@
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<com.google.android.material.textfield.TextInputLayout
@ -32,8 +33,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:text="@string/search"
android:backgroundTint="@color/colorButtonBg"
android:text="@string/search"
android:textColor="@color/colorButtonText"
app:layout_constraintBottom_toBottomOf="@+id/search"
app:layout_constraintEnd_toEndOf="parent"
@ -62,10 +63,10 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/discoverList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
app:layoutManager="LinearLayoutManager"
app:layoutManager="com.google.android.flexbox.FlexboxLayoutManager"
app:layout_constraintTop_toBottomOf="@+id/search" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>