[NUI] Refactoring ControlState to use bitmask #6530
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ControlState was implemented inefficently on the memory and the performance. This patch purposed to reduce inefficency by using bitflags on the state instead of string list. [https://github.sec.samsung.net/NUI/OneUIComponents/issues/15]
long type bitmask will be represent each states,
1 1 1 1 1
O S D P F
Normal : 0L
Focused : 1L
Pressed : 2L
Disabled : 4L
Selected : 8L
Other : 16L
and All : 31L
This concept is based on VisualState of NUI2,
https://github.sec.samsung.net/dotnet/nui2/blob/main/src/Tizen.NUI2.Components/Base/ViewState.cs but we had to modified few states to keep backward compatibility of NUI ControlState.
Description of Change
API Changes