-
Notifications
You must be signed in to change notification settings - Fork 27
all: less strings is more #9036
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
Open
dogi
wants to merge
8
commits into
master
Choose a base branch
from
lessstringsismore
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Performed a full-repository dead-code analysis covering Kotlin classes, XML resources, and Gradle modules. Removed all identified unused code to reduce APK size and improve codebase maintainability. Changes: - Removed 119 unused layout files (28% utilization → 100%) - Removed 137 unused string resources from strings.xml - Removed 1 unused drawable (ic_mypersonals.xml) - Removed 1 unused style (AppTheme.Dialog.NoActionBar.MinWidth) Impact: - Estimated APK size reduction: 2-5 MB (5-10%) - Improved build performance - Cleaner codebase with higher code health (98%+) Analysis method: - Used comprehensive grep searches across all Kotlin and XML files - Verified each resource was not referenced via R.* or @resource/ - Checked for both direct references and XML-to-XML references - Preserved all DI modules and dynamically-referenced resources All changes verified to maintain functionality while removing dead code.
…ifest The string title_activity_dashboard was incorrectly identified as unused because the initial scan didn't check AndroidManifest.xml. This string is required by DashboardActivity's android:label attribute. Fixes build error: - AAPT: error: resource string/title_activity_dashboard not found
Restore layout files that were incorrectly removed in the dead code removal sweep. These layouts are actively referenced in the codebase and their removal caused compilation errors. Restored files: - activity_audio_player.xml - used by AudioPlayerActivity - activity_csvviewer.xml - used by CSVViewerActivity - activity_exo_player_video.xml - used by VideoPlayerActivity - activity_image_viewer.xml - used by ImageViewerActivity - activity_markdown_viewer.xml - used by MarkdownViewerActivity - activity_pdfreader.xml - used by PDFReaderActivity - activity_textfile_viewer.xml - used by TextFileViewerActivity - alert_add_attachment.xml - used by EditAchievementFragment - dialog_campaign_challenge.xml - used by MarkdownDialog - dialog_progress.xml - used by DialogUtils - edit_profile_dialog.xml - used by UserProfileFragment - row_stat.xml - used by UserProfileFragment - user_list_item.xml - used by TeamListAdapter This fixes compilation errors for missing binding classes: ActivityAudioPlayerBinding, ActivityCsvviewerBinding, ActivityExoPlayerVideoBinding, ActivityImageViewerBinding, ActivityMarkdownViewerBinding, ActivityPdfreaderBinding, ActivityTextfileViewerBinding, AlertAddAttachmentBinding, DialogCampaignChallengeBinding, DialogProgressBinding, EditProfileDialogBinding, RowStatBinding, UserListItemBinding
Restore 29 additional layout files that were incorrectly removed in the dead code removal sweep (83fb944). These layouts are actively referenced through ViewBinding in Kotlin code, causing compilation errors. The initial dead code analysis only checked for direct R.layout.* references but missed ViewBinding references like DialogServerUrlBinding, which are generated from layout XML files. Restored files and their usages: - dialog_server_url_.xml → DialogServerUrlBinding (DashboardElementActivity, LoginActivity, ServerDialogExtensions, SyncActivity) - alert_guest_login.xml → AlertGuestLoginBinding (GuestLoginExtensions) - fragment_send_survey.xml → FragmentSendSurveyBinding (SendSurveyFragment) - item_team_list.xml → ItemTeamListBinding (AdapterTeamList) - fragment_plan.xml → FragmentPlanBinding (PlanFragment) - alert_create_team.xml → AlertCreateTeamBinding (PlanFragment, TeamFragment) - fragment_team_course.xml → FragmentTeamCourseBinding (TeamCourseFragment) - fragment_discussion_list.xml → FragmentDiscussionListBinding (DiscussionListFragment) - row_joined_user.xml → RowJoinedUserBinding (AdapterJoinedMember) - row_member_request.xml → RowMemberRequestBinding (AdapterMemberRequest) - fragment_member_detail.xml → FragmentMemberDetailBinding (MemberDetailFragment) - row_team_resource.xml → RowTeamResourceBinding (AdapterTeamResource, AdapterTeamCourse) - fragment_team_resource.xml → FragmentTeamResourceBinding (TeamResourceFragment) - row_task.xml → RowTaskBinding (AdapterTask) - alert_task.xml → AlertTaskBinding (TeamTaskFragment) - alert_users_spinner.xml → AlertUsersSpinnerBinding (TeamTaskFragment) - fragment_team_task.xml → FragmentTeamTaskBinding (TeamTaskFragment) - fragment_achievement.xml → FragmentAchievementBinding (AchievementFragment) - layout_button_primary.xml → LayoutButtonPrimaryBinding (AchievementFragment) - row_achievement.xml → RowAchievementBinding (AchievementFragment) - row_other_info.xml → RowOtherInfoBinding (AdapterOtherInfo) - activity_become_member.xml → ActivityBecomeMemberBinding (BecomeMemberActivity) - alert_reference.xml → AlertReferenceBinding (EditAchievementFragment) - edit_attachement.xml → EditAttachementBinding (EditAchievementFragment) - edit_other_info.xml → EditOtherInfoBinding (EditAchievementFragment) - fragment_edit_achievement.xml → FragmentEditAchievementBinding (EditAchievementFragment) - add_meetup.xml → AddMeetupBinding (TeamCalendarFragment) - fragment_enterprise_calendar.xml → FragmentEnterpriseCalendarBinding (TeamCalendarFragment) - fragment_team.xml → FragmentTeamBinding (TeamFragment) This fixes hundreds of compilation errors like: - "Unresolved reference: DialogServerUrlBinding" - "Unresolved reference: AlertGuestLoginBinding" - "Unresolved reference: ItemTeamListBinding" etc. The dead code removal process needs to be improved to check for ViewBinding references, not just direct R.layout.* references.
Restores 33 layout XML files that were incorrectly removed in the dead code removal sweep. These layouts are actively referenced by ViewBinding in the following modules: - Feedback (activity_feedback_detail, fragment_feedback, etc.) - Map (activity_offline_map) - Health (activity_add_examination, fragment_vital_sign, etc.) - Meetup (fragment_my_meetup_detail) - Personals (fragment_my_personals, row_my_personal) - News (activity_reply, row_news) - Resources/Library (row_library, fragment_library_detail, etc.) - Survey/Submission (row_survey, fragment_my_submission, etc.) - Rating (fragment_rating) - References (fragment_reference, row_reference) - Onboarding (activity_on_boarding) Without these files, ViewBinding cannot generate the required binding classes, causing compilation to fail with "Unresolved reference" errors. Fixes compilation errors for multiple UI modules.
Restored 44 layout XML files that were removed in the comprehensive dead code removal sweep but are actually required for ViewBinding to generate the corresponding binding classes. This fixes all ViewBinding compilation errors including: - FragmentMembersBinding, FragmentCalendarBinding - ItemAiResponseMessageBinding, ItemUserMessageBinding - FragmentChatDetailBinding, RowChatHistoryBinding - RowCourseBinding, FragmentMyProgressBinding - ActivityDashboardBinding, FragmentHomeBellBinding - And 34 other ViewBinding classes All restored files are actively referenced in Kotlin source files.
The style AppTheme.Dialog.NoActionBar.MinWidth was referenced by several DialogFragment classes but was removed during cleanup, causing compilation errors: - BaseDialogFragment.kt - FeedbackFragment.kt - RatingFragment.kt - CollectionsFragment.kt Restored the style definition with appropriate dialog theme properties.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.