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
16
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
5dd57f0e
Commit
5dd57f0e
authored
8 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Save videos sort order
parent
f496561b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+18
-2
18 additions, 2 deletions
...roid/src/org/videolan/vlc/gui/video/VideoListAdapter.java
with
18 additions
and
2 deletions
vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+
18
−
2
View file @
5dd57f0e
...
...
@@ -21,8 +21,10 @@
package
org.videolan.vlc.gui.video
;
import
android.content.Context
;
import
android.content.SharedPreferences
;
import
android.databinding.DataBindingUtil
;
import
android.databinding.ViewDataBinding
;
import
android.preference.PreferenceManager
;
import
android.support.annotation.MainThread
;
import
android.support.annotation.Nullable
;
import
android.support.v4.util.ArrayMap
;
...
...
@@ -43,6 +45,7 @@ import org.videolan.vlc.gui.helpers.UiTools;
import
org.videolan.vlc.media.MediaGroup
;
import
org.videolan.vlc.media.MediaWrapper
;
import
org.videolan.vlc.util.Strings
;
import
org.videolan.vlc.util.Util
;
import
java.util.ArrayList
;
import
java.util.Collection
;
...
...
@@ -301,9 +304,17 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View
public
class
VideoComparator
extends
SortedList
.
Callback
<
MediaWrapper
>
{
private
int
mSortDirection
=
1
;
private
int
mSortBy
=
SORT_BY_TITLE
;
private
static
final
String
KEY_SORT_BY
=
"sort_by"
;
private
static
final
String
KEY_SORT_DIRECTION
=
"sort_direction"
;
private
int
mSortDirection
;
private
int
mSortBy
;
protected
SharedPreferences
mSettings
=
PreferenceManager
.
getDefaultSharedPreferences
(
VLCApplication
.
getAppContext
());
public
VideoComparator
()
{
mSortBy
=
mSettings
.
getInt
(
KEY_SORT_BY
,
SORT_BY_TITLE
);
mSortDirection
=
mSettings
.
getInt
(
KEY_SORT_DIRECTION
,
1
);
}
public
int
sortDirection
(
int
sortby
)
{
if
(
sortby
==
mSortBy
)
return
mSortDirection
;
...
...
@@ -343,6 +354,11 @@ public class VideoListAdapter extends RecyclerView.Adapter<VideoListAdapter.View
break
;
}
resetSorting
();
SharedPreferences
.
Editor
editor
=
mSettings
.
edit
();
editor
.
putInt
(
KEY_SORT_BY
,
mSortBy
);
editor
.
putInt
(
KEY_SORT_DIRECTION
,
mSortDirection
);
Util
.
commitPreferences
(
editor
);
}
@Override
...
...
This diff is collapsed.
Click to expand it.
Geoffrey Métais
@Dekans
mentioned in commit
d06201b8
·
8 years ago
mentioned in commit
d06201b8
mentioned in commit d06201b8543ef8dc60867221bc77f10c8050151e
Toggle commit list
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