Skip to content
Open
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
6 changes: 6 additions & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ignore_dirs": [
".git",
"node_modules"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import android.view.ViewGroup.LayoutParams;
import android.webkit.WebSettings;
import android.webkit.CookieManager;
import android.webkit.DownloadListener;
import android.content.Intent;
import android.net.Uri;

import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableMapKeySetIterator;
Expand Down Expand Up @@ -48,14 +51,26 @@ public String getName() {
}

@Override
public RNWebView createViewInstance(ThemedReactContext context) {
public RNWebView createViewInstance(final ThemedReactContext context) {
RNWebView rnwv = new RNWebView(this, context);

// Fixes broken full-screen modals/galleries due to body
// height being 0.
rnwv.setLayoutParams(
new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT));

rnwv.setDownloadListener(new DownloadListener() {
public void onDownloadStart(String url, String userAgent,
String contentDisposition, String mimetype,
long contentLength) {
Intent i = new Intent(Intent.ACTION_VIEW);

i.setData(Uri.parse(url));
context.startActivity(i);
}
});

CookieManager.getInstance().setAcceptCookie(true); // add default cookie support
CookieManager.getInstance().setAcceptFileSchemeCookies(true); // add default cookie support

Expand Down