version:1.5
fix:迁移到奥乐云平台 add:
This commit is contained in:
@@ -16,5 +16,5 @@
|
||||
-->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.android.colorfulos.icons">
|
||||
package="com.aoleyun.os.icons">
|
||||
</manifest>
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/legacy_icon_background"/>
|
||||
<foreground>
|
||||
<com.android.colorfulos.icons.FixedScaleDrawable />
|
||||
<com.aoleyun.os.icons.FixedScaleDrawable />
|
||||
</foreground>
|
||||
</adaptive-icon>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.android.colorfulos.icons;
|
||||
package com.aoleyun.os.icons;
|
||||
|
||||
import static android.graphics.Paint.DITHER_FLAG;
|
||||
import static android.graphics.Paint.FILTER_BITMAP_FLAG;
|
||||
|
||||
import static com.android.colorfulos.icons.ShadowGenerator.BLUR_FACTOR;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
@@ -22,6 +20,8 @@ import android.os.Build;
|
||||
import android.os.Process;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import com.aoleyun.os.icons.R;
|
||||
|
||||
/**
|
||||
* This class will be moved to androidx library. There shouldn't be any dependency outside
|
||||
* this package.
|
||||
@@ -269,7 +269,7 @@ public class BaseIconFactory implements AutoCloseable {
|
||||
mOldBounds.set(icon.getBounds());
|
||||
|
||||
if (ATLEAST_OREO && icon instanceof AdaptiveIconDrawable) {
|
||||
int offset = Math.max((int) Math.ceil(BLUR_FACTOR * size),
|
||||
int offset = Math.max((int) Math.ceil(ShadowGenerator.BLUR_FACTOR * size),
|
||||
Math.round(size * (1 - scale) / 2 ));
|
||||
icon.setBounds(offset, offset, size - offset, size - offset);
|
||||
icon.draw(mCanvas);
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.colorfulos.icons;
|
||||
package com.aoleyun.os.icons;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Bitmap.Config;
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.colorfulos.icons;
|
||||
package com.aoleyun.os.icons;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.graphics.Bitmap;
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.colorfulos.icons;
|
||||
package com.aoleyun.os.icons;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.colorfulos.icons;
|
||||
package com.aoleyun.os.icons;
|
||||
|
||||
import static android.graphics.Paint.ANTI_ALIAS_FLAG;
|
||||
import static android.graphics.Paint.FILTER_BITMAP_FLAG;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.android.colorfulos.icons;
|
||||
package com.aoleyun.os.icons;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.Resources.Theme;
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.colorfulos.icons;
|
||||
package com.aoleyun.os.icons;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Rect;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.colorfulos.icons;
|
||||
package com.aoleyun.os.icons;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
@@ -14,9 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.colorfulos.icons;
|
||||
|
||||
import static com.android.colorfulos.icons.GraphicsUtils.setColorAlphaBound;
|
||||
package com.aoleyun.os.icons;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Bitmap.Config;
|
||||
@@ -146,12 +144,12 @@ public class ShadowGenerator {
|
||||
|
||||
// Key shadow
|
||||
p.setShadowLayer(shadowBlur, 0, keyShadowDistance,
|
||||
setColorAlphaBound(Color.BLACK, keyShadowAlpha));
|
||||
GraphicsUtils.setColorAlphaBound(Color.BLACK, keyShadowAlpha));
|
||||
c.drawRoundRect(bounds, radius, radius, p);
|
||||
|
||||
// Ambient shadow
|
||||
p.setShadowLayer(shadowBlur, 0, 0,
|
||||
setColorAlphaBound(Color.BLACK, ambientShadowAlpha));
|
||||
GraphicsUtils.setColorAlphaBound(Color.BLACK, ambientShadowAlpha));
|
||||
c.drawRoundRect(bounds, radius, radius, p);
|
||||
|
||||
if (Color.alpha(color) < 255) {
|
||||
@@ -13,11 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.colorfulos.icons.cache;
|
||||
|
||||
import static com.android.colorfulos.icons.BaseIconFactory.getFullResDefaultActivityIcon;
|
||||
import static com.android.colorfulos.icons.BitmapInfo.LOW_RES_ICON;
|
||||
import static com.android.colorfulos.icons.GraphicsUtils.setColorAlphaBound;
|
||||
package com.aoleyun.os.icons.cache;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.ContentValues;
|
||||
@@ -42,12 +38,12 @@ import android.os.UserHandle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.colorfulos.icons.BaseIconFactory;
|
||||
import com.android.colorfulos.icons.BitmapInfo;
|
||||
import com.android.colorfulos.icons.BitmapRenderer;
|
||||
import com.android.colorfulos.icons.GraphicsUtils;
|
||||
import com.android.colorfulos.util.ComponentKey;
|
||||
import com.android.colorfulos.util.SQLiteCacheHelper;
|
||||
import com.aoleyun.os.icons.BaseIconFactory;
|
||||
import com.aoleyun.os.icons.BitmapInfo;
|
||||
import com.aoleyun.os.icons.BitmapRenderer;
|
||||
import com.aoleyun.os.icons.GraphicsUtils;
|
||||
import com.aoleyun.os.util.ComponentKey;
|
||||
import com.aoleyun.os.util.SQLiteCacheHelper;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.Collections;
|
||||
@@ -162,14 +158,14 @@ public abstract class BaseIconCache {
|
||||
return resources.getDrawableForDensity(iconId, mIconDpi);
|
||||
} catch (Resources.NotFoundException e) { }
|
||||
}
|
||||
return getFullResDefaultActivityIcon(mIconDpi);
|
||||
return BaseIconFactory.getFullResDefaultActivityIcon(mIconDpi);
|
||||
}
|
||||
|
||||
public Drawable getFullResIcon(String packageName, int iconId) {
|
||||
try {
|
||||
return getFullResIcon(mPackageManager.getResourcesForApplication(packageName), iconId);
|
||||
} catch (PackageManager.NameNotFoundException e) { }
|
||||
return getFullResDefaultActivityIcon(mIconDpi);
|
||||
return BaseIconFactory.getFullResDefaultActivityIcon(mIconDpi);
|
||||
}
|
||||
|
||||
public Drawable getFullResIcon(ActivityInfo info) {
|
||||
@@ -177,7 +173,7 @@ public abstract class BaseIconCache {
|
||||
return getFullResIcon(mPackageManager.getResourcesForApplication(info.applicationInfo),
|
||||
info.getIconResource());
|
||||
} catch (PackageManager.NameNotFoundException e) { }
|
||||
return getFullResDefaultActivityIcon(mIconDpi);
|
||||
return BaseIconFactory.getFullResDefaultActivityIcon(mIconDpi);
|
||||
}
|
||||
|
||||
private BitmapInfo makeDefaultIcon(UserHandle user) {
|
||||
@@ -439,7 +435,7 @@ public abstract class BaseIconCache {
|
||||
|
||||
entry.title = appInfo.loadLabel(mPackageManager);
|
||||
entry.contentDescription = mPackageManager.getUserBadgedLabel(entry.title, user);
|
||||
entry.icon = useLowResIcon ? LOW_RES_ICON : iconInfo.icon;
|
||||
entry.icon = useLowResIcon ? BitmapInfo.LOW_RES_ICON : iconInfo.icon;
|
||||
entry.color = iconInfo.color;
|
||||
|
||||
// Add the icon in the DB here, since these do not get written during
|
||||
@@ -473,7 +469,7 @@ public abstract class BaseIconCache {
|
||||
Long.toString(getSerialNumberForUser(cacheKey.user))});
|
||||
if (c.moveToNext()) {
|
||||
// Set the alpha to be 255, so that we never have a wrong color
|
||||
entry.color = setColorAlphaBound(c.getInt(0), 255);
|
||||
entry.color = GraphicsUtils.setColorAlphaBound(c.getInt(0), 255);
|
||||
entry.title = c.getString(1);
|
||||
if (entry.title == null) {
|
||||
entry.title = "";
|
||||
@@ -484,7 +480,7 @@ public abstract class BaseIconCache {
|
||||
}
|
||||
|
||||
if (lowRes) {
|
||||
entry.icon = LOW_RES_ICON;
|
||||
entry.icon = BitmapInfo.LOW_RES_ICON;
|
||||
} else {
|
||||
byte[] data = c.getBlob(2);
|
||||
try {
|
||||
@@ -13,13 +13,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.colorfulos.icons.cache;
|
||||
package com.aoleyun.os.icons.cache;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import com.android.colorfulos.icons.BitmapInfo;
|
||||
import com.aoleyun.os.icons.BitmapInfo;
|
||||
|
||||
public interface CachingLogic<T> {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.colorfulos.icons.cache;
|
||||
package com.aoleyun.os.icons.cache;
|
||||
|
||||
import android.os.Handler;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.colorfulos.icons.cache;
|
||||
package com.aoleyun.os.icons.cache;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
@@ -27,7 +27,7 @@ import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.SparseBooleanArray;
|
||||
|
||||
import com.android.colorfulos.icons.cache.BaseIconCache.IconDB;
|
||||
import com.aoleyun.os.icons.cache.BaseIconCache.IconDB;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.android.colorfulos.util;
|
||||
package com.aoleyun.os.util;
|
||||
|
||||
/**
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.colorfulos.util;
|
||||
package com.aoleyun.os.util;
|
||||
|
||||
import static android.database.sqlite.SQLiteDatabase.NO_LOCALIZED_COLLATORS;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.android.colorfulos.util;
|
||||
package com.aoleyun.os.util;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
@@ -14,10 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.colorfulos.icons;
|
||||
package com.aoleyun.os.icons;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.aoleyun.os.icons.R;
|
||||
|
||||
/**
|
||||
* Wrapper class to provide access to {@link BaseIconFactory} and also to provide pool of this class
|
||||
* that are threadsafe.
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.colorfulos.icons;
|
||||
package com.aoleyun.os.icons;
|
||||
|
||||
import static android.content.Intent.ACTION_MANAGED_PROFILE_ADDED;
|
||||
import static android.content.Intent.ACTION_MANAGED_PROFILE_REMOVED;
|
||||
@@ -32,7 +32,8 @@ import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.util.SparseLongArray;
|
||||
|
||||
import com.android.colorfulos.icons.cache.BaseIconCache;
|
||||
import com.aoleyun.os.icons.R;
|
||||
import com.aoleyun.os.icons.cache.BaseIconCache;
|
||||
|
||||
/**
|
||||
* Wrapper class to provide access to {@link BaseIconFactory} and also to provide pool of this class
|
||||
Reference in New Issue
Block a user