diff --git a/Raichou/app/src/main/java/dev/mixi/raichou/HomeListFragment.kt b/Raichou/app/src/main/java/dev/mixi/raichou/HomeListFragment.kt index 00c75b6..779fefe 100644 --- a/Raichou/app/src/main/java/dev/mixi/raichou/HomeListFragment.kt +++ b/Raichou/app/src/main/java/dev/mixi/raichou/HomeListFragment.kt @@ -10,14 +10,11 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.observe import androidx.navigation.Navigation import dev.mixi.raichou.databinding.FragmentHomeListBinding -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.MainScope -import kotlinx.coroutines.cancel /** * A simple [Fragment] subclass. */ -class HomeListFragment : Fragment(), CoroutineScope by MainScope() { +class HomeListFragment : Fragment() { val viewModel by viewModels() lateinit var binding: FragmentHomeListBinding @@ -43,9 +40,4 @@ class HomeListFragment : Fragment(), CoroutineScope by MainScope() { } } } - - override fun onDestroy() { - super.onDestroy() - cancel() - } } diff --git a/Raichou/app/src/main/java/dev/mixi/raichou/MainActivity.kt b/Raichou/app/src/main/java/dev/mixi/raichou/MainActivity.kt index 547f551..9317adc 100644 --- a/Raichou/app/src/main/java/dev/mixi/raichou/MainActivity.kt +++ b/Raichou/app/src/main/java/dev/mixi/raichou/MainActivity.kt @@ -4,10 +4,8 @@ import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.databinding.DataBindingUtil import dev.mixi.raichou.databinding.ActivityMainBinding -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.MainScope -class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() { +class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/Raichou/app/src/main/java/dev/mixi/raichou/MediumPostFragment.kt b/Raichou/app/src/main/java/dev/mixi/raichou/MediumPostFragment.kt index e5074a8..945058d 100644 --- a/Raichou/app/src/main/java/dev/mixi/raichou/MediumPostFragment.kt +++ b/Raichou/app/src/main/java/dev/mixi/raichou/MediumPostFragment.kt @@ -12,15 +12,12 @@ import androidx.fragment.app.viewModels import androidx.lifecycle.observe import com.google.android.material.snackbar.Snackbar import dev.mixi.raichou.databinding.FragmentMediumPostBinding -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.MainScope -import kotlinx.coroutines.cancel import timber.log.Timber /** * A simple [Fragment] subclass. */ -class MediumPostFragment : Fragment(), CoroutineScope by MainScope() { +class MediumPostFragment : Fragment() { lateinit var binding: FragmentMediumPostBinding val viewModel by viewModels() @@ -57,11 +54,6 @@ class MediumPostFragment : Fragment(), CoroutineScope by MainScope() { showListWithPermissionCheck() } - override fun onDestroy() { - super.onDestroy() - cancel() - } - fun post() { val adapter = binding.list.adapter as ImageListAdapter val list = adapter.getSelectedImageList()