mirror of
https://github.com/NiciDieNase/chaosflix
synced 2025-02-18 14:08:26 +00:00
group downloads, inProgress and bookmarks in one tab
This commit is contained in:
parent
e63d199d38
commit
5d4582a0aa
17 changed files with 303 additions and 113 deletions
|
@ -29,22 +29,10 @@
|
|||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="media.ccc.de"
|
||||
android:pathPrefix="/v/"/>
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="media.ccc.de"
|
||||
android:pathPrefix="/c/"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".NavigationActivity"
|
||||
android:exported="true"/>
|
||||
<activity android:name=".NavigationActivity">
|
||||
<nav-graph android:value="@navigation/main_navigation"/>
|
||||
</activity>
|
||||
<activity android:name=".browse.BrowseActivity">
|
||||
<meta-data
|
||||
android:name="android.app.searchable"
|
||||
|
|
|
@ -1,22 +1,36 @@
|
|||
package de.nicidienase.chaosflix.touch
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.MenuItem
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.navigation.ui.setupWithNavController
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
import de.nicidienase.chaosflix.touch.databinding.ActivityNavigationBinding
|
||||
|
||||
class NavigationActivity : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_navigation)
|
||||
val bottomNavigationView = findViewById<BottomNavigationView>(R.id.bottom_navigation)
|
||||
val binding = ActivityNavigationBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
val navController = findNavController(R.id.nav_host)
|
||||
bottomNavigationView.setupWithNavController(navController)
|
||||
binding.bottomNavigation.setupWithNavController(navController)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
|
||||
return when (item?.itemId){
|
||||
android.R.id.home -> findNavController(R.id.nav_host).navigateUp()
|
||||
else -> super.onOptionsItemSelected(item)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val TAG = NavigationActivity::class.java.simpleName
|
||||
|
||||
fun launch(context: Context) {
|
||||
context.startActivity(Intent(context, NavigationActivity::class.java))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ class SplashActivity : AppCompatActivity() {
|
|||
}
|
||||
|
||||
private fun goToOverview() {
|
||||
BrowseActivity.launch(this)
|
||||
NavigationActivity.launch(this)
|
||||
finish()
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.view.View
|
|||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import de.nicidienase.chaosflix.common.viewmodel.BrowseViewModel
|
||||
import de.nicidienase.chaosflix.common.viewmodel.ViewModelFactory
|
||||
|
@ -16,7 +17,7 @@ open class BrowseFragment : androidx.fragment.app.Fragment() {
|
|||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
viewModel = ViewModelProviders.of(activity!!, ViewModelFactory.getInstance(requireContext())).get(BrowseViewModel::class.java)
|
||||
viewModel = ViewModelProvider(requireActivity(), ViewModelFactory.getInstance(requireContext())).get(BrowseViewModel::class.java)
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
|
|
|
@ -42,7 +42,7 @@ class ConferenceGroupFragment : BrowseFragment() {
|
|||
recyclerView.layoutManager = layoutManager
|
||||
val conferencesAdapter = ConferenceRecyclerViewAdapter {
|
||||
findNavController().navigate(
|
||||
ConferencesTabBrowseFragmentDirections.actionConferencesTabBrowseFragmentToEventsListFragment(it)
|
||||
ConferencesTabBrowseFragmentDirections.actionConferencesTabBrowseFragmentToEventsListFragment(conference = it)
|
||||
)
|
||||
// TODO navigate to events-list for conference
|
||||
}
|
||||
|
|
|
@ -6,10 +6,12 @@ import android.view.LayoutInflater
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import de.nicidienase.chaosflix.touch.R
|
||||
import de.nicidienase.chaosflix.touch.browse.BrowseFragment
|
||||
import de.nicidienase.chaosflix.touch.browse.mediathek.MyChaosflixFragmentDirections
|
||||
import de.nicidienase.chaosflix.touch.databinding.FragmentDownloadsBinding
|
||||
|
||||
class DownloadsListFragment : BrowseFragment() {
|
||||
|
@ -28,9 +30,11 @@ class DownloadsListFragment : BrowseFragment() {
|
|||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
with(FragmentDownloadsBinding.inflate(inflater, container, false)) {
|
||||
setupToolbar(incToolbar.toolbar, R.string.downloads)
|
||||
incToolbar.toolbar.visibility = View.GONE
|
||||
overlay = incOverlay.loadingOverlay
|
||||
val offlineEventAdapter = OfflineEventAdapter(viewModel.offlineItemManager, viewModel::deleteOfflineItem) {
|
||||
viewModel.showDetailsForEvent(it)
|
||||
val offlineEventAdapter = OfflineEventAdapter(viewModel.offlineItemManager, viewModel::deleteOfflineItem) { guid ->
|
||||
// viewModel.showDetailsForEvent(guid)
|
||||
findNavController().navigate(MyChaosflixFragmentDirections.actionMyChaosflixFragmentToEventDetailsFragment(eventGuid = guid))
|
||||
}
|
||||
list.adapter = offlineEventAdapter
|
||||
if (columnCount <= 1) {
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package de.nicidienase.chaosflix.touch.browse.eventslist
|
||||
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.navigation.fragment.navArgs
|
||||
import de.nicidienase.chaosflix.common.mediadata.MediaRepository
|
||||
import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Event
|
||||
import de.nicidienase.chaosflix.touch.databinding.FragmentEventsListBinding
|
||||
|
||||
class ConferenceEventListFragment: EventsListFragment() {
|
||||
|
||||
private val args: ConferenceEventListFragmentArgs by navArgs()
|
||||
|
||||
override fun navigateToDetails(event: Event) {
|
||||
findNavController().navigate(ConferenceEventListFragmentDirections.actionEventsListFragmentToEventDetailsFragment(event))
|
||||
}
|
||||
|
||||
override fun setupEvents(binding: FragmentEventsListBinding) {
|
||||
args.conference.let { conference ->
|
||||
setupToolbar(binding.incToolbar.toolbar, conference.title, false)
|
||||
// eventAdapter.setShowTags(conference.getTagsUsefull());
|
||||
viewModel.getEventsforConference(conference).observe(viewLifecycleOwner, Observer { events: List<Event>? ->
|
||||
if (events != null) {
|
||||
setEvents(events)
|
||||
setLoadingOverlayVisibility(false)
|
||||
}
|
||||
})
|
||||
viewModel.updateEventsForConference(conference).observe(viewLifecycleOwner, Observer { state ->
|
||||
when (state.state) {
|
||||
MediaRepository.State.RUNNING -> setRefreshing(binding, true)
|
||||
MediaRepository.State.DONE -> setRefreshing(binding, false)
|
||||
}
|
||||
state.error?.let {
|
||||
showSnackbar(it, binding)
|
||||
}
|
||||
})
|
||||
}
|
||||
binding.swipeRefreshLayout.isEnabled = true
|
||||
binding.swipeRefreshLayout.setOnRefreshListener {
|
||||
args.conference?.let { viewModel.updateEventsForConference(it) }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@ import android.widget.SearchView
|
|||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.navigation.fragment.navArgs
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
|
@ -25,92 +26,59 @@ import de.nicidienase.chaosflix.touch.browse.BrowseFragment
|
|||
import de.nicidienase.chaosflix.touch.browse.adapters.EventRecyclerViewAdapter
|
||||
import de.nicidienase.chaosflix.touch.databinding.FragmentEventsListBinding
|
||||
|
||||
class EventsListFragment : BrowseFragment(), SearchView.OnQueryTextListener {
|
||||
abstract class EventsListFragment : BrowseFragment(), SearchView.OnQueryTextListener {
|
||||
private var columnCount = 1
|
||||
private var eventAdapter: EventRecyclerViewAdapter? = null
|
||||
private var conference: Conference? = null
|
||||
private var layoutManager: LinearLayoutManager? = null
|
||||
private var snackbar: Snackbar? = null
|
||||
private var type = 0
|
||||
|
||||
override fun onAttach(context: Context) {
|
||||
super.onAttach(context)
|
||||
setHasOptionsMenu(true)
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
if (arguments != null) {
|
||||
columnCount = arguments?.getInt(ARG_COLUMN_COUNT) ?: 1
|
||||
type = arguments?.getInt(ARG_TYPE) ?: TYPE_EVENTS
|
||||
conference = arguments?.getParcelable(ARG_CONFERENCE)
|
||||
}
|
||||
setHasOptionsMenu(true)
|
||||
columnCount = resources.getInteger(R.integer.num_columns)
|
||||
}
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
val binding = FragmentEventsListBinding.inflate(inflater, container, false)
|
||||
val activity = requireActivity() as AppCompatActivity
|
||||
activity.setSupportActionBar(binding.incToolbar.toolbar)
|
||||
overlay = binding.incOverlay.loadingOverlay
|
||||
// overlay = binding.incOverlay.loadingOverlay
|
||||
layoutManager = if (columnCount <= 1) {
|
||||
LinearLayoutManager(context)
|
||||
} else {
|
||||
GridLayoutManager(context, columnCount)
|
||||
}
|
||||
binding.list.layoutManager = layoutManager
|
||||
eventAdapter = EventRecyclerViewAdapter { event ->
|
||||
findNavController().navigate(EventsListFragmentDirections.actionEventsListFragmentToEventDetailsFragment(event))
|
||||
}
|
||||
eventAdapter = EventRecyclerViewAdapter { navigateToDetails(it) }
|
||||
eventAdapter?.setHasStableIds(true)
|
||||
binding.list.adapter = eventAdapter
|
||||
layoutManager?.let {
|
||||
val itemDecoration = DividerItemDecoration(binding.list.context, it.orientation)
|
||||
binding.list.addItemDecoration(itemDecoration)
|
||||
}
|
||||
val listObserver = Observer<List<Event>> { persistentEvents: List<Event>? ->
|
||||
setLoadingOverlayVisibility(false)
|
||||
persistentEvents?.let { setEvents(it) }
|
||||
}
|
||||
if (type == TYPE_BOOKMARKS) {
|
||||
setupToolbar(binding.incToolbar.toolbar, R.string.bookmarks)
|
||||
viewModel.getBookmarkedEvents().observe(viewLifecycleOwner, listObserver)
|
||||
} else if (type == TYPE_IN_PROGRESS) {
|
||||
setupToolbar(binding.incToolbar.toolbar, R.string.continue_watching)
|
||||
viewModel.getInProgressEvents().observe(viewLifecycleOwner, listObserver)
|
||||
} else if (type == TYPE_EVENTS) {
|
||||
run {
|
||||
setupToolbar(binding.incToolbar.toolbar, conference?.title ?: "", false)
|
||||
// eventAdapter.setShowTags(conference.getTagsUsefull());
|
||||
viewModel.getEventsforConference(conference!!).observe(viewLifecycleOwner, Observer { events: List<Event>? ->
|
||||
if (events != null) {
|
||||
setEvents(events)
|
||||
setLoadingOverlayVisibility(false)
|
||||
}
|
||||
})
|
||||
viewModel.updateEventsForConference(conference!!).observe(viewLifecycleOwner, Observer { state ->
|
||||
when (state.state) {
|
||||
MediaRepository.State.RUNNING -> setLoadingOverlayVisibility(true)
|
||||
MediaRepository.State.DONE -> setLoadingOverlayVisibility(false)
|
||||
}
|
||||
if (state.error != null) {
|
||||
showSnackbar(state.error)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
binding.swipeRefreshLayout.isEnabled = false
|
||||
setupEvents(binding)
|
||||
return binding.root
|
||||
}
|
||||
|
||||
private fun showSnackbar(message: String?) {
|
||||
if (snackbar != null) {
|
||||
snackbar?.dismiss()
|
||||
}
|
||||
snackbar = Snackbar.make(view!!, message!!, Snackbar.LENGTH_LONG)
|
||||
snackbar?.setAction("Okay") { view: View? -> snackbar?.dismiss() }
|
||||
snackbar?.show()
|
||||
protected abstract fun navigateToDetails(event: Event)
|
||||
|
||||
protected abstract fun setupEvents(binding: FragmentEventsListBinding)
|
||||
|
||||
protected fun setRefreshing(binding: FragmentEventsListBinding, refreshing: Boolean){
|
||||
binding.swipeRefreshLayout.isRefreshing = refreshing
|
||||
}
|
||||
|
||||
private fun setEvents(events: List<Event>) {
|
||||
protected fun showSnackbar(message: String, binding: FragmentEventsListBinding) {
|
||||
snackbar?.dismiss()
|
||||
snackbar = Snackbar.make(binding.root, message, Snackbar.LENGTH_LONG).apply {
|
||||
setAction("Okay") { view: View? -> snackbar?.dismiss() }
|
||||
show()
|
||||
}
|
||||
}
|
||||
|
||||
protected fun setEvents(events: List<Event>) {
|
||||
eventAdapter?.items = events
|
||||
val layoutState = arguments?.getParcelable<Parcelable>(LAYOUTMANAGER_STATE)
|
||||
if (layoutState != null) {
|
||||
|
@ -154,7 +122,7 @@ class EventsListFragment : BrowseFragment(), SearchView.OnQueryTextListener {
|
|||
const val TYPE_BOOKMARKS = 1
|
||||
const val TYPE_IN_PROGRESS = 2
|
||||
fun newInstance(type: Int, conference: Conference?, columnCount: Int): EventsListFragment {
|
||||
val fragment = EventsListFragment()
|
||||
val fragment = ConferenceEventListFragment()
|
||||
val args = Bundle()
|
||||
args.putInt(ARG_TYPE, type)
|
||||
args.putInt(ARG_COLUMN_COUNT, columnCount)
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package de.nicidienase.chaosflix.touch.browse.mediathek
|
||||
|
||||
import android.view.View
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Event
|
||||
import de.nicidienase.chaosflix.touch.R
|
||||
import de.nicidienase.chaosflix.touch.browse.eventslist.EventsListFragment
|
||||
import de.nicidienase.chaosflix.touch.databinding.FragmentEventsListBinding
|
||||
|
||||
class BookmarksListFragment : EventsListFragment() {
|
||||
|
||||
override fun setupEvents(binding: FragmentEventsListBinding) {
|
||||
setupToolbar(binding.incToolbar.toolbar, R.string.bookmarks)
|
||||
binding.incToolbar.toolbar.visibility = View.GONE
|
||||
viewModel.getBookmarkedEvents().observe(viewLifecycleOwner, Observer { persistentEvents: List<Event>? ->
|
||||
setLoadingOverlayVisibility(false)
|
||||
persistentEvents?.let { setEvents(it) }
|
||||
})
|
||||
}
|
||||
|
||||
override fun navigateToDetails(event: Event) {
|
||||
findNavController().navigate(
|
||||
MyChaosflixFragmentDirections.actionMyChaosflixFragmentToEventDetailsFragment(event = event))
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package de.nicidienase.chaosflix.touch.browse.mediathek
|
||||
|
||||
import android.view.View
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Event
|
||||
import de.nicidienase.chaosflix.touch.R
|
||||
import de.nicidienase.chaosflix.touch.browse.eventslist.EventsListFragment
|
||||
import de.nicidienase.chaosflix.touch.databinding.FragmentEventsListBinding
|
||||
|
||||
class InProgressListFragment: EventsListFragment() {
|
||||
|
||||
override fun setupEvents(binding: FragmentEventsListBinding) {
|
||||
setupToolbar(binding.incToolbar.toolbar, R.string.continue_watching)
|
||||
binding.incToolbar.toolbar.visibility = View.GONE
|
||||
viewModel.getInProgressEvents().observe(viewLifecycleOwner, Observer { persistentEvents: List<Event>? ->
|
||||
setLoadingOverlayVisibility(false)
|
||||
persistentEvents?.let { setEvents(it) }
|
||||
})
|
||||
}
|
||||
|
||||
override fun navigateToDetails(event: Event) {
|
||||
findNavController().navigate(
|
||||
MyChaosflixFragmentDirections.actionMyChaosflixFragmentToEventDetailsFragment(event = event))
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package de.nicidienase.chaosflix.touch.browse.mediathek
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
import de.nicidienase.chaosflix.touch.databinding.FragmentMediathekBinding
|
||||
|
||||
class MediathekFragment: Fragment() {
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||
val binding = FragmentMediathekBinding.inflate(inflater)
|
||||
|
||||
val mediathekPagerAdapter = MediathekPagerAdapter(this)
|
||||
binding.viewpager.adapter = mediathekPagerAdapter
|
||||
|
||||
TabLayoutMediator(binding.tabs, binding.viewpager) { tab, position ->
|
||||
tab.text = mediathekPagerAdapter.getItemTitle(position)
|
||||
}.attach()
|
||||
|
||||
return binding.root
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package de.nicidienase.chaosflix.touch.browse.mediathek
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter
|
||||
import de.nicidienase.chaosflix.touch.browse.download.DownloadsListFragment
|
||||
import java.lang.IndexOutOfBoundsException
|
||||
|
||||
class MediathekPagerAdapter(fragment: Fragment) : FragmentStateAdapter(fragment) {
|
||||
|
||||
override fun getItemCount(): Int = elements.size
|
||||
|
||||
fun getItemTitle(position: Int): String {
|
||||
try {
|
||||
return elements[position].first
|
||||
} catch (ex: IndexOutOfBoundsException){
|
||||
error("no fragment for this index")
|
||||
}
|
||||
}
|
||||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
try {
|
||||
return elements[position].second()
|
||||
} catch (ex: IndexOutOfBoundsException){
|
||||
error("no fragment for this index")
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
private val elements: List<Pair<String, ()-> Fragment>> = listOf(
|
||||
"In Progress" to ::InProgressListFragment,
|
||||
"Bookmarks" to ::BookmarksListFragment,
|
||||
"Downloads" to ::DownloadsListFragment
|
||||
)
|
||||
}
|
||||
}
|
|
@ -166,7 +166,7 @@ class EventDetailsFragment : Fragment() {
|
|||
viewModel.download(e, r).observe(viewLifecycleOwner, Observer {
|
||||
when (it?.state) {
|
||||
OfflineItemManager.State.Downloading -> {
|
||||
Snackbar.make(fragment_container, "Download started", Snackbar.LENGTH_LONG).show()
|
||||
Snackbar.make(binding.root, "Download started", Snackbar.LENGTH_LONG).show()
|
||||
}
|
||||
OfflineItemManager.State.PermissionRequired -> {
|
||||
pendingDownload = liveEvent.data
|
||||
|
@ -303,7 +303,11 @@ class EventDetailsFragment : Fragment() {
|
|||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
when (item.itemId) {
|
||||
android.R.id.home -> {
|
||||
findNavController().popBackStack(R.id.eventsListFragment, false)
|
||||
findNavController().apply {
|
||||
popBackStack(R.id.eventsListFragment, false) ||
|
||||
navigateUp()
|
||||
|
||||
}
|
||||
return true
|
||||
}
|
||||
R.id.action_play -> {
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="de.nicidienase.chaosflix.common.viewmodel.BrowseViewModel" />
|
||||
</data>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -23,17 +29,22 @@
|
|||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/list"
|
||||
android:contentDescription="@string/list_of_events"
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipeRefreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_anchor="@id/app_bar_layout"
|
||||
tools:listitem="@layout/item_conference_cardview"/>
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/list"
|
||||
android:contentDescription="@string/list_of_events"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_anchor="@id/app_bar_layout"
|
||||
tools:listitem="@layout/item_conference_cardview"/>
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/inc_overlay"
|
||||
layout="@layout/loading_overlay"/>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</layout>
|
||||
|
|
26
touch/src/main/res/layout/fragment_mediathek.xml
Normal file
26
touch/src/main/res/layout/fragment_mediathek.xml
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tabs"
|
||||
style="@style/ColoredToolbarStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:tabMode="auto" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/viewpager"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tabs"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -9,16 +9,8 @@
|
|||
android:id="@+id/livestreamListFragment"
|
||||
android:icon="@drawable/ic_camera"
|
||||
android:title="@string/livestreams"/>
|
||||
<!-- <item-->
|
||||
<!-- android:id="@+id/nav_bookmarks"-->
|
||||
<!-- android:icon="@drawable/ic_bookmark"-->
|
||||
<!-- android:title="@string/bookmarks"/>-->
|
||||
<!-- <item-->
|
||||
<!-- android:id="@+id/nav_inprogress"-->
|
||||
<!-- android:icon="@android:drawable/ic_media_play"-->
|
||||
<!-- android:title="@string/continue_watching"/>-->
|
||||
<item
|
||||
android:id="@+id/downloadsListFragment"
|
||||
android:icon="@drawable/ic_download_dark"
|
||||
android:title="Downloads"/>
|
||||
android:id="@+id/myChaosflixFragment"
|
||||
android:icon="@drawable/chaosflix_icon"
|
||||
android:title="MyChaosflix"/>
|
||||
</menu>
|
|
@ -20,13 +20,28 @@
|
|||
tools:layout="@layout/fragment_event_details">
|
||||
<argument
|
||||
android:name="event"
|
||||
app:argType="de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Event" />
|
||||
app:argType="de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Event"
|
||||
app:nullable="true"
|
||||
android:defaultValue="@null" />
|
||||
<action
|
||||
android:id="@+id/action_eventDetailsFragment_self"
|
||||
app:destination="@id/eventDetailsFragment" />
|
||||
<action
|
||||
android:id="@+id/action_eventDetailsFragment_to_exoPlayerFragment"
|
||||
app:destination="@id/exoPlayerFragment" />
|
||||
<deepLink
|
||||
android:id="@+id/deepLink2"
|
||||
app:uri="media.ccc.de/v/{eventName}" />
|
||||
<argument
|
||||
android:name="eventName"
|
||||
app:argType="string"
|
||||
app:nullable="true"
|
||||
android:defaultValue="@null" />
|
||||
<argument
|
||||
android:name="eventGuid"
|
||||
app:argType="string"
|
||||
app:nullable="true"
|
||||
android:defaultValue="@null" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/livestreamListFragment"
|
||||
|
@ -37,22 +52,24 @@
|
|||
android:id="@+id/action_livestreamListFragment_to_exoPlayerFragment"
|
||||
app:destination="@id/exoPlayerFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/downloadsListFragment"
|
||||
android:name="de.nicidienase.chaosflix.touch.browse.download.DownloadsListFragment"
|
||||
android:label="DownloadsListFragment"
|
||||
tools:layout="@layout/fragment_downloads"/>
|
||||
<fragment
|
||||
android:id="@+id/eventsListFragment"
|
||||
android:name="de.nicidienase.chaosflix.touch.browse.eventslist.EventsListFragment"
|
||||
tools:layout="@layout/fragment_events_list"
|
||||
android:label="EventsListFragment" >
|
||||
android:name="de.nicidienase.chaosflix.touch.browse.eventslist.ConferenceEventListFragment"
|
||||
tools:layout="@layout/fragment_events_list">
|
||||
<action
|
||||
android:id="@+id/action_eventsListFragment_to_eventDetailsFragment"
|
||||
app:destination="@id/eventDetailsFragment" />
|
||||
<argument
|
||||
android:name="conference"
|
||||
app:argType="de.nicidienase.chaosflix.common.mediadata.entities.recording.persistence.Conference" />
|
||||
<deepLink
|
||||
android:id="@+id/deepLink"
|
||||
app:uri="media.ccc.de/c/{conferenceName}" />
|
||||
<argument
|
||||
android:name="conferenceName"
|
||||
app:argType="string"
|
||||
app:nullable="true"
|
||||
android:defaultValue="@null" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/exoPlayerFragment"
|
||||
|
@ -63,4 +80,12 @@
|
|||
android:name="playbackItem"
|
||||
app:argType="de.nicidienase.chaosflix.touch.playback.PlaybackItem" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/myChaosflixFragment"
|
||||
android:name="de.nicidienase.chaosflix.touch.browse.mediathek.MediathekFragment"
|
||||
android:label="MyChaosflixFragment" >
|
||||
<action
|
||||
android:id="@+id/action_myChaosflixFragment_to_eventDetailsFragment"
|
||||
app:destination="@id/eventDetailsFragment" />
|
||||
</fragment>
|
||||
</navigation>
|
Loading…
Add table
Reference in a new issue