Android Add volume plus minus button in navigation bar Android source code case

Source: Internet
Author: User

Some Android devices do not have an entity's volume adjustment button, or from the point of view of protecting the body keys, you need to add a volume plus minus adjustment button to the virtual keys in the navigation bar.

Here I recommend the more good Android source fragment website: http://code.662p.com/list/173_1.html

The effect is as follows:

The implementation process is as follows:

1. First add the volume plus minus resource file in Systemui, the path is as follows:

frameworks/base/packages/systemui/res/

Put the picture in the corresponding drawable folder, including Volume +, and volume--see.

2. Modify the navigation bar layout file, path:

frameworks/base/packages/systemui/res/

Locate the Navigation_bar.xml file in the corresponding layout folder to modify it:

Add "Volume minus" before the return key to return the layout of the key:

<com.android.systemui.statusbar.policy.keybuttonview android:id= "@+id/back"                android:layout_width= "128DP" Android:paddingstart= "25DP" android:paddingend= "25DP"                android:layout_height= "match_parent"                android:src= "@drawable/ic_sysbar_back"                systemui:keycode= "4"                android:layout_weight= "0"                systemui:glowbackground= "@drawable/ic_sysbar_highlight"                android:contentdescription= "@string/accessibility_back"                />

Detailed Description: http://android.662p.com/thread-6038-1-1.html

Android Add volume plus minus button in navigation bar Android source code case

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.