]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fix handling the click on the account expander image
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 2 Apr 2019 21:24:15 +0000 (00:24 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Tue, 2 Apr 2019 21:24:15 +0000 (00:24 +0300)
app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
app/src/main/res/layout/account_summary_row.xml

index 77a56c35325dc5d6533799565d9c80aa401bd0a9..d711247b5b5cdca63faa36dada771761b6b0ca16 100644 (file)
@@ -677,10 +677,14 @@ public class MainActivity extends ProfileThemedActivity {
 
     }
     public void onAccountSummaryRowViewClicked(View view) {
-        ViewGroup row = (ViewGroup) view.getParent();
+        ViewGroup row;
+        if ( view.getId() == R.id.account_expander ) row = (ViewGroup) view.getParent().getParent();
+        else row = (ViewGroup) view.getParent();
+
         LedgerAccount acc = (LedgerAccount) row.getTag();
         switch (view.getId()) {
             case R.id.account_row_acc_name:
+            case R.id.account_expander:
             case R.id.account_expander_container:
                 Log.d("accounts", "Account expander clicked");
                 if (!acc.hasSubAccounts()) return;
index f962ada392da038f8a1854dff4765b9b82e3c5da..ca88fe86eaf6a1af7e3c0405b86694963257199a 100644 (file)
@@ -68,7 +68,9 @@
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_margin="8dp"
-            android:background="@drawable/ic_expand_less_black_24dp" />
+            android:background="@drawable/ic_expand_less_black_24dp"
+            android:clickable="true"
+            android:onClick="onAccountSummaryRowViewClicked" />
     </FrameLayout>
 
     <TextView