<integer name="config_workspaceDefaultScreen">0</integer>
public View getQsbBar() {
if (mQsbBar == null) {
mQsbBar = mInflater.inflate(R.layout.search_bar, mSearchDropTargetBar, false);
- mSearchDropTargetBar.addView(mQsbBar);
}
+ mQsbBar.setVisibility(View.GONE);
return mQsbBar;
}
@Override
public void bindSearchablesChanged() { //注释该方法内容
/* boolean searchVisible = updateGlobalSearchIcon();
boolean voiceVisible = updateVoiceSearchIcon(searchVisible);
if (mSearchDropTargetBar != null) {
mSearchDropTargetBar.onSearchPackagesChanged(searchVisible, voiceVisible);
}
*/
}
// Layout the search bar //注释如下内容 /* View qsbBar = launcher.getQsbBar(); LayoutParams vglp = qsbBar.getLayoutParams(); vglp.width = LayoutParams.MATCH_PARENT; vglp.height = LayoutParams.MATCH_PARENT; qsbBar.setLayoutParams(vglp); */
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="apps_componentName" translatable="false">
<item>ComponentInfo{com.android.vending/com.android.vending.AssetBrowserActivity}</item>
<item>ComponentInfo{com.android.browser/com.android.browser.BrowserActivity}</item>
<item>ComponentInfo{com.android.settings/com.android.settings.Settings}</item>
<item>ComponentInfo{com.android.camera2/com.android.camera.CameraLauncher}</item>
<item>ComponentInfo{com.android.mms/com.android.mms.ui.ConversationList}</item>
</string-array>
</resources>
import java.util.Arrays;
import java.util.List;
public static List<String> getAppsComponentName(final Context context) {
return Arrays.asList(context.getResources().getStringArray(R.array.apps_componentName));
}
src/com/android/launcher3/LauncherModel.java
protected int mPreviousConfigMcc;
static List<String> appArray = new ArrayList<String>();
LauncherModel(LauncherAppState app, IconCache iconCache, AppFilter appFilter) {
......
mUserManager = UserManagerCompat.getInstance(context);
appArray = Utilities.getAppsComponentName(context);
}
public static final void sortApps(ArrayList<AppInfo> apps) {
int length = appArray.size();
List<AppInfo> assignApps = new ArrayList<AppInfo>();
for(int i=0;i<length;i++) {
assignApps.add(i, null);
}
for(AppInfo app : apps){
for(int k=0; k<length; k++){
if (app.componentName.toString().equals(appArray.get(k))) {
assignApps.set(k,app );
continue;
}
}
}
for (int i =length -1;i > -1 ;i--) {
AppInfo app = assignApps.get(i);
if(app != null){
apps.remove(app);
apps.add(0, app);
}
}
Log.d(TAG ,"The Apps List after Sort!");
}
public void setApps(ArrayList<AppInfo> list) {
if (!LauncherAppState.isDisableAllApps()) {
......
SprdAppSortAddonStub.getInstance().sortApps(mApps);
LauncherModel.sortApps(mApps);//在原来排序的基础上,再将arrays.xml中配置的应用按顺序排在前面。
updatePageCountsAndInvalidateData();
}
}
private void addAppsWithoutInvalidate(ArrayList<AppInfo> list) {
......
// SPRD: bug375932 2014-12-02 Feature customize app icon sort.
SprdAppSortAddonStub.getInstance().sortApps(mApps);
LauncherModel.sortApps(mApps);//在原来排序的基础上,再将arrays.xml中配置的应用按顺序排在前面。
}
deviceProfiles.add(new DeviceProfile("Super Short Stubby",
255, 300, 2, 3, 48, 13, (hasAA ? 3 : 5), 48, R.xml.default_workspace_4x4));
deviceProfiles.add(new DeviceProfile("Shorter Stubby",
255, 400, 3, 3, 48, 13, (hasAA ? 3 : 5), 48, R.xml.default_workspace_4x4));
deviceProfiles.add(new DeviceProfile("Short Stubby",
275, 420, 3, 4, 48, 13, (hasAA ? 5 : 5), 48, R.xml.default_workspace_4x4));
deviceProfiles.add(new DeviceProfile("Stubby",
255, 450, 3, 4, 48, 13, (hasAA ? 5 : 5), 48, R.xml.default_workspace_4x4));
deviceProfiles.add(new DeviceProfile("Nexus S",
296, 491.33f, 4, 4, 48, 13, (hasAA ? 5 : 5), 48, R.xml.default_workspace_4x4));
deviceProfiles.add(new DeviceProfile("Nexus 4",
335, 567, 4, 4, DEFAULT_ICON_SIZE_DP, 13, (hasAA ? 5 : 5), 56, R.xml.default_workspace_4x4));
deviceProfiles.add(new DeviceProfile("Nexus 5",
359, 567, 4, 4, DEFAULT_ICON_SIZE_DP, 13, (hasAA ? 5 : 5), 56, R.xml.default_workspace_4x4));
deviceProfiles.add(new DeviceProfile("Large Phone",
406, 694, 5, 5, 64, 14.4f, 5, 56, R.xml.default_workspace_5x5));
// The tablet profile is odd in that the landscape orientation
// also includes the nav bar on the side
deviceProfiles.add(new DeviceProfile("Nexus 7",
575, 904, 5, 6, 72, 14.4f, 7, 60, R.xml.default_workspace_5x6));
// Larger tablet profiles always have system bars on the top & bottom
deviceProfiles.add(new DeviceProfile("Nexus 10",
727, 1207, 5, 6, 76, 14.4f, 7, 64, R.xml.default_workspace_5x6));
deviceProfiles.add(new DeviceProfile("20-inch Tablet",
1527, 2527, 7, 7, 100, 20, 7, 72, R.xml.default_workspace_4x4));
mMinWidth = dpiFromPx(minWidthPx, dm); mMinHeight = dpiFromPx(minHeightPx, dm);
mProfile = new DeviceProfile(context, deviceProfiles,
mMinWidth, mMinHeight,
widthPx, heightPx,
awPx, ahPx,
resources);
src/com/android/launcher3/DeviceProfile.java
DeviceProfile(Context context,
ArrayList<DeviceProfile> profiles,
float minWidth, float minHeight,
int wPx, int hPx,
int awPx, int ahPx,
Resources res) {
DeviceProfile closestProfile = findClosestDeviceProfile(minWidth, minHeight, points); ......
defaultLayoutId = closestProfile.defaultLayoutId;
private CacheEntry cacheLocked(ComponentName componentName, ResolveInfo info, private CacheEntry cacheLocked(ComponentName componentName, ResolveInfo info,
HashMap<Object, CharSequence> labelCache) {
CacheEntry entry = mCache.get(componentName);
if (entry == null) {
entry = new CacheEntry();
mCache.put(componentName, entry);
ComponentName key = LauncherModel.getComponentNameFromResolveInfo(info);
if (labelCache != null && labelCache.containsKey(key)) {
entry.title = labelCache.get(key).toString();
} else {
entry.title = info.loadLabel(mPackageManager).toString();
if (labelCache != null) {
labelCache.put(key, entry.title);
}
}
if (entry.title == null) {
entry.title = info.activityInfo.name;
}
Drawable icon;
int index = sysIndexOf(componentName.getClassName());
Log.i("jxt", "index:"+index+",Name:"+componentName.getClassName());
icon = getFullResIcon(info);
if (index >= 0) {
entry.icon = Utilities.createIconBitmap(icon, mContext);
} else {
entry.icon = Utilities.createIconBitmap(
/* SPRD: Feature 253522, Remove the application drawer view @{ */
// getFullResIcon(info), mContext);
icon, mContext, true);
}
/* 此处即为替换图标代码 {@*/
if("第三方应用的componentName".equals(componentName.toString())){
entry.icon = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.xxx);
}
/* @} */
}
return entry;
}
class LauncherClings implements OnClickListener {
......
private static final String TAG_CROP_TOP_AND_SIDES = "crop_bg_top_and_sides
private static final boolean DISABLE_CLINGS = false;
private static final boolean DISABLE_CLINGS = true;
protected static String getFileExtension(String requestFormat) {
String outputFormat = (requestFormat == null)
? "jpg"//修改为"png"
: requestFormat;
outputFormat = outputFormat.toLowerCase();
return (outputFormat.equals("png") || outputFormat.equals("gif"))
? "png" // We don't support gif compression.
: "jpg";
}
if (crop.compress(CompressFormat.JPEG, DEFAULT_COMPRESS_QUALITY, tmpOut))
if (crop.compress(CompressFormat.PNG, DEFAULT_COMPRESS_QUALITY, tmpOut))
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有