-
Notifications
You must be signed in to change notification settings - Fork 1
Update PDF viewer to use toolbar layout and remove screenshot prevention #919
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
PruthiviRaj27
wants to merge
3
commits into
master
Choose a base branch
from
fix_pdf_screen_shot_issue
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
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the base class to
BaseToolBarActivityfor a screen that is meant to be fullscreen and has no toolbar seems counter-intuitive. This change necessitates adding agonetoolbar to the layout file, which feels like a workaround and adds an unnecessary view.Please consider if a more appropriate base class is available to extend, for example, one that provides common functionality without enforcing a toolbar.
If
BaseToolBarActivitymust be used for other essential logic it contains, it might indicate that the responsibilities in your base activities could be separated more cleanly (e.g., toolbar logic in one class, other common logic in another). This would improve long-term maintainability.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gemini-code-assist BaseToolBarActivity is the base activity for all other activities, providing common theme settings and privacy-related implementations.
For this specific activity, we don’t need the toolbar UI, but we still require the underlying privacy logic.
To avoid duplicating code, we continue to extend BaseToolBarActivity and simply hide the toolbar view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification, @PruthiviRaj27. I understand that
BaseToolBarActivityserves as a common base for shared theme settings and privacy logic across your activities, and extending it here avoids code duplication for those functionalities.While this approach works, it does introduce a slight architectural compromise by requiring a
gonetoolbar in the layout for an activity that doesn't visually use it. This can make the code less intuitive and potentially harder to maintain ifBaseToolBarActivityaccumulates more toolbar-specific logic in the future.For long-term maintainability and clearer separation of concerns, consider refactoring your activity hierarchy. You could introduce a more fundamental
BaseActivity(or similar) that handles only the common theme and privacy logic, and then haveBaseToolBarActivityextend that class. This would allowPdfViewerActivityto extend the truly minimal base class, avoiding the need for a hidden toolbar and making the purpose of each base class more explicit.