Android桌面Launcher2修改笔记


1、修改workspace消失动画

从workspace切换到其他界面时,有个workspace缩小的动画,默认缩小到0.7,不够,改成缩小到0.

修改workspace.java中getChangeStateAnimation函数如下部分:

 if (state != State.NORMAL) {
        	finalScaleFactor = mSpringLoadedShrinkFactor - (stateIsSmall ? 0.1f : 0);
          

修改为

 if (state != State.NORMAL) {        	
            finalScaleFactor = stateIsSmall ? 0 : mSpringLoadedShrinkFactor;


2、QSB bar放到横屏的顶部

把values-land\styles.xml中QSB相关配置替换成values\styles.xml中的配置
然后layout-land\launcher.xml 作如下修改

 

<include
            android:id="@+id/qsb_bar"
            layout="@layout/qsb_bar"            
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="top|center"/>

3、All App页面背景透明

layout\apps_customize_pane.xml 作如下修改

<com.android.mainmenu.AppsCustomizeTabHost
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:launcher="http://schemas.android.com/apk/res/com.android.mainmenu"
    android:background="#00000000">
    
<FrameLayout
    android:id="@+id/animation_buffer"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#a0000000"
    android:visibility="gone" />

然后修改 updateWallpaperVisibility 这个函数

  void updateWallpaperVisibility(boolean visible) {
    	
    	// 增加这一句把背景搞成透明
    	visible = true;
    	
    	
        int wpflags = visible ? WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER : 0;
        int curflags = getWindow().getAttributes().flags
                & WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
        if (wpflags != curflags) {
            getWindow().setFlags(wpflags, WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER);
        }
        setWorkspaceBackground(visible);
    }

4、去掉HotSeat

1>修改HotSeat.xml文件

<com.android.mainmenu.Hotseat
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:launcher="http://schemas.android.com/apk/res/com.android.mainmenu"
    launcher:cellCountX="0"
    launcher:cellCountY="1">
launcher:cellCountX="0" 去掉显示空间。

2>修改 showOutOfSpaceMessage 这个函数,删掉HotSeat的提示

void showOutOfSpaceMessage(boolean isHotseatLayout) {
	if (!isHotseatLayout)
	{
        int strId = (isHotseatLayout ? R.string.hotseat_out_of_space : R.string.out_of_space);
        Toast.makeText(this, getString(strId), Toast.LENGTH_SHORT).show();
    }
}

5、瘦身

1>、删掉res子目录下的所有wallpaper*.jpg

2>、注释掉 AndroidManifest.xml 下的这句话,去掉编辑壁纸功能。

  <!-- 
    <action android:name="android.intent.action.SET_WALLPAPER" />
  -->	


原生800*480 launcher 界面



修改后的界面





  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值