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

Feature nav #1177

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

Feature nav #1177

wants to merge 11 commits into from

Conversation

wxm2004
Copy link

@wxm2004 wxm2004 commented Sep 20, 2024

问题解决

想要实现菜单栏高亮页面的转换,我的解决办法是设置一个变量来跟踪当前页面,进入java/swati4star/createpdf/activity 目录下,新创建一个BaseActivity基类,在这里实现所有与highlight相关的操作。创建一个标志性变量currentPage (home默认页面),实现在导航菜单的点击事件中,更新 currentPage 变量,并调用更新高亮的方法(onNavigationItemSelected())要与Resources下的Layout中的.xml布局文件相连接,由于社区中有人提出页面切换不能实现高亮与之对应,因此后续又完善了updateNavigationHighlight() 方法实现了highlight与page的联调。此外,还在BaseActivity中添加了重置高亮的方法clearHighlights (),最后完善资源配置文件,drawer_menu.xml (菜单资源)以及AndroidManifest.xml。

Copy link

codeclimate bot commented Sep 20, 2024

Code Climate has analyzed commit 3ab057d and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 3

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant