-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
BugFix - Unify Drawer Menu Item Handling #13513
BugFix - Unify Drawer Menu Item Handling #13513
Conversation
378ca02
to
a032f85
Compare
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.
When selecting Personal Files from the Activities tab, All files will be selected instead.
On a side note, I don't think we should be using string matching to determine which tab is currently open.
This is a workaround solution and @tobiasKaminsky we decided to fix it this way until we have better codebase and structure. Obviously the whole structure, navigation flow is wrong and broken. That's not the case in here. Proper fix will be fixing navigation flow and have single source of truth for simple tasks like highlighting drawer menu item. That fix will consume much more time, and I can't decide to implement that fix by myself. Because of the priorities, time etc. If you have the proper fix with much less code change, please open PR. Current codebase behaviors: Currently, some menu items, such as “Settings,” in the drawer menu don’t extend from DrawerActivity, which is causing navigation issues (different action bar, different back button behavior when it compared to other activities). There are multiple methods being used to highlight the drawer menu, leading to some inconsistencies. Two menu item variable was responsible for holding menu item value. setDrawerMenuItemChecked() gets called multiple times from different files and some value of it overriding correct value and applying wrong one. |
0857bdf
to
bc5cc29
Compare
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
…rawerActivity Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
Signed-off-by: alperozturk <[email protected]>
bc5cc29
to
5f03cae
Compare
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/13513.apk |
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.
This change fixes the issue and works fine on my end.
But we should keep in mind that this is just a workaround. We will need to implement a proper at some point in the future, as @alperozturk96 mentioned.
Tests written, or not not needed
Stores the menu item value in memory, eliminating the need for argument passing and state management when restoring the menu item.
Calls
setDrawerMenuItemChecked()
only when necessary, ensuring a single source of truth for the menu item state.Utilizes
DrawerActivity
to manage the menu item, with sub-activities modifying the item as needed.Removes redundant logic related to menu item handling.
How to Test?