mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 876938: MenuItem should handle closing the menu of share action. [r=wesj]
--HG-- extra : rebase_source : ca005ac974e3efbf858edac3fd360a3cfddc21b9
This commit is contained in:
parent
691ca38200
commit
f085bc3ffe
@ -1439,12 +1439,6 @@ abstract public class BrowserApp extends GeckoApp
|
||||
if (Build.VERSION.SDK_INT >= 14) {
|
||||
MenuItem share = mMenu.findItem(R.id.share);
|
||||
GeckoActionProvider provider = new GeckoActionProvider(this);
|
||||
provider.setOnTargetSelectedListener(new GeckoActionProvider.OnTargetSelectedListener() {
|
||||
@Override
|
||||
public void onTargetSelected() {
|
||||
closeOptionsMenu();
|
||||
}
|
||||
});
|
||||
share.setActionProvider(provider);
|
||||
}
|
||||
|
||||
|
@ -218,6 +218,16 @@ public class GeckoMenuItem implements MenuItem, View.OnClickListener {
|
||||
@Override
|
||||
public MenuItem setActionProvider(ActionProvider actionProvider) {
|
||||
mActionProvider = actionProvider;
|
||||
if (mActionProvider != null && mActionProvider instanceof GeckoActionProvider) {
|
||||
GeckoActionProvider provider = (GeckoActionProvider) mActionProvider;
|
||||
provider.setOnTargetSelectedListener(new GeckoActionProvider.OnTargetSelectedListener() {
|
||||
@Override
|
||||
public void onTargetSelected() {
|
||||
mMenu.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user