[Android] Improve audio lists and player display
Geoffrey Métais
git at videolan.org
Wed Nov 16 11:31:00 CET 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Nov 16 11:30:04 2016 +0100| [8ecad33e9d551cc9f21ce90fbb47acc3ce1cecf7] | committer: Geoffrey Métais
Improve audio lists and player display
> https://code.videolan.org/videolan/vlc-android/commit/8ecad33e9d551cc9f21ce90fbb47acc3ce1cecf7
---
vlc-android/res/layout/audio_browser.xml | 48 +++++++---------------
vlc-android/res/layout/main.xml | 1 +
vlc-android/res/layout/secondary.xml | 1 +
.../vlc/gui/AudioPlayerContainerActivity.java | 5 ++-
4 files changed, 21 insertions(+), 34 deletions(-)
diff --git a/vlc-android/res/layout/audio_browser.xml b/vlc-android/res/layout/audio_browser.xml
index 4e74f01..832b71b 100644
--- a/vlc-android/res/layout/audio_browser.xml
+++ b/vlc-android/res/layout/audio_browser.xml
@@ -44,57 +44,39 @@
<org.videolan.vlc.gui.view.ContextMenuRecyclerView
android:id="@+id/artists_list"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:clipToPadding="false"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:paddingLeft="20dp"
android:paddingRight="20dp"
- android:scrollbars="none"
- android:nestedScrollingEnabled="true"
- style="@style/Theme.VLC.List" />
+ android:scrollbars="none" />
<org.videolan.vlc.gui.view.ContextMenuRecyclerView
android:id="@+id/albums_list"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:clipToPadding="false"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:paddingLeft="20dp"
android:paddingRight="20dp"
- android:scrollbars="none"
- android:focusable="true"
- android:nestedScrollingEnabled="true"
- style="@style/Theme.VLC.List" />
+ android:scrollbars="none" />
<org.videolan.vlc.gui.view.ContextMenuRecyclerView
android:id="@+id/songs_list"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:clipToPadding="false"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:paddingLeft="20dp"
android:paddingRight="20dp"
- android:scrollbars="none"
- android:focusable="true"
- android:nestedScrollingEnabled="true"
- style="@style/Theme.VLC.List" />
+ android:scrollbars="none" />
<org.videolan.vlc.gui.view.ContextMenuRecyclerView
android:id="@+id/genres_list"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:clipToPadding="false"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:paddingLeft="20dp"
android:paddingRight="20dp"
- android:scrollbars="none"
- android:focusable="true"
- android:nestedScrollingEnabled="true"
- style="@style/Theme.VLC.List" />
+ android:scrollbars="none" />
<org.videolan.vlc.gui.view.ContextMenuRecyclerView
android:id="@+id/playlists_list"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:clipToPadding="false"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
android:paddingLeft="20dp"
android:paddingRight="20dp"
- android:scrollbars="none"
- android:focusable="true"
- android:nestedScrollingEnabled="true" />
+ android:scrollbars="none" />
</android.support.v4.view.ViewPager>
</org.videolan.vlc.gui.view.SwipeRefreshLayout>
<org.videolan.vlc.gui.view.FastScroller
diff --git a/vlc-android/res/layout/main.xml b/vlc-android/res/layout/main.xml
index f2cb492..b9d2b80 100644
--- a/vlc-android/res/layout/main.xml
+++ b/vlc-android/res/layout/main.xml
@@ -28,6 +28,7 @@
android:id="@+id/audio_player_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:visibility="gone"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
<fragment
android:id="@+id/audio_player"
diff --git a/vlc-android/res/layout/secondary.xml b/vlc-android/res/layout/secondary.xml
index 9e866ab..dce5cba 100644
--- a/vlc-android/res/layout/secondary.xml
+++ b/vlc-android/res/layout/secondary.xml
@@ -18,6 +18,7 @@
android:id="@+id/audio_player_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:visibility="gone"
vlc:layout_behavior="android.support.design.widget.BottomSheetBehavior">
<fragment
android:id="@+id/audio_player"
diff --git a/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java b/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
index 34eed20..0eebbe8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/AudioPlayerContainerActivity.java
@@ -83,6 +83,7 @@ public class AudioPlayerContainerActivity extends AppCompatActivity implements P
protected AppBarLayout mAppBarLayout;
protected Toolbar mToolbar;
protected AudioPlayer mAudioPlayer;
+ private FrameLayout mAudioPLayerContainer;
protected SharedPreferences mSettings;
private final PlaybackServiceActivity.Helper mHelper = new PlaybackServiceActivity.Helper(this, this);
protected PlaybackService mService;
@@ -116,7 +117,8 @@ public class AudioPlayerContainerActivity extends AppCompatActivity implements P
mAudioPlayer = (AudioPlayer) getSupportFragmentManager().findFragmentById(R.id.audio_player);
mAudioPlayer.setUserVisibleHint(false);
- mBottomSheetBehavior = BottomSheetBehavior.from(findViewById(R.id.audio_player_container));
+ mAudioPLayerContainer = (FrameLayout) findViewById(R.id.audio_player_container);
+ mBottomSheetBehavior = BottomSheetBehavior.from(mAudioPLayerContainer);
mBottomSheetBehavior.setHideable(true);
mBottomSheetBehavior.setPeekHeight(getResources().getDimensionPixelSize(R.dimen.player_peek_height));
mBottomSheetBehavior.setBottomSheetCallback(mAudioPlayerBottomSheetCallback);
@@ -237,6 +239,7 @@ public class AudioPlayerContainerActivity extends AppCompatActivity implements P
* Show the audio player.
*/
public void showAudioPlayer() {
+ mAudioPLayerContainer.setVisibility(View.VISIBLE);
if (mBottomSheetBehavior.getState() == BottomSheetBehavior.STATE_HIDDEN) {
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
mActionBar.collapseActionView();
More information about the Android
mailing list