Ex-spouses cannot be friends. An individual can remain civil with an ex if minor children are involved. But friends? No.
A relationship with someone who chooses to remain "friends" with an ex-spouse is a bad headache which will deepen into an unforgiving and never ending migraine.