Clean up binds

This commit is contained in:
Luke Hubmayer-Werner 2024-08-14 22:39:15 +09:30
parent a74ccdcfcb
commit 3c40669bad
2 changed files with 3 additions and 3 deletions

View File

@ -122,7 +122,7 @@ class MainActivity : AppCompatActivity() {
initializePdfDocument() initializePdfDocument()
pdfDocument.renderThumbnails(thumbnailWidth, thumbnailHeight) pdfDocument.renderThumbnails(thumbnailWidth, thumbnailHeight)
val container = findViewById<LinearLayout>(R.id.thumbnails_layout) val container = binding.appBarMain.contentMain.thumbnailsLayout
for (bitmap in pdfDocument.bitmapThumbnails.values) { for (bitmap in pdfDocument.bitmapThumbnails.values) {
val img = ImageView(this) val img = ImageView(this)
img.setImageBitmap(bitmap) img.setImageBitmap(bitmap)
@ -130,7 +130,7 @@ class MainActivity : AppCompatActivity() {
} }
presentationView() presentationView()
val containerScroll = findViewById<HorizontalScrollView>(R.id.thumbnails_scroll) val containerScroll = binding.appBarMain.contentMain.thumbnailsScroll
containerScroll.viewTreeObserver.addOnScrollChangedListener { containerScroll.viewTreeObserver.addOnScrollChangedListener {
presentationScroll.scrollTo( presentationScroll.scrollTo(
containerScroll.scrollX * (presentationLayout.width - presentationScroll.width) / (container.width - containerScroll.width), containerScroll.scrollX * (presentationLayout.width - presentationScroll.width) / (container.width - containerScroll.width),

View File

@ -20,7 +20,7 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<include layout="@layout/content_main" /> <include android:id="@+id/content_main" layout="@layout/content_main" />
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab" android:id="@+id/fab"