@@ -306,10 +306,10 @@ private List<TitleBarButtonController> getOrCreateButtonControllersByInstanceId(
306
306
return new ArrayList <>(result .values ());
307
307
}
308
308
309
- private List <TitleBarButtonController > getOrCreateButtonControllersById (@ Nullable Map <String , TitleBarButtonController > currentButtons ,@ NonNull List <Button > buttons ) {
309
+ private List <TitleBarButtonController > getOrCreateButtonControllers (@ Nullable Map <String , TitleBarButtonController > currentButtons , @ NonNull List <Button > buttons ) {
310
310
ArrayList result = new ArrayList <TitleBarButtonController >();
311
311
for (Button b : buttons ) {
312
- result .add (take (first (perform (currentButtons , null , Map ::values ), button -> button .getId ().equals (b . id )), createButtonController (b )));
312
+ result .add (take (first (perform (currentButtons , null , Map ::values ), button -> button .getButton ().equals (b )), createButtonController (b )));
313
313
}
314
314
return result ;
315
315
}
@@ -369,7 +369,7 @@ private void mergeButtons(TopBarOptions options, TopBarButtons buttons, View chi
369
369
private void mergeRightButtons (TopBarOptions options , TopBarButtons buttons , View child ) {
370
370
if (buttons .right == null ) return ;
371
371
List <Button > rightButtons = mergeButtonsWithColor (buttons .right , options .rightButtonColor , options .rightButtonDisabledColor );
372
- List <TitleBarButtonController > toMerge = getOrCreateButtonControllersById (componentRightButtons .get (child ), rightButtons );
372
+ List <TitleBarButtonController > toMerge = getOrCreateButtonControllers (componentRightButtons .get (child ), rightButtons );
373
373
List <TitleBarButtonController > toRemove = difference (currentRightButtons , toMerge , TitleBarButtonController ::equals );
374
374
forEach (toRemove , TitleBarButtonController ::destroy );
375
375
@@ -383,7 +383,7 @@ private void mergeRightButtons(TopBarOptions options, TopBarButtons buttons, Vie
383
383
private void mergeLeftButton (TopBarOptions options , TopBarButtons buttons , View child ) {
384
384
if (buttons .left == null ) return ;
385
385
List <Button > leftButtons = mergeButtonsWithColor (buttons .left , options .leftButtonColor , options .leftButtonDisabledColor );
386
- List <TitleBarButtonController > toMerge = getOrCreateButtonControllersById (componentLeftButtons .get (child ), leftButtons );
386
+ List <TitleBarButtonController > toMerge = getOrCreateButtonControllers (componentLeftButtons .get (child ), leftButtons );
387
387
componentLeftButtons .put (child , keyBy (toMerge , TitleBarButtonController ::getButtonInstanceId ));
388
388
topBarController .setLeftButtons (toMerge );
389
389
}
0 commit comments