Closed Nstd closed 7 years ago
Hello @Nstd ,
Not sure if I got the issue. Yes it uses R.android.id.content inside the getActivityContentView() method. Are you using the the addFloatingSubButton method ? Or is this happening only on your specific overridden method?
Regards,
Hello @Nstd Could not go much deeper into the issue but I have downloaded the project and ran it and the FloatingMenuButton seems nice. The code you're using to build the FloatingMenu inside the ScalpelHelper seems correct and its usage is good. You stated that
then DataBindingUtil.setContentView(this, R.layout.my_layout) return a null object
I found that you add FloatingSubButton inner android.R.id.content too, which cause following problem.
When DataBindingUtil invoke bindToAddedViews()
How precisely can this be fixed? The android.R.id.content allows the library to get the hierarchy where the button is going to be added.
Regards,
PS : (Jake Wharton's library is nice and with that FloatingMenu, is even cooler :), congratulations)
Hi @rjsvieira
Please use the branch of feature-databinding
. When we launch the app, it shows a Toast mBinding is null = true
, which means DataBindingUtil find binding object failed.
I think maybe the mechanism of showing sub menu just in conflict with the databinding mechanism.
PS: I think so too, LOL
Hi @rjsvieira I found a simple solution.
mBinding = DataBindingUtil..setContentView(this, R.layout.my_view);
...
activity.findViewById(android.R.id.content).post(new Runnalbe() {
@Override
public void run() {
//to dynamic add FloatingMenu and Scalpel
}
});
Thanks~
I override setContent() method, to dynamic add FloatingMenuButton such as:
then
DataBindingUtil.setContentView(this, R.layout.my_layout)
return a null objectI found that you add FloatingSubButton inner android.R.id.content too, which cause following problem.
When DataBindingUtil invoke bindToAddedViews()
The
bind()
method in else invokereturn (T) sMapper.getDataBinder(bindingComponent, roots, layoutId);
which return null, while the 'bind()' method in if can return correct binding object.