当前位置:   article > 正文

android launcher进入编辑模式创建文件夹_launcher创建文件夹

launcher创建文件夹
  1. 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
  2. index 3adb7529033..d92e2ccc77b 100644
  3. --- a/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java
  4. +++ b/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java
  5. @@ -128,7 +128,8 @@ public class BadgedImageView extends ImageView {
  6. Path iconPath = PathParser.createPathFromPathData(
  7. getResources().getString(com.android.internal.R.string.config_icon_mask));
  8. - mDotRenderer = new DotRenderer(mPositioner.getBubbleSize(),iconPath, DEFAULT_PATH_SIZE);
  9. + mDotRenderer = new DotRenderer(mPositioner.getBubbleSize(),
  10. + iconPath, DEFAULT_PATH_SIZE);
  11. }
  12. public void showDotAndBadge(boolean onLeft) {
  13. @@ -208,7 +209,8 @@ public class BadgedImageView extends ImageView {
  14. * @param iconPath The new icon path to use when calculating dot position.
  15. */
  16. void drawDot(Path iconPath) {
  17. - mDotRenderer = new DotRenderer(mPositioner.getBubbleSize(),iconPath, DEFAULT_PATH_SIZE);
  18. + mDotRenderer = new DotRenderer(mPositioner.getBubbleSize(),
  19. + iconPath, DEFAULT_PATH_SIZE);
  20. invalidate();
  21. }
  22. diff --git a/frameworks/libs/systemui/iconloaderlib/res/drawable-hdpi/icon_selected.png b/frameworks/libs/systemui/iconloaderlib/res/drawable-hdpi/icon_selected.png
  23. deleted file mode 100755
  24. index f34b16b8b2a..00000000000
  25. Binary files a/frameworks/libs/systemui/iconloaderlib/res/drawable-hdpi/icon_selected.png and /dev/null differ
  26. diff --git a/frameworks/libs/systemui/iconloaderlib/res/drawable-hdpi/icon_unselect.png b/frameworks/libs/systemui/iconloaderlib/res/drawable-hdpi/icon_unselect.png
  27. deleted file mode 100755
  28. index 8aecf242925..00000000000
  29. Binary files a/frameworks/libs/systemui/iconloaderlib/res/drawable-hdpi/icon_unselect.png and /dev/null differ
  30. diff --git a/frameworks/libs/systemui/iconloaderlib/res/values/colors.xml b/frameworks/libs/systemui/iconloaderlib/res/values/colors.xml
  31. index 40b77aeda90..70582c2e252 100644
  32. --- a/frameworks/libs/systemui/iconloaderlib/res/values/colors.xml
  33. +++ b/frameworks/libs/systemui/iconloaderlib/res/values/colors.xml
  34. @@ -21,6 +21,4 @@
  35. <!-- Yellow 600, used for highlighting "important" conversations in settings & notifications -->
  36. <color name="important_conversation">#f9ab00</color>
  37. - <color name="icon_badge_color">#e83242</color>
  38. - <color name="icon_badge_color1">#00ff00</color>
  39. </resources>
  40. 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
  41. index 8672d24c216..97a0fd3ffca 100644
  42. --- a/frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/DotRenderer.java
  43. +++ b/frameworks/libs/systemui/iconloaderlib/src/com/android/launcher3/icons/DotRenderer.java
  44. @@ -29,11 +29,6 @@ import android.graphics.Rect;
  45. import android.graphics.RectF;
  46. import android.util.Log;
  47. import android.view.ViewDebug;
  48. -import android.content.Context;
  49. -import android.graphics.BitmapFactory;
  50. -import android.graphics.Typeface;
  51. -import static android.graphics.Paint.ANTI_ALIAS_FLAG;
  52. -import static android.graphics.Paint.FILTER_BITMAP_FLAG;
  53. /**
  54. * Used to draw a notification dot on top of an icon.
  55. @@ -68,88 +63,7 @@ public class DotRenderer {
  56. mLeftDotPosition = getPathPoint(iconShapePath, pathSize, -1);
  57. mRightDotPosition = getPathPoint(iconShapePath, pathSize, 1);
  58. }
  59. - //alan add start
  60. - public DotRenderer(Context context,int iconSizePx, Path iconShapePath, int pathSize) {
  61. - int size = Math.round(SIZE_PERCENTAGE * iconSizePx);
  62. - ShadowGenerator.Builder builder = new ShadowGenerator.Builder(Color.TRANSPARENT);
  63. - builder.ambientShadowAlpha = 88;
  64. - mBackgroundWithShadow = builder.setupBlurForSize(size).createPill(size, size);
  65. - mCircleRadius = builder.radius;
  66. -
  67. - mBitmapOffset = -mBackgroundWithShadow.getHeight() * 0.5f; // Same as width.
  68. - // Find the points on the path that are closest to the top left and right corners.
  69. - mLeftDotPosition = getPathPoint(iconShapePath, pathSize, -1);
  70. - mRightDotPosition = getPathPoint(iconShapePath, pathSize, 1);
  71. - initOtherParams(context);
  72. - }
  73. -
  74. - private Bitmap mSelectedIcon;
  75. - private Bitmap mUnselectIcon;
  76. - private Rect mBitmapRect = new Rect();
  77. - private RectF mTargetRect = new RectF();
  78. - private int mNoticeDotcolor;
  79. - private Paint mNoticeTextPaint;
  80. -
  81. - private void initOtherParams(Context context) {
  82. - mSelectedIcon = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon_selected);
  83. - mUnselectIcon = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon_unselect);
  84. -
  85. - mBitmapRect.set(0, 0, mSelectedIcon.getWidth(), mSelectedIcon.getHeight());
  86. - mTargetRect.set(-mCircleRadius, -mCircleRadius, mCircleRadius, mCircleRadius);
  87. -
  88. - mNoticeDotcolor = context.getColor(R.color.icon_badge_color);
  89. -
  90. - mNoticeTextPaint = new Paint(ANTI_ALIAS_FLAG);
  91. - mNoticeTextPaint.setTextSize(mCircleRadius * 1.45f);
  92. - mNoticeTextPaint.setColor(Color.WHITE);
  93. - mNoticeTextPaint.setTextAlign(Paint.Align.CENTER);
  94. - }
  95. -
  96. - private void resetTargetRect() {
  97. - mTargetRect.set(-mCircleRadius, -mCircleRadius, mCircleRadius, mCircleRadius);
  98. - }
  99. -
  100. - private void drawDots(Canvas canvas, DrawParams params){
  101. - resetTargetRect();
  102. - if (drawSelectDot(canvas, params)) {
  103. - } else if (params.noticeCount > 0) {
  104. - drawNotificationDot(canvas, params);
  105. - }
  106. - }
  107. -
  108. - private boolean drawSelectDot(Canvas canvas, DrawParams params) {
  109. - if (!params.isInSelectMode) return false;
  110. - Bitmap bitmap = params.isSelected ? mSelectedIcon : mUnselectIcon;
  111. - canvas.drawBitmap(bitmap, mBitmapRect, mTargetRect, mCirclePaint);
  112. - return params.isInSelectMode;
  113. - }
  114. -
  115. - private void drawNotificationDot(Canvas canvas, DrawParams params) {
  116. - mCirclePaint.setColor(mNoticeDotcolor);
  117. - if (params.isDotTypeBadges) {
  118. - canvas.drawRoundRect(mTargetRect, mCircleRadius, mCircleRadius, mCirclePaint);
  119. - return;
  120. - }
  121. -
  122. - int noticeCount = params.noticeCount;
  123. - if (noticeCount > 99) {
  124. - mTargetRect.set(-mCircleRadius - 16, -mCircleRadius - 1, mCircleRadius + 16, mCircleRadius + 1);
  125. - } else if (noticeCount > 9) {
  126. - mTargetRect.set(-mCircleRadius - 5, -mCircleRadius - 1, mCircleRadius + 5, mCircleRadius + 1);
  127. - }
  128. - canvas.drawRoundRect(mTargetRect, mCircleRadius + 1, mCircleRadius + 1, mCirclePaint);
  129. -
  130. - String unreadText = noticeCount > 99 ? "99+" : String.valueOf(noticeCount);
  131. -
  132. - float centerX = mTargetRect.left + mTargetRect.width() / 2.0f;
  133. - float centerY = mTargetRect.top + mTargetRect.height() / 2.0f;
  134. -
  135. - Paint.FontMetrics fontMetrics = mNoticeTextPaint.getFontMetrics();
  136. - float offsetY = (fontMetrics.ascent + fontMetrics.bottom) / 2f;
  137. - canvas.drawText(unreadText, centerX, centerY - offsetY, mNoticeTextPaint);
  138. - }
  139. - //alan add end
  140. private static float[] getPathPoint(Path path, float size, float direction) {
  141. float halfSize = size / 2;
  142. // Small delta so that we don't get a zero size triangle
  143. @@ -205,11 +119,10 @@ public class DotRenderer {
  144. canvas.translate(dotCenterX + offsetX, dotCenterY + offsetY);
  145. canvas.scale(params.scale, params.scale);
  146. -// mCirclePaint.setColor(Color.BLACK);
  147. -// canvas.drawBitmap(mBackgroundWithShadow, mBitmapOffset, mBitmapOffset, mCirclePaint);
  148. -// mCirclePaint.setColor(params.color);
  149. -// canvas.drawCircle(0, 0, mCircleRadius, mCirclePaint);
  150. - drawDots(canvas,params);
  151. + mCirclePaint.setColor(Color.BLACK);
  152. + canvas.drawBitmap(mBackgroundWithShadow, mBitmapOffset, mBitmapOffset, mCirclePaint);
  153. + mCirclePaint.setColor(params.color);
  154. + canvas.drawCircle(0, 0, mCircleRadius, mCirclePaint);
  155. canvas.restore();
  156. }
  157. @@ -226,29 +139,5 @@ public class DotRenderer {
  158. /** Whether the dot should align to the top left of the icon rather than the top right. */
  159. @ViewDebug.ExportedProperty(category = "notification dot")
  160. public boolean leftAlign;
  161. -
  162. - //alan add start
  163. - public boolean isInSelectMode = false;
  164. -
  165. - public boolean isSelected = false;
  166. -
  167. - public boolean isDotTypeBadges = false;
  168. -
  169. - public int noticeCount;
  170. -
  171. - @Override
  172. - public String toString() {
  173. - return "DrawParams{" +
  174. - "color=" + color +
  175. - ", iconBounds=" + iconBounds +
  176. - ", scale=" + scale +
  177. - ", leftAlign=" + leftAlign +
  178. - ", isInSelectMode=" + isInSelectMode +
  179. - ", isSelected=" + isSelected +
  180. - ", isDotTypeBadges=" + isDotTypeBadges +
  181. - ", noticeCount=" + noticeCount +
  182. - '}';
  183. - }
  184. - //alan add end
  185. }
  186. }
  187. diff --git a/packages/apps/Launcher3/res/drawable-xxhdpi/icon_create_folder.png b/packages/apps/Launcher3/res/drawable-xxhdpi/icon_create_folder.png
  188. deleted file mode 100755
  189. index eec2d4e7041..00000000000
  190. Binary files a/packages/apps/Launcher3/res/drawable-xxhdpi/icon_create_folder.png and /dev/null differ
  191. diff --git a/packages/apps/Launcher3/res/layout/custome_groupalign_target_bar.xml b/packages/apps/Launcher3/res/layout/custome_groupalign_target_bar.xml
  192. index 3fd381e64f1..df189c0a887 100755
  193. --- a/packages/apps/Launcher3/res/layout/custome_groupalign_target_bar.xml
  194. +++ b/packages/apps/Launcher3/res/layout/custome_groupalign_target_bar.xml
  195. @@ -13,32 +13,55 @@
  196. See the License for the specific language governing permissions and
  197. limitations under the License.
  198. -->
  199. -<com.android.launcher3.DropTargetBar xmlns:android="http://schemas.android.com/apk/res/android"
  200. +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  201. android:layout_width="match_parent"
  202. android:layout_height="@dimen/dynamic_grid_drop_target_size"
  203. android:layout_gravity="center_horizontal|top"
  204. android:focusable="false"
  205. - android:alpha="0"
  206. + android:alpha="1"
  207. + android:orientation="horizontal"
  208. android:theme="@style/HomeScreenElementTheme"
  209. android:visibility="invisible">
  210. -
  211. - <!-- Delete target -->
  212. - <com.android.launcher3.CreateFolderDropTarget
  213. + <View
  214. + android:layout_width="20dp"
  215. + android:layout_height="wrap_content"
  216. + android:layout_weight="0.4"
  217. + android:gravity="center"
  218. + android:layout_gravity="center"/>
  219. + <TextView
  220. android:id="@+id/group_target_text"
  221. - style="@style/DropTargetButton"
  222. - android:layout_width="match_parent"
  223. - android:layout_height="match_parent"
  224. + style="@style/DropTargetButtonBase"
  225. + android:layout_width="80dp"
  226. + android:layout_height="wrap_content"
  227. android:layout_gravity="center"
  228. + android:layout_weight="1"
  229. android:gravity="center"
  230. + android:drawablePadding="3dp"
  231. + android:drawableLeft="@mipmap/folder_group"
  232. android:text="@string/group_drop_target_label" />
  233. -
  234. - <com.android.launcher3.AlignDropTarget
  235. + <View
  236. + android:layout_width="20dp"
  237. + android:layout_height="wrap_content"
  238. + android:layout_gravity="center"
  239. + android:layout_weight="0.4"
  240. + android:gravity="center"/>
  241. + <!-- Uninstall target -->
  242. + <TextView
  243. android:id="@+id/align_target_text"
  244. - style="@style/DropTargetButton"
  245. - android:layout_width="match_parent"
  246. - android:layout_height="match_parent"
  247. + style="@style/DropTargetButtonBase"
  248. + android:layout_width="80dp"
  249. + android:layout_height="wrap_content"
  250. android:layout_gravity="center"
  251. android:gravity="center"
  252. + android:layout_weight="1"
  253. + android:drawablePadding="3dp"
  254. + android:drawableLeft="@mipmap/align_icon"
  255. android:text="@string/align_drop_target_label" />
  256. -
  257. -</com.android.launcher3.DropTargetBar>
  258. \ No newline at end of file
  259. + <View
  260. + android:layout_width="20dp"
  261. + android:layout_height="wrap_content"
  262. + android:layout_gravity="center"
  263. + android:layout_weight="0.4"
  264. + android:gravity="center"/>
  265. + <!-- Delete target -->
  266. +</LinearLayout>
  267. \ No newline at end of file
  268. diff --git a/packages/apps/Launcher3/res/values/strings.xml b/packages/apps/Launcher3/res/values/strings.xml
  269. index 562631b0520..bd7b1e35357 100644
  270. --- a/packages/apps/Launcher3/res/values/strings.xml
  271. +++ b/packages/apps/Launcher3/res/values/strings.xml
  272. @@ -496,8 +496,8 @@
  273. <!-- Label for uninstall drop target (from the device).
  274. May appear next to remove_drop_target_label [CHAR_LIMIT=20]-->
  275. <string name="uninstall_drop_target_label">Uninstall</string>
  276. - <string name="group_drop_target_label" >Create Folder</string>
  277. - <string name="align_drop_target_label" >Align</string>
  278. + <string name="group_drop_target_label" >"成组"</string>
  279. + <string name="align_drop_target_label" >"对齐"</string>
  280. <!-- Label for app info drop target. [CHAR_LIMIT=20] -->
  281. <string name="app_info_drop_target_label">App info</string>
  282. <!-- Label for install drop target. [CHAR_LIMIT=20] -->
  283. diff --git a/packages/apps/Launcher3/src/com/android/launcher3/AlignDropTarget.java b/packages/apps/Launcher3/src/com/android/launcher3/AlignDropTarget.java
  284. deleted file mode 100755
  285. index eb2e0c52630..00000000000
  286. --- a/packages/apps/Launcher3/src/com/android/launcher3/AlignDropTarget.java
  287. +++ /dev/null
  288. @@ -1,121 +0,0 @@
  289. -package com.android.launcher3;
  290. -import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ITEM_DROPPED_ON_CANCEL;
  291. -import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ITEM_DROPPED_ON_REMOVE;
  292. -import static com.android.launcher3.logging.StatsLogManage
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/952663
推荐阅读
相关标签
  

闽ICP备14008679号