Skip to content

Commit 685a07d

Browse files
authored
feat(SDK35): Support edge to edge (#342)
2 parents fa64319 + ce91d7b commit 685a07d

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

Legacy/BugTracker/src/main/java/com/infomaniak/lib/bugtracker/BugTrackerActivity.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import android.text.format.Formatter
2424
import android.webkit.MimeTypeMap
2525
import androidx.activity.viewModels
2626
import androidx.appcompat.app.AppCompatActivity
27+
import androidx.core.view.ViewCompat
28+
import androidx.core.view.WindowInsetsCompat
2729
import androidx.core.view.isGone
2830
import androidx.core.view.isVisible
2931
import androidx.core.widget.doOnTextChanged
@@ -58,6 +60,13 @@ class BugTrackerActivity : AppCompatActivity() {
5860

5961
override fun onCreate(savedInstanceState: Bundle?) = with(binding) {
6062
super.onCreate(savedInstanceState)
63+
64+
ViewCompat.setOnApplyWindowInsetsListener(root) { view, insets ->
65+
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
66+
with(systemBars) { view.setMargins(top = top, left = left, right = right, bottom = bottom) }
67+
WindowInsetsCompat.CONSUMED
68+
}
69+
6170
setContentView(root)
6271

6372
toolbar.setNavigationOnClickListener { finish() }

Legacy/Stores/src/main/res/layout/activity_update_required.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
xmlns:tools="http://schemas.android.com/tools"
2020
android:layout_width="match_parent"
2121
android:layout_height="match_parent"
22+
android:fitsSystemWindows="true"
2223
android:orientation="vertical"
2324
tools:context=".updaterequired.UpdateRequiredActivity">
2425

Legacy/src/main/res/layout/activity_webview.xml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
~ You should have received a copy of the GNU General Public License
1616
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
1717
-->
18-
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
19-
android:id="@+id/webview"
18+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
2019
android:layout_width="match_parent"
21-
android:layout_height="match_parent" />
20+
android:layout_height="match_parent"
21+
android:fitsSystemWindows="true">
22+
23+
<WebView
24+
android:id="@+id/webview"
25+
android:layout_width="match_parent"
26+
android:layout_height="match_parent" />
27+
</FrameLayout>

0 commit comments

Comments
 (0)