New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request:- Expose method which takes menuitem as target #72
Comments
Have you tried targeting |
@xiphirx Yes with TapTarget.forView, in onPrepareOptionsMenu, this method returns null. Possibly because it has just been inflated? |
|
The menu is inflated in CreateOptionsMenu and after some changes to the items I am calling TapTarget.forToolbarMenuItem(toolbar, R.id.menu_mymenuitem.... etc) - This always resolves to null. I took a look at the toolbar variable and although the MenuItem is in the mItems collection, it is not in the mActionItems collection. I am guessing but its either because it has been added by the fragment or that the item is not fully added to the toolbar in the onPrepareOptionsMenu method? You see my reason for simply being able to supply a menuitem object :) (banging head on wall) |
Supplying a Could you possible provide a minimal code sample that would replicate this? I can take a further look afterwards |
` @OverRide
|
@xiphirx Apologies, this seems to be an issue with the menu element itself. It seems an actionViewClass is needed for the method getActionView to work. The library is now working with forView(MenuItemCompat.getActionView(MenuItem) Thank you |
@xiphirx It is worth noting however that this seems to introduce a problem as only menu items with an ActionViewClass will work. This is fine for something like a search action but for a standard menu item, im at a total loss. Appreciate the work. |
I'm skeptical that is actually the case. It seems like something else is going on since the sample app utilizes the |
@xiphirx I have used that function as per the sample app without a problem. The sample app calls this in onCreate within an activity. I am calling in the onPrepareOptionsMenu within a fragment as the visibility is changing there. I will dive further. |
I have a situation where I change the visibility of a menuitem in onPrepareOptionsMenu within a fragment. I want to show a TapTargetView when the item becomes visible.
I have a reference to the menuitem and would like to create the TapTargetView with the menuitem as the target, possibly in onPrepareOptionsMenu.
I have tried getting a reference to the toolbar and finding the item in onPrepareOptionsMenu using the id but it always resolves as null in this method.
Could you assist or possibly add the ability to pass a menuitem?
Thanks
Jason
The text was updated successfully, but these errors were encountered: