Archived
Moved the fetching task to a separate activity; changed the time attributes in StudIPEvent.kt to strings
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.denizk0461.studip.fragment
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
@@ -8,6 +9,7 @@ import android.view.ViewGroup
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.navigation.fragment.NavHostFragment.Companion.findNavController
|
||||
import com.denizk0461.studip.R
|
||||
import com.denizk0461.studip.activity.FetcherActivity
|
||||
import com.denizk0461.studip.adapter.StudIPEventPageAdapter
|
||||
import com.denizk0461.studip.databinding.FragmentEventBinding
|
||||
import com.denizk0461.studip.viewmodel.EventViewModel
|
||||
@@ -90,7 +92,8 @@ class EventFragment : Fragment() {
|
||||
}
|
||||
|
||||
private fun launchWebview() {
|
||||
findNavController(this).navigate(R.id.action_FirstFragment_to_SecondFragment)
|
||||
// findNavController(this).navigate(R.id.action_FirstFragment_to_SecondFragment)
|
||||
startActivity(Intent(context, FetcherActivity::class.java))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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?,
|
||||
|
||||
Reference in New Issue
Block a user