detach the view from the parent before adding to borderView
TIMOB-12134-formatted the code as per the standard, removed the additional null check
Merge pull request #3752 from salachi/TIMOB-12134-borderWidth

detach the view from the parent before adding to borderView