Launcher橫屏的修改方法

一些產品在橫屏使用時,也希望hotseat在屏幕的下方。一個朋友問具體是怎麼做的。我現在把我目前做的寫在下面,希望對要做這件事的人有所幫助。

 

 

diff -r res//layout-land/launcher.xml /home/hu/原始的代碼/Gingerbread/packages/apps/Launcher2/res//layout-land/launcher.xml


<         android:layout_height="fill_parent"
<         android:layout_width="@dimen/button_bar_height_portrait"
<         android:layout_gravity="right|center_vertical"
---
>         android:layout_height="@dimen/button_bar_height"
>         android:layout_width="fill_parent"
>         android:layout_gravity="bottom|center_horizontal"


<             launcher:direction="vertical"
---
>             launcher:direction="horizontal"
>            
>         <ImageView
>             android:id="@+id/hotseat_left1"
>             style="@style/HotseatButton"
>             android:layout_toLeftOf="@id/all_apps_button"
>             android:src="@drawable/hotseat_phone"
>             android:onClick="launchHotSeat"
>             />
>            
>   <ImageView                                                       //我擴展了一些 hotseat 。 只留了一個當例子。
>             android:id="@+id/hotseat_left"
>             style="@style/HotseatButton.Left"
>             android:layout_toLeftOf="@id/hotseat_left1"
>             android:src="@drawable/hotseat_namecard"
>             android:onClick="launchHotSeat"
>             />
>            
>         <ImageView
>             android:id="@+id/hotseat_right1"
>             style="@style/HotseatButton"
>             android:layout_toRightOf="@id/all_apps_button"
>
>             android:src="@drawable/hotseat_call_log"
>
>             android:onClick="launchHotSeat"


diff -r res//layout-land/workspace_screen.xml /home/hu/原始的代碼/Gingerbread/packages/apps/Launcher2/res//layout-land/workspace_screen.xml
27,32c27,32
<     launcher:longAxisStartPadding="65dip"
<     launcher:longAxisEndPadding="65dip"
<     launcher:shortAxisStartPadding="0dip"
<     launcher:shortAxisEndPadding="0dip"
<     launcher:shortAxisCells="4"
<     launcher:longAxisCells="4" />
---
>     launcher:longAxisStartPadding="6dip"                                  // 這個可以任意調整
>     launcher:longAxisEndPadding="6dip"
>     launcher:shortAxisStartPadding="1dip"
>     launcher:shortAxisEndPadding="1dip"
>     launcher:shortAxisCells="6"
>     launcher:longAxisCells="6" />


diff -r res//values/arrays.xml /home/hu/原始的代碼/Gingerbread/packages/apps/Launcher2/res//values/arrays.xml
3a4
>         <item>intent:#Intent;action=com.android.contacts.action.LIST_CONTACTS;end</item>
5c6,7
<         <item>*BROWSER*</item>
---
>         <item>intent:#Intent;action=com.android.phone.action.RECENT_CALLS;end</item>
>         <item>intent:#Intent;action=com.android.schedule.action.XXXX_SCHEDULE</item>    //擴展了hotseat上按鍵的intent參數
8,9c10,13
<         <item>@drawable/hotseat_phone</item>
<         <item>@drawable/hotseat_browser</item>
---
>         <item>@drawable/hotseat_namecard</item>                                        // Launcher啓動後,Launcher.java還要重新初始化界面。
>         <item>@drawable/hotseat_inner_phone</item>
>         <item>@drawable/hotseat_call_log</item>
>         <item>@drawable/hotseat_schedule</item>
diff -r res//values-land/styles.xml /home/hu/原始的代碼/Gingerbread/packages/apps/Launcher2/res//values-land/styles.xml
22,23c22,23
<         <item name="android:paddingTop">12dip</item>
<         <item name="android:paddingBottom">12dip</item>
---
>         <item name="android:paddingTop">2dip</item>
>         <item name="android:paddingBottom">2dip</item>
25,26c25,26
<         <item name="android:layout_height">wrap_content</item>                    //這就是那個朋友問的問題。
<         <item name="android:layout_width">fill_parent</item>
---
>         <item name="android:layout_height">fill_parent</item>
>         <item name="android:layout_width">wrap_content</item>
32c32
<         <item name="android:layout_marginBottom">4dip</item>
---
>         <item name="android:layout_marginBottom">0dip</item>
36c36
<         <item name="android:layout_marginTop">4dip</item>
---
>         <item name="android:layout_marginTop">0dip</item>
diff -r res//xml/default_workspace.xml /home/hu/原始的代碼/Gingerbread/packages/apps/Launcher2/res//xml/default_workspace.xml
47,48c47,48
<         launcher:packageName="com.android.music"
<         launcher:className="com.android.music.MediaAppWidgetProvider"
---
>         launcher:packageName="com.android.xxx_calendar.widget"
>         launcher:className="com.android.xxx_calendar.widget.Calendar_widget"                 //希望開機就加載自己的AppWidget。這個還不對,哪個朋友知道原因,請賜教。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章