]> git.ktnx.net Git - mobile-ledger.git/commitdiff
new transaction form: use a CoordinatorLayout as base, and poop the FAB out of the...
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 26 Nov 2019 21:56:05 +0000 (23:56 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 26 Nov 2019 21:56:05 +0000 (23:56 +0200)
makes it behave nice when a snack bar message appears

app/src/main/res/layout/fragment_new_transaction.xml

index 8a35cf680671a00770c97bb114080fa6a97ba5b1..b5ce2a8dd25fc0b211127788b761bd0a3921cbe6 100644 (file)
   ~ You should have received a copy of the GNU General Public License
   ~ along with MoLe. If not, see <https://www.gnu.org/licenses/>.
   -->
-
-<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    tools:context="net.ktnx.mobileledger.ui.activity.NewTransactionActivity">
+    android:layout_height="match_parent">
 
-    <androidx.recyclerview.widget.RecyclerView
-        android:id="@+id/new_transaction_accounts"
-        android:layout_width="0dp"
-        android:layout_height="0dp"
-        android:paddingStart="@dimen/activity_horizontal_margin"
-        android:paddingEnd="@dimen/activity_horizontal_margin"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
-        tools:showIn="@layout/activity_new_transaction">
-    </androidx.recyclerview.widget.RecyclerView>
+    <androidx.constraintlayout.widget.ConstraintLayout xmlns:tools="http://schemas.android.com/tools"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        tools:context="net.ktnx.mobileledger.ui.activity.NewTransactionActivity">
+
+        <androidx.recyclerview.widget.RecyclerView
+            android:id="@+id/new_transaction_accounts"
+            android:layout_width="0dp"
+            android:layout_height="0dp"
+            android:paddingStart="@dimen/activity_horizontal_margin"
+            android:paddingEnd="@dimen/activity_horizontal_margin"
+            app:layout_constraintBottom_toBottomOf="parent"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            tools:showIn="@layout/activity_new_transaction" />
+
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
 
     <com.google.android.material.floatingactionbutton.FloatingActionButton
         android:id="@+id/fab"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_gravity="center"
+        android:layout_gravity="bottom|end"
         android:layout_marginEnd="@dimen/fab_margin"
         android:layout_marginBottom="@dimen/fab_margin"
         android:padding="@dimen/fab_margin"
@@ -49,6 +53,4 @@
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintEnd_toEndOf="parent"
         app:srcCompat="@drawable/ic_save_white_24dp" />
-
-
-</androidx.constraintlayout.widget.ConstraintLayout>
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file