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
7 changes: 7 additions & 0 deletions app/src/main/assets/scrollable_web_content.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<style>
body.expanded {
width: 200%;
}
</style>
</head>
<body>
<div id="lipsum">
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class ScrollingActivity : AppCompatActivity() {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show()
}
binding.bottomFab.setOnClickListener {
binding.webView.evaluateJavascript("document.body.classList.toggle('expanded');", null)
}
WebView.setWebContentsDebuggingEnabled(true)
binding.webView.apply {
with(settings) {
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/layout/activity_scrolling.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,15 @@
app:layout_anchorGravity="bottom|end"
app:srcCompat="@android:drawable/ic_dialog_email" />

<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/bottom_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/fab_margin"
android:layout_marginEnd="@dimen/fab_margin"
app:layout_anchor="@id/webView"
app:layout_anchorGravity="bottom|end"
android:text="@string/fab_toggle_webview_width"
/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

<string name="action_set_coordinator_bottom_matching_behaviour">Match coordinator bottom behaviour</string>
<string name="action_set_regular_behaviour">Regular behaviour</string>
<string name="fab_toggle_webview_width">toggle width</string>
</resources>
Loading
Loading