diff --git a/app/src/main/java/org/pixeldroid/app/postCreation/PostCreationFragment.kt b/app/src/main/java/org/pixeldroid/app/postCreation/PostCreationFragment.kt index 6490ba9e..c6a6b3d9 100644 --- a/app/src/main/java/org/pixeldroid/app/postCreation/PostCreationFragment.kt +++ b/app/src/main/java/org/pixeldroid/app/postCreation/PostCreationFragment.kt @@ -36,6 +36,7 @@ import org.pixeldroid.app.postCreation.camera.CameraActivity import org.pixeldroid.app.postCreation.camera.CameraFragment import org.pixeldroid.app.postCreation.carousel.CarouselItem import org.pixeldroid.app.utils.BaseFragment +import org.pixeldroid.app.utils.bindingLifecycleAware import org.pixeldroid.app.utils.db.entities.InstanceDatabaseEntity import org.pixeldroid.app.utils.db.entities.UserDatabaseEntity import org.pixeldroid.app.utils.fileExtension @@ -53,7 +54,7 @@ class PostCreationFragment : BaseFragment() { private var user: UserDatabaseEntity? = null private var instance: InstanceDatabaseEntity = InstanceDatabaseEntity("", "") - private lateinit var binding: FragmentPostCreationBinding + private var binding: FragmentPostCreationBinding by bindingLifecycleAware() private lateinit var model: PostCreationViewModel override fun onCreateView( diff --git a/app/src/main/java/org/pixeldroid/app/postCreation/PostSubmissionFragment.kt b/app/src/main/java/org/pixeldroid/app/postCreation/PostSubmissionFragment.kt index 2c1b68c8..0aa1821f 100644 --- a/app/src/main/java/org/pixeldroid/app/postCreation/PostSubmissionFragment.kt +++ b/app/src/main/java/org/pixeldroid/app/postCreation/PostSubmissionFragment.kt @@ -22,6 +22,7 @@ import org.pixeldroid.app.R import org.pixeldroid.app.databinding.FragmentPostSubmissionBinding import org.pixeldroid.app.postCreation.camera.CameraFragment import org.pixeldroid.app.utils.BaseFragment +import org.pixeldroid.app.utils.bindingLifecycleAware import org.pixeldroid.app.utils.db.entities.InstanceDatabaseEntity import org.pixeldroid.app.utils.db.entities.UserDatabaseEntity import org.pixeldroid.app.utils.setSquareImageFromURL @@ -35,7 +36,7 @@ class PostSubmissionFragment : BaseFragment() { private var user: UserDatabaseEntity? = null private lateinit var instance: InstanceDatabaseEntity - private lateinit var binding: FragmentPostSubmissionBinding + private var binding: FragmentPostSubmissionBinding by bindingLifecycleAware() private lateinit var model: PostCreationViewModel override fun onCreateView( diff --git a/app/src/main/java/org/pixeldroid/app/postCreation/camera/CameraFragment.kt b/app/src/main/java/org/pixeldroid/app/postCreation/camera/CameraFragment.kt index 00abfb97..4677d814 100644 --- a/app/src/main/java/org/pixeldroid/app/postCreation/camera/CameraFragment.kt +++ b/app/src/main/java/org/pixeldroid/app/postCreation/camera/CameraFragment.kt @@ -41,6 +41,7 @@ import org.pixeldroid.app.R import org.pixeldroid.app.databinding.FragmentCameraBinding import org.pixeldroid.app.postCreation.PostCreationActivity import org.pixeldroid.app.utils.BaseFragment +import org.pixeldroid.app.utils.bindingLifecycleAware import java.io.File import java.util.concurrent.ExecutorService import java.util.concurrent.Executors @@ -61,7 +62,7 @@ class CameraFragment : BaseFragment() { private val cameraLifecycleOwner = CameraLifecycleOwner() - private lateinit var binding: FragmentCameraBinding + private var binding: FragmentCameraBinding by bindingLifecycleAware() private var displayId: Int = -1 private var lensFacing: Int = CameraSelector.LENS_FACING_BACK diff --git a/app/src/main/java/org/pixeldroid/app/posts/feeds/cachedFeeds/CachedFeedFragment.kt b/app/src/main/java/org/pixeldroid/app/posts/feeds/cachedFeeds/CachedFeedFragment.kt index 81be3ba0..4aa9abea 100644 --- a/app/src/main/java/org/pixeldroid/app/posts/feeds/cachedFeeds/CachedFeedFragment.kt +++ b/app/src/main/java/org/pixeldroid/app/posts/feeds/cachedFeeds/CachedFeedFragment.kt @@ -21,6 +21,7 @@ import org.pixeldroid.app.posts.feeds.initAdapter import org.pixeldroid.app.stories.StoriesAdapter import org.pixeldroid.app.utils.BaseFragment import org.pixeldroid.app.utils.api.objects.FeedContentDatabase +import org.pixeldroid.app.utils.bindingLifecycleAware import org.pixeldroid.app.utils.db.AppDatabase import org.pixeldroid.app.utils.db.dao.feedContent.FeedContentDao import org.pixeldroid.app.utils.limitedLengthSmoothScrollToPosition @@ -34,7 +35,7 @@ open class CachedFeedFragment : BaseFragment() { internal lateinit var adapter: PagingDataAdapter internal var headerAdapter: StoriesAdapter? = null - private lateinit var binding: FragmentFeedBinding + private var binding: FragmentFeedBinding by bindingLifecycleAware() private var job: Job? = null