Skip to content
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

[Android] fixed share icon display issue on android #462

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

hrishiakhade
Copy link

PR Checklist

What is the current behavior?

enableDefaultShare: false is not working on android

What is the new behavior?

enableDefaultShare: false is now working on android

Fixes/Implements/Closes #[Issue Number].

Replaced the native library code in RNInAppBrowser.java

from

   if (options.hasKey(KEY_DEFAULT_SHARE_MENU_ITEM) && 
       options.getBoolean(KEY_DEFAULT_SHARE_MENU_ITEM)) {
     builder.addDefaultShareMenuItem();
   }
   ```

to
if(options.hasKey(KEY_DEFAULT_SHARE_MENU_ITEM)){
 if(options.getBoolean(KEY_DEFAULT_SHARE_MENU_ITEM)){
   builder.setShareState(CustomTabsIntent.SHARE_STATE_ON);
 }else{
   builder.setShareState(CustomTabsIntent.SHARE_STATE_OFF);
 }
}else{
 builder.setShareState(CustomTabsIntent.SHARE_STATE_OFF);
}

@hrishiakhade hrishiakhade changed the title fixed share icon display issue on android [Android] fixed share icon display issue on android Jul 10, 2024
Copy link

@twocs twocs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hrishiakhade marked the conversation https://github.com/proyecto26/react-native-inappbrowser/pull/462/files/1b3b1c3dd94fc5f793bb3fb87dabd4634836a3ef#r1695653707 as resolved because the indentation has been fixed, and asked "Pls check" but the merge was not been subsequently reviewed. It looks like the requested change has been implemented completely. @jdnichollsc can approve and merge it in?

builder.setShareState(CustomTabsIntent.SHARE_STATE_OFF);
}
} else {
builder.setShareState(CustomTabsIntent.SHARE_STATE_OFF);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hrishiakhade I think we can remove this else condition, so users can specify this option to enable/disable that share state instead, what do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@twocs oh I added a small comment here, sorry for the delay folks!
Next time, please send me a message from WhatsApp or Telegram, this is my profile: https://bio.link/jdnichollsc 🙏

@RomualdPercereau
Copy link

Ok for merging? @jdnichollsc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants