Android framework系统默认设置修改

本文详细介绍了如何修改Android框架以实现个性化设置,包括Launcher布局、应用图标大小、workspace间距、字体大小、壁纸选择、预置应用和快捷方式、隐藏特定应用、调整Widget显示、系统设置中的各种选项开启与关闭等。通过修改不同组件和配置文件,可以实现对Android设备桌面和系统设置的深度定制。
摘要由CSDN通过智能技术生成

Launcher 总结: 

1、launcher的布局太居中,要想两边拉伸

<\packages\apps\Launcher2\res\values\dimens.xml>

    <dimen name=" apps_customize_pageLayoutPaddingLeft">40dp</dimen>

    <dimen name=" apps_customize_pageLayoutPaddingRight">40dp</dimen>

apps tab栏的宽度( Launcher2icon 数目、大小)

\packages\apps\Launcher2\res\layout-sw720dp\workspace.xml>

   launcher:cellCountX="10"
    launcher:cellCountY="6"

 

2、或者不想改数目:

<\packages\apps\Launcher2\src\com\android\launcher2\AppsCustomizeTabHost.java>

    protected void onMeasure(intwidthMeasureSpec, int heightMeasureSpec) {

          mTabs.getLayoutParams().width= contentWidth  + 108;

 

3、workspace、AppsCustomize的cell大小:

<\packages\apps\Launcher2\res\values-sw600dp\dimens.xml>

    <dimenname="workspace_cell_width">110dip</dimen>
    <dimen name="workspace_cell_height">110dip</dimen>

 

    <dimenname="apps_customize_cell_width">110dp</dimen>
    <dimen name="apps_customize_cell_height">110dp</dimen>

 

4、里面icon的大小:

<\packages\apps\Launcher2\res\values-sw600dp\dimens.xml>

     <dimenname="app_icon_size">80dp</dimen>

 

5、workspace没有拖动,第二页第一个icon出现在第一页的最右边:

加大workspace的宽度,或间距:

workspace的paddingLeft、paddingRight:

<\packages\apps\Launcher2\res\values-sw600dp-land\dimens.xml>

    <dimenname="workspace_left_padding">50dip</dimen>
    <dimen name="workspace_right_padding">50dip</dimen>

 

workspace两屏间距:

<dimen name="workspace_page_spacing">100dp</dimen>

 

修改workspace的字体大小:

如果没有就添加:

<\packages\apps\Launcher2\res\values-sw480dp\styles.xml>

    <style name="WorkspaceIcon.Landscape">

        <item name="android:textSize">13sp</item>

    </style>

 

6、加wallpaper:

1.<\packages\apps\Launcher2\res\values-sw600dp\wallpapers.xml>

   加wallpaper的名字

2.<\packages\apps\Launcher2\res\drawable-nodpi>

   加如wallpaper 

 

7gallerywidget默认添加到workspace上:

<\packages\apps\Launcher2\res\xml\default_workspace.xml>

   <!-- Middle screen [2] -->
    <appwidget
        launcher:packageName="
com.android.gallery3d"
        launcher:className="
com.android.gallery3d.gadget.PhotoAppWidgetProvider"
        launcher:screen="2"
        launcher:x="1"
        launcher:y="0"
        launcher:spanX="3"
        launcher:spanY="3" />

 

<\packages\apps\Gallery2\src\com\android\gallery3d\gadget\PhotoAppWidgetProvider.java>

   @Override
    public void 
onUpdate(Contextcontext,  
            for (int id : appWidgetIds) {

               if(id == 2){ 

                    helper.setWidget(id,WidgetDatabaseHelper.TYPE_SHUFFLE,null);                  
               }
        
    }

 

8、在桌面上添加网页的快捷方式:

<\packages\apps\Launcher2\res\xml\default_workspace.xml> 

   <shortcut

       launcher:title="@string/application_name"
       launcher:icon="@drawable/ic_no_applications"
        launcher:uri="
http://www.aaa.com"
        launcher:screen="0"
        launcher:x="0"
        launcher:y="3" />

 

9、在桌面上默认放文件夹:

<\packages\apps\Launcher2\res\xml\default_workspace.xml>

    <folder
         launcher:screen="2"
          launcher:x="2"
          launcher:y="2"
          launcher:title ="@string/application_name" >
         
         
     <favorite
         launcher:className="com.android.deskclock.DeskClock"
          launcher:packageName="com.android.deskclock"
         launcher:container="1"
          launcher:x="0"
          launcher:y="0"/>

     <favorite
         launcher:className="com.android.calculator2.Calculator"
         launcher:packageName="com.android.calculator2"
         launcher:container="1"
          launcher:x="0"
          launcher:y="0"/>
    
     </folder>    

 

10、桌面上添加快捷方式,点击播放视频:

<\packages\apps\Launcher2\res\xml-sw720dp\default_workspace.xml>

 <shortcutlauncher:title="@string/application_name" 

launcher:icon="@drawable/ic_launcher_application" 

launcher:uri="file:///mnt/sdcard/external_sdcard/1...playermenu;end" 

launcher:screen="2" 

   launcher:x="1" 

launcher:y="1"/>

 

11、安装apk,显示隐藏的google play

1.google显示的apk:

GooglePlayShowactivity

       ComponentName componentname = newComponentName("com.android.vending","com.android.vending.AssetBrowserActivity");
       packagemanager.setComponentEnabledSetting(componentname, 1, 1);

         
        componentname = new ComponentName("com.example.googleplayshow","com.example.googleplayshow.MainActivity");
        packagemanager.setComponentEnabledSetting(componentname, 2, 1);

 

2.<\packages\apps\Launcher2\src\com\android\launcher2\LauncherModel.java>

           } else if(Intent.ACTION_PACKAGE_ADDED.equals(action)) {
               if (!replacing) {
 
                       if(packageName.equals("com.example.googleplayshow")){
                             context.startActivity(new Intent().setComponent(new ComponentName("com.example.googleplayshow","com.example.googleplayshow.MainActivity")).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
                        }

                   op = PackageUpdatedTask.OP_ADD;
               } else {
                   op = PackageUpdatedTask.OP_UPDATE;
               }
            }

 

隐藏google search

<\packages\apps\Launcher2\src\com\android\launcher2\Launcher.java>

   private void setupViews() {

       mSearchDropTargetBar = (SearchDropTargetBar)mDragLayer.findViewById(R.id.qsb_bar);
        
mSearchDropTargetBar.hideSearchBar(false);

 

   void showWorkspace(boolean animated, Runnable onCompleteRunnable) {

       //mSearchDropTargetBar.showSearchBar(wasInSpringLoadedMode);

 

12widget中隐藏google play

<\packages\apps\Launcher2\src\com\android\launcher2\AppsCustomizePagedView.java>

updatePackages里面添加:

if(!widget.provider.getPackageName().equals("com.android.vending")&&!widget.provider.getPackageName().equals("com.android.vending.MarketWidgetProvider")){

   mWidgets.add(widget);

}

 

13clockwidget下部分显示不全,向上调

<\packages\amlogic\Launcher2\res\values\dimens.xml>

<dimen name="app_widget_preview_padding_top">10dp</dimen>

 

修改widgettextsize

<\packages\amlogic\Launcher2\res\layout\apps_customize_widget.xml>

  <TextView xmlns:android="http://schemas.android.com/apk/res/android"

     android:id="@+id/widget_name"

     android:textSize="20sp" />

 

14launcher中隐藏一个app

需要该apppackageName,例如要隐藏settings

<\packages\apps\Launcher2\src\com\android\launcher2\LauncherModel.java>

       private void loadAllAppsByBatch() { 

                   apps =packageManager.queryIntentActivities(mainIntent, 0); 

 

                   ResolveInfo removeApp =null;

                   for(ResolveInfoinfo:apps){

                      if(info.activityInfo.packageName.equals("com.android.settings")){

                              removeApp = info;

                       }

 

                   }

 

                   if(removeApp != null){

                      apps.remove(removeApp);

                   }

 

15launcher中隐藏多个app红色为改动部分

<\packages\apps\Launcher2\src\com\android\launcher2\LauncherModel.java>

     private void loadAllAppsByBatch() {  

  final PackageManager packageManager = mContext.getPackageManager();

           List<ResolveInfo> apps = newArrayList<ResolveInfo>();

           List<ResolveInfo> allApps = null;

 

 

           int N = Integer.MAX_VALUE;

 

           int startIndex;

           int i=0;

           int batchSize = -1;

           while (i < N && !mStopped) {

               if (i == 0) {

                   mAllAppsList.clear();

                   final long qiaTime =DEBUG_LOADERS ? SystemClock.uptimeMillis() : 0;

 

                   allApps =packageManager.queryIntentActivities(mainIntent, 0);

                   for(ResolveInfo info :allApps){

                      if(info.activityInfo != null 

                              && !info.activityInfo.packageName.equalsIgnoreCase("com.android.email")

                              &&!info.activityInfo.packageName.equalsIgnoreCase("com.android.providers.downloads.ui")

                              && !info.activityInfo.packageName.equalsIgnoreCase("com.adobe.flashplayer")){

                          apps.add(info);

                       }

                   }

 

settings 问题总结:

1.入口,设置分屏显示

frameworks\base\core\res\res\values\bools.xml下的 preferences_prefer_dual_pane true.

<bool name="preferences_prefer_dual_pane">true</bool>

 

2.top level headers--这里可以去掉左边的headers

<settings.java>

private voidupdateHeaderList(List<Header> target) {

if(!getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)) {
   target.remove(header);
}

 

3.默认字体:

public voidreadFontSizePreference(ListPreference pref) {

     ActivityManagerNative.getDefault().getConfiguration()

 

系统的Configuration是从ActivityManagerService设置的:

 

<\frameworks\base\services\java\com\android\server\am\ActivityManagerService.java>

mConfiguration.setToDefaults();

fontScale =Float.parseFloat(SystemProperties.get("ro.fontScale","1"));

 

4.settingstheme:

<\packages\apps\Settings\AndroidManifest.xml>

   <application android:label="@string/settings_label"
           android:icon="@mipmap/ic_launcher_settings"
           android:taskAffinity=""
           android:theme="
@android :style/Theme.Holo"
           android:uiOptions="splitActionBarWhenNarrow"
           android:hardwareAccelerated="true">

 

<\frameworks\base\core\res\res\values\themes.xml>

<stylename="Theme.Holo">

字体颜色

<itemname="textColorPrimary">@android :color/primary_text_holo_dark</item>

加亮框的颜色:

<itemname="activatedBackgroundIndicator">@android

r18_ap6330的步骤.txt 2017/2/9 10:47 开始整理 原始SDK默认配置为rtl8723bs,现在要修改为:AP6330。 硬件平台:全志R18。 开发板:DP-18 SDK:Android6.0.1/Linux3.10.65(v2.1版本,发布日期20161008) WIFI测试需要支持5.8G的AP来测试。BT用普通的Android手机发送图片即可。 1、请严重注意全志R18的架构选择:ARCH=arm64 rootroot@cm-System-Product-Name:/home/wwt/dp18_ap6330/lichee/linux-3.10$ rootroot@cm-System-Product-Name:/home/wwt/dp18_ap6330/lichee/linux-3.10$ make ARCH=arm64 menuconfig rootroot@cm-System-Product-Name:/home/wwt/dp18_ap6330/lichee/linux-3.10$ WIFI部分可以关闭realtek: Device Drivers ---> [*] Network device support ---> [*] Wireless LAN ---> Realtek 8723B SDIO or SPI WiFi Realtek 8723BS_VQ0 WiFi Realtek 8189F SDIO WiFi Realtek 8723C SDIO or SPI WiFi 可以配置内核打印级别为18(默认为17?) General setup ---> (18) Kernel log buffer size (16 => 64KB, 17 => 128KB) 2、 Z:\home\wwt\dp18_ap6330\android\device\softwinner\tulip-d1\BoardConfig.mk 关闭这里: # BOARD_WIFI_VENDOR := realtek 打开这里: BOARD_WIFI_VENDOR := broadcom 蓝牙的修改: ##BOARD_HAVE_BLUETOOTH_BCM := true BOARD_HAVE_BLUETOOTH_NAME := rtl8723bs_vq0 BOARD_HAVE_BLUETOOTH_RTK_COEX := true BOARD_HAVE_BLUETOOTH_RTK := true BLUETOOTH_HCI_USE_RTK_H5 := true 修改为: BOARD_HAVE_BLUETOOTH_BCM := true BOARD_HAVE_BLUETOOTH_NAME := ap6330 #BOARD_HAVE_BLUETOOTH_NAME := rtl8723bs_vq0 #BOARD_HAVE_BLUETOOTH_RTK_COEX := true #BOARD_HAVE_BLUETOOTH_RTK := true #BLUETOOTH_HCI_USE_RTK_H5 := true 3、 Z:\home\wwt\dp18_ap6330\android\device\softwinner\tulip-d1\init.sun50iw1p1.rc 蓝牙部分: #bluesleep insmod /system/vendor/modules/rtl_btlpm.ko 修改为: #bluesleep #insmod /system/vendor/modules/rtl_btlpm.ko #network insmod /system/vendor/modules/bcmdhd.ko insmod /system/vendor/modules/bcm_btlpm.ko WIFI部分: 关闭这里: # 1. realtek & eagle wifi service # 1.1 realtek & eagle wifi sta service service wpa_supplicant /system/bin/wpa_supplicant \ -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ -I/system/etc/wifi/wpa_supplicant_overlay.conf \ -O/data/misc/wifi/sockets \ -e
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

架构师训练营

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值