zoukankan      html  css  js  c++  java
  • android launcher2开发之 有抽屉改成无抽屉



    在launcher.java中在createShortcut方法中   屏蔽全部应用button
    修改之前
    View createShortcut(int layoutResId, ViewGroup parent, ShortcutInfo info) {
    BubbleTextView favorite = (BubbleTextView) mInflater.inflate(
    layoutResId, parent, false);
    favorite.applyFromShortcutInfo(info, mIconCache);
    favorite.setOnClickListener(this);
    if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS
    && info.getIcon(mIconCache) == null) {
    // All apps icon
    // Drawable d =
    // getResources().getDrawable(R.drawable.all_apps_button_icon);
    Drawable d = mHotseat.getAppsButtonBitmap();// qijinling

    Utilities.resizeIconDrawable(d);
    favorite.setCompoundDrawables(null, d, null, null);
    favorite.setOnTouchListener(getHapticFeedbackTouchListener());
    }
    Utilities.applyTypeface(favorite);
    return favorite;
    }




    修改之后
     */
    View createShortcut(int layoutResId, ViewGroup parent, ShortcutInfo info) {
    BubbleTextView favorite = (BubbleTextView) mInflater.inflate(
    layoutResId, parent, false);
    favorite.applyFromShortcutInfo(info, mIconCache);
    favorite.setOnClickListener(this);
    if (info.itemType == LauncherSettings.Favorites.ITEM_TYPE_ALLAPPS
    && info.getIcon(mIconCache) == null) {
    // All apps icon
    Drawable d = getResources().getDrawable(
    R.drawable.all_apps_button_icon);


    // 隐藏菜单
    favorite.setWidth(0);
    favorite.setHeight(0);
    favorite.setVisibility(View.GONE);
    Utilities.resizeIconDrawable(d);
    favorite.setCompoundDrawables(null, d, null, null);
    favorite.setOnTouchListener(getHapticFeedbackTouchListener());
    }
    Utilities.applyTypeface(favorite);
    return favorite;
    }










    然后在AppsCustomizePagedView类中 找到DISABLE_ALL_APPS 属性




      //无抽屉true  同理反之
        public static boolean DISABLE_ALL_APPS = true;   属性设置 TRUE 或者FAULE

  • 相关阅读:
    解压 Android 系统中的 system.img
    挂载system.img并提取文件
    [android]system.img文件的打包和解包
    linux修改权限
    不懂这个别说是刷机高手!安卓Recovery你知多少
    Android刷机
    eclipse的“sun.misc.BASE64Encoder”问题解决
    spring的multipartResolver和java后端获取的MultipartHttpServletRequest方法对比 (附:遇到的坑)
    《高性能mysql》笔记(第一章,mysql的架构与历史)
    hystrix流程图收藏
  • 原文地址:https://www.cnblogs.com/jhcelue/p/6789212.html
Copyright © 2011-2022 走看看