Commit e43a1982 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Add a "stream" entry in More fragment

parent 366c0fa6
<!--
~ *************************************************************************
~ ic_more_stream.xml
~ **************************************************************************
~ Copyright © 2020 VLC authors and VideoLAN
~ Author: Nicolas POMEPUY
~ This program is free software; you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation; either version 2 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program; if not, write to the Free Software
~ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
~ ***************************************************************************
~
~
-->
<vector android:height="32dp"
android:viewportHeight="24"
android:viewportWidth="24"
android:width="32dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillAlpha="1"
android:fillColor="#757575"
android:fillType="nonZero"
android:pathData="m12,3c-4.9706,0 -9,4.0294 -9,9l2,0c0,-3.866 3.134,-7 7,-7 3.866,0 7,3.134 7,7l2,0c0,-4.9706 -4.0294,-9 -9,-9zM11.5,7c-2.5213,0.2561 -4.5,2.4112 -4.5,5l2,0c0,-1.6568 1.3431,-3 3,-3 1.6568,0 3,1.3432 3,3l2,0c0,-2.7614 -2.2386,-5 -5,-5 -0.1726,0 -0.3319,-0.017 -0.5,0zM12,11c-0.3866,0 -0.6839,0.2375 -0.8438,0.5625l-3.0313,7.9375 -1.625,0 0,1.5C10,20.9871 14,20.9871 17.5,21l0,-1.5 -1.625,0 -3.0313,-7.9375c-0.1599,-0.325 -0.4571,-0.5625 -0.8438,-0.5625z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
......@@ -10,7 +10,7 @@
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/background_default_darker"
android:background="?attr/background_default"
app:layout_behavior="org.videolan.vlc.gui.helpers.BottomSheetBehavior">
<androidx.constraintlayout.widget.ConstraintLayout
......@@ -23,7 +23,6 @@
android:id="@+id/mrlbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?attr/background_default"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:elevation="4dp"
......
......@@ -74,15 +74,30 @@
app:layout_constraintStart_toEndOf="@+id/settingsButton"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/streamsButton"
style="@style/Widget.MaterialComponents.Button.OutlinedButton.Icon"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="@string/open_mrl"
app:icon="@drawable/ic_more_stream"
app:layout_constraintEnd_toEndOf="@+id/settingsButton"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/settingsButton" />
<org.videolan.vlc.gui.view.TitleListView
android:id="@+id/history_entry"
android:layout_width="0dp"
app:title="@string/history"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginTop="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/settingsButton" />
app:layout_constraintTop_toBottomOf="@+id/streamsButton"
app:title="@string/history">
</org.videolan.vlc.gui.view.TitleListView>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
......
......@@ -10,7 +10,7 @@
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/background_default_darker"
android:background="?attr/background_default"
app:layout_behavior="org.videolan.vlc.gui.helpers.BottomSheetBehavior">
<androidx.constraintlayout.widget.ConstraintLayout
......@@ -23,7 +23,6 @@
android:id="@+id/mrlbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?attr/background_default"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
android:elevation="4dp"
......
......@@ -25,7 +25,8 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools">
<TextView
android:id="@+id/title"
......@@ -44,6 +45,7 @@
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:layout_height="wrap_content"
tools:listitem="@layout/card_browser_item"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......
......@@ -43,6 +43,7 @@ import org.videolan.resources.ACTIVITY_RESULT_PREFERENCES
import org.videolan.tools.*
import org.videolan.vlc.R
import org.videolan.vlc.gui.SecondaryActivity.Companion.ABOUT
import org.videolan.vlc.gui.SecondaryActivity.Companion.STREAMS
import org.videolan.vlc.gui.helpers.*
import org.videolan.vlc.gui.preferences.PreferencesActivity
import org.videolan.vlc.gui.view.EmptyLoadingState
......@@ -111,6 +112,11 @@ class MoreFragment : BaseFragment(), IRefreshable, IHistory, SwipeRefreshLayout.
i.putExtra("fragment", ABOUT)
requireActivity().startActivityForResult(i, SecondaryActivity.ACTIVITY_RESULT_SECONDARY)
}
streamsButton.setOnClickListener {
val i = Intent(activity, SecondaryActivity::class.java)
i.putExtra("fragment", STREAMS)
requireActivity().startActivityForResult(i, SecondaryActivity.ACTIVITY_RESULT_SECONDARY)
}
historyAdapter.updateEvt.observe(viewLifecycleOwner) {
swipeRefreshLayout.isRefreshing = false
//restoreMultiSelectHelper()
......
......@@ -47,6 +47,7 @@ import org.videolan.vlc.gui.browser.FileBrowserFragment
import org.videolan.vlc.gui.browser.KEY_MEDIA
import org.videolan.vlc.gui.browser.StorageBrowserFragment
import org.videolan.vlc.gui.helpers.UiTools
import org.videolan.vlc.gui.network.MRLPanelFragment
import org.videolan.vlc.gui.video.VideoGridFragment
import org.videolan.vlc.reloadLibrary
......@@ -139,6 +140,7 @@ class SecondaryActivity : ContentActivity() {
}
}
ABOUT -> fragment = AboutFragment()
STREAMS -> fragment = MRLPanelFragment()
VIDEO_GROUP_LIST -> {
fragment = VideoGridFragment().apply {
arguments = Bundle(2).apply {
......@@ -171,6 +173,7 @@ class SecondaryActivity : ContentActivity() {
const val ALBUMS_SONGS = "albumsSongs"
const val ABOUT = "about"
const val STREAMS = "streams"
const val VIDEO_GROUP_LIST = "videoGroupList"
const val STORAGE_BROWSER = "storage_browser"
const val FILE_BROWSER = "file_browser"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment