]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java
NT: better alignment anchoring when hiding comment
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / NewTransactionItemHolder.java
index 77ce69a000dd96aaecc2e3ba95b1b27e4e692b78..70819ebedcbc3aeafa0482aabf930b2d683c92bb 100644 (file)
@@ -53,6 +53,8 @@ import net.ktnx.mobileledger.utils.Logger;
 import net.ktnx.mobileledger.utils.MLDB;
 import net.ktnx.mobileledger.utils.Misc;
 
+import org.jetbrains.annotations.NotNull;
+
 import java.text.DecimalFormatSymbols;
 import java.util.Calendar;
 import java.util.Date;
@@ -430,7 +432,7 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder
         tvAccount.setEnabled(editable);
         tvAmount.setEnabled(editable);
     }
-    private void setCommentVisible(Boolean visible) {
+    private void setCommentVisible(@NotNull Boolean visible) {
         if (visible) {
             // showing; show the comment view and align the comment button to it
             tvComment.setVisibility(View.VISIBLE);
@@ -442,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);
         }