欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android開發(fā)實(shí)現(xiàn)Launcher3應(yīng)用列表修改透明背景的方法

 更新時(shí)間:2017年11月03日 11:55:16   作者:偉雪無痕  
這篇文章主要介紹了Android開發(fā)實(shí)現(xiàn)Launcher3應(yīng)用列表修改透明背景的方法,結(jié)合實(shí)例形式分析了Launcher3相關(guān)配置文件與功能函數(shù)修改設(shè)置操作技巧,需要的朋友可以參考下

本文實(shí)例講述了Android開發(fā)實(shí)現(xiàn)Launcher3應(yīng)用列表修改透明背景的方法。分享給大家供大家參考,具體如下:

Launcher時(shí)開機(jī)完成后第一個(gè)啟動(dòng)的應(yīng)用,用來展示應(yīng)用列表和快捷方式、小部件等。Launcher作為第一個(gè)(開機(jī)后第一個(gè)啟動(dòng)的應(yīng)用)展示給用戶的應(yīng)用程序,其設(shè)計(jì)的好壞影響到用戶的體驗(yàn),甚至影響用戶購機(jī)的判斷。所以很多品牌廠商都會(huì)不遺余力的對Launcher進(jìn)行深度定制,如小米的MIUI、華為的EMUI等。Android默認(rèn)的Launcher沒有過多的定制,更加簡潔,受到源生黨的追捧,Google的Nexus系列手機(jī)基本都是用的源生Launcher,目前Android源生的Launcher版本是Launcher3。

前面總結(jié)了一些常見的launcher3配置修改方法,這里來分析一下launcher3的應(yīng)用列表背景的修改技巧。

將launcher3的應(yīng)用列表背景修改為透明,與Launcher2略有不同,需要進(jìn)行如下步驟:

1. 找到res/layout/apps_customize_pane.xml文件,將

<com.android.launcher3.appscustomizetabhost
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:background="#FF000000">

修改為:

<com.android.launcher3.appscustomizetabhost
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:background="#00000000">

將動(dòng)畫部分

<frameLayout
android:id="@+id/animation_buffer" 
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF000000"
android:visibility="gone" />

修改為:

<frameLayout
 android:id="@+id/animation_buffer" 
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000"
android:visibility="gone" />

2、找到AppsCustomizeTabHost.java類中的onTabChangedEnd()方法,如下:

private void onTabChangedEnd(AppsCustomizePagedView.ContentType type) {
    int bgAlpha = (int) (255 * (getResources().getInteger(
      R.integer.config_appsCustomizeSpringLoadedBgAlpha) / 100f));
    setBackgroundColor(Color.argb(bgAlpha, 0, 0, 0));
    mAppsCustomizePane.setContentType(type);
}

其中bgAlpha為透明度的參數(shù),將其改為你需要的透明度即可,255為不透明,以上1、2步驟完之后,保存,編譯,即可達(dá)到需要的效果。

更多關(guān)于Android相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《Android開發(fā)入門與進(jìn)階教程》、《Android調(diào)試技巧與常見問題解決方法匯總》、《Android多媒體操作技巧匯總(音頻,視頻,錄音等)》、《Android基本組件用法總結(jié)》、《Android視圖View技巧總結(jié)》、《Android布局layout技巧總結(jié)》及《Android控件用法總結(jié)

希望本文所述對大家Android程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論