]> git.ktnx.net Git - mobile-ledger-staging.git/commitdiff
assign click handler at runtime
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 28 Nov 2020 07:17:34 +0000 (09:17 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 28 Nov 2020 07:17:34 +0000 (09:17 +0200)
doing it in the XML is deprecated

app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
app/src/main/res/layout/main_app_layout.xml

index c66f43c489a98328556edd196dcdec6580b92852..eb74e11f60d97763ad231b261d00f9f42e74c2b8 100644 (file)
@@ -237,6 +237,8 @@ public class MainActivity extends ProfileThemedActivity {
         findViewById(R.id.nav_new_profile_button).setOnClickListener(
                 v -> startEditProfileActivity(null));
 
+        findViewById(R.id.transaction_list_cancel_download).setOnClickListener(this::onStopTransactionRefreshClick);
+
         RecyclerView root = findViewById(R.id.nav_profile_list);
         if (root == null)
             throw new RuntimeException("Can't get hold on the transaction value view");
index c8a710249cef750b92921936d39234c8052e0bc1..a33fc7b34b1a79c606d26b49e4ecb7e2fbdc61dc 100644 (file)
                         android:background="@drawable/ic_clear_accent_24dp"
                         android:clickable="true"
                         android:focusable="true"
-                        android:onClick="onStopTransactionRefreshClick" />
+                        />
                 </LinearLayout>
 
             </LinearLayout>