Commit ee34ac7d by Daniel Dahan

development: added automatic removal of subviews when reloading button containers

parent 2904209e
...@@ -324,6 +324,10 @@ public class BasicCardView : MaterialCardView, Comparable { ...@@ -324,6 +324,10 @@ public class BasicCardView : MaterialCardView, Comparable {
buttonsContainer!.translatesAutoresizingMaskIntoConstraints = false buttonsContainer!.translatesAutoresizingMaskIntoConstraints = false
buttonsContainer!.backgroundColor = MaterialTheme.clear.color buttonsContainer!.backgroundColor = MaterialTheme.clear.color
addSubview(buttonsContainer!) addSubview(buttonsContainer!)
} else {
for v in buttonsContainer!.subviews {
v.removeFromSuperview()
}
} }
reloadView() reloadView()
} }
......
...@@ -453,6 +453,10 @@ public class ImageCardView : MaterialCardView, Comparable { ...@@ -453,6 +453,10 @@ public class ImageCardView : MaterialCardView, Comparable {
buttonsContainer!.translatesAutoresizingMaskIntoConstraints = false buttonsContainer!.translatesAutoresizingMaskIntoConstraints = false
buttonsContainer!.backgroundColor = MaterialTheme.clear.color buttonsContainer!.backgroundColor = MaterialTheme.clear.color
addSubview(buttonsContainer!) addSubview(buttonsContainer!)
} else {
for v in buttonsContainer!.subviews {
v.removeFromSuperview()
}
} }
reloadView() reloadView()
} }
......
...@@ -86,6 +86,10 @@ public class NavigationBarView: UIView { ...@@ -86,6 +86,10 @@ public class NavigationBarView: UIView {
leftButtonsContainer!.translatesAutoresizingMaskIntoConstraints = false leftButtonsContainer!.translatesAutoresizingMaskIntoConstraints = false
leftButtonsContainer!.backgroundColor = MaterialTheme.clear.color leftButtonsContainer!.backgroundColor = MaterialTheme.clear.color
addSubview(leftButtonsContainer!) addSubview(leftButtonsContainer!)
} else {
for v in leftButtonsContainer!.subviews {
v.removeFromSuperview()
}
} }
reloadView() reloadView()
} }
...@@ -109,6 +113,10 @@ public class NavigationBarView: UIView { ...@@ -109,6 +113,10 @@ public class NavigationBarView: UIView {
rightButtonsContainer!.translatesAutoresizingMaskIntoConstraints = false rightButtonsContainer!.translatesAutoresizingMaskIntoConstraints = false
rightButtonsContainer!.backgroundColor = MaterialTheme.clear.color rightButtonsContainer!.backgroundColor = MaterialTheme.clear.color
addSubview(rightButtonsContainer!) addSubview(rightButtonsContainer!)
} else {
for v in rightButtonsContainer!.subviews {
v.removeFromSuperview()
}
} }
reloadView() reloadView()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment