Fix a bug

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-02-11 14:15:14 +01:00
parent d18498ea9d
commit 45847abf4f

View File

@ -126,6 +126,8 @@ public class CallsListController extends BaseController implements SearchView.On
private SearchView searchView;
private String searchQuery;
private View view;
public CallsListController() {
super();
setHasOptionsMenu(true);
@ -322,7 +324,7 @@ public class CallsListController extends BaseController implements SearchView.On
new Handler().postDelayed(() -> {
bottomSheet.setCancelable(true);
if (bottomSheet.isShowing()) {
bottomSheet.cancel();
bottomSheet.dismiss();
}
}, 2500);
}
@ -426,7 +428,7 @@ public class CallsListController extends BaseController implements SearchView.On
} else {
bottomSheet.setCancelable(bottomSheetLockEvent.isCancelable());
if (bottomSheet.isShowing() && bottomSheetLockEvent.isCancel()) {
bottomSheet.cancel();
bottomSheet.dismiss();
}
}
}
@ -444,7 +446,9 @@ public class CallsListController extends BaseController implements SearchView.On
}
private void prepareAndShowBottomSheetWithBundle(Bundle bundle, boolean shouldShowCallMenuController) {
View view = getActivity().getLayoutInflater().inflate(R.layout.bottom_sheet, null, false);
if (view == null) {
view = getActivity().getLayoutInflater().inflate(R.layout.bottom_sheet, null, false);
}
if (shouldShowCallMenuController) {
getChildRouter((ViewGroup) view).setRoot(
@ -458,14 +462,9 @@ public class CallsListController extends BaseController implements SearchView.On
.pushChangeHandler(new VerticalChangeHandler()));
}
boolean isNew = false;
if (bottomSheet == null) {
bottomSheet = new BottomSheet.Builder(getActivity()).setView(view).create();
isNew = true;
}
if (bottomSheet.getWindow() != null && isNew) {
} else if (bottomSheet.getWindow() != null) {
bottomSheet.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
}