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 @@ - +