Android 11.0 Launcher3 app图标和hotseat 添加背景(焦点选中背景)

在11.0进行Tv设备定制化开发中,由于需要使用遥控器来移动来控制点击功能,所以需要给app 的Icon 和hotseat 添加背景来显示选中状态
所以就需要在Launcher3中给Item 添加默认背景

在Launcher3中布局是由Workspace 构造的 每一个页面由一个CellLayout组成,CellLayout还不是真正容纳图标的ViewGroup,每个CellLayout会包含一个ShortcutAndWidgetContainer,这才是真正容纳图标和Widget的ViewGroup。

接下来具体看ShortcutAndWidgetContainer.java 的源码分析问题
路径: /packages/apps/Launcher3/src/com/android/launcher3/ShortcutAndWidgetContainer.java

public class ShortcutAndWidgetContainer extends ViewGroup {
   
    
    
    static final String TAG = "ShortcutAndWidgetContainer";

    // These are temporary variables to prevent having to allocate a new object just to
    // return an (x, y

猜你喜欢

转载自blog.csdn.net/baidu_41666295/article/details/124790066