From: Damyan Ivanov Date: Tue, 2 Apr 2019 21:24:15 +0000 (+0300) Subject: fix handling the click on the account expander image X-Git-Tag: v0.9~21 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=608de71a076ac030abb61ace753c9357ea33064e;p=mobile-ledger.git fix handling the click on the account expander image --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index 77a56c35..d711247b 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -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; diff --git a/app/src/main/res/layout/account_summary_row.xml b/app/src/main/res/layout/account_summary_row.xml index f962ada3..ca88fe86 100644 --- a/app/src/main/res/layout/account_summary_row.xml +++ b/app/src/main/res/layout/account_summary_row.xml @@ -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" />