mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-09 17:23:18 +08:00
Fix updating stack config props. (#231)
When some of config props change or new header items are added we need to perform a header update. This diff adds logic to trigger updating header props when that happens.
This commit is contained in:
committed by
GitHub
parent
0a2336d005
commit
2c5f95cea6
@@ -207,6 +207,12 @@ public class ScreenStackHeaderConfig extends ViewGroup {
|
||||
}
|
||||
}
|
||||
|
||||
private void maybeUpdate() {
|
||||
if (getParent() != null) {
|
||||
onUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public ScreenStackHeaderSubview getConfigSubview(int index) {
|
||||
return mConfigSubviews[index];
|
||||
}
|
||||
@@ -220,6 +226,7 @@ public class ScreenStackHeaderConfig extends ViewGroup {
|
||||
mSubviewsCount--;
|
||||
}
|
||||
mConfigSubviews[index] = null;
|
||||
maybeUpdate();
|
||||
}
|
||||
|
||||
public void addConfigSubview(ScreenStackHeaderSubview child, int index) {
|
||||
@@ -227,6 +234,7 @@ public class ScreenStackHeaderConfig extends ViewGroup {
|
||||
mSubviewsCount++;
|
||||
}
|
||||
mConfigSubviews[index] = child;
|
||||
maybeUpdate();
|
||||
}
|
||||
|
||||
private TextView getTitleTextView() {
|
||||
|
||||
Reference in New Issue
Block a user