您的位置:首页 > 移动开发 > Android开发

[RK3288][Android7.1.2] Launcher3 源码阅读之step6:根据布局文件找到对应的自定义View

2017-08-17 13:39 721 查看
launcher.xml文件里面有引用了一些自定义View。具体在哪里实施呢?我们根据xml布局文件必须要知道以下的自定义View。

public abstract class BaseRecyclerView extends RecyclerView
public abstract class ButtonDropTarget extends TextView
public abstract class PagedView extends ViewGroup
public abstract class PageIndicator extends FrameLayout
public abstract class BaseContainerView extends FrameLayout
public class InsettableFrameLayout extends FrameLayout
public class Hotseat extends FrameLayout
public class AllAppsRecyclerViewContainerView extends FrameLayout
public class LauncherRootView extends InsettableFrameLayout
public class DragLayer extends InsettableFrameLayout
public class Workspace extends PagedView
public class DropTargetBar extends LinearLayout
public class DeleteDropTarget extends ButtonDropTarget
public class ExtendedEditText extends EditText
public class UninstallDropTarget extends ButtonDropTarget
public class InfoDropTarget extends UninstallDropTarget
public class PageIndicatorCaretLandscape extends PageIndicator
public class WidgetsContainerView extends BaseContainerView
public class AllAppsContainerView extends BaseContainerView
public class WidgetsRecyclerView extends BaseRecyclerView
public class AllAppsRecyclerView extends BaseRecyclerView
public class CellLayout extends ViewGroup
这里简单说明一下: 有五个类是继承了 FrameLayout 帧布局。也就是说,这些类是在帧布局的基础上再分化出来的。

在  FrameLayout 家族树形的结构如下:共计10个类

FrameLayout ---> PageIndicator ---> PageIndicatorCaretLandscape
FrameLayout ---> BaseContainerView ---> WidgetsContainerView
FrameLayout ---> BaseContainerView ---> AllAppsContainerView
FrameLayout ---> InsettableFrameLayout ---> LauncherRootView
FrameLayout ---> InsettableFrameLayout ---> DragLayer
FrameLayout ---> AllAppsRecyclerViewContainerView
FrameLayout ---> Hotseat
RecyclerView 家族树形结构如下:共计3个类

RecyclerView ---> BaseRecyclerView ---> WidgetsRecyclerView
RecyclerView ---> BaseRecyclerView ---> AllAppsRecyclerView
TextView 家族树形结构如下:共计4个类

TextView ---> ButtonDropTarget ---> DeleteDropTarget
TextView ---> ButtonDropTarget ---> UninstallDropTarget
TextView ---> ButtonDropTarget ---> UninstallDropTarget ---> InfoDropTarget
ViewGroup 树形结构:

ViewGroup ---> PagedView ---> Workspace
ViewGroup ---> CellLayoutEditText 树形结构:
EditText ---> ExtendedEditTextLinearLayout 树形结构:
LinearLayout ---> DropTargetBar

这样,我们就会知道大致这些自定义View的祖宗都是些什么了。这会很好帮助我们分析这些自定义View。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐