From 3c40669bad960d9f3b4aaf9dbc26aa4cb528c155 Mon Sep 17 00:00:00 2001 From: Luke Hubmayer-Werner Date: Wed, 14 Aug 2024 22:39:15 +0930 Subject: [PATCH] Clean up binds --- app/src/main/java/com/lhw/pdf/MainActivity.kt | 4 ++-- app/src/main/res/layout/app_bar_main.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/lhw/pdf/MainActivity.kt b/app/src/main/java/com/lhw/pdf/MainActivity.kt index 5eaf5f2..7c13b6b 100644 --- a/app/src/main/java/com/lhw/pdf/MainActivity.kt +++ b/app/src/main/java/com/lhw/pdf/MainActivity.kt @@ -122,7 +122,7 @@ class MainActivity : AppCompatActivity() { initializePdfDocument() pdfDocument.renderThumbnails(thumbnailWidth, thumbnailHeight) - val container = findViewById(R.id.thumbnails_layout) + val container = binding.appBarMain.contentMain.thumbnailsLayout for (bitmap in pdfDocument.bitmapThumbnails.values) { val img = ImageView(this) img.setImageBitmap(bitmap) @@ -130,7 +130,7 @@ class MainActivity : AppCompatActivity() { } presentationView() - val containerScroll = findViewById(R.id.thumbnails_scroll) + val containerScroll = binding.appBarMain.contentMain.thumbnailsScroll containerScroll.viewTreeObserver.addOnScrollChangedListener { presentationScroll.scrollTo( containerScroll.scrollX * (presentationLayout.width - presentationScroll.width) / (container.width - containerScroll.width), diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml index 0d4e98f..e1c24c3 100644 --- a/app/src/main/res/layout/app_bar_main.xml +++ b/app/src/main/res/layout/app_bar_main.xml @@ -20,7 +20,7 @@ - +