Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
0a0f22c4
Commit
0a0f22c4
authored
Aug 18, 2013
by
Felix Paul Kühne
Browse files
Library: implement correct navigation for music albums and TV shows
parent
57aabe99
Changes
1
Hide whitespace changes
Inline
Side-by-side
AspenProject/VLCPlaylistViewController.m
View file @
0a0f22c4
...
...
@@ -24,6 +24,7 @@
@interface
VLCPlaylistViewController
()
<
AQGridViewDataSource
,
AQGridViewDelegate
,
UITableViewDataSource
,
UITableViewDelegate
>
{
NSMutableArray
*
_foundMedia
;
NSUInteger
_libraryMode
;
UIBarButtonItem
*
_menuButton
;
}
@end
...
...
@@ -56,7 +57,7 @@
{
[
super
viewDidLoad
];
UIBarButtonItem
*
add
Button
=
[
UIBarButtonItem
themedRevealMenuButtonWithTarget
:
self
andSelector
:
@selector
(
leftButtonAction
:
)];
_menu
Button
=
[
UIBarButtonItem
themedRevealMenuButtonWithTarget
:
self
andSelector
:
@selector
(
leftButtonAction
:
)];
/* After day 354 of the year, the usual VLC cone is replaced by another cone
* wearing a Father Xmas hat.
...
...
@@ -67,9 +68,9 @@
[[
NSCalendar
alloc
]
initWithCalendarIdentifier
:
NSGregorianCalendar
];
NSUInteger
dayOfYear
=
[
gregorian
ordinalityOfUnit
:
NSDayCalendarUnit
inUnit
:
NSYearCalendarUnit
forDate
:
[
NSDate
date
]];
if
(
dayOfYear
>=
354
)
add
Button
.
image
=
[
UIImage
imageNamed
:
@"vlc-xmas"
];
_menu
Button
.
image
=
[
UIImage
imageNamed
:
@"vlc-xmas"
];
self
.
navigationItem
.
leftBarButtonItem
=
add
Button
;
self
.
navigationItem
.
leftBarButtonItem
=
_menu
Button
;
[
self
.
editButtonItem
setBackgroundImage
:[
UIImage
imageNamed
:
@"button"
]
forState:
UIControlStateNormal
barMetrics
:
UIBarMetricsDefault
];
...
...
@@ -259,9 +260,15 @@
NSManagedObject
*
currentObject
=
_foundMedia
[
indexPath
.
row
];
if
([
currentObject
isKindOfClass
:[
MLAlbum
class
]])
{
_foundMedia
=
[
NSMutableArray
arrayWithArray
:[[(
MLAlbum
*
)
currentObject
tracks
]
allObjects
]];
self
.
navigationItem
.
leftBarButtonItem
=
[
UIBarButtonItem
themedBackButtonWithTarget
:
self
andSelector
:
@selector
(
backToAllItems
:
)];
[
self
.
navigationItem
.
leftBarButtonItem
setTitle
:
NSLocalizedString
(
@"LIBRARY_MUSIC"
,
@""
)];
self
.
title
=
[(
MLAlbum
*
)
currentObject
name
];
[
self
updateViewContents
];
}
else
if
([
currentObject
isKindOfClass
:[
MLShow
class
]])
{
_foundMedia
=
[
NSMutableArray
arrayWithArray
:[[(
MLShow
*
)
currentObject
episodes
]
allObjects
]];
self
.
navigationItem
.
leftBarButtonItem
=
[
UIBarButtonItem
themedBackButtonWithTarget
:
self
andSelector
:
@selector
(
backToAllItems
:
)];
[
self
.
navigationItem
.
leftBarButtonItem
setTitle
:
NSLocalizedString
(
@"LIBRARY_SERIES"
,
@""
)];
self
.
title
=
[(
MLShow
*
)
currentObject
name
];
[
self
updateViewContents
];
}
else
{
if
(
!
self
.
movieViewController
)
...
...
@@ -351,6 +358,12 @@
[[(
VLCAppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
revealController
]
toggleSidebar
:
!
[(
VLCAppDelegate
*
)[
UIApplication
sharedApplication
].
delegate
revealController
].
sidebarShowing
duration
:
kGHRevealSidebarDefaultAnimationDuration
];
}
-
(
IBAction
)
backToAllItems
:(
id
)
sender
{
self
.
navigationItem
.
leftBarButtonItem
=
_menuButton
;
[
self
setLibraryMode
:
_libraryMode
];
}
/* deprecated in iOS 6 */
-
(
BOOL
)
shouldAutorotateToInterfaceOrientation
:(
UIInterfaceOrientation
)
toInterfaceOrientation
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment