Avoid leaks of bindings
This commit is contained in:
parent
59e29ef232
commit
4ac7aa6bcb
|
@ -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(
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<T: FeedContentDatabase> : BaseFragment() {
|
|||
internal lateinit var adapter: PagingDataAdapter<T, RecyclerView.ViewHolder>
|
||||
internal var headerAdapter: StoriesAdapter? = null
|
||||
|
||||
private lateinit var binding: FragmentFeedBinding
|
||||
private var binding: FragmentFeedBinding by bindingLifecycleAware()
|
||||
|
||||
|
||||
private var job: Job? = null
|
||||
|
|
Loading…
Reference in New Issue