Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use view binding instead of findViewById #475

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

chrgernoe
Copy link
Member

@chrgernoe chrgernoe commented Jan 14, 2025

View binding is has some technical advantages. See https://developer.android.com/topic/libraries/view-binding. I think also it is much clearer which element is accessed where. Search through the layout is not so easy to understand. However, there are still some code that uses findViewById which cannot easily changed.

@github-actions github-actions bot added the KTLO This feature will not be delivered to customers label Jan 14, 2025
@@ -20,17 +20,16 @@
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Copy link
Member Author

Choose a reason for hiding this comment

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

It seems to be a bug in the Android library because this layout was working with the previous implementation but with view binding the margins were not recognized anymore.

@chrgernoe chrgernoe force-pushed the ktlo/use-view-binding branch from cc3cf97 to 349b367 Compare January 19, 2025 14:26
@chrgernoe chrgernoe requested a review from paetz January 19, 2025 14:27
paetz
paetz previously approved these changes Jan 20, 2025
app/src/main/java/com/yacgroup/yacguide/CountryActivity.kt Outdated Show resolved Hide resolved
app/src/main/java/com/yacgroup/yacguide/TableActivity.kt Outdated Show resolved Hide resolved
@@ -152,7 +152,6 @@
<string name="ascend_edit_date">Datum:</string>
<string name="ascend_edit_style">Stil:</string>
<string name="ascend_edit_title">Begehung bearbeiten</string>
<string name="select_year">Jahr auswählen</string>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we display this anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

Inflating the year picker layout into the dialog somehow overrides the complete dialog, including the title. Look good for me.

@chrgernoe chrgernoe marked this pull request as ready for review January 21, 2025 20:40
@chrgernoe chrgernoe force-pushed the ktlo/use-view-binding branch from 67515aa to 4cc6c5c Compare January 23, 2025 23:47
@chrgernoe chrgernoe requested a review from paetz January 23, 2025 23:48
@chrgernoe chrgernoe force-pushed the ktlo/use-view-binding branch from 069b19a to f5cd638 Compare January 25, 2025 22:47
@@ -66,7 +67,7 @@ abstract class TableActivity : BaseNavigationActivity() {
Comment(
text = it.text.orEmpty(),
properties = listOf(
CommentProperty(R.id.qualityLayout, R.string.relevance, RegionComment.QUALITY_MAP, it.qualityId)
CommentProperty(R.string.relevance, RegionComment.QUALITY_MAP, it.qualityId)
Copy link
Collaborator

Choose a reason for hiding this comment

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

  • Please check e.g. in Zittauer Gebirge - Weißbachtal - Kleiner Grenzkogel - Alter Weg. When showing the comments dialog, the comment's text is placed above the drying info, which is a regression. Another example is Zittauer Gebirge - Weißbachtal - Kleiner Grenzkogel - Alter Weg. In the first comment, the comment's text is placed above protection, too.

Seems to be a flakiness since most comments look ok as far as I could see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
KTLO This feature will not be delivered to customers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants