launcher2修改

1、修改workspace消失动画

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

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

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

修改为

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


2、QSB bar放到横屏的顶部

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

 

  1. <include  
  2.             android:id="@+id/qsb_bar"  
  3.             layout="@layout/qsb_bar"              
  4.             android:layout_width="match_parent"  
  5.             android:layout_height="wrap_content"  
  6.             android:layout_gravity="top|center"/>  

3、All App页面背景透明

layout\apps_customize_pane.xml 作如下修改

  1. <com.android.mainmenu.AppsCustomizeTabHost  
  2.     xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     xmlns:launcher="http://schemas.android.com/apk/res/com.android.mainmenu"  
  4.     android:background="#00000000">  
  5.       
  6. <FrameLayout  
  7.     android:id="@+id/animation_buffer"  
  8.     android:layout_width="match_parent"  
  9.     android:layout_height="match_parent"  
  10.     android:background="#a0000000"  
  11.     android:visibility="gone" />  

然后修改 updateWallpaperVisibility 这个函数

  1. void updateWallpaperVisibility(boolean visible) {  
  2.       
  3.     // 增加这一句把背景搞成透明  
  4.     visible = true;  
  5.       
  6.       
  7.       int wpflags = visible ? WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER : 0;  
  8.       int curflags = getWindow().getAttributes().flags  
  9.               & WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;  
  10.       if (wpflags != curflags) {  
  11.           getWindow().setFlags(wpflags, WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER);  
  12.       }  
  13.       setWorkspaceBackground(visible);  
  14.   }  

4、去掉HotSeat

1>修改HotSeat.xml文件

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

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

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

5、瘦身

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

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

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


原生800*480 launcher 界面



修改后的界面


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值