From: Damyan Ivanov Date: Mon, 28 Dec 2020 16:47:55 +0000 (+0200) Subject: replace xml onClick declaration with run-time hooking X-Git-Tag: v0.16.0~3 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=b8b0c37ef75e735ccbf4de66353e54c283be9344;p=mobile-ledger.git replace xml onClick declaration with run-time hooking declarative handlers are deprecated --- 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 2fc09379..92cb1f4b 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 @@ -301,6 +301,8 @@ public class MainActivity extends ProfileThemedActivity { Data.lastUpdateDate.observe(this, date -> refreshLastUpdateInfo()); Data.lastUpdateTransactionCount.observe(this, date -> refreshLastUpdateInfo()); Data.lastUpdateAccountCount.observe(this, date -> refreshLastUpdateInfo()); + b.navAccountSummary.setOnClickListener(this::onAccountSummaryClicked); + b.navLatestTransactions.setOnClickListener(this::onLatestTransactionsClicked); } private void scheduleDataRetrievalIfStale(long lastUpdate) { long now = new Date().getTime(); diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 1fc6d8b6..06feeb10 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -292,7 +292,6 @@ @@ -300,7 +299,6 @@