How to remove the default google search bar of Launcher ?, Launcherbar

Source: Internet
Author: User

How to remove the default google search bar of Launcher ?, Launcherbar
JB2/JB3/JB5/JB9 version: 1. Modify Launcher2/res/layout/qsb_bar.xml as follows:
<Include android: id = "@ + id/qsb_search_bar"
Layout = "@ layout/search_bar"
Android: visibility = "gone"/> Add android: visibility = "gone" 2. Modify Launcher2/res/layout-port/launcher. xml as follows:
<Com. android. launcher2.DrawableStateProxyView
Android: id = "@ + id/voice_button_proxy"
Android: layout_width = "80dp"
Android: layout_height = "@ dimen/qsb_bar_height"
Android: layout_gravity = "top | right"
Android: clickable = "true"
OnClick = "onClickVoiceButton"
Android: importantForAccessibility = "no"
Launcher: sourceViewId = "@ + id/voice_button"/> modify android: clickable = "false" 3. Modify Launcher2/src/com/android/launcher2/SearchDropTargetBar. java
The onFinishInflate () method is as follows:
......
// Create the varous fade animations
If (mEnableDropDownDropTargets ){
MDropTargetBar. setTranslationY (-mBarHeight );
MDropTargetBarAnim = ObjectAnimator. ofFloat (mDropTargetBar, "translationY",-mBarHeight, 0f );
MQSBSearchBarAnim = ObjectAnimator. ofFloat (mQSBSearchBar, "translationY",-mBarHeight,-mBarHeight );
} Else {
MDropTargetBar. setAlpha (0f); mDropTargetBarAnim = ObjectAnimator. ofFloat (mDropTargetBar, "alpha", 0f, 1f );
MQSBSearchBarAnim = ObjectAnimator. ofFloat (mQSBSearchBar, "alpha", 0f, 0f );
}
... 4. Modify the attributes of Launcher2/src/com/android/launcher2/SearchDropTargetBar. java
The showSearchBar () method is as follows:
Public void showSearchBar (boolean animated ){
If (! MIsSearchBarHidden) return;
If (animated ){
PrepareStartAnimation (mQSBSearchBar );
MQSBSearchBarAnim. reverse ();
} Else {
MQSBSearchBarAnim. cancel ();
If (mEnableDropDownDropTargets ){
MQSBSearchBar. setTranslationY (0 );
} Else {
MQSBSearchBar. setAlpha (0f );
}
}
MIsSearchBarHidden = false;
} KK version: 1. Modify Launcher3/res/layout-port/search_bar.xml as follows:
<RelativeLayout
Xmlns: android = "http://schemas.android.com/apk/res/android"
Xmlns: launcher = "http://schemas.android.com/apk/resauto/
Com. android. launcher3"
Style = "@ style/SearchDropTargetBar"
Android: layout_width = "match_parent"
Android: layout_height = "match_parent"
Android: background = "@ drawable/search_frame"
Android: visibility = "gone"> Add android: visibility = "gone"
2. Modify Launcher3/res/layout-port/launcher. xml as follows:
<Com. android. launcher3.DrawableStateProxyView
Android: id = "@ + id/voice_button_proxy"
Android: layout_width = "0dp"
Android: layout_height = "0dp"
Android: layout_gravity = "top | end"
Android: clickable = "true"
Android: onClick = "onClickVoiceButton"
Android: importantForAccessibility = "no"
Launcher: sourceViewId = "@ + id/voice_button"/> modify android: clickable = "false"
3. Modify the settings of Launcher3/src/com/android/launcher3/SearchDropTargetBar. java
The setup () method is as follows:
......
If (mEnableDropDownDropTargets ){
MQSBSearchBarAnim = ObjectAnimator. ofFloat (mQSBSearchBar, "translationY",-mBarHeight,-mBarHeight );
} Else {
MQSBSearchBarAnim = ObjectAnimator. ofFloat (mQSBSearchBar, "alpha", 0f, 0f );
}
......
4. Modify the settings of Launcher3/src/com/android/launcher3/SearchDropTargetBar. java
The showSearchBar () method is as follows:
Public void showSearchBar (boolean animated ){
Boolean needToCancelOngoingAnimation =
MQSBSearchBarAnim. isRunning ()&&! Animated;
If (! MIsSearchBarHidden &&! NeedToCancelOngoingAnimation) return;
If (animated ){
PrepareStartAnimation (mQSBSearchBar );
MQSBSearchBarAnim. reverse ();
} Else {
MQSBSearchBarAnim. cancel ();
If (mEnableDropDownDropTargets ){
MQSBSearchBar. setTranslationY (0 );
} Else {
MQSBSearchBar. setAlpha (0f );
}
}
MIsSearchBarHidden = false;
}
5. Modify the settings of Launcher3/src/com/android/launcher3/Workspace. java
The getChangeStateAnimation () method is as follows:
......
Float finalSearchBarAlpha =! StateIsNormal? 0f: 0f; // The default value is 1f: 0f.
......

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.