Skip to content

snanmre/custom-navigation-bar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

custom-navigation-bar

Tested on Android 4.4.2

NOTE THAT Changes in these files tagged with "[ADD]"

Adding Key Buttons

  • Add buttons(com.android.systemui.statusbar.policy.KeyButtonView) into navigation_bar.xml files contained in;
    • res/layout/
    • res/layout-ldrtl/
    • res/layout-sw600dp/
    • res/layout-sw720dp/
  • Don't forget to define "systemui::keyCode" value.
  • Consider different rotations (FrameLayouts in navigation_bar.xml with id rot90 and rot0)
  • Sample: Brightness buttons (kbBrightnessDown, kbBrightnessUp) in navigation_bar.xml

Adding Custom Buttons

  • Add buttons into navigation_bar.xml files
  • Create a touch listener for the button in PhoneStatusBar.java
  • Use action MotionEvent.ACTION_UP in the listener
  • Sample: mStandByOnTouchListener in PhoneStatusBar.java

Handling Buttons in Application Level

  • Create a touch listener for the button
  • Broadcast an special intent
  • Then in user-level application, register an intent receiver for this action
  • Sample: mStandByOnTouchListener in PhoneStatusBar.java

Hiding/Showing Navigation Bar or Enable/Disable Buttons

  • Register a broadcast intent receiver in PhoneStatusBar.java
  • Then process received intent data
  • Sample: mNavBarReceiver in PhoneStatusBar.java

Releases

No releases published

Packages

No packages published

Languages