From c0d1c10b6440db293b1781e7b14705e0c00ab10a Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sat, 25 Apr 2020 23:02:00 +0300 Subject: [PATCH] NT: better alignment anchoring when hiding comment --- .../mobileledger/ui/activity/NewTransactionItemHolder.java | 4 ++-- app/src/main/res/layout/new_transaction_row.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java index 3a757607..70819ebe 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java @@ -444,11 +444,11 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder commentButton.setLayoutParams(lp); } else { - // hiding; hide the comment comment view and align amounts layout under it + // hiding; hide the comment view and align the comment bottom to the amount tvComment.setVisibility(View.GONE); ConstraintLayout.LayoutParams lp = (ConstraintLayout.LayoutParams) commentButton.getLayoutParams(); - lp.bottomToBottom = R.id.ntr_account; // R.id.parent doesn't work here + lp.bottomToBottom = R.id.amount_layout; // R.id.parent doesn't work here commentButton.setLayoutParams(lp); } diff --git a/app/src/main/res/layout/new_transaction_row.xml b/app/src/main/res/layout/new_transaction_row.xml index 65814a79..90944e2c 100644 --- a/app/src/main/res/layout/new_transaction_row.xml +++ b/app/src/main/res/layout/new_transaction_row.xml @@ -100,7 +100,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/ic_comment_gray_24dp" - app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintBottom_toBottomOf="@id/amount_layout" app:layout_constraintStart_toStartOf="@+id/ntr_account" app:layout_constraintTop_toBottomOf="@+id/account_row_acc_name" /> -- 2.39.5