赞
踩
- diff --git a/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java b/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java
- index 3adb7529033..d92e2ccc77b 100644
- --- a/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java
- +++ b/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java
- @@ -128,7 +128,8 @@ public class BadgedImageView extends ImageView {
-
- Path iconPath = PathParser.createPathFromPathData(
- getResources().getString(com.android.internal.R.string.config_icon_mask));
- - mDotRenderer = new DotRenderer(mPositioner.getBubbleSize(),iconPath, DEFAULT_PATH_SIZE);
- + mDotRenderer = new DotRenderer(mPositioner.getBubbleSize(),
- + iconPath, DEFAULT_PATH_SIZE);
- }
-
- public void showDotAndBadge(boolean onLeft) {
- @@ -208,7 +209,8 @@ public class BadgedImageView extends ImageView {
- * @param iconPath The new icon path to use when calculating dot position.
- */
- void drawDot(Path iconPath) {
- - mDotRenderer = new DotRenderer(mPositioner.getBubbleSize(),iconPath, DEFAULT_PATH_SIZE);
- + mDotRenderer = new DotRenderer(mPositioner.getBubbleSize(),
- + iconPath, DEFAULT_PATH_SIZE);
- invalidate();
- }
-
- diff --git a/frameworks/libs/systemui/iconloaderlib/res/drawable-hdpi/icon_selected.png b/frameworks/libs/systemui/iconloaderlib/res/drawable-hdpi/icon_selected.png
- deleted file mode 100755
- index f34b16b8b2a..00000000000
- Binary files a/frameworks/libs/systemui/iconloaderlib/res/drawable-hdpi/icon_selected.png and /dev/null differ
- diff --git a/frameworks/libs/systemui/iconloaderlib/res/drawable-hdpi/icon_unselect.png b/frameworks/libs/systemui/iconloaderlib/res/drawable-hdpi/icon_unselect.png
- deleted file mode 100755
- index 8aecf242925..00000000000
- Binary files a/frameworks/libs/systemui/iconloaderlib/res/drawable-hdpi/icon_unselect.png and /dev/null differ
- diff --git a/frameworks/libs/systemui/iconloaderlib/res/values/colors.xml b/frameworks/libs/systemui/iconloaderlib/res/values/colors.xml
- index 40b77aeda90..70582c2e252 100644
- --- a/frameworks/libs/systemui/iconloaderlib/res/values/colors.xml
- +++ b/frameworks/libs/systemui/iconloaderlib/res/values/colors.xml
- @@ -21,6 +21,4 @@
-
- <!-- Yellow 600, used for highlighting "important" conversations in settings & notifications -->
- <color name="important_conversation">#f9ab00</color>
- - <color name="icon_badge_color">#e83242</color>
- - <color name="icon_badge_color1">#00ff00</color>
- </resources>
- diff --git a/frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/DotRenderer.java b/frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/DotRenderer.java
- index 8672d24c216..97a0fd3ffca 100644
- --- a/frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/DotRenderer.java
- +++ b/frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/DotRenderer.java
- @@ -29,11 +29,6 @@ import android.graphics.Rect;
- import android.graphics.RectF;
- import android.util.Log;
- import android.view.ViewDebug;
- -import android.content.Context;
- -import android.graphics.BitmapFactory;
- -import android.graphics.Typeface;
- -import static android.graphics.Paint.ANTI_ALIAS_FLAG;
- -import static android.graphics.Paint.FILTER_BITMAP_FLAG;
-
- /**
- * Used to draw a notification dot on top of an icon.
- @@ -68,88 +63,7 @@ public class DotRenderer {
- mLeftDotPosition = getPathPoint(iconShapePath, pathSize, -1);
- mRightDotPosition = getPathPoint(iconShapePath, pathSize, 1);
- }
- - //alan add start
- - public DotRenderer(Context context,int iconSizePx, Path iconShapePath, int pathSize) {
- - int size = Math.round(SIZE_PERCENTAGE * iconSizePx);
- - ShadowGenerator.Builder builder = new ShadowGenerator.Builder(Color.TRANSPARENT);
- - builder.ambientShadowAlpha = 88;
- - mBackgroundWithShadow = builder.setupBlurForSize(size).createPill(size, size);
- - mCircleRadius = builder.radius;
- -
- - mBitmapOffset = -mBackgroundWithShadow.getHeight() * 0.5f; // Same as width.
-
- - // Find the points on the path that are closest to the top left and right corners.
- - mLeftDotPosition = getPathPoint(iconShapePath, pathSize, -1);
- - mRightDotPosition = getPathPoint(iconShapePath, pathSize, 1);
- - initOtherParams(context);
- - }
- -
- - private Bitmap mSelectedIcon;
- - private Bitmap mUnselectIcon;
- - private Rect mBitmapRect = new Rect();
- - private RectF mTargetRect = new RectF();
- - private int mNoticeDotcolor;
- - private Paint mNoticeTextPaint;
- -
- - private void initOtherParams(Context context) {
- - mSelectedIcon = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon_selected);
- - mUnselectIcon = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon_unselect);
- -
- - mBitmapRect.set(0, 0, mSelectedIcon.getWidth(), mSelectedIcon.getHeight());
- - mTargetRect.set(-mCircleRadius, -mCircleRadius, mCircleRadius, mCircleRadius);
- -
- - mNoticeDotcolor = context.getColor(R.color.icon_badge_color);
- -
- - mNoticeTextPaint = new Paint(ANTI_ALIAS_FLAG);
- - mNoticeTextPaint.setTextSize(mCircleRadius * 1.45f);
- - mNoticeTextPaint.setColor(Color.WHITE);
- - mNoticeTextPaint.setTextAlign(Paint.Align.CENTER);
- - }
- -
- - private void resetTargetRect() {
- - mTargetRect.set(-mCircleRadius, -mCircleRadius, mCircleRadius, mCircleRadius);
- - }
- -
- - private void drawDots(Canvas canvas, DrawParams params){
- - resetTargetRect();
- - if (drawSelectDot(canvas, params)) {
- - } else if (params.noticeCount > 0) {
- - drawNotificationDot(canvas, params);
- - }
- - }
- -
- - private boolean drawSelectDot(Canvas canvas, DrawParams params) {
- - if (!params.isInSelectMode) return false;
- - Bitmap bitmap = params.isSelected ? mSelectedIcon : mUnselectIcon;
- - canvas.drawBitmap(bitmap, mBitmapRect, mTargetRect, mCirclePaint);
- - return params.isInSelectMode;
- - }
- -
- - private void drawNotificationDot(Canvas canvas, DrawParams params) {
- - mCirclePaint.setColor(mNoticeDotcolor);
- - if (params.isDotTypeBadges) {
- - canvas.drawRoundRect(mTargetRect, mCircleRadius, mCircleRadius, mCirclePaint);
- - return;
- - }
- -
- - int noticeCount = params.noticeCount;
- - if (noticeCount > 99) {
- - mTargetRect.set(-mCircleRadius - 16, -mCircleRadius - 1, mCircleRadius + 16, mCircleRadius + 1);
- - } else if (noticeCount > 9) {
- - mTargetRect.set(-mCircleRadius - 5, -mCircleRadius - 1, mCircleRadius + 5, mCircleRadius + 1);
- - }
- - canvas.drawRoundRect(mTargetRect, mCircleRadius + 1, mCircleRadius + 1, mCirclePaint);
- -
- - String unreadText = noticeCount > 99 ? "99+" : String.valueOf(noticeCount);
- -
- - float centerX = mTargetRect.left + mTargetRect.width() / 2.0f;
- - float centerY = mTargetRect.top + mTargetRect.height() / 2.0f;
- -
- - Paint.FontMetrics fontMetrics = mNoticeTextPaint.getFontMetrics();
- - float offsetY = (fontMetrics.ascent + fontMetrics.bottom) / 2f;
- - canvas.drawText(unreadText, centerX, centerY - offsetY, mNoticeTextPaint);
- - }
- - //alan add end
- private static float[] getPathPoint(Path path, float size, float direction) {
- float halfSize = size / 2;
- // Small delta so that we don't get a zero size triangle
- @@ -205,11 +119,10 @@ public class DotRenderer {
- canvas.translate(dotCenterX + offsetX, dotCenterY + offsetY);
- canvas.scale(params.scale, params.scale);
-
- -// mCirclePaint.setColor(Color.BLACK);
- -// canvas.drawBitmap(mBackgroundWithShadow, mBitmapOffset, mBitmapOffset, mCirclePaint);
- -// mCirclePaint.setColor(params.color);
- -// canvas.drawCircle(0, 0, mCircleRadius, mCirclePaint);
- - drawDots(canvas,params);
- + mCirclePaint.setColor(Color.BLACK);
- + canvas.drawBitmap(mBackgroundWithShadow, mBitmapOffset, mBitmapOffset, mCirclePaint);
- + mCirclePaint.setColor(params.color);
- + canvas.drawCircle(0, 0, mCircleRadius, mCirclePaint);
- canvas.restore();
- }
-
- @@ -226,29 +139,5 @@ public class DotRenderer {
- /** Whether the dot should align to the top left of the icon rather than the top right. */
- @ViewDebug.ExportedProperty(category = "notification dot")
- public boolean leftAlign;
- -
- - //alan add start
- - public boolean isInSelectMode = false;
- -
- - public boolean isSelected = false;
- -
- - public boolean isDotTypeBadges = false;
- -
- - public int noticeCount;
- -
- - @Override
- - public String toString() {
- - return "DrawParams{" +
- - "color=" + color +
- - ", iconBounds=" + iconBounds +
- - ", scale=" + scale +
- - ", leftAlign=" + leftAlign +
- - ", isInSelectMode=" + isInSelectMode +
- - ", isSelected=" + isSelected +
- - ", isDotTypeBadges=" + isDotTypeBadges +
- - ", noticeCount=" + noticeCount +
- - '}';
- - }
- - //alan add end
- }
- }
- diff --git a/packages/apps/Launcher3/res/drawable-xxhdpi/icon_create_folder.png b/packages/apps/Launcher3/res/drawable-xxhdpi/icon_create_folder.png
- deleted file mode 100755
- index eec2d4e7041..00000000000
- Binary files a/packages/apps/Launcher3/res/drawable-xxhdpi/icon_create_folder.png and /dev/null differ
- diff --git a/packages/apps/Launcher3/res/layout/custome_groupalign_target_bar.xml b/packages/apps/Launcher3/res/layout/custome_groupalign_target_bar.xml
- index 3fd381e64f1..df189c0a887 100755
- --- a/packages/apps/Launcher3/res/layout/custome_groupalign_target_bar.xml
- +++ b/packages/apps/Launcher3/res/layout/custome_groupalign_target_bar.xml
- @@ -13,32 +13,55 @@
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
- -<com.android.launcher3.DropTargetBar xmlns:android="http://schemas.android.com/apk/res/android"
- +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="@dimen/dynamic_grid_drop_target_size"
- android:layout_gravity="center_horizontal|top"
- android:focusable="false"
- - android:alpha="0"
- + android:alpha="1"
- + android:orientation="horizontal"
- android:theme="@style/HomeScreenElementTheme"
- android:visibility="invisible">
- -
- - <!-- Delete target -->
- - <com.android.launcher3.CreateFolderDropTarget
- + <View
- + android:layout_width="20dp"
- + android:layout_height="wrap_content"
- + android:layout_weight="0.4"
- + android:gravity="center"
- + android:layout_gravity="center"/>
- + <TextView
- android:id="@+id/group_target_text"
- - style="@style/DropTargetButton"
- - android:layout_width="match_parent"
- - android:layout_height="match_parent"
- + style="@style/DropTargetButtonBase"
- + android:layout_width="80dp"
- + android:layout_height="wrap_content"
- android:layout_gravity="center"
- + android:layout_weight="1"
- android:gravity="center"
- + android:drawablePadding="3dp"
- + android:drawableLeft="@mipmap/folder_group"
- android:text="@string/group_drop_target_label" />
- -
- - <com.android.launcher3.AlignDropTarget
- + <View
- + android:layout_width="20dp"
- + android:layout_height="wrap_content"
- + android:layout_gravity="center"
- + android:layout_weight="0.4"
- + android:gravity="center"/>
- + <!-- Uninstall target -->
- + <TextView
- android:id="@+id/align_target_text"
- - style="@style/DropTargetButton"
- - android:layout_width="match_parent"
- - android:layout_height="match_parent"
- + style="@style/DropTargetButtonBase"
- + android:layout_width="80dp"
- + android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:gravity="center"
- + android:layout_weight="1"
- + android:drawablePadding="3dp"
- + android:drawableLeft="@mipmap/align_icon"
- android:text="@string/align_drop_target_label" />
- -
- -</com.android.launcher3.DropTargetBar>
- \ No newline at end of file
- + <View
- + android:layout_width="20dp"
- + android:layout_height="wrap_content"
- + android:layout_gravity="center"
- + android:layout_weight="0.4"
- + android:gravity="center"/>
- + <!-- Delete target -->
- +</LinearLayout>
- \ No newline at end of file
- diff --git a/packages/apps/Launcher3/res/values/strings.xml b/packages/apps/Launcher3/res/values/strings.xml
- index 562631b0520..bd7b1e35357 100644
- --- a/packages/apps/Launcher3/res/values/strings.xml
- +++ b/packages/apps/Launcher3/res/values/strings.xml
- @@ -496,8 +496,8 @@
- <!-- Label for uninstall drop target (from the device).
- May appear next to remove_drop_target_label [CHAR_LIMIT=20]-->
- <string name="uninstall_drop_target_label">Uninstall</string>
- - <string name="group_drop_target_label" >Create Folder</string>
- - <string name="align_drop_target_label" >Align</string>
- + <string name="group_drop_target_label" >"成组"</string>
- + <string name="align_drop_target_label" >"对齐"</string>
- <!-- Label for app info drop target. [CHAR_LIMIT=20] -->
- <string name="app_info_drop_target_label">App info</string>
- <!-- Label for install drop target. [CHAR_LIMIT=20] -->
- diff --git a/packages/apps/Launcher3/src/com/android/launcher3/AlignDropTarget.java b/packages/apps/Launcher3/src/com/android/launcher3/AlignDropTarget.java
- deleted file mode 100755
- index eb2e0c52630..00000000000
- --- a/packages/apps/Launcher3/src/com/android/launcher3/AlignDropTarget.java
- +++ /dev/null
- @@ -1,121 +0,0 @@
- -package com.android.launcher3;
- -import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ITEM_DROPPED_ON_CANCEL;
- -import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ITEM_DROPPED_ON_REMOVE;
- -import static com.android.launcher3.logging.StatsLogManage
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。