Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
535
Issue boards
Milestones
Wiki
Code
Merge requests
15
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
35262381
Commit
35262381
authored
6 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
PlaylistActivity: Fix playlist being fully loaded
parent
cf212c83
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/res/layout/playlist_activity.xml
+13
-20
13 additions, 20 deletions
vlc-android/res/layout/playlist_activity.xml
vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java
+21
-19
21 additions, 19 deletions
vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java
with
34 additions
and
39 deletions
vlc-android/res/layout/playlist_activity.xml
+
13
−
20
View file @
35262381
...
@@ -13,7 +13,8 @@
...
@@ -13,7 +13,8 @@
xmlns:vlc=
"http://schemas.android.com/apk/res-auto"
xmlns:vlc=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/coordinator"
android:id=
"@+id/coordinator"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:background=
"?attr/background_default"
>
<com.google.android.material.appbar.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:id=
"@+id/appbar"
android:id=
"@+id/appbar"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -53,32 +54,24 @@
...
@@ -53,32 +54,24 @@
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
<androidx.recyclerview.widget.RecyclerView
android:layout_width=
"match_parent"
android:id=
"@+id/songs"
android:layout_width=
"@dimen/default_content_width"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
vlc:layout_behavior=
"@string/appbar_scrolling_view_behavior"
android:fastScrollEnabled=
"true"
android:keyboardNavigationCluster=
"true"
android:layout_gravity=
"center_horizontal"
tools:targetApi=
"o"
>
android:paddingTop=
"@dimen/listview_bottom_padding"
<androidx.recyclerview.widget.RecyclerView
android:paddingBottom=
"@dimen/listview_bottom_padding"
android:id=
"@+id/songs"
android:paddingLeft=
"10dp"
android:layout_width=
"@dimen/default_content_width"
android:paddingRight=
"10dp"
android:layout_height=
"match_parent"
style=
"@style/Theme.VLC.List"
android:fastScrollEnabled=
"true"
vlc:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
android:layout_gravity=
"center_horizontal"
android:paddingTop=
"16dp"
android:paddingBottom=
"@dimen/listview_bottom_padding"
android:paddingLeft=
"10dp"
android:paddingRight=
"10dp"
style=
"@style/Theme.VLC.List"
android:background=
"?attr/background_default"
/>
</androidx.core.widget.NestedScrollView>
<com.google.android.material.floatingactionbutton.FloatingActionButton
<com.google.android.material.floatingactionbutton.FloatingActionButton
vlc:rippleColor=
"@color/orange50"
vlc:rippleColor=
"@color/orange50"
android:id=
"@+id/fab"
android:id=
"@+id/fab"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"25dp"
android:layout_marginEnd=
"25dp"
android:layout_marginEnd=
"25dp"
vlc:layout_anchor=
"@+id/appbar"
vlc:layout_anchor=
"@+id/appbar"
vlc:layout_anchorGravity=
"bottom|right|end"
vlc:layout_anchorGravity=
"bottom|right|end"
...
...
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/gui/PlaylistActivity.java
+
21
−
19
View file @
35262381
...
@@ -24,23 +24,12 @@
...
@@ -24,23 +24,12 @@
package
org.videolan.vlc.gui
;
package
org.videolan.vlc.gui
;
import
android.annotation.TargetApi
;
import
android.annotation.TargetApi
;
import
androidx.lifecycle.Observer
;
import
androidx.lifecycle.ViewModelProviders
;
import
androidx.paging.PagedList
;
import
android.content.Intent
;
import
android.content.Intent
;
import
androidx.databinding.DataBindingUtil
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.graphics.drawable.BitmapDrawable
;
import
android.graphics.drawable.BitmapDrawable
;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
androidx.annotation.Nullable
;
import
com.google.android.material.bottomsheet.BottomSheetBehavior
;
import
androidx.coordinatorlayout.widget.CoordinatorLayout
;
import
androidx.core.view.ViewCompat
;
import
androidx.appcompat.view.ActionMode
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.view.Gravity
;
import
android.view.Gravity
;
import
android.view.Menu
;
import
android.view.Menu
;
...
@@ -48,6 +37,8 @@ import android.view.MenuItem;
...
@@ -48,6 +37,8 @@ import android.view.MenuItem;
import
android.view.View
;
import
android.view.View
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
com.google.android.material.bottomsheet.BottomSheetBehavior
;
import
org.videolan.medialibrary.Medialibrary
;
import
org.videolan.medialibrary.Medialibrary
;
import
org.videolan.medialibrary.media.MediaLibraryItem
;
import
org.videolan.medialibrary.media.MediaLibraryItem
;
import
org.videolan.medialibrary.media.MediaWrapper
;
import
org.videolan.medialibrary.media.MediaWrapper
;
...
@@ -78,6 +69,16 @@ import java.util.Arrays;
...
@@ -78,6 +69,16 @@ import java.util.Arrays;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
import
androidx.annotation.Nullable
;
import
androidx.appcompat.view.ActionMode
;
import
androidx.coordinatorlayout.widget.CoordinatorLayout
;
import
androidx.databinding.DataBindingUtil
;
import
androidx.lifecycle.Observer
;
import
androidx.lifecycle.ViewModelProviders
;
import
androidx.paging.PagedList
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
public
class
PlaylistActivity
extends
AudioPlayerContainerActivity
implements
IEventsHandler
,
ActionMode
.
Callback
,
View
.
OnClickListener
,
CtxActionReceiver
{
public
class
PlaylistActivity
extends
AudioPlayerContainerActivity
implements
IEventsHandler
,
ActionMode
.
Callback
,
View
.
OnClickListener
,
CtxActionReceiver
{
public
final
static
String
TAG
=
"VLC/PlaylistActivity"
;
public
final
static
String
TAG
=
"VLC/PlaylistActivity"
;
...
@@ -92,7 +93,7 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
...
@@ -92,7 +93,7 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
private
PagedTracksModel
tracksModel
;
private
PagedTracksModel
tracksModel
;
@Override
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
public
void
onCreate
(
final
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
mBinding
=
DataBindingUtil
.
setContentView
(
this
,
R
.
layout
.
playlist_activity
);
mBinding
=
DataBindingUtil
.
setContentView
(
this
,
R
.
layout
.
playlist_activity
);
...
@@ -121,7 +122,7 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
...
@@ -121,7 +122,7 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
}
}
}
}
});
});
final
int
fabVisibility
=
savedInstanceState
!=
null
?
savedInstanceState
.
get
Int
(
TAG_FAB_VISIBILITY
)
:
-
1
;
final
boolean
fabVisibility
=
savedInstanceState
!=
null
&&
savedInstanceState
.
get
Boolean
(
TAG_FAB_VISIBILITY
);
if
(!
TextUtils
.
isEmpty
(
mPlaylist
.
getArtworkMrl
()))
{
if
(!
TextUtils
.
isEmpty
(
mPlaylist
.
getArtworkMrl
()))
{
WorkersKt
.
runIO
(
new
Runnable
()
{
WorkersKt
.
runIO
(
new
Runnable
()
{
...
@@ -134,8 +135,10 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
...
@@ -134,8 +135,10 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
@Override
@Override
public
void
run
()
{
public
void
run
()
{
mBinding
.
appbar
.
setExpanded
(
true
,
true
);
mBinding
.
appbar
.
setExpanded
(
true
,
true
);
if
(
fabVisibility
!=
-
1
)
if
(
savedInstanceState
!=
null
)
{
mBinding
.
fab
.
setVisibility
(
fabVisibility
);
if
(
fabVisibility
)
mBinding
.
fab
.
show
();
else
mBinding
.
fab
.
hide
();
}
}
}
});
});
}
else
WorkersKt
.
runOnMainThread
(
new
Runnable
()
{
}
else
WorkersKt
.
runOnMainThread
(
new
Runnable
()
{
...
@@ -152,14 +155,13 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
...
@@ -152,14 +155,13 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
private
void
fabFallback
()
{
private
void
fabFallback
()
{
mBinding
.
appbar
.
setExpanded
(
false
);
mBinding
.
appbar
.
setExpanded
(
false
);
ViewCompat
.
setNestedScrollingEnabled
(
mBinding
.
songs
,
false
);
final
CoordinatorLayout
.
LayoutParams
lp
=
(
CoordinatorLayout
.
LayoutParams
)
mBinding
.
fab
.
getLayoutParams
();
final
CoordinatorLayout
.
LayoutParams
lp
=
(
CoordinatorLayout
.
LayoutParams
)
mBinding
.
fab
.
getLayoutParams
();
lp
.
setAnchorId
(
R
.
id
.
songs
);
lp
.
setAnchorId
(
R
.
id
.
songs
);
lp
.
anchorGravity
=
Gravity
.
BOTTOM
|
Gravity
.
RIGHT
|
Gravity
.
END
;
lp
.
anchorGravity
=
Gravity
.
BOTTOM
|
Gravity
.
END
;
lp
.
bottomMargin
=
getResources
().
getDimensionPixelSize
(
R
.
dimen
.
default_margin
);
lp
.
bottomMargin
=
getResources
().
getDimensionPixelSize
(
R
.
dimen
.
default_margin
);
lp
.
setBehavior
(
new
FloatingActionButtonBehavior
(
PlaylistActivity
.
this
,
null
));
lp
.
setBehavior
(
new
FloatingActionButtonBehavior
(
PlaylistActivity
.
this
,
null
));
mBinding
.
fab
.
setLayoutParams
(
lp
);
mBinding
.
fab
.
setLayoutParams
(
lp
);
mBinding
.
fab
.
s
etVisibility
(
View
.
VISIBLE
);
mBinding
.
fab
.
s
how
(
);
}
}
@Override
@Override
...
@@ -171,7 +173,7 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
...
@@ -171,7 +173,7 @@ public class PlaylistActivity extends AudioPlayerContainerActivity implements IE
@Override
@Override
public
void
onSaveInstanceState
(
Bundle
outState
)
{
public
void
onSaveInstanceState
(
Bundle
outState
)
{
outState
.
putParcelable
(
AudioBrowserFragment
.
TAG_ITEM
,
mPlaylist
);
outState
.
putParcelable
(
AudioBrowserFragment
.
TAG_ITEM
,
mPlaylist
);
outState
.
put
Int
(
TAG_FAB_VISIBILITY
,
mBinding
.
fab
.
getVisibility
());
outState
.
put
Boolean
(
TAG_FAB_VISIBILITY
,
mBinding
.
fab
.
getVisibility
()
==
View
.
VISIBLE
);
super
.
onSaveInstanceState
(
outState
);
super
.
onSaveInstanceState
(
outState
);
}
}
...
...
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