2014-09-22 4 views
0

guyz 테마 :이 ADWLauncher실행기 아이콘 내가 런처 아이콘 테마 다시 약간의 도움이 필요

static Drawable getIcon(PackageManager manager, Context context, ActivityInfo activityInfo) { 
     String themePackage=AlmostNexusSettingsHelper.getThemePackageName(context, Launcher.THEME_DEFAULT); 
     Drawable icon = null; 
     if(themePackage.equals(Launcher.THEME_DEFAULT)){ 
      icon = Utilities.createIconThumbnail(activityInfo.loadIcon(manager), context); 
     }else{ 
      // get from theme 
      Resources themeResources = null; 
      if(AlmostNexusSettingsHelper.getThemeIcons(context)){ 
       activityInfo.name=activityInfo.name.toLowerCase().replace(".", "_"); 
       try { 
        themeResources = manager.getResourcesForApplication(themePackage); 
       } catch (NameNotFoundException e) { 
        //e.printStackTrace(); 
       } 
       if(themeResources!=null){ 
        int resource_id = themeResources.getIdentifier(activityInfo.name, "drawable", themePackage); 
        if(resource_id!=0){ 
         icon=themeResources.getDrawable(resource_id); 
        } 

        // use IconShader 
        if(icon==null){ 
         if (compiledIconShaderName==null || 
          compiledIconShaderName.compareTo(themePackage)!=0){ 
          compiledIconShader = null; 
          resource_id = themeResources.getIdentifier("shader", "xml", themePackage); 
          if(resource_id!=0){ 
           XmlResourceParser xpp = themeResources.getXml(resource_id); 
           compiledIconShader = IconShader.parseXml(xpp); 
          } 
         } 

         if(compiledIconShader!=null){ 
          icon = Utilities.createIconThumbnail(activityInfo.loadIcon(manager), context); 
          try { 
           icon = IconShader.processIcon(icon, compiledIconShader); 
          } catch (Exception e) {} 
         } 
        } 
       } 
      } 

      if(icon==null){ 
       icon = Utilities.createIconThumbnail(activityInfo.loadIcon(manager), context); 
      }else{ 
       icon = Utilities.createIconThumbnail(icon, context); 
      } 
     } 
     return icon; 
    } 

에 LauncherModel.java에서 아이콘을 변경하는 방법입니다하지만 그런 방법이없는 페이지

을 LauncherModel에서는 대신 IconCache (ADWLauncher에 없음) (https://android.googlesource.com/platform/packages/apps/Launcher2/+/master/src/com/android/launcher2/IconCache.java) 어떻게 구현할 수있는 iconcache.java를 편집 할 수 있습니까?

답변

0

런처 아이콘을 변경하려면 그냥 내 프로젝트를 체크 아웃해야합니다. https://github.com/slightfoot/android-launcher-badges

+0

thnx, 나는 그것을 확인합니다,하지만 난 ADW의 테마 팩 호환성을 추가하기 위해 노력하고 있어요 : P 난 그냥 아이콘에 문제 가지고, 그것의 대부분을 추가 한 : -/ –

+0

내가 어쩌면 내가, 제거 shud 생각하고를 iconcache 시스템을 사용하고 ADWLauncher에서 수행 한 작업을 좋아하지만 내 마지막 수단은 앱 효율성에 영향을 미치기 때문입니다. –