Public void setopen (Boolean open, Boolean animate) {<br/> If (isopen () ^ open) {// The same is false, true </P> <p >}< br/> Public Boolean isopen () {<br/> return mcontent. getvisibility () = visible; <br/>}< br/>
As shown in the code above. You need to implement setopen () // to enable and disable a panle. Benefits of using exclusive or operations
A ^ B. When A and B are the same --> false, A, and B are true.
1. when panle is invisible, if it is open = true, panle visible should be executed in the IF statement block. If it is open = false, it is invisible, all if statement blocks are not executed.
2. when panle is visible, if it is open = true, panle visible should be implemented. If it is open = false, the IF statement block will not be executed. If it is open = false, it will be visible, and all the if statement blocks will be executed.
When using an exclusive or statement, consider not all the above situations !!!!