mirror of
https://github.com/NiciDieNase/chaosflix
synced 2025-02-16 21:18:23 +00:00
formatting
This commit is contained in:
parent
9f51e7be92
commit
8c3d182239
10 changed files with 23 additions and 24 deletions
|
@ -7,4 +7,4 @@ data class ImportItem(
|
|||
val lecture: FahrplanLecture,
|
||||
var event: Event?,
|
||||
var selected: Boolean = false
|
||||
)
|
||||
)
|
||||
|
|
|
@ -3,4 +3,4 @@ package de.nicidienase.chaosflix.common.eventimport
|
|||
data class FahrplanExport(
|
||||
val conference: String,
|
||||
val lectures: List<FahrplanLecture>
|
||||
)
|
||||
)
|
||||
|
|
|
@ -3,11 +3,11 @@ package de.nicidienase.chaosflix.common.eventimport
|
|||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class FahrplanLecture(
|
||||
@SerializedName("lecture_id")
|
||||
var lectureId: String? = null,
|
||||
var title: String,
|
||||
var subtitle: String? = null,
|
||||
var links: String? = null,
|
||||
var track: String? = null,
|
||||
var description: String? = null
|
||||
)
|
||||
@SerializedName("lecture_id")
|
||||
var lectureId: String? = null,
|
||||
var title: String,
|
||||
var subtitle: String? = null,
|
||||
var links: String? = null,
|
||||
var track: String? = null,
|
||||
var description: String? = null
|
||||
)
|
||||
|
|
|
@ -236,7 +236,7 @@ class MediaRepository(
|
|||
if (searchEvents.events.isNotEmpty()) {
|
||||
val eventDto = searchEvents.events[0]
|
||||
val conference = updateConferencesAndGet(eventDto.conferenceUrl.split("/").last())
|
||||
if(updateConference && conference != null){
|
||||
if (updateConference && conference != null) {
|
||||
updateEventsForConference(conference)
|
||||
}
|
||||
if (conference?.id != null) {
|
||||
|
|
|
@ -9,7 +9,6 @@ import androidx.lifecycle.viewModelScope
|
|||
import com.google.gson.Gson
|
||||
import de.nicidienase.chaosflix.common.ImportItem
|
||||
import de.nicidienase.chaosflix.common.eventimport.FahrplanExport
|
||||
import de.nicidienase.chaosflix.common.eventimport.FahrplanLecture
|
||||
import de.nicidienase.chaosflix.common.mediadata.MediaRepository
|
||||
import de.nicidienase.chaosflix.common.userdata.entities.watchlist.WatchlistItem
|
||||
import de.nicidienase.chaosflix.common.util.LiveEvent
|
||||
|
@ -37,8 +36,8 @@ class FavoritesImportViewModel(
|
|||
val working: LiveData<Boolean>
|
||||
get() = _working
|
||||
|
||||
private val _processCount = MutableLiveData<Pair<Int,Int>> (0 to 0)
|
||||
val processCount: LiveData<Pair<Int,Int>>
|
||||
private val _processCount = MutableLiveData<Pair<Int, Int>> (0 to 0)
|
||||
val processCount: LiveData<Pair<Int, Int>>
|
||||
get() = _processCount
|
||||
|
||||
val importItemCount: LiveData<Int> = Transformations.map(items) { items ->
|
||||
|
|
|
@ -67,4 +67,4 @@ class ViewModelFactory private constructor(context: Context) : ViewModelProvider
|
|||
}
|
||||
|
||||
companion object : SingletonHolder<ViewModelFactory, Context>(::ViewModelFactory)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,4 +95,4 @@ internal class FavoritesImportViewModelTest {
|
|||
"\"links\":\"2019-12-30\"}" +
|
||||
"]}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@ import android.view.ViewGroup
|
|||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.ListAdapter
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import de.nicidienase.chaosflix.touch.databinding.ItemFavoritImportBinding
|
||||
import de.nicidienase.chaosflix.common.ImportItem
|
||||
import de.nicidienase.chaosflix.touch.databinding.ItemFavoritImportBinding
|
||||
import java.lang.NumberFormatException
|
||||
|
||||
class ImportItemAdapter(private val onListItemClick: ((ImportItem) -> Unit)? = null) : ListAdapter<ImportItem, ImportItemAdapter.ViewHolder>(
|
||||
|
@ -44,4 +44,4 @@ class ImportItemAdapter(private val onListItemClick: ((ImportItem) -> Unit)? = n
|
|||
}
|
||||
|
||||
class ViewHolder(val binding: ItemFavoritImportBinding) : RecyclerView.ViewHolder(binding.root)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,4 +18,4 @@ class FavoritesImportActivity : AppCompatActivity() {
|
|||
companion object {
|
||||
private val TAG = FavoritesImportActivity::class.java.simpleName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,11 +66,11 @@ class FavoritesImportFragment : Fragment() {
|
|||
viewModel.working.observe(viewLifecycleOwner, Observer { working ->
|
||||
binding.incOverlay.loadingOverlay.visibility = if (working) View.VISIBLE else View.GONE
|
||||
})
|
||||
viewModel.processCount.observe(viewLifecycleOwner, Observer {pair ->
|
||||
Log.i(TAG,"Progress ${pair.first}/${pair.second}")
|
||||
viewModel.processCount.observe(viewLifecycleOwner, Observer { pair ->
|
||||
Log.i(TAG, "Progress ${pair.first}/${pair.second}")
|
||||
binding.incOverlay.progressbar.apply {
|
||||
if(pair.second != 0){
|
||||
visibility = View.VISIBLE
|
||||
if (pair.second != 0) {
|
||||
visibility = View.VISIBLE
|
||||
progress = (100 * pair.first / pair.second)
|
||||
}
|
||||
}
|
||||
|
@ -142,4 +142,4 @@ class FavoritesImportFragment : Fragment() {
|
|||
companion object {
|
||||
private val TAG = FavoritesImportFragment::class.java.simpleName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue