Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
55a71922
Commit
55a71922
authored
6 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Restrict breadcrumb to supported protocoles
parent
7e8c3430
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
+6
-10
6 additions, 10 deletions
...d/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
vlc-android/src/org/videolan/vlc/util/Browserutils.kt
+27
-0
27 additions, 0 deletions
vlc-android/src/org/videolan/vlc/util/Browserutils.kt
with
33 additions
and
10 deletions
vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
+
6
−
10
View file @
55a71922
...
...
@@ -113,9 +113,7 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
if
(
sortItem
!=
null
)
sortItem
.
isVisible
=
!
isRootDirectory
}
protected
open
fun
defineIsRoot
():
Boolean
{
return
mrl
==
null
}
protected
open
fun
defineIsRoot
()
=
mrl
==
null
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
{
binding
=
DirectoryBrowserBinding
.
inflate
(
inflater
,
container
,
false
)
...
...
@@ -132,20 +130,20 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
viewModel
.
dataset
.
observe
(
this
,
Observer
<
MutableList
<
MediaLibraryItem
>>
{
mediaLibraryItems
->
adapter
.
update
(
mediaLibraryItems
!!
)
})
viewModel
.
getDescriptionUpdate
().
observe
(
this
,
Observer
{
pair
->
if
(
pair
!=
null
)
adapter
.
notifyItemChanged
(
pair
.
first
,
pair
.
second
)
})
}
override
fun
setBreadcrumb
()
{
val
ariane
=
requireActivity
().
findViewById
<
RecyclerView
>(
R
.
id
.
ariane
)
?:
return
currentMedia
?.
let
{
val
media
=
currentMedia
if
(
media
!=
null
&&
isSchemeSupported
(
media
?.
uri
?.
scheme
))
{
ariane
.
visibility
=
View
.
VISIBLE
ariane
.
layoutManager
=
LinearLayoutManager
(
requireContext
(),
LinearLayoutManager
.
HORIZONTAL
,
false
)
ariane
.
adapter
=
PathAdapter
(
this
,
Uri
.
decode
(
it
.
uri
.
path
))
ariane
.
adapter
=
PathAdapter
(
this
,
Uri
.
decode
(
media
.
uri
.
path
))
if
(
ariane
.
itemDecorationCount
==
0
)
{
val
did
=
DividerItemDecoration
(
requireContext
(),
DividerItemDecoration
.
HORIZONTAL
)
did
.
setDrawable
(
ContextCompat
.
getDrawable
(
requireContext
(),
R
.
drawable
.
divider_grey_50_18dp
)
!!
)
ariane
.
addItemDecoration
(
did
)
}
ariane
.
scrollToPosition
(
ariane
.
adapter
.
itemCount
-
1
)
}
?:
run
{
ariane
.
visibility
=
View
.
GONE
}
}
else
ariane
.
visibility
=
View
.
GONE
}
fun
backTo
(
tag
:
String
)
{
...
...
@@ -273,9 +271,7 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
}
}
override
fun
clear
()
{
adapter
.
clear
()
}
override
fun
clear
()
=
adapter
.
clear
()
private
fun
removeMedia
(
mw
:
MediaWrapper
)
{
viewModel
.
remove
(
mw
)
...
...
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/util/Browserutils.kt
0 → 100644
+
27
−
0
View file @
55a71922
/*****************************************************************************
* browserutils.kt
*****************************************************************************
* Copyright © 2018 VLC authors and VideoLAN
*
* 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.
*****************************************************************************/
package
org.videolan.vlc.util
fun
isSchemeSupported
(
scheme
:
String
?)
=
when
(
scheme
)
{
"file"
,
"smb"
,
"ssh"
,
"nfs"
->
true
else
->
false
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment