Dbrant has uploaded a new change for review.
https://gerrit.wikimedia.org/r/226714
Change subject: Fix possible crash involving the Share tooltip.
......................................................................
Fix possible crash involving the Share tooltip.
This only seems to happen in 4.2.2, where it's possible that the system
returns null when we request the View for an ActionMode menu item.
Also removed an unnecessary parameter from showShareToolTip().
Bug: T106679
Change-Id: I8fd7cc1c0a7348b148a58cce838f207930e4da0a
---
M wikipedia/src/main/java/org/wikipedia/page/snippet/ShareHandler.java
1 file changed, 10 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia
refs/changes/14/226714/1
diff --git
a/wikipedia/src/main/java/org/wikipedia/page/snippet/ShareHandler.java
b/wikipedia/src/main/java/org/wikipedia/page/snippet/ShareHandler.java
index cfca5f5..3ffc18a 100755
--- a/wikipedia/src/main/java/org/wikipedia/page/snippet/ShareHandler.java
+++ b/wikipedia/src/main/java/org/wikipedia/page/snippet/ShareHandler.java
@@ -251,16 +251,18 @@
// ensure the tool tip is shown after CAB animation.
final View shareItemView = ActivityUtil.getMenuItemView(activity,
shareItem);
- int delay = getInteger(android.R.integer.config_longAnimTime);
- shareItemView.postDelayed(new Runnable() {
- @Override
- public void run() {
- showShareToolTip(shareItemView, shareItem.getIcon());
- }
- }, delay);
+ if (shareItemView != null) {
+ int delay = getInteger(android.R.integer.config_longAnimTime);
+ shareItemView.postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ showShareToolTip(shareItemView);
+ }
+ }, delay);
+ }
}
- private void showShareToolTip(View shareItemView, Drawable icon) {
+ private void showShareToolTip(View shareItemView) {
ToolTipUtil.showToolTip(activity, shareItemView,
R.layout.inflate_tool_tip_share,
getColor(SHARE_TOOL_TIP_COLOR), ToolTip.Position.CENTER);
}
--
To view, visit https://gerrit.wikimedia.org/r/226714
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fd7cc1c0a7348b148a58cce838f207930e4da0a
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits