View the shortcut key F4 for the class's inheritance relationship. In Android Studio, you often use shortcut keys in this article. Have written. Today is mainly about some of the configuration of the interface of this shortcut key. This piece of functionality is relatively cold and may be used by very many people. However, many of these configurations are similar in Android studio.
Nonsense not much to say directly. For example, I select activity, and then press F4. On the right, there will be a diagram with an inheritance relationship to the activity.
1, the first brief analysis of several elements:
Note: The number of icons in this section is from left to right.
First icon : Displays the entire inheritance relationship. Contains the parent class, child class
second icon : Show Parent class
third icon : Show sub-class
The Fourth icon : alphabetical order, this is not very useful, we do not care
Scope: This is the scope, that is, you want to query which scope of the inheritance relationship, the following drop-down box is to select the scope you want.
I won't say the next few icons, it's not too much.
Say it again. There are two types of class icons that are queried for inheritance relationships:
icon with small gray lock : class in source code
no small gray lock : class in current project
2. Scope Brief Analysis:
Before explaining the point, the so-called do not show the source code in the class, are down. Not upward. For example, I look at the inheritance of activity, assuming that you choose to not show the scope of the source code, only refers to the activity of the source code of the subclass of the non-display, if not understood, see the following production description.
Production: In fact, the query scope is currently project. This time hides the non-project classes that inherit the activity, for example listactivity.
All: This is a good understanding that includes this project and the source code
Test: This is, in a sense, the same as this class.
This class: Current classes
Configure: Configure the range of queries you want to set yourself.
The default option is the above few. As for Local,share, I joined it myself.
I chose production, for example. You'll just see myactivity, and My Code also has classes that inherit myactivity. So there's an arrow in front of myactivity. It's just that I didn't unfold.
Once again, select MyActivity, then press F4, bring up the inheritance graph, select the second icon, and then the range selects the current class, and you can see the parent class of myactivity.
Select a third icon. This time you can only see the myactivity of the class.
It is expected that some people will say how I am not able to use it. That's because your scope is a problem, be sure to pay attention to the scope of your choice.
3, the next major point of configure after how to configure
1) Icon and area function analysis
First through the Configure to join the scope, I joined the local and share two, in fact you can join the type is two, either local or share, name you can take ha. My side is easy to explain so just name it by type.
Share with a small white arrow, local no, very good distinction.
First icon : Add a scope
second icon : delete scope
third icon : Copy a scope, here is a complete copy except name, name unnamed
Fourth icon : Save your selected scope as. There's a time when you might get a little bit out of this, this is the bug in Android Studio, you turn off the dialog box, and once again, you can configure.
The fifth to sixth icon : Change position icon, for example, you can move the local to share above.
Pattern: Range Matching (this piece of content will be spoken along with the four buttons on the right)
The pattern below has a row of selectable content , which in fact is the choice of your project and the reference package to show in what way, assuming you think this piece is too confusing to see. You choose a different way, the following production classes and library classes will be displayed depending on the display you choose.
include,exclude: The two are relative, one to join, one to remove, all for pattern, here is the add removal for package level content
Include Recursively,exclude recursively: These two are also relative. Add and remove pattern content. Here is the addition and removal of content at the class level
You can also get the pattern content by clicking the White button behind the pattern. To edit directly.
2) Configure the number of references
Check share, then copy, you can see that there is a unnamed in the scope,unnamed pattern content is the same as the share. I set the pattern of the share to the MyActivity class:
Set the local pattern to com.example.myapp.* in this package
Configuration is complete. Click OK. Back to the Inheritance relationship page, let's look at the effect. Choose Share, you will see this time myactivity subclass Bactivity will not be queried out. Because it is not in the query scope.
Select Local,local Range is the entire package, this time you can see bactivity also be queried out
OK, that's all for today, the next one will introduce the assumption of building project with Gradle
Viewing inheritance relationships for classes in Android Studio