@capgo/inappbrowser 8.1.15 → 8.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -55,7 +55,7 @@ import org.json.JSONObject;
|
|
|
55
55
|
)
|
|
56
56
|
public class InAppBrowserPlugin extends Plugin implements WebViewDialog.PermissionHandler {
|
|
57
57
|
|
|
58
|
-
private final String pluginVersion = "8.1.
|
|
58
|
+
private final String pluginVersion = "8.1.17";
|
|
59
59
|
|
|
60
60
|
public static final String CUSTOM_TAB_PACKAGE_NAME = "com.android.chrome"; // Change when in stable
|
|
61
61
|
private CustomTabsClient customTabsClient;
|
|
@@ -49,6 +49,7 @@ import android.webkit.WebView;
|
|
|
49
49
|
import android.webkit.WebViewClient;
|
|
50
50
|
import android.widget.ImageButton;
|
|
51
51
|
import android.widget.ImageView;
|
|
52
|
+
import android.widget.RelativeLayout;
|
|
52
53
|
import android.widget.TextView;
|
|
53
54
|
import android.widget.Toast;
|
|
54
55
|
import android.widget.Toolbar;
|
|
@@ -991,7 +992,7 @@ public class WebViewDialog extends Dialog {
|
|
|
991
992
|
window.setLayout(1, 1);
|
|
992
993
|
_webView.setAlpha(0f);
|
|
993
994
|
_webView.setVisibility(View.INVISIBLE);
|
|
994
|
-
_webView.setLayoutParams(new
|
|
995
|
+
_webView.setLayoutParams(new RelativeLayout.LayoutParams(0, 0));
|
|
995
996
|
} else {
|
|
996
997
|
_webView.setAlpha(0f);
|
|
997
998
|
_webView.setVisibility(View.INVISIBLE);
|
|
@@ -1102,6 +1103,19 @@ public class WebViewDialog extends Dialog {
|
|
|
1102
1103
|
View statusBarColorView = findViewById(R.id.status_bar_color_view);
|
|
1103
1104
|
View toolbarView = findViewById(R.id.tool_bar);
|
|
1104
1105
|
|
|
1106
|
+
// Fix content browser layout height for all Android versions to allow proper scrolling
|
|
1107
|
+
// This fixes landscape scrolling issues where bottom content is unreachable
|
|
1108
|
+
View contentBrowserLayout = findViewById(R.id.content_browser_layout);
|
|
1109
|
+
if (contentBrowserLayout != null) {
|
|
1110
|
+
ViewGroup.LayoutParams layoutParams = contentBrowserLayout.getLayoutParams();
|
|
1111
|
+
if (layoutParams != null) {
|
|
1112
|
+
// Use MATCH_PARENT for height to allow proper scrolling in all orientations
|
|
1113
|
+
// The AppBarLayout's layout_behavior will handle positioning automatically
|
|
1114
|
+
layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
|
|
1115
|
+
contentBrowserLayout.setLayoutParams(layoutParams);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1105
1119
|
// Special handling for Android 15+
|
|
1106
1120
|
if (isAndroid15Plus) {
|
|
1107
1121
|
// Get AppBarLayout which contains the toolbar
|
|
@@ -1149,31 +1163,6 @@ public class WebViewDialog extends Dialog {
|
|
|
1149
1163
|
params.topMargin = statusBarHeight;
|
|
1150
1164
|
appBarLayout.setLayoutParams(params);
|
|
1151
1165
|
appBarLayout.setBackgroundColor(finalBgColor);
|
|
1152
|
-
View contentBrowserLayout = findViewById(R.id.content_browser_layout);
|
|
1153
|
-
View parentContainer = findViewById(android.R.id.content);
|
|
1154
|
-
if (contentBrowserLayout == null || parentContainer == null) {
|
|
1155
|
-
Log.w("InAppBrowser", "Required views not found for height calculation");
|
|
1156
|
-
return;
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
|
-
ViewGroup.LayoutParams layoutParams = contentBrowserLayout.getLayoutParams();
|
|
1160
|
-
if (!(layoutParams instanceof ViewGroup.MarginLayoutParams)) {
|
|
1161
|
-
Log.w("InAppBrowser", "Content browser layout does not support margins");
|
|
1162
|
-
return;
|
|
1163
|
-
}
|
|
1164
|
-
ViewGroup.MarginLayoutParams mlpContentBrowserLayout = (ViewGroup.MarginLayoutParams) layoutParams;
|
|
1165
|
-
|
|
1166
|
-
int parentHeight = parentContainer.getHeight();
|
|
1167
|
-
int appBarHeight = appBarLayout.getHeight(); // can be 0 if not visible with the toolbar type BLANK
|
|
1168
|
-
|
|
1169
|
-
if (parentHeight <= 0) {
|
|
1170
|
-
Log.w("InAppBrowser", "Parent dimensions not yet available");
|
|
1171
|
-
return;
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
// Recompute the height of the content browser to be able to set margin bottom as we want to
|
|
1175
|
-
mlpContentBrowserLayout.height = parentHeight - (statusBarHeight + appBarHeight);
|
|
1176
|
-
contentBrowserLayout.setLayoutParams(mlpContentBrowserLayout);
|
|
1177
1166
|
});
|
|
1178
1167
|
}
|
|
1179
1168
|
}
|
|
@@ -28,7 +28,7 @@ public class InAppBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
28
28
|
case aware = "AWARE"
|
|
29
29
|
case fakeVisible = "FAKE_VISIBLE"
|
|
30
30
|
}
|
|
31
|
-
private let pluginVersion: String = "8.1.
|
|
31
|
+
private let pluginVersion: String = "8.1.17"
|
|
32
32
|
public let identifier = "InAppBrowserPlugin"
|
|
33
33
|
public let jsName = "InAppBrowser"
|
|
34
34
|
public let pluginMethods: [CAPPluginMethod] = [
|