Skip to content

Add fade animation #11

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

Merged
merged 4 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const App = () => {
import { openBrowser } from "@swan-io/react-native-browser";

openBrowser("https://swan.io", {
animationType: "", // "fade" | "slide" (default to "slide")
dismissButtonStyle: "close", // "cancel" | "close" | "done" (default to "close")
barTintColor: "#FFF", // in-app browser UI background color
controlTintColor: "#000", // in-app browser buttons color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,19 @@ protected static void open(final Activity activity,
intentBuilder.setShowTitle(false);
intentBuilder.setInstantAppsEnabled(false);

intentBuilder.setStartAnimations(activity,
com.facebook.react.R.anim.catalyst_slide_up, io.swan.rnbrowser.R.anim.inert);
intentBuilder.setExitAnimations(activity,
io.swan.rnbrowser.R.anim.inert, com.facebook.react.R.anim.catalyst_slide_down);
String animationType = options.getString("animationType");

if (animationType != null && animationType.equals("fade")) {
intentBuilder.setStartAnimations(activity,
com.facebook.react.R.anim.catalyst_fade_in, io.swan.rnbrowser.R.anim.inert);
intentBuilder.setExitAnimations(activity,
io.swan.rnbrowser.R.anim.inert, com.facebook.react.R.anim.catalyst_fade_out);
} else {
intentBuilder.setStartAnimations(activity,
com.facebook.react.R.anim.catalyst_slide_up, io.swan.rnbrowser.R.anim.inert);
intentBuilder.setExitAnimations(activity,
io.swan.rnbrowser.R.anim.inert, com.facebook.react.R.anim.catalyst_slide_down);
}

@ColorInt int blackColor = activity.getResources().getColor(android.R.color.black);
CustomTabColorSchemeParams.Builder paramsBuilder = new CustomTabColorSchemeParams.Builder();
Expand Down
24 changes: 12 additions & 12 deletions example/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ GEM
base64
nkf
rexml
activesupport (6.1.7.7)
activesupport (7.0.8.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
Expand Down Expand Up @@ -57,27 +56,29 @@ GEM
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.2.3)
concurrent-ruby (1.3.3)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.16.3)
ffi (1.17.0)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.4)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.7.2)
minitest (5.22.3)
minitest (5.24.1)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.2.6)
rexml (3.2.9)
strscan
ruby-macho (2.5.1)
strscan (3.1.0)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
Expand All @@ -89,7 +90,6 @@ GEM
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.6.13)

PLATFORMS
ruby
Expand All @@ -99,7 +99,7 @@ DEPENDENCIES
cocoapods (>= 1.13, < 1.15)

RUBY VERSION
ruby 2.6.10p210
ruby 3.3.4p94

BUNDLED WITH
1.17.2
2.5.14
Loading