Skip to content

chore: begin view binding migration#19324

Merged
lukstbit merged 2 commits intoankidroid:mainfrom
david-allison:11116-enable-view-binding
Oct 12, 2025
Merged

chore: begin view binding migration#19324
lukstbit merged 2 commits intoankidroid:mainfrom
david-allison:11116-enable-view-binding

Conversation

@david-allison
Copy link
Copy Markdown
Member

Purpose / Description

This begins AnkiDroid's transition to ViewBindings.

This has mostly been completed in the following pull request, this code exists so we can perform an architecture review of the dependency, and so I can start splitting the linked PR into reviewable chunks

Fixes

Approach

How Has This Been Tested?

Non-functional change

Learning (optional, can help others)

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Licenses

Library Description License
ViewBindingPropertyDelegate (vbdp) Simplifies Android view bindings The Apache Software License, Version 2.0

Maintainers:

  • Add the Licenses Adds a resource under an open source license See wiki: Licences label
  • Update the licenses wiki when merging

@david-allison david-allison added the Licenses Adds a resource under an open source license See wiki: Licences label Oct 12, 2025
Copy link
Copy Markdown
Member

@BrayanDSO BrayanDSO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint is failing. Rest looks good

@BrayanDSO BrayanDSO added Needs Author Reply Waiting for a reply from the original author Needs Second Approval Has one approval, one more approval to merge labels Oct 12, 2025
https://github.com/androidbroadcast/ViewBindingPropertyDelegate/

Simplifies the API for View Bindings

Chosen as it has a simple, non-reflection-based API

There is a line of duplication of `R.layout`
 references/ViewBinding caused by the lack of reflection

Issue 11116
@lukstbit lukstbit force-pushed the 11116-enable-view-binding branch from 0e5c091 to a998115 Compare October 12, 2025 15:34
Copy link
Copy Markdown
Member

@lukstbit lukstbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Lint was failing due to a missing copyright header in VbpUtils.kt, I added that to get things moving. I'll also add the license entry to the wiki

diff --git a/AnkiDroid/src/main/java/dev/androidbroadcast/vbpd/internal/VbpdUtils.kt b/AnkiDroid/src/main/java/dev/androidbroadcast/vbpd/internal/VbpdUtils.kt
index f689d4d41f..5a9cb2c760 100644
--- a/AnkiDroid/src/main/java/dev/androidbroadcast/vbpd/internal/VbpdUtils.kt
+++ b/AnkiDroid/src/main/java/dev/androidbroadcast/vbpd/internal/VbpdUtils.kt
@@ -1,4 +1,20 @@
 /*
+ *  Copyright (c) 2025 David Allison <davidallisongithub@gmail.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free Software
+ *  Foundation; either version 3 of the License, or (at your option) any later
+ *  version.
+ *
+ *  This program is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ *  PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License along with
+ *  this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * This file incorporates code under the following license:
+ *
  *    Copyright 2020-2025 Kirill Rozov
  *
  * Licensed under the Apache License, Version 2.0 (the "License");

@lukstbit lukstbit added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Author Reply Waiting for a reply from the original author Needs Second Approval Has one approval, one more approval to merge labels Oct 12, 2025
@lukstbit lukstbit enabled auto-merge October 12, 2025 15:43
@lukstbit lukstbit added this pull request to the merge queue Oct 12, 2025
Merged via the queue into ankidroid:main with commit 2c696ae Oct 12, 2025
10 checks passed
@github-actions github-actions Bot added this to the 2.23 release milestone Oct 12, 2025
@github-actions github-actions Bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Oct 12, 2025
@david-allison david-allison added the hacktoberfest-accepted Accepted for Hacktoberfest label Oct 26, 2025
@david-allison david-allison deleted the 11116-enable-view-binding branch November 4, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted Accepted for Hacktoberfest Licenses Adds a resource under an open source license See wiki: Licences

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants