Moved the fetching task to a separate activity; changed the time attributes in StudIPEvent.kt to strings

This commit is contained in:
denizk0461
2023-04-12 18:58:10 +02:00
parent 4f78eb8373
commit d55a304cec
11 changed files with 131 additions and 29 deletions
@@ -11,7 +11,7 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import com.denizk0461.studip.data.StudIPParser
import com.denizk0461.studip.databinding.FragmentParserBinding
import com.denizk0461.studip.viewmodel.ParserViewModel
import com.denizk0461.studip.viewmodel.FetcherViewModel
import java.net.URLDecoder
/**
@@ -19,14 +19,14 @@ import java.net.URLDecoder
*/
class ParserFragment : Fragment() {
private var _binding: FragmentParserBinding? = null
private var html = "" // temporary storage for the website HTML
private var _binding: FragmentParserBinding? = null
// This property is only valid between onCreateView and
// onDestroyView.
private val binding get() = _binding!!
private val viewModel: ParserViewModel by viewModels()
private val viewModel: FetcherViewModel by viewModels()
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,